Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: -LAN- <laipz8200@outlook.com>tags/1.8.0
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import fields | |||
| from flask_restx import fields | |||
| from libs.helper import AppIconUrlField | |||
| @@ -1,7 +1,7 @@ | |||
| from functools import wraps | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import NotFound, Unauthorized | |||
| @@ -1,8 +1,8 @@ | |||
| from typing import Any, Optional | |||
| import flask_restful | |||
| import flask_restx | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, fields, marshal_with | |||
| from flask_restx import Resource, fields, marshal_with | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import Forbidden | |||
| @@ -40,7 +40,7 @@ def _get_resource(resource_id, tenant_id, resource_model): | |||
| ).scalar_one_or_none() | |||
| if resource is None: | |||
| flask_restful.abort(404, message=f"{resource_model.__name__} not found.") | |||
| flask_restx.abort(404, message=f"{resource_model.__name__} not found.") | |||
| return resource | |||
| @@ -81,7 +81,7 @@ class BaseApiKeyListResource(Resource): | |||
| ) | |||
| if current_key_count >= self.max_keys: | |||
| flask_restful.abort( | |||
| flask_restx.abort( | |||
| 400, | |||
| message=f"Cannot create more than {self.max_keys} API keys for this resource type.", | |||
| code="max_keys_exceeded", | |||
| @@ -126,7 +126,7 @@ class BaseApiKeyResource(Resource): | |||
| ) | |||
| if key is None: | |||
| flask_restful.abort(404, message="API key not found") | |||
| flask_restx.abort(404, message="API key not found") | |||
| db.session.query(ApiToken).where(ApiToken.id == api_key_id).delete() | |||
| db.session.commit() | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.wraps import account_initialization_required, setup_required | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.app.wraps import get_app_model | |||
| @@ -2,7 +2,7 @@ from typing import Literal | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.common.errors import NoFileUploadedError, TooManyFilesError | |||
| @@ -2,7 +2,7 @@ import uuid | |||
| from typing import cast | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, inputs, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, inputs, marshal, marshal_with, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import BadRequest, Forbidden, abort | |||
| @@ -1,7 +1,7 @@ | |||
| from typing import cast | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import Forbidden | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import InternalServerError | |||
| import services | |||
| @@ -2,7 +2,7 @@ import logging | |||
| import flask_login | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import InternalServerError, NotFound | |||
| import services | |||
| @@ -2,8 +2,8 @@ from datetime import datetime | |||
| import pytz # pip install pytz | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from sqlalchemy import func, or_ | |||
| from sqlalchemy.orm import joinedload | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| @@ -1,7 +1,7 @@ | |||
| from collections.abc import Sequence | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.app.error import ( | |||
| @@ -2,7 +2,7 @@ import json | |||
| from enum import StrEnum | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.console import api | |||
| @@ -1,8 +1,8 @@ | |||
| import logging | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, fields, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, fields, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from werkzeug.exceptions import Forbidden, InternalServerError, NotFound | |||
| from controllers.console import api | |||
| @@ -3,7 +3,7 @@ from typing import cast | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.console import api | |||
| from controllers.console.app.wraps import get_app_model | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import BadRequest | |||
| from controllers.console import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| from constants.languages import supported_language | |||
| @@ -5,7 +5,7 @@ import pytz | |||
| import sqlalchemy as sa | |||
| from flask import jsonify | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.app.wraps import get_app_model | |||
| @@ -4,7 +4,7 @@ from collections.abc import Sequence | |||
| from typing import cast | |||
| from flask import abort, request | |||
| from flask_restful import Resource, inputs, marshal_with, reqparse | |||
| from flask_restx import Resource, inputs, marshal_with, reqparse | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import Forbidden, InternalServerError, NotFound | |||
| @@ -1,6 +1,6 @@ | |||
| from dateutil.parser import isoparse | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from sqlalchemy.orm import Session | |||
| from controllers.console import api | |||
| @@ -2,7 +2,7 @@ import logging | |||
| from typing import Any, NoReturn | |||
| from flask import Response | |||
| from flask_restful import Resource, fields, inputs, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, fields, inputs, marshal, marshal_with, reqparse | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import Forbidden | |||
| @@ -1,8 +1,8 @@ | |||
| from typing import cast | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from controllers.console import api | |||
| from controllers.console.app.wraps import get_app_model | |||
| @@ -5,7 +5,7 @@ import pytz | |||
| import sqlalchemy as sa | |||
| from flask import jsonify | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.app.wraps import get_app_model | |||
| @@ -1,5 +1,5 @@ | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from constants.languages import supported_language | |||
| from controllers.console import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -3,7 +3,7 @@ import logging | |||
| import requests | |||
| from flask import current_app, redirect, request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from werkzeug.exceptions import Forbidden | |||
| from configs import dify_config | |||
| @@ -2,7 +2,7 @@ import base64 | |||
| import secrets | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| @@ -2,7 +2,7 @@ from typing import cast | |||
| import flask_login | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| import services | |||
| from configs import dify_config | |||
| @@ -3,7 +3,7 @@ from typing import Optional | |||
| import requests | |||
| from flask import current_app, redirect, request | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import Unauthorized | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.wraps import account_initialization_required, only_edition_cloud, setup_required | |||
| @@ -1,6 +1,6 @@ | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from libs.helper import extract_remote_ip | |||
| from libs.login import login_required | |||
| @@ -2,7 +2,7 @@ import json | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import NotFound | |||
| @@ -1,7 +1,7 @@ | |||
| import flask_restful | |||
| import flask_restx | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| import services | |||
| @@ -589,7 +589,7 @@ class DatasetApiKeyApi(Resource): | |||
| ) | |||
| if current_key_count >= self.max_keys: | |||
| flask_restful.abort( | |||
| flask_restx.abort( | |||
| 400, | |||
| message=f"Cannot create more than {self.max_keys} API keys for this resource type.", | |||
| code="max_keys_exceeded", | |||
| @@ -629,7 +629,7 @@ class DatasetApiDeleteApi(Resource): | |||
| ) | |||
| if key is None: | |||
| flask_restful.abort(404, message="API key not found") | |||
| flask_restx.abort(404, message="API key not found") | |||
| db.session.query(ApiToken).where(ApiToken.id == api_key_id).delete() | |||
| db.session.commit() | |||
| @@ -4,7 +4,7 @@ from typing import Literal, cast | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal, marshal_with, reqparse | |||
| from sqlalchemy import asc, desc, select | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| @@ -2,7 +2,7 @@ import uuid | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal, reqparse | |||
| from flask_restx import Resource, marshal, reqparse | |||
| from sqlalchemy import select | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| @@ -1,6 +1,6 @@ | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal, reqparse | |||
| from flask_restx import Resource, marshal, reqparse | |||
| from werkzeug.exceptions import Forbidden, InternalServerError, NotFound | |||
| import services | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.console import api | |||
| from controllers.console.datasets.hit_testing_base import DatasetsHitTestingBase | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask_login import current_user | |||
| from flask_restful import marshal, reqparse | |||
| from flask_restx import marshal, reqparse | |||
| from werkzeug.exceptions import Forbidden, InternalServerError, NotFound | |||
| import services.dataset_service | |||
| @@ -1,7 +1,7 @@ | |||
| from typing import Literal | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.console import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.console import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console import api | |||
| from controllers.console.datasets.error import WebsiteCrawlError | |||
| @@ -65,7 +65,7 @@ class ChatAudioApi(InstalledAppResource): | |||
| class ChatTextApi(InstalledAppResource): | |||
| def post(self, installed_app): | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| app_model = installed_app.app | |||
| try: | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask_login import current_user | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| from werkzeug.exceptions import InternalServerError, NotFound | |||
| import services | |||
| @@ -1,6 +1,6 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import NotFound | |||
| @@ -3,7 +3,7 @@ from typing import Any | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, inputs, marshal_with, reqparse | |||
| from flask_restx import Resource, inputs, marshal_with, reqparse | |||
| from sqlalchemy import and_ | |||
| from werkzeug.exceptions import BadRequest, Forbidden, NotFound | |||
| @@ -1,8 +1,8 @@ | |||
| import logging | |||
| from flask_login import current_user | |||
| from flask_restful import marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from werkzeug.exceptions import InternalServerError, NotFound | |||
| from controllers.console.app.error import ( | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import marshal_with | |||
| from flask_restx import marshal_with | |||
| from controllers.common import fields | |||
| from controllers.console import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, fields, marshal_with, reqparse | |||
| from flask_restx import Resource, fields, marshal_with, reqparse | |||
| from constants.languages import languages | |||
| from controllers.console import api | |||
| @@ -1,6 +1,6 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import fields, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import fields, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.console import api | |||
| @@ -1,6 +1,6 @@ | |||
| import logging | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| from werkzeug.exceptions import InternalServerError | |||
| from controllers.console.app.error import ( | |||
| @@ -1,7 +1,7 @@ | |||
| from functools import wraps | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.console.explore.error import AppAccessDeniedError | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from constants import HIDDEN_VALUE | |||
| from controllers.console import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from libs.login import login_required | |||
| from services.feature_service import FeatureService | |||
| @@ -2,7 +2,7 @@ from typing import Literal | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with | |||
| from flask_restx import Resource, marshal_with | |||
| from werkzeug.exceptions import Forbidden | |||
| import services | |||
| @@ -1,7 +1,7 @@ | |||
| import os | |||
| from flask import session | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.console import api | |||
| @@ -3,7 +3,7 @@ from typing import cast | |||
| import httpx | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| import services | |||
| from controllers.common import helpers | |||
| @@ -1,5 +1,5 @@ | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from configs import dify_config | |||
| from libs.helper import StrLen, email, extract_remote_ip | |||
| @@ -1,6 +1,6 @@ | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -2,7 +2,7 @@ import json | |||
| import logging | |||
| import requests | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from packaging import version | |||
| from configs import dify_config | |||
| @@ -3,7 +3,7 @@ from datetime import datetime | |||
| import pytz | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, fields, marshal_with, reqparse | |||
| from flask_restx import Resource, fields, marshal_with, reqparse | |||
| from sqlalchemy import select | |||
| from sqlalchemy.orm import Session | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.console import api | |||
| from controllers.console.wraps import account_initialization_required, setup_required | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -2,7 +2,7 @@ from urllib import parse | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, abort, marshal_with, reqparse | |||
| from flask_restx import Resource, abort, marshal_with, reqparse | |||
| import services | |||
| from configs import dify_config | |||
| @@ -2,7 +2,7 @@ import io | |||
| from flask import send_file | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.console import api | |||
| @@ -2,7 +2,7 @@ import io | |||
| from flask import request, send_file | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from configs import dify_config | |||
| @@ -3,7 +3,7 @@ from urllib.parse import urlparse | |||
| from flask import make_response, redirect, request, send_file | |||
| from flask_login import current_user | |||
| from flask_restful import ( | |||
| from flask_restx import ( | |||
| Resource, | |||
| reqparse, | |||
| ) | |||
| @@ -2,7 +2,7 @@ import logging | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import Resource, fields, inputs, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, fields, inputs, marshal, marshal_with, reqparse | |||
| from sqlalchemy import select | |||
| from werkzeug.exceptions import Unauthorized | |||
| @@ -1,7 +1,7 @@ | |||
| from urllib.parse import quote | |||
| from flask import Response, request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import NotFound | |||
| import services | |||
| @@ -1,7 +1,7 @@ | |||
| from urllib.parse import quote | |||
| from flask import Response | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| from controllers.common.errors import UnsupportedFileTypeError | |||
| @@ -1,7 +1,7 @@ | |||
| from mimetypes import guess_extension | |||
| from flask import request | |||
| from flask_restful import Resource, marshal_with | |||
| from flask_restx import Resource, marshal_with | |||
| from werkzeug.exceptions import Forbidden | |||
| import services | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console.wraps import setup_required | |||
| from controllers.inner_api import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.console.wraps import setup_required | |||
| from controllers.inner_api import api | |||
| @@ -4,7 +4,7 @@ from typing import Optional | |||
| from flask import current_app, request | |||
| from flask_login import user_logged_in | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| from pydantic import BaseModel | |||
| from sqlalchemy.orm import Session | |||
| @@ -1,6 +1,6 @@ | |||
| import json | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.console.wraps import setup_required | |||
| from controllers.inner_api import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from pydantic import ValidationError | |||
| from controllers.console.app.mcp_server import AppMCPServerStatus | |||
| @@ -1,7 +1,7 @@ | |||
| from typing import Literal | |||
| from flask import request | |||
| from flask_restful import Resource, marshal, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.service_api import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, marshal_with | |||
| from flask_restx import Resource, marshal_with | |||
| from controllers.common import fields | |||
| from controllers.service_api import api | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import InternalServerError | |||
| import services | |||
| @@ -1,7 +1,7 @@ | |||
| import logging | |||
| from flask import request | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from werkzeug.exceptions import BadRequest, InternalServerError, NotFound | |||
| import services | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from sqlalchemy.orm import Session | |||
| from werkzeug.exceptions import BadRequest, NotFound | |||
| @@ -1,5 +1,5 @@ | |||
| from flask import request | |||
| from flask_restful import Resource, marshal_with | |||
| from flask_restx import Resource, marshal_with | |||
| import services | |||
| from controllers.common.errors import ( | |||
| @@ -2,7 +2,7 @@ import logging | |||
| from urllib.parse import quote | |||
| from flask import Response | |||
| from flask_restful import Resource, reqparse | |||
| from flask_restx import Resource, reqparse | |||
| from controllers.service_api import api | |||
| from controllers.service_api.app.error import ( | |||
| @@ -1,8 +1,8 @@ | |||
| import json | |||
| import logging | |||
| from flask_restful import Resource, fields, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, fields, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from werkzeug.exceptions import BadRequest, InternalServerError, NotFound | |||
| import services | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource, marshal_with | |||
| from flask_restx import Resource, marshal_with | |||
| from werkzeug.exceptions import Forbidden | |||
| from controllers.common import fields | |||
| @@ -2,8 +2,8 @@ import logging | |||
| from dateutil.parser import isoparse | |||
| from flask import request | |||
| from flask_restful import Resource, fields, marshal_with, reqparse | |||
| from flask_restful.inputs import int_range | |||
| from flask_restx import Resource, fields, marshal_with, reqparse | |||
| from flask_restx.inputs import int_range | |||
| from sqlalchemy.orm import Session, sessionmaker | |||
| from werkzeug.exceptions import BadRequest, InternalServerError, NotFound | |||
| @@ -1,7 +1,7 @@ | |||
| from typing import Literal | |||
| from flask import request | |||
| from flask_restful import marshal, marshal_with, reqparse | |||
| from flask_restx import marshal, marshal_with, reqparse | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| import services.dataset_service | |||
| @@ -1,7 +1,7 @@ | |||
| import json | |||
| from flask import request | |||
| from flask_restful import marshal, reqparse | |||
| from flask_restx import marshal, reqparse | |||
| from sqlalchemy import desc, select | |||
| from werkzeug.exceptions import Forbidden, NotFound | |||
| @@ -1,7 +1,7 @@ | |||
| from typing import Literal | |||
| from flask_login import current_user # type: ignore | |||
| from flask_restful import marshal, reqparse | |||
| from flask_restx import marshal, reqparse | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.service_api import api | |||
| @@ -1,6 +1,6 @@ | |||
| from flask import request | |||
| from flask_login import current_user | |||
| from flask_restful import marshal, reqparse | |||
| from flask_restx import marshal, reqparse | |||
| from werkzeug.exceptions import NotFound | |||
| from controllers.service_api import api | |||
| @@ -1,4 +1,4 @@ | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from configs import dify_config | |||
| from controllers.service_api import api | |||
| @@ -1,5 +1,5 @@ | |||
| from flask_login import current_user | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from controllers.service_api import api | |||
| from controllers.service_api.wraps import validate_dataset_token | |||
| @@ -7,7 +7,7 @@ from typing import Optional | |||
| from flask import current_app, request | |||
| from flask_login import user_logged_in # type: ignore | |||
| from flask_restful import Resource | |||
| from flask_restx import Resource | |||
| from pydantic import BaseModel | |||
| from sqlalchemy import select, update | |||
| from sqlalchemy.orm import Session | |||
| @@ -1,5 +1,5 @@ | |||
| from flask import request | |||
| from flask_restful import Resource, marshal_with, reqparse | |||
| from flask_restx import Resource, marshal_with, reqparse | |||
| from werkzeug.exceptions import Unauthorized | |||
| from controllers.common import fields | |||
| @@ -65,7 +65,7 @@ class AudioApi(WebApiResource): | |||
| class TextApi(WebApiResource): | |||
| def post(self, app_model: App, end_user): | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| try: | |||
| parser = reqparse.RequestParser() | |||
| @@ -1,6 +1,6 @@ | |||
| import logging | |||
| from flask_restful import reqparse | |||
| from flask_restx import reqparse | |||
| from werkzeug.exceptions import InternalServerError, NotFound | |||
| import services | |||