From 318a3d03087e1102b856381fc004acb0d781bb5f Mon Sep 17 00:00:00 2001 From: 99 Date: Thu, 2 Apr 2026 17:36:58 +0800 Subject: [PATCH 001/122] refactor(api): tighten login and wrapper typing (#34447) --- .../console/app/workflow_draft_variable.py | 4 +- api/controllers/console/app/wraps.py | 54 +++++-- .../rag_pipeline_draft_variable.py | 5 +- api/controllers/service_api/wraps.py | 140 ++++++++---------- api/dify_app.py | 11 +- api/extensions/ext_login.py | 39 ++++- api/libs/login.py | 27 ++-- .../console/test_workspace_account.py | 2 +- .../console/test_workspace_members.py | 2 +- .../unit_tests/extensions/test_ext_login.py | 17 +++ api/tests/unit_tests/libs/test_login.py | 49 +++++- 11 files changed, 229 insertions(+), 121 deletions(-) create mode 100644 api/tests/unit_tests/extensions/test_ext_login.py diff --git a/api/controllers/console/app/workflow_draft_variable.py b/api/controllers/console/app/workflow_draft_variable.py index 366f145360..f6d076320c 100644 --- a/api/controllers/console/app/workflow_draft_variable.py +++ b/api/controllers/console/app/workflow_draft_variable.py @@ -193,7 +193,7 @@ workflow_draft_variable_list_model = console_ns.model( ) -def _api_prerequisite(f: Callable[..., Any]) -> Callable[..., Any]: +def _api_prerequisite[**P, R](f: Callable[P, R]) -> Callable[P, R | Response]: """Common prerequisites for all draft workflow variable APIs. It ensures the following conditions are satisfied: @@ -210,7 +210,7 @@ def _api_prerequisite(f: Callable[..., Any]) -> Callable[..., Any]: @edit_permission_required @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW]) @wraps(f) - def wrapper(*args: Any, **kwargs: Any): + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R | Response: return f(*args, **kwargs) return wrapper diff --git a/api/controllers/console/app/wraps.py b/api/controllers/console/app/wraps.py index bd6f019eac..c9cf08072a 100644 --- a/api/controllers/console/app/wraps.py +++ b/api/controllers/console/app/wraps.py @@ -1,6 +1,6 @@ from collections.abc import Callable from functools import wraps -from typing import Any +from typing import overload from sqlalchemy import select @@ -23,14 +23,30 @@ def _load_app_model_with_trial(app_id: str) -> App | None: return app_model -def get_app_model( - view: Callable[..., Any] | None = None, +@overload +def get_app_model[**P, R]( + view: Callable[P, R], *, mode: AppMode | list[AppMode] | None = None, -) -> Callable[..., Any] | Callable[[Callable[..., Any]], Callable[..., Any]]: - def decorator(view_func: Callable[..., Any]) -> Callable[..., Any]: +) -> Callable[P, R]: ... + + +@overload +def get_app_model[**P, R]( + view: None = None, + *, + mode: AppMode | list[AppMode] | None = None, +) -> Callable[[Callable[P, R]], Callable[P, R]]: ... + + +def get_app_model[**P, R]( + view: Callable[P, R] | None = None, + *, + mode: AppMode | list[AppMode] | None = None, +) -> Callable[P, R] | Callable[[Callable[P, R]], Callable[P, R]]: + def decorator(view_func: Callable[P, R]) -> Callable[P, R]: @wraps(view_func) - def decorated_view(*args: Any, **kwargs: Any): + def decorated_view(*args: P.args, **kwargs: P.kwargs) -> R: if not kwargs.get("app_id"): raise ValueError("missing app_id in path parameters") @@ -68,14 +84,30 @@ def get_app_model( return decorator(view) -def get_app_model_with_trial( - view: Callable[..., Any] | None = None, +@overload +def get_app_model_with_trial[**P, R]( + view: Callable[P, R], *, mode: AppMode | list[AppMode] | None = None, -) -> Callable[..., Any] | Callable[[Callable[..., Any]], Callable[..., Any]]: - def decorator(view_func: Callable[..., Any]) -> Callable[..., Any]: +) -> Callable[P, R]: ... + + +@overload +def get_app_model_with_trial[**P, R]( + view: None = None, + *, + mode: AppMode | list[AppMode] | None = None, +) -> Callable[[Callable[P, R]], Callable[P, R]]: ... + + +def get_app_model_with_trial[**P, R]( + view: Callable[P, R] | None = None, + *, + mode: AppMode | list[AppMode] | None = None, +) -> Callable[P, R] | Callable[[Callable[P, R]], Callable[P, R]]: + def decorator(view_func: Callable[P, R]) -> Callable[P, R]: @wraps(view_func) - def decorated_view(*args: Any, **kwargs: Any): + def decorated_view(*args: P.args, **kwargs: P.kwargs) -> R: if not kwargs.get("app_id"): raise ValueError("missing app_id in path parameters") diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py index d635dcb530..93feec0019 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py @@ -1,4 +1,5 @@ import logging +from collections.abc import Callable from typing import Any, NoReturn from flask import Response, request @@ -55,7 +56,7 @@ class WorkflowDraftVariablePatchPayload(BaseModel): register_schema_models(console_ns, WorkflowDraftVariablePatchPayload) -def _api_prerequisite(f): +def _api_prerequisite[**P, R](f: Callable[P, R]) -> Callable[P, R | Response]: """Common prerequisites for all draft workflow variable APIs. It ensures the following conditions are satisfied: @@ -70,7 +71,7 @@ def _api_prerequisite(f): @login_required @account_initialization_required @get_rag_pipeline - def wrapper(*args, **kwargs): + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R | Response: if not isinstance(current_user, Account) or not current_user.has_edit_permission: raise Forbidden() return f(*args, **kwargs) diff --git a/api/controllers/service_api/wraps.py b/api/controllers/service_api/wraps.py index 2dd916bb31..b9389ccc47 100644 --- a/api/controllers/service_api/wraps.py +++ b/api/controllers/service_api/wraps.py @@ -1,9 +1,10 @@ +import inspect import logging import time from collections.abc import Callable from enum import StrEnum, auto from functools import wraps -from typing import Any, cast, overload +from typing import cast, overload from flask import current_app, request from flask_login import user_logged_in @@ -230,94 +231,73 @@ def cloud_edition_billing_rate_limit_check[**P, R]( return interceptor -def validate_dataset_token( - view: Callable[..., Any] | None = None, -) -> Callable[..., Any] | Callable[[Callable[..., Any]], Callable[..., Any]]: - def decorator(view_func: Callable[..., Any]) -> Callable[..., Any]: - @wraps(view_func) - def decorated(*args: Any, **kwargs: Any) -> Any: - api_token = validate_and_get_api_token("dataset") +def validate_dataset_token[R](view: Callable[..., R]) -> Callable[..., R]: + positional_parameters = [ + parameter + for parameter in inspect.signature(view).parameters.values() + if parameter.kind in (inspect.Parameter.POSITIONAL_ONLY, inspect.Parameter.POSITIONAL_OR_KEYWORD) + ] + expects_bound_instance = bool(positional_parameters and positional_parameters[0].name in {"self", "cls"}) - # get url path dataset_id from positional args or kwargs - # Flask passes URL path parameters as positional arguments - dataset_id = None + @wraps(view) + def decorated(*args: object, **kwargs: object) -> R: + api_token = validate_and_get_api_token("dataset") - # First try to get from kwargs (explicit parameter) - dataset_id = kwargs.get("dataset_id") + # Flask may pass URL path parameters positionally, so inspect both kwargs and args. + dataset_id = kwargs.get("dataset_id") - # If not in kwargs, try to extract from positional args - if not dataset_id and args: - # For class methods: args[0] is self, args[1] is dataset_id (if exists) - # Check if first arg is likely a class instance (has __dict__ or __class__) - if len(args) > 1 and hasattr(args[0], "__dict__"): - # This is a class method, dataset_id should be in args[1] - potential_id = args[1] - # Validate it's a string-like UUID, not another object - try: - # Try to convert to string and check if it's a valid UUID format - str_id = str(potential_id) - # Basic check: UUIDs are 36 chars with hyphens - if len(str_id) == 36 and str_id.count("-") == 4: - dataset_id = str_id - except Exception: - logger.exception("Failed to parse dataset_id from class method args") - elif len(args) > 0: - # Not a class method, check if args[0] looks like a UUID - potential_id = args[0] - try: - str_id = str(potential_id) - if len(str_id) == 36 and str_id.count("-") == 4: - dataset_id = str_id - except Exception: - logger.exception("Failed to parse dataset_id from positional args") + if not dataset_id and args: + potential_id = args[0] + try: + str_id = str(potential_id) + if len(str_id) == 36 and str_id.count("-") == 4: + dataset_id = str_id + except Exception: + logger.exception("Failed to parse dataset_id from positional args") - # Validate dataset if dataset_id is provided - if dataset_id: - dataset_id = str(dataset_id) - dataset = db.session.scalar( - select(Dataset) - .where( - Dataset.id == dataset_id, - Dataset.tenant_id == api_token.tenant_id, - ) - .limit(1) + if dataset_id: + dataset_id = str(dataset_id) + dataset = db.session.scalar( + select(Dataset) + .where( + Dataset.id == dataset_id, + Dataset.tenant_id == api_token.tenant_id, ) - if not dataset: - raise NotFound("Dataset not found.") - if not dataset.enable_api: - raise Forbidden("Dataset api access is not enabled.") - tenant_account_join = db.session.execute( - select(Tenant, TenantAccountJoin) - .where(Tenant.id == api_token.tenant_id) - .where(TenantAccountJoin.tenant_id == Tenant.id) - .where(TenantAccountJoin.role.in_(["owner"])) - .where(Tenant.status == TenantStatus.NORMAL) - ).one_or_none() # TODO: only owner information is required, so only one is returned. - if tenant_account_join: - tenant, ta = tenant_account_join - account = db.session.get(Account, ta.account_id) - # Login admin - if account: - account.current_tenant = tenant - current_app.login_manager._update_request_context_with_user(account) # type: ignore - user_logged_in.send(current_app._get_current_object(), user=current_user) # type: ignore - else: - raise Unauthorized("Tenant owner account does not exist.") + .limit(1) + ) + if not dataset: + raise NotFound("Dataset not found.") + if not dataset.enable_api: + raise Forbidden("Dataset api access is not enabled.") + + tenant_account_join = db.session.execute( + select(Tenant, TenantAccountJoin) + .where(Tenant.id == api_token.tenant_id) + .where(TenantAccountJoin.tenant_id == Tenant.id) + .where(TenantAccountJoin.role.in_(["owner"])) + .where(Tenant.status == TenantStatus.NORMAL) + ).one_or_none() # TODO: only owner information is required, so only one is returned. + if tenant_account_join: + tenant, ta = tenant_account_join + account = db.session.get(Account, ta.account_id) + # Login admin + if account: + account.current_tenant = tenant + current_app.login_manager._update_request_context_with_user(account) # type: ignore + user_logged_in.send(current_app._get_current_object(), user=current_user) # type: ignore else: - raise Unauthorized("Tenant does not exist.") - if args and isinstance(args[0], Resource): - return view_func(args[0], api_token.tenant_id, *args[1:], **kwargs) + raise Unauthorized("Tenant owner account does not exist.") + else: + raise Unauthorized("Tenant does not exist.") - return view_func(api_token.tenant_id, *args, **kwargs) + if expects_bound_instance: + if not args: + raise TypeError("validate_dataset_token expected a bound resource instance.") + return view(args[0], api_token.tenant_id, *args[1:], **kwargs) - return decorated + return view(api_token.tenant_id, *args, **kwargs) - if view: - return decorator(view) - - # if view is None, it means that the decorator is used without parentheses - # use the decorator as a function for method_decorators - return decorator + return decorated def validate_and_get_api_token(scope: str | None = None): diff --git a/api/dify_app.py b/api/dify_app.py index d6deb8e007..bbe3f33787 100644 --- a/api/dify_app.py +++ b/api/dify_app.py @@ -1,5 +1,14 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + from flask import Flask +if TYPE_CHECKING: + from extensions.ext_login import DifyLoginManager + class DifyApp(Flask): - pass + """Flask application type with Dify-specific extension attributes.""" + + login_manager: DifyLoginManager diff --git a/api/extensions/ext_login.py b/api/extensions/ext_login.py index 02e50a90fc..bc59eaca63 100644 --- a/api/extensions/ext_login.py +++ b/api/extensions/ext_login.py @@ -1,7 +1,8 @@ import json +from typing import cast import flask_login -from flask import Response, request +from flask import Request, Response, request from flask_login import user_loaded_from_request, user_logged_in from sqlalchemy import select from werkzeug.exceptions import NotFound, Unauthorized @@ -16,13 +17,35 @@ from models import Account, Tenant, TenantAccountJoin from models.model import AppMCPServer, EndUser from services.account_service import AccountService -login_manager = flask_login.LoginManager() +type LoginUser = Account | EndUser + + +class DifyLoginManager(flask_login.LoginManager): + """Project-specific Flask-Login manager with a stable unauthorized contract. + + Dify registers `unauthorized_handler` below to always return a JSON `Response`. + Overriding this method lets callers rely on that narrower return type instead of + Flask-Login's broader callback contract. + """ + + def unauthorized(self) -> Response: + """Return the registered unauthorized handler result as a Flask `Response`.""" + return cast(Response, super().unauthorized()) + + def load_user_from_request_context(self) -> None: + """Populate Flask-Login's request-local user cache for the current request.""" + self._load_user() + + +login_manager = DifyLoginManager() # Flask-Login configuration @login_manager.request_loader -def load_user_from_request(request_from_flask_login): +def load_user_from_request(request_from_flask_login: Request) -> LoginUser | None: """Load user based on the request.""" + del request_from_flask_login + # Skip authentication for documentation endpoints if dify_config.SWAGGER_UI_ENABLED and request.path.endswith((dify_config.SWAGGER_UI_PATH, "/swagger.json")): return None @@ -100,10 +123,12 @@ def load_user_from_request(request_from_flask_login): raise NotFound("End user not found.") return end_user + return None + @user_logged_in.connect @user_loaded_from_request.connect -def on_user_logged_in(_sender, user): +def on_user_logged_in(_sender: object, user: LoginUser) -> None: """Called when a user logged in. Note: AccountService.load_logged_in_account will populate user.current_tenant_id @@ -114,8 +139,10 @@ def on_user_logged_in(_sender, user): @login_manager.unauthorized_handler -def unauthorized_handler(): +def unauthorized_handler() -> Response: """Handle unauthorized requests.""" + # Keep this as a concrete `Response`; `DifyLoginManager.unauthorized()` narrows + # Flask-Login's callback contract based on this override. return Response( json.dumps({"code": "unauthorized", "message": "Unauthorized."}), status=401, @@ -123,5 +150,5 @@ def unauthorized_handler(): ) -def init_app(app: DifyApp): +def init_app(app: DifyApp) -> None: login_manager.init_app(app) diff --git a/api/libs/login.py b/api/libs/login.py index 68a2050747..067597cb3c 100644 --- a/api/libs/login.py +++ b/api/libs/login.py @@ -2,19 +2,19 @@ from __future__ import annotations from collections.abc import Callable from functools import wraps -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, cast -from flask import current_app, g, has_request_context, request +from flask import Response, current_app, g, has_request_context, request from flask_login.config import EXEMPT_METHODS from werkzeug.local import LocalProxy from configs import dify_config +from dify_app import DifyApp +from extensions.ext_login import DifyLoginManager from libs.token import check_csrf_token from models import Account if TYPE_CHECKING: - from flask.typing import ResponseReturnValue - from models.model import EndUser @@ -29,7 +29,13 @@ def _resolve_current_user() -> EndUser | Account | None: return get_current_object() if callable(get_current_object) else user_proxy # type: ignore -def current_account_with_tenant(): +def _get_login_manager() -> DifyLoginManager: + """Return the project login manager with Dify's narrowed unauthorized contract.""" + app = cast(DifyApp, current_app) + return app.login_manager + + +def current_account_with_tenant() -> tuple[Account, str]: """ Resolve the underlying account for the current user proxy and ensure tenant context exists. Allows tests to supply plain Account mocks without the LocalProxy helper. @@ -42,7 +48,7 @@ def current_account_with_tenant(): return user, user.current_tenant_id -def login_required[**P, R](func: Callable[P, R]) -> Callable[P, R | ResponseReturnValue]: +def login_required[**P, R](func: Callable[P, R]) -> Callable[P, R | Response]: """ If you decorate a view with this, it will ensure that the current user is logged in and authenticated before calling the actual view. (If they are @@ -77,13 +83,16 @@ def login_required[**P, R](func: Callable[P, R]) -> Callable[P, R | ResponseRetu """ @wraps(func) - def decorated_view(*args: P.args, **kwargs: P.kwargs) -> R | ResponseReturnValue: + def decorated_view(*args: P.args, **kwargs: P.kwargs) -> R | Response: if request.method in EXEMPT_METHODS or dify_config.LOGIN_DISABLED: return current_app.ensure_sync(func)(*args, **kwargs) user = _resolve_current_user() if user is None or not user.is_authenticated: - return current_app.login_manager.unauthorized() # type: ignore + # `DifyLoginManager` guarantees that the registered unauthorized handler + # is surfaced here as a concrete Flask `Response`. + unauthorized_response: Response = _get_login_manager().unauthorized() + return unauthorized_response g._login_user = user # we put csrf validation here for less conflicts # TODO: maybe find a better place for it. @@ -96,7 +105,7 @@ def login_required[**P, R](func: Callable[P, R]) -> Callable[P, R | ResponseRetu def _get_user() -> EndUser | Account | None: if has_request_context(): if "_login_user" not in g: - current_app.login_manager._load_user() # type: ignore + _get_login_manager().load_user_from_request_context() return g._login_user diff --git a/api/tests/unit_tests/controllers/console/test_workspace_account.py b/api/tests/unit_tests/controllers/console/test_workspace_account.py index 9afc1c4166..7f9fe9cbf9 100644 --- a/api/tests/unit_tests/controllers/console/test_workspace_account.py +++ b/api/tests/unit_tests/controllers/console/test_workspace_account.py @@ -20,7 +20,7 @@ def app(): app = Flask(__name__) app.config["TESTING"] = True app.config["RESTX_MASK_HEADER"] = "X-Fields" - app.login_manager = SimpleNamespace(_load_user=lambda: None) + app.login_manager = SimpleNamespace(load_user_from_request_context=lambda: None) return app diff --git a/api/tests/unit_tests/controllers/console/test_workspace_members.py b/api/tests/unit_tests/controllers/console/test_workspace_members.py index 368892b922..239fec8430 100644 --- a/api/tests/unit_tests/controllers/console/test_workspace_members.py +++ b/api/tests/unit_tests/controllers/console/test_workspace_members.py @@ -12,7 +12,7 @@ from models.account import Account, TenantAccountRole def app(): flask_app = Flask(__name__) flask_app.config["TESTING"] = True - flask_app.login_manager = SimpleNamespace(_load_user=lambda: None) + flask_app.login_manager = SimpleNamespace(load_user_from_request_context=lambda: None) return flask_app diff --git a/api/tests/unit_tests/extensions/test_ext_login.py b/api/tests/unit_tests/extensions/test_ext_login.py new file mode 100644 index 0000000000..64abc19427 --- /dev/null +++ b/api/tests/unit_tests/extensions/test_ext_login.py @@ -0,0 +1,17 @@ +import json + +from flask import Response + +from extensions.ext_login import unauthorized_handler + + +def test_unauthorized_handler_returns_json_response() -> None: + response = unauthorized_handler() + + assert isinstance(response, Response) + assert response.status_code == 401 + assert response.content_type == "application/json" + assert json.loads(response.get_data(as_text=True)) == { + "code": "unauthorized", + "message": "Unauthorized.", + } diff --git a/api/tests/unit_tests/libs/test_login.py b/api/tests/unit_tests/libs/test_login.py index 0c9e73299b..2bf2212844 100644 --- a/api/tests/unit_tests/libs/test_login.py +++ b/api/tests/unit_tests/libs/test_login.py @@ -2,11 +2,12 @@ from types import SimpleNamespace from unittest.mock import MagicMock import pytest -from flask import Flask, g -from flask_login import LoginManager, UserMixin +from flask import Flask, Response, g +from flask_login import UserMixin from pytest_mock import MockerFixture import libs.login as login_module +from extensions.ext_login import DifyLoginManager from libs.login import current_user from models.account import Account @@ -39,9 +40,12 @@ def login_app(mocker: MockerFixture) -> Flask: app = Flask(__name__) app.config["TESTING"] = True - login_manager = LoginManager() + login_manager = DifyLoginManager() login_manager.init_app(app) - login_manager.unauthorized = mocker.Mock(name="unauthorized", return_value="Unauthorized") + login_manager.unauthorized = mocker.Mock( + name="unauthorized", + return_value=Response("Unauthorized", status=401, content_type="application/json"), + ) @login_manager.user_loader def load_user(_user_id: str): @@ -109,18 +113,43 @@ class TestLoginRequired: resolved_user: MockUser | None, description: str, ): - """Test that missing or unauthenticated users are redirected.""" + """Test that missing or unauthenticated users return the manager response.""" resolve_user = resolve_current_user(resolved_user) with login_app.test_request_context(): result = protected_view() - assert result == "Unauthorized", description + assert result is login_app.login_manager.unauthorized.return_value, description + assert isinstance(result, Response) + assert result.status_code == 401 resolve_user.assert_called_once_with() login_app.login_manager.unauthorized.assert_called_once_with() csrf_check.assert_not_called() + def test_unauthorized_access_propagates_response_object( + self, + login_app: Flask, + protected_view, + csrf_check: MagicMock, + resolve_current_user, + mocker: MockerFixture, + ) -> None: + """Test that unauthorized responses are propagated as Flask Response objects.""" + resolve_user = resolve_current_user(None) + response = Response("Unauthorized", status=401, content_type="application/json") + mocker.patch.object( + login_module, "_get_login_manager", return_value=SimpleNamespace(unauthorized=lambda: response) + ) + + with login_app.test_request_context(): + result = protected_view() + + assert result is response + assert isinstance(result, Response) + resolve_user.assert_called_once_with() + csrf_check.assert_not_called() + @pytest.mark.parametrize( ("method", "login_disabled"), [ @@ -168,10 +197,14 @@ class TestGetUser: """Test that _get_user loads user if not already in g.""" mock_user = MockUser("test_user") - def _load_user() -> None: + def load_user_from_request_context() -> None: g._login_user = mock_user - load_user = mocker.patch.object(login_app.login_manager, "_load_user", side_effect=_load_user) + load_user = mocker.patch.object( + login_app.login_manager, + "load_user_from_request_context", + side_effect=load_user_from_request_context, + ) with login_app.test_request_context(): user = login_module._get_user() From a3386da5d61ed22b6770687db2791584a8affdf0 Mon Sep 17 00:00:00 2001 From: Asuka Minato Date: Thu, 2 Apr 2026 18:48:46 +0900 Subject: [PATCH 002/122] ci: Update pyrefly version to 0.59.1 (#34452) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- api/pyproject.toml | 2 +- api/uv.lock | 40 ++++++++++++---------------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/api/pyproject.toml b/api/pyproject.toml index 863b61cad1..cbd9af151b 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -171,7 +171,7 @@ dev = [ "sseclient-py>=1.8.0", "pytest-timeout>=2.4.0", "pytest-xdist>=3.8.0", - "pyrefly>=0.57.1", + "pyrefly>=0.59.1", ] ############################################################ diff --git a/api/uv.lock b/api/uv.lock index 9381fabb40..d171483d37 100644 --- a/api/uv.lock +++ b/api/uv.lock @@ -53,23 +53,6 @@ dependencies = [ ] sdist = { url = "https://files.pythonhosted.org/packages/45/4a/064321452809dae953c1ed6e017504e72551a26b6f5708a5a80e4bf556ff/aiohttp-3.13.4.tar.gz", hash = "sha256:d97a6d09c66087890c2ab5d49069e1e570583f7ac0314ecf98294c1b6aaebd38", size = 7859748, upload-time = "2026-03-28T17:19:40.6Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d4/7e/cb94129302d78c46662b47f9897d642fd0b33bdfef4b73b20c6ced35aa4c/aiohttp-3.13.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8ea0c64d1bcbf201b285c2246c51a0c035ba3bbd306640007bc5844a3b4658c1", size = 760027, upload-time = "2026-03-28T17:15:33.022Z" }, - { url = "https://files.pythonhosted.org/packages/5e/cd/2db3c9397c3bd24216b203dd739945b04f8b87bb036c640da7ddb63c75ef/aiohttp-3.13.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6f742e1fa45c0ed522b00ede565e18f97e4cf8d1883a712ac42d0339dfb0cce7", size = 508325, upload-time = "2026-03-28T17:15:34.714Z" }, - { url = "https://files.pythonhosted.org/packages/36/a3/d28b2722ec13107f2e37a86b8a169897308bab6a3b9e071ecead9d67bd9b/aiohttp-3.13.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dcfb50ee25b3b7a1222a9123be1f9f89e56e67636b561441f0b304e25aaef8f", size = 502402, upload-time = "2026-03-28T17:15:36.409Z" }, - { url = "https://files.pythonhosted.org/packages/fa/d6/acd47b5f17c4430e555590990a4746efbcb2079909bb865516892bf85f37/aiohttp-3.13.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3262386c4ff370849863ea93b9ea60fd59c6cf56bf8f93beac625cf4d677c04d", size = 1771224, upload-time = "2026-03-28T17:15:38.223Z" }, - { url = "https://files.pythonhosted.org/packages/98/af/af6e20113ba6a48fd1cd9e5832c4851e7613ef50c7619acdaee6ec5f1aff/aiohttp-3.13.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:473bb5aa4218dd254e9ae4834f20e31f5a0083064ac0136a01a62ddbae2eaa42", size = 1731530, upload-time = "2026-03-28T17:15:39.988Z" }, - { url = "https://files.pythonhosted.org/packages/81/16/78a2f5d9c124ad05d5ce59a9af94214b6466c3491a25fb70760e98e9f762/aiohttp-3.13.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e56423766399b4c77b965f6aaab6c9546617b8994a956821cc507d00b91d978c", size = 1827925, upload-time = "2026-03-28T17:15:41.944Z" }, - { url = "https://files.pythonhosted.org/packages/2a/1f/79acf0974ced805e0e70027389fccbb7d728e6f30fcac725fb1071e63075/aiohttp-3.13.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8af249343fafd5ad90366a16d230fc265cf1149f26075dc9fe93cfd7c7173942", size = 1923579, upload-time = "2026-03-28T17:15:44.071Z" }, - { url = "https://files.pythonhosted.org/packages/af/53/29f9e2054ea6900413f3b4c3eb9d8331f60678ec855f13ba8714c47fd48d/aiohttp-3.13.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bc0a5cf4f10ef5a2c94fdde488734b582a3a7a000b131263e27c9295bd682d9", size = 1767655, upload-time = "2026-03-28T17:15:45.911Z" }, - { url = "https://files.pythonhosted.org/packages/f3/57/462fe1d3da08109ba4aa8590e7aed57c059af2a7e80ec21f4bac5cfe1094/aiohttp-3.13.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5c7ff1028e3c9fc5123a865ce17df1cb6424d180c503b8517afbe89aa566e6be", size = 1630439, upload-time = "2026-03-28T17:15:48.11Z" }, - { url = "https://files.pythonhosted.org/packages/d7/4b/4813344aacdb8127263e3eec343d24e973421143826364fa9fc847f6283f/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ba5cf98b5dcb9bddd857da6713a503fa6d341043258ca823f0f5ab7ab4a94ee8", size = 1745557, upload-time = "2026-03-28T17:15:50.13Z" }, - { url = "https://files.pythonhosted.org/packages/d4/01/1ef1adae1454341ec50a789f03cfafe4c4ac9c003f6a64515ecd32fe4210/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:d85965d3ba21ee4999e83e992fecb86c4614d6920e40705501c0a1f80a583c12", size = 1741796, upload-time = "2026-03-28T17:15:52.351Z" }, - { url = "https://files.pythonhosted.org/packages/22/04/8cdd99af988d2aa6922714d957d21383c559835cbd43fbf5a47ddf2e0f05/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:49f0b18a9b05d79f6f37ddd567695943fcefb834ef480f17a4211987302b2dc7", size = 1805312, upload-time = "2026-03-28T17:15:54.407Z" }, - { url = "https://files.pythonhosted.org/packages/fb/7f/b48d5577338d4b25bbdbae35c75dbfd0493cb8886dc586fbfb2e90862239/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7f78cb080c86fbf765920e5f1ef35af3f24ec4314d6675d0a21eaf41f6f2679c", size = 1621751, upload-time = "2026-03-28T17:15:56.564Z" }, - { url = "https://files.pythonhosted.org/packages/bc/89/4eecad8c1858e6d0893c05929e22343e0ebe3aec29a8a399c65c3cc38311/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:67a3ec705534a614b68bbf1c70efa777a21c3da3895d1c44510a41f5a7ae0453", size = 1826073, upload-time = "2026-03-28T17:15:58.489Z" }, - { url = "https://files.pythonhosted.org/packages/f5/5c/9dc8293ed31b46c39c9c513ac7ca152b3c3d38e0ea111a530ad12001b827/aiohttp-3.13.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d6630ec917e85c5356b2295744c8a97d40f007f96a1c76bf1928dc2e27465393", size = 1760083, upload-time = "2026-03-28T17:16:00.677Z" }, - { url = "https://files.pythonhosted.org/packages/1e/19/8bbf6a4994205d96831f97b7d21a0feed120136e6267b5b22d229c6dc4dc/aiohttp-3.13.4-cp311-cp311-win32.whl", hash = "sha256:54049021bc626f53a5394c29e8c444f726ee5a14b6e89e0ad118315b1f90f5e3", size = 439690, upload-time = "2026-03-28T17:16:02.902Z" }, - { url = "https://files.pythonhosted.org/packages/0c/f5/ac409ecd1007528d15c3e8c3a57d34f334c70d76cfb7128a28cffdebd4c1/aiohttp-3.13.4-cp311-cp311-win_amd64.whl", hash = "sha256:c033f2bc964156030772d31cbf7e5defea181238ce1f87b9455b786de7d30145", size = 463824, upload-time = "2026-03-28T17:16:05.058Z" }, { url = "https://files.pythonhosted.org/packages/1e/bd/ede278648914cabbabfdf95e436679b5d4156e417896a9b9f4587169e376/aiohttp-3.13.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ee62d4471ce86b108b19c3364db4b91180d13fe3510144872d6bad5401957360", size = 752158, upload-time = "2026-03-28T17:16:06.901Z" }, { url = "https://files.pythonhosted.org/packages/90/de/581c053253c07b480b03785196ca5335e3c606a37dc73e95f6527f1591fe/aiohttp-3.13.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c0fd8f41b54b58636402eb493afd512c23580456f022c1ba2db0f810c959ed0d", size = 501037, upload-time = "2026-03-28T17:16:08.82Z" }, { url = "https://files.pythonhosted.org/packages/fa/f9/a5ede193c08f13cc42c0a5b50d1e246ecee9115e4cf6e900d8dbd8fd6acb/aiohttp-3.13.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4baa48ce49efd82d6b1a0be12d6a36b35e5594d1dd42f8bfba96ea9f8678b88c", size = 501556, upload-time = "2026-03-28T17:16:10.63Z" }, @@ -1586,7 +1569,7 @@ dev = [ { name = "lxml-stubs", specifier = "~=0.5.1" }, { name = "mypy", specifier = "~=1.19.1" }, { name = "pandas-stubs", specifier = "~=3.0.0" }, - { name = "pyrefly", specifier = ">=0.57.1" }, + { name = "pyrefly", specifier = ">=0.59.1" }, { name = "pytest", specifier = "~=9.0.2" }, { name = "pytest-benchmark", specifier = "~=5.2.3" }, { name = "pytest-cov", specifier = "~=7.1.0" }, @@ -4839,18 +4822,19 @@ wheels = [ [[package]] name = "pyrefly" -version = "0.57.1" +version = "0.59.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c9/c1/c17211e5bbd2b90a24447484713da7cc2cee4e9455e57b87016ffc69d426/pyrefly-0.57.1.tar.gz", hash = "sha256:b05f6f5ee3a6a5d502ca19d84cb9ab62d67f05083819964a48c1510f2993efc6", size = 5310800, upload-time = "2026-03-18T18:42:35.614Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d5/ce/7882c2af92b2ff6505fcd3430eff8048ece6c6254cc90bdc76ecee12dfab/pyrefly-0.59.1.tar.gz", hash = "sha256:bf1675b0c38d45df2c8f8618cbdfa261a1b92430d9d31eba16e0282b551e210f", size = 5475432, upload-time = "2026-04-01T22:04:04.11Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/58/8af37856c8d45b365ece635a6728a14b0356b08d1ff1ac601d7120def1e0/pyrefly-0.57.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:91974bfbe951eebf5a7bc959c1f3921f0371c789cad84761511d695e9ab2265f", size = 12681847, upload-time = "2026-03-18T18:42:10.963Z" }, - { url = "https://files.pythonhosted.org/packages/5f/d7/fae6dd9d0355fc5b8df7793f1423b7433ca8e10b698ea934c35f0e4e6522/pyrefly-0.57.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:808087298537c70f5e7cdccb5bbaad482e7e056e947c0adf00fb612cbace9fdc", size = 12219634, upload-time = "2026-03-18T18:42:13.469Z" }, - { url = "https://files.pythonhosted.org/packages/29/8f/9511ae460f0690e837b9ba0f7e5e192079e16ff9a9ba8a272450e81f11f8/pyrefly-0.57.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b01f454fa5539e070c0cba17ddec46b3d2107d571d519bd8eca8f3142ba02a6", size = 34947757, upload-time = "2026-03-18T18:42:17.152Z" }, - { url = "https://files.pythonhosted.org/packages/07/43/f053bf9c65218f70e6a49561e9942c7233f8c3e4da8d42e5fe2aae50b3d2/pyrefly-0.57.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02ad59ea722191f51635f23e37574662116b82ca9d814529f7cb5528f041f381", size = 37621018, upload-time = "2026-03-18T18:42:20.79Z" }, - { url = "https://files.pythonhosted.org/packages/0e/76/9cea46de01665bbc125e4f215340c9365c8d56cda6198ff238a563ea8e75/pyrefly-0.57.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54bc0afe56776145e37733ff763e7e9679ee8a76c467b617dc3f227d4124a9e2", size = 40203649, upload-time = "2026-03-18T18:42:24.519Z" }, - { url = "https://files.pythonhosted.org/packages/fd/8b/2fb4a96d75e2a57df698a43e2970e441ba2704e3906cdc0386a055daa05a/pyrefly-0.57.1-py3-none-win32.whl", hash = "sha256:468e5839144b25bb0dce839bfc5fd879c9f38e68ebf5de561f30bed9ae19d8ca", size = 11732953, upload-time = "2026-03-18T18:42:27.379Z" }, - { url = "https://files.pythonhosted.org/packages/13/5a/4a197910fe2e9b102b15ae5e7687c45b7b5981275a11a564b41e185dd907/pyrefly-0.57.1-py3-none-win_amd64.whl", hash = "sha256:46db9c97093673c4fb7fab96d610e74d140661d54688a92d8e75ad885a56c141", size = 12537319, upload-time = "2026-03-18T18:42:30.196Z" }, - { url = "https://files.pythonhosted.org/packages/b5/c6/bc442874be1d9b63da1f9debb4f04b7d0c590a8dc4091921f3c288207242/pyrefly-0.57.1-py3-none-win_arm64.whl", hash = "sha256:feb1bbe3b0d8d5a70121dcdf1476e6a99cc056a26a49379a156f040729244dcb", size = 12013455, upload-time = "2026-03-18T18:42:32.928Z" }, + { url = "https://files.pythonhosted.org/packages/d0/10/04a0e05b08fc855b6fe38c3df549925fc3c2c6e750506870de7335d3e1f7/pyrefly-0.59.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:390db3cd14aa7e0268e847b60cd9ee18b04273eddfa38cf341ed3bb43f3fef2a", size = 12868133, upload-time = "2026-04-01T22:03:39.436Z" }, + { url = "https://files.pythonhosted.org/packages/c7/78/fa7be227c3e3fcacee501c1562278dd026186ffd1b5b5beb51d3941a3aed/pyrefly-0.59.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d246d417b6187c1650d7f855f61c68fbfd6d6155dc846d4e4d273a3e6b5175cb", size = 12379325, upload-time = "2026-04-01T22:03:42.046Z" }, + { url = "https://files.pythonhosted.org/packages/bb/13/6828ce1c98171b5f8388f33c4b0b9ea2ab8c49abe0ef8d793c31e30a05cb/pyrefly-0.59.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:575ac67b04412dc651a7143d27e38a40fbdd3c831c714d5520d0e9d4c8631ab4", size = 35826408, upload-time = "2026-04-01T22:03:45.067Z" }, + { url = "https://files.pythonhosted.org/packages/23/56/79ed8ece9a7ecad0113c394a06a084107db3ad8f1fefe19e7ded43c51245/pyrefly-0.59.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:062e6262ce1064d59dcad81ac0499bb7a3ad501e9bc8a677a50dc630ff0bf862", size = 38532699, upload-time = "2026-04-01T22:03:48.376Z" }, + { url = "https://files.pythonhosted.org/packages/18/7d/ecc025e0f0e3f295b497f523cc19cefaa39e57abede8fc353d29445d174b/pyrefly-0.59.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43ef4247f9e6f734feb93e1f2b75335b943629956e509f545cc9cdcccd76dd20", size = 36743570, upload-time = "2026-04-01T22:03:51.362Z" }, + { url = "https://files.pythonhosted.org/packages/2f/03/b1ce882ebcb87c673165c00451fbe4df17bf96ccfde18c75880dc87c5f5e/pyrefly-0.59.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a2d01723b84d042f4fa6ec871ffd52d0a7e83b0ea791c2e0bb0ff750abce56", size = 41236246, upload-time = "2026-04-01T22:03:54.361Z" }, + { url = "https://files.pythonhosted.org/packages/17/af/5e9c7afd510e7dd64a2204be0ed39e804089cbc4338675a28615c7176acb/pyrefly-0.59.1-py3-none-win32.whl", hash = "sha256:4ea70c780848f8376411e787643ae5d2d09da8a829362332b7b26d15ebcbaf56", size = 11884747, upload-time = "2026-04-01T22:03:56.776Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c1/7db1077627453fd1068f0761f059a9512645c00c4c20acfb9f0c24ac02ec/pyrefly-0.59.1-py3-none-win_amd64.whl", hash = "sha256:67e6a08cfd129a0d2788d5e40a627f9860e0fe91a876238d93d5c63ff4af68ae", size = 12720608, upload-time = "2026-04-01T22:03:59.252Z" }, + { url = "https://files.pythonhosted.org/packages/07/16/4bb6e5fce5a9cf0992932d9435d964c33e507aaaf96fdfbb1be493078a4a/pyrefly-0.59.1-py3-none-win_arm64.whl", hash = "sha256:01179cb215cf079e8223a064f61a074f7079aa97ea705cbbc68af3d6713afd15", size = 12223158, upload-time = "2026-04-01T22:04:01.869Z" }, ] [[package]] From 894826771abf0543d76514d43f945c401006c8ac Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Thu, 2 Apr 2026 19:45:19 +0800 Subject: [PATCH 003/122] chore: clean up useless tailwind reference (#34478) --- .../app/(appDetailLayout)/[appId]/style.module.css | 2 -- .../[datasetId]/documents/style.module.css | 2 -- .../app/configuration/base/var-highlight/style.module.css | 2 -- .../app/configuration/base/warning-mask/style.module.css | 2 -- .../app/configuration/config-prompt/style.module.css | 2 -- .../app/configuration/config/automatic/style.module.css | 2 -- .../app/configuration/ctrl-btn-group/style.module.css | 2 -- web/app/components/app/configuration/style.module.css | 2 -- web/app/components/base/app-icon-picker/style.module.css | 2 -- web/app/components/base/audio-btn/style.module.css | 2 -- .../components/base/chat/chat/loading-anim/style.module.css | 2 -- web/app/components/base/copy-feedback/style.module.css | 2 -- web/app/components/base/grid-mask/style.module.css | 2 -- web/app/components/base/image-gallery/style.module.css | 2 -- web/app/components/base/radio/style.module.css | 2 -- web/app/components/base/simple-pie-chart/index.module.css | 2 -- web/app/components/base/svg/style.module.css | 2 -- web/app/components/base/ui/scroll-area/index.module.css | 2 -- .../components/base/video-gallery/VideoPlayer.module.css | 2 -- web/app/components/base/voice-input/index.module.css | 2 -- web/app/components/billing/annotation-full/style.module.css | 2 -- .../components/billing/apps-full-in-dialog/style.module.css | 2 -- .../components/billing/plan-upgrade-modal/style.module.css | 2 -- web/app/components/billing/pricing/header.module.css | 2 -- web/app/components/billing/upgrade-btn/style.module.css | 2 -- .../components/billing/vector-space-full/style.module.css | 2 -- .../components/custom/custom-web-app-brand/style.module.css | 2 -- web/app/components/custom/style.module.css | 2 -- web/app/components/datasets/create/index.module.css | 2 -- web/app/components/develop/secret-key/style.module.css | 2 -- web/app/components/explore/app-list/style.module.css | 2 -- web/app/components/explore/sidebar/no-apps/style.module.css | 2 -- .../account-dropdown/workplace-selector/index.module.css | 2 -- .../account-setting/Integrations-page/index.module.css | 2 -- .../header/account-setting/language-page/index.module.css | 2 -- .../members-page/invited-modal/index.module.css | 2 -- .../provider-added-card/quota-panel.module.css | 2 -- web/app/components/header/index.module.css | 2 -- web/app/components/header/nav/index.module.css | 2 -- .../header/plugins-nav/downloading-icon.module.css | 2 -- .../plugins/reference-setting-modal/style.module.css | 2 -- .../workflow/nodes/_base/components/retry/style.module.css | 2 -- web/app/signin/page.module.css | 2 -- web/app/styles/markdown.css | 6 ++++-- 44 files changed, 4 insertions(+), 88 deletions(-) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/style.module.css b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/style.module.css index 1f1aca2d11..45c7d197b4 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/style.module.css +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .app { flex-grow: 1; height: 0; diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css index 955f5d593b..67a9fe3bf5 100644 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css +++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .logTable td { padding: 7px 8px; box-sizing: border-box; diff --git a/web/app/components/app/configuration/base/var-highlight/style.module.css b/web/app/components/app/configuration/base/var-highlight/style.module.css index b7a66085ce..2bcef0dabb 100644 --- a/web/app/components/app/configuration/base/var-highlight/style.module.css +++ b/web/app/components/app/configuration/base/var-highlight/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .item { background-color: rgba(21, 94, 239, 0.05); } diff --git a/web/app/components/app/configuration/base/warning-mask/style.module.css b/web/app/components/app/configuration/base/warning-mask/style.module.css index f922ec332f..a2c394de2a 100644 --- a/web/app/components/app/configuration/base/warning-mask/style.module.css +++ b/web/app/components/app/configuration/base/warning-mask/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .mask { backdrop-filter: blur(2px); } diff --git a/web/app/components/app/configuration/config-prompt/style.module.css b/web/app/components/app/configuration/config-prompt/style.module.css index 3086441327..224d59d9c8 100644 --- a/web/app/components/app/configuration/config-prompt/style.module.css +++ b/web/app/components/app/configuration/config-prompt/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .gradientBorder { background: radial-gradient(circle at 100% 100%, #fcfcfd 0, #fcfcfd 10px, transparent 10px) 0% 0%/12px 12px no-repeat, radial-gradient(circle at 0 100%, #fcfcfd 0, #fcfcfd 10px, transparent 10px) 100% 0%/12px 12px no-repeat, diff --git a/web/app/components/app/configuration/config/automatic/style.module.css b/web/app/components/app/configuration/config/automatic/style.module.css index fb25784808..fa67b8519b 100644 --- a/web/app/components/app/configuration/config/automatic/style.module.css +++ b/web/app/components/app/configuration/config/automatic/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/app/configuration/ctrl-btn-group/style.module.css b/web/app/components/app/configuration/ctrl-btn-group/style.module.css index 0614d2775b..3e874868a9 100644 --- a/web/app/components/app/configuration/ctrl-btn-group/style.module.css +++ b/web/app/components/app/configuration/ctrl-btn-group/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .ctrlBtn { left: -16px; right: -16px; diff --git a/web/app/components/app/configuration/style.module.css b/web/app/components/app/configuration/style.module.css index 136d065215..01f2c93167 100644 --- a/web/app/components/app/configuration/style.module.css +++ b/web/app/components/app/configuration/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .advancedPromptMode { position: relative; } diff --git a/web/app/components/base/app-icon-picker/style.module.css b/web/app/components/base/app-icon-picker/style.module.css index c22ca04a66..5ec199a232 100644 --- a/web/app/components/base/app-icon-picker/style.module.css +++ b/web/app/components/base/app-icon-picker/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .container { display: flex; flex-direction: column; diff --git a/web/app/components/base/audio-btn/style.module.css b/web/app/components/base/audio-btn/style.module.css index 2a07ad0697..7e3175aa13 100644 --- a/web/app/components/base/audio-btn/style.module.css +++ b/web/app/components/base/audio-btn/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .playIcon { background-image: url(~@/app/components/develop/secret-key/assets/play.svg); background-position: center; diff --git a/web/app/components/base/chat/chat/loading-anim/style.module.css b/web/app/components/base/chat/chat/loading-anim/style.module.css index 1e1a87a312..d5a373df6f 100644 --- a/web/app/components/base/chat/chat/loading-anim/style.module.css +++ b/web/app/components/base/chat/chat/loading-anim/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .dot-flashing { position: relative; animation: dot-flashing 1s infinite linear alternate; diff --git a/web/app/components/base/copy-feedback/style.module.css b/web/app/components/base/copy-feedback/style.module.css index 1335976835..83625d6189 100644 --- a/web/app/components/base/copy-feedback/style.module.css +++ b/web/app/components/base/copy-feedback/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .copyIcon { background-image: url(~@/app/components/develop/secret-key/assets/copy.svg); background-position: center; diff --git a/web/app/components/base/grid-mask/style.module.css b/web/app/components/base/grid-mask/style.module.css index 24d73a62af..e051271fab 100644 --- a/web/app/components/base/grid-mask/style.module.css +++ b/web/app/components/base/grid-mask/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .gridBg{ background-image: url(./Grid.svg); background-repeat: repeat; diff --git a/web/app/components/base/image-gallery/style.module.css b/web/app/components/base/image-gallery/style.module.css index 3cbe886b04..2e4c62e456 100644 --- a/web/app/components/base/image-gallery/style.module.css +++ b/web/app/components/base/image-gallery/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .item { max-height: 200px; margin-right: 8px; diff --git a/web/app/components/base/radio/style.module.css b/web/app/components/base/radio/style.module.css index 3ecf32f8d6..3e6bcdf418 100644 --- a/web/app/components/base/radio/style.module.css +++ b/web/app/components/base/radio/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .container { padding: 4px; border-radius: 4px; diff --git a/web/app/components/base/simple-pie-chart/index.module.css b/web/app/components/base/simple-pie-chart/index.module.css index 8ee0bdecf8..827b18d5f1 100644 --- a/web/app/components/base/simple-pie-chart/index.module.css +++ b/web/app/components/base/simple-pie-chart/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .simplePieChart { border-radius: 50%; box-shadow: 0 0 5px -3px rgb(from var(--simple-pie-chart-color) r g b / 0.1), 0.5px 0.5px 3px 0 rgb(from var(--simple-pie-chart-color) r g b / 0.3); diff --git a/web/app/components/base/svg/style.module.css b/web/app/components/base/svg/style.module.css index 885a9f8c3a..9258fe8ed3 100644 --- a/web/app/components/base/svg/style.module.css +++ b/web/app/components/base/svg/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .svgIcon { background-image: url(~@/app/components/develop/secret-key/assets/svg.svg); background-position: center; diff --git a/web/app/components/base/ui/scroll-area/index.module.css b/web/app/components/base/ui/scroll-area/index.module.css index 4b0cb17875..a81fd3d3c2 100644 --- a/web/app/components/base/ui/scroll-area/index.module.css +++ b/web/app/components/base/ui/scroll-area/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .scrollbar::before, .scrollbar::after { content: ''; diff --git a/web/app/components/base/video-gallery/VideoPlayer.module.css b/web/app/components/base/video-gallery/VideoPlayer.module.css index c31499184f..04c4a367d6 100644 --- a/web/app/components/base/video-gallery/VideoPlayer.module.css +++ b/web/app/components/base/video-gallery/VideoPlayer.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .videoPlayer { position: relative; width: 100%; diff --git a/web/app/components/base/voice-input/index.module.css b/web/app/components/base/voice-input/index.module.css index 330d261af0..8286f9d9a9 100644 --- a/web/app/components/base/voice-input/index.module.css +++ b/web/app/components/base/voice-input/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .wrapper { background: linear-gradient(131deg, #2250F2 0%, #0EBCF3 100%); box-shadow: 0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08); diff --git a/web/app/components/billing/annotation-full/style.module.css b/web/app/components/billing/annotation-full/style.module.css index 61a4406ae5..15bedd84ca 100644 --- a/web/app/components/billing/annotation-full/style.module.css +++ b/web/app/components/billing/annotation-full/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/billing/apps-full-in-dialog/style.module.css b/web/app/components/billing/apps-full-in-dialog/style.module.css index 06c062be7d..1f68e665a6 100644 --- a/web/app/components/billing/apps-full-in-dialog/style.module.css +++ b/web/app/components/billing/apps-full-in-dialog/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #0EBCF3 -29.55%, #2250F2 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/billing/plan-upgrade-modal/style.module.css b/web/app/components/billing/plan-upgrade-modal/style.module.css index 3b6dbf27a5..50ad488388 100644 --- a/web/app/components/billing/plan-upgrade-modal/style.module.css +++ b/web/app/components/billing/plan-upgrade-modal/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .surface { border: 0.5px solid var(--color-components-panel-border, rgba(16, 24, 40, 0.08)); background: diff --git a/web/app/components/billing/pricing/header.module.css b/web/app/components/billing/pricing/header.module.css index 43deaea206..fc05646d86 100644 --- a/web/app/components/billing/pricing/header.module.css +++ b/web/app/components/billing/pricing/header.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .instrumentSerif { font-family: "Instrument Serif", serif; font-style: italic; diff --git a/web/app/components/billing/upgrade-btn/style.module.css b/web/app/components/billing/upgrade-btn/style.module.css index 6fbdb8b6c4..ab8c30ebd5 100644 --- a/web/app/components/billing/upgrade-btn/style.module.css +++ b/web/app/components/billing/upgrade-btn/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .upgradeBtn { background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #00B2FF 12.96%, #132BFF 90.95%); box-shadow: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(0, 162, 253, 0.12); diff --git a/web/app/components/billing/vector-space-full/style.module.css b/web/app/components/billing/vector-space-full/style.module.css index 61a4406ae5..15bedd84ca 100644 --- a/web/app/components/billing/vector-space-full/style.module.css +++ b/web/app/components/billing/vector-space-full/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/custom/custom-web-app-brand/style.module.css b/web/app/components/custom/custom-web-app-brand/style.module.css index e24f725c03..bdc7d7cfbf 100644 --- a/web/app/components/custom/custom-web-app-brand/style.module.css +++ b/web/app/components/custom/custom-web-app-brand/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .mask { background: linear-gradient(273deg, rgba(255, 255, 255, 0.00) 51.75%, rgba(255, 255, 255, 0.80) 115.32%); } diff --git a/web/app/components/custom/style.module.css b/web/app/components/custom/style.module.css index df955bd293..0a839f6387 100644 --- a/web/app/components/custom/style.module.css +++ b/web/app/components/custom/style.module.css @@ -1,5 +1,3 @@ -@reference "../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/datasets/create/index.module.css b/web/app/components/datasets/create/index.module.css index 2e7e4f3a56..e69de29bb2 100644 --- a/web/app/components/datasets/create/index.module.css +++ b/web/app/components/datasets/create/index.module.css @@ -1,2 +0,0 @@ -@reference "../../../styles/globals.css"; - diff --git a/web/app/components/develop/secret-key/style.module.css b/web/app/components/develop/secret-key/style.module.css index b62ba4cf27..f13161c888 100644 --- a/web/app/components/develop/secret-key/style.module.css +++ b/web/app/components/develop/secret-key/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .customModal { max-width: 800px !important; max-height: calc(100vh - 80px); diff --git a/web/app/components/explore/app-list/style.module.css b/web/app/components/explore/app-list/style.module.css index ca83ab0fa2..241130a03d 100644 --- a/web/app/components/explore/app-list/style.module.css +++ b/web/app/components/explore/app-list/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .textGradient { background: linear-gradient(to right, rgba(16, 74, 225, 1) 0, rgba(0, 152, 238, 1) 100%); -webkit-background-clip: text; diff --git a/web/app/components/explore/sidebar/no-apps/style.module.css b/web/app/components/explore/sidebar/no-apps/style.module.css index 556774eb75..ad3787ce2b 100644 --- a/web/app/components/explore/sidebar/no-apps/style.module.css +++ b/web/app/components/explore/sidebar/no-apps/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .light { background-image: url('./no-web-apps-light.png'); } diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.module.css b/web/app/components/header/account-dropdown/workplace-selector/index.module.css index 4b2257f427..c3184f7e18 100644 --- a/web/app/components/header/account-dropdown/workplace-selector/index.module.css +++ b/web/app/components/header/account-dropdown/workplace-selector/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .popup { left: 4px; transform: translateX(-100%); diff --git a/web/app/components/header/account-setting/Integrations-page/index.module.css b/web/app/components/header/account-setting/Integrations-page/index.module.css index e7c70e8e02..7c2a883639 100644 --- a/web/app/components/header/account-setting/Integrations-page/index.module.css +++ b/web/app/components/header/account-setting/Integrations-page/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .google-icon { background: url(../../assets/google.svg) center center no-repeat; background-size: 16px 16px; diff --git a/web/app/components/header/account-setting/language-page/index.module.css b/web/app/components/header/account-setting/language-page/index.module.css index e7c70e8e02..7c2a883639 100644 --- a/web/app/components/header/account-setting/language-page/index.module.css +++ b/web/app/components/header/account-setting/language-page/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../../styles/globals.css"; - .google-icon { background: url(../../assets/google.svg) center center no-repeat; background-size: 16px 16px; diff --git a/web/app/components/header/account-setting/members-page/invited-modal/index.module.css b/web/app/components/header/account-setting/members-page/invited-modal/index.module.css index 37e23b1f79..96470439f0 100644 --- a/web/app/components/header/account-setting/members-page/invited-modal/index.module.css +++ b/web/app/components/header/account-setting/members-page/invited-modal/index.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .modal { padding: 32px !important; width: 480px !important; diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.module.css b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.module.css index 9c106968ca..47d2c4cead 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.module.css +++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../styles/globals.css"; - .gridBg { background-size: 4px 4px; background-image: diff --git a/web/app/components/header/index.module.css b/web/app/components/header/index.module.css index 755433a799..9e23bc10a6 100644 --- a/web/app/components/header/index.module.css +++ b/web/app/components/header/index.module.css @@ -1,5 +1,3 @@ -@reference "../../styles/globals.css"; - .header-DEVELOPMENT { background: linear-gradient(180deg, rgba(253, 176, 34, 0.08) 0%, rgba(253, 176, 34, 0) 100%); border-top: 4px solid #FDB022; diff --git a/web/app/components/header/nav/index.module.css b/web/app/components/header/nav/index.module.css index 2e7e4f3a56..e69de29bb2 100644 --- a/web/app/components/header/nav/index.module.css +++ b/web/app/components/header/nav/index.module.css @@ -1,2 +0,0 @@ -@reference "../../../styles/globals.css"; - diff --git a/web/app/components/header/plugins-nav/downloading-icon.module.css b/web/app/components/header/plugins-nav/downloading-icon.module.css index 53b2cf5479..bbd6a35e4c 100644 --- a/web/app/components/header/plugins-nav/downloading-icon.module.css +++ b/web/app/components/header/plugins-nav/downloading-icon.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - @keyframes realistic-blink { 0% { fill: #37ff37; opacity: 0.4; } 15% { fill: #37ff37; opacity: 0.9; } diff --git a/web/app/components/plugins/reference-setting-modal/style.module.css b/web/app/components/plugins/reference-setting-modal/style.module.css index 61a4406ae5..15bedd84ca 100644 --- a/web/app/components/plugins/reference-setting-modal/style.module.css +++ b/web/app/components/plugins/reference-setting-modal/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../styles/globals.css"; - .textGradient { background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); -webkit-background-clip: text; diff --git a/web/app/components/workflow/nodes/_base/components/retry/style.module.css b/web/app/components/workflow/nodes/_base/components/retry/style.module.css index 0e92485b68..2ce4e7b400 100644 --- a/web/app/components/workflow/nodes/_base/components/retry/style.module.css +++ b/web/app/components/workflow/nodes/_base/components/retry/style.module.css @@ -1,5 +1,3 @@ -@reference "../../../../../../styles/globals.css"; - .input::-webkit-inner-spin-button, .input::-webkit-outer-spin-button { -webkit-appearance: none; diff --git a/web/app/signin/page.module.css b/web/app/signin/page.module.css index ba89077ec0..e9759b23a8 100644 --- a/web/app/signin/page.module.css +++ b/web/app/signin/page.module.css @@ -1,5 +1,3 @@ -@reference "../styles/globals.css"; - .githubIcon { background: center/contain url('./assets/github.svg') no-repeat; } diff --git a/web/app/styles/markdown.css b/web/app/styles/markdown.css index 1ada6e49bd..45b3d4bad1 100644 --- a/web/app/styles/markdown.css +++ b/web/app/styles/markdown.css @@ -1,6 +1,5 @@ @import '../../themes/markdown-light.css'; @import '../../themes/markdown-dark.css'; -@reference "./globals.css"; .markdown-body { -ms-text-size-adjust: 100%; @@ -73,7 +72,6 @@ } .markdown-body abbr[title]:hover::after { - @apply shadow-xl shadow-shadow-shadow-5 rounded-md; position: absolute; bottom: 100%; left: 0; @@ -84,8 +82,12 @@ font-size: 12px; line-height: 1; color: var(--color-text-secondary); + border-radius: 0.375rem; border: 0.5px solid var(--color-components-panel-border); background-color: var(--color-components-tooltip-bg); + box-shadow: + 0px 8px 8px -4px var(--color-shadow-shadow-5), + 0px 20px 24px -4px var(--color-shadow-shadow-5); } .markdown-body b, From d243de26ec33477154af83f9f6edbb9b24022a98 Mon Sep 17 00:00:00 2001 From: Renzo <170978465+RenzoMXD@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:34:38 +0200 Subject: [PATCH 004/122] refactor: select in metadata_service (#34479) --- api/services/metadata_service.py | 77 ++++++++++++------ .../unit_tests/services/dataset_metadata.py | 78 +++---------------- 2 files changed, 65 insertions(+), 90 deletions(-) diff --git a/api/services/metadata_service.py b/api/services/metadata_service.py index 12729278cc..672f309bac 100644 --- a/api/services/metadata_service.py +++ b/api/services/metadata_service.py @@ -1,6 +1,8 @@ import copy import logging +from sqlalchemy import delete, func, select + from core.rag.index_processor.constant.built_in_field import BuiltInField, MetadataDataSource from extensions.ext_database import db from extensions.ext_redis import redis_client @@ -25,10 +27,14 @@ class MetadataService: raise ValueError("Metadata name cannot exceed 255 characters.") current_user, current_tenant_id = current_account_with_tenant() # check if metadata name already exists - if ( - db.session.query(DatasetMetadata) - .filter_by(tenant_id=current_tenant_id, dataset_id=dataset_id, name=metadata_args.name) - .first() + if db.session.scalar( + select(DatasetMetadata) + .where( + DatasetMetadata.tenant_id == current_tenant_id, + DatasetMetadata.dataset_id == dataset_id, + DatasetMetadata.name == metadata_args.name, + ) + .limit(1) ): raise ValueError("Metadata name already exists.") for field in BuiltInField: @@ -54,10 +60,14 @@ class MetadataService: lock_key = f"dataset_metadata_lock_{dataset_id}" # check if metadata name already exists current_user, current_tenant_id = current_account_with_tenant() - if ( - db.session.query(DatasetMetadata) - .filter_by(tenant_id=current_tenant_id, dataset_id=dataset_id, name=name) - .first() + if db.session.scalar( + select(DatasetMetadata) + .where( + DatasetMetadata.tenant_id == current_tenant_id, + DatasetMetadata.dataset_id == dataset_id, + DatasetMetadata.name == name, + ) + .limit(1) ): raise ValueError("Metadata name already exists.") for field in BuiltInField: @@ -65,7 +75,11 @@ class MetadataService: raise ValueError("Metadata name already exists in Built-in fields.") try: MetadataService.knowledge_base_metadata_lock_check(dataset_id, None) - metadata = db.session.query(DatasetMetadata).filter_by(id=metadata_id, dataset_id=dataset_id).first() + metadata = db.session.scalar( + select(DatasetMetadata) + .where(DatasetMetadata.id == metadata_id, DatasetMetadata.dataset_id == dataset_id) + .limit(1) + ) if metadata is None: raise ValueError("Metadata not found.") old_name = metadata.name @@ -74,9 +88,9 @@ class MetadataService: metadata.updated_at = naive_utc_now() # update related documents - dataset_metadata_bindings = ( - db.session.query(DatasetMetadataBinding).filter_by(metadata_id=metadata_id).all() - ) + dataset_metadata_bindings = db.session.scalars( + select(DatasetMetadataBinding).where(DatasetMetadataBinding.metadata_id == metadata_id) + ).all() if dataset_metadata_bindings: document_ids = [binding.document_id for binding in dataset_metadata_bindings] documents = DocumentService.get_document_by_ids(document_ids) @@ -101,15 +115,19 @@ class MetadataService: lock_key = f"dataset_metadata_lock_{dataset_id}" try: MetadataService.knowledge_base_metadata_lock_check(dataset_id, None) - metadata = db.session.query(DatasetMetadata).filter_by(id=metadata_id, dataset_id=dataset_id).first() + metadata = db.session.scalar( + select(DatasetMetadata) + .where(DatasetMetadata.id == metadata_id, DatasetMetadata.dataset_id == dataset_id) + .limit(1) + ) if metadata is None: raise ValueError("Metadata not found.") db.session.delete(metadata) # deal related documents - dataset_metadata_bindings = ( - db.session.query(DatasetMetadataBinding).filter_by(metadata_id=metadata_id).all() - ) + dataset_metadata_bindings = db.session.scalars( + select(DatasetMetadataBinding).where(DatasetMetadataBinding.metadata_id == metadata_id) + ).all() if dataset_metadata_bindings: document_ids = [binding.document_id for binding in dataset_metadata_bindings] documents = DocumentService.get_document_by_ids(document_ids) @@ -224,16 +242,23 @@ class MetadataService: # deal metadata binding (in the same transaction as the doc_metadata update) if not operation.partial_update: - db.session.query(DatasetMetadataBinding).filter_by(document_id=operation.document_id).delete() + db.session.execute( + delete(DatasetMetadataBinding).where( + DatasetMetadataBinding.document_id == operation.document_id + ) + ) current_user, current_tenant_id = current_account_with_tenant() for metadata_value in operation.metadata_list: # check if binding already exists if operation.partial_update: - existing_binding = ( - db.session.query(DatasetMetadataBinding) - .filter_by(document_id=operation.document_id, metadata_id=metadata_value.id) - .first() + existing_binding = db.session.scalar( + select(DatasetMetadataBinding) + .where( + DatasetMetadataBinding.document_id == operation.document_id, + DatasetMetadataBinding.metadata_id == metadata_value.id, + ) + .limit(1) ) if existing_binding: continue @@ -275,9 +300,13 @@ class MetadataService: "id": item.get("id"), "name": item.get("name"), "type": item.get("type"), - "count": db.session.query(DatasetMetadataBinding) - .filter_by(metadata_id=item.get("id"), dataset_id=dataset.id) - .count(), + "count": db.session.scalar( + select(func.count(DatasetMetadataBinding.id)).where( + DatasetMetadataBinding.metadata_id == item.get("id"), + DatasetMetadataBinding.dataset_id == dataset.id, + ) + ) + or 0, } for item in dataset.doc_metadata or [] if item.get("id") != "built-in" diff --git a/api/tests/unit_tests/services/dataset_metadata.py b/api/tests/unit_tests/services/dataset_metadata.py index 5ba18d8dc0..b825a8686a 100644 --- a/api/tests/unit_tests/services/dataset_metadata.py +++ b/api/tests/unit_tests/services/dataset_metadata.py @@ -401,10 +401,7 @@ class TestMetadataServiceCreateMetadata: metadata_args = MetadataTestDataFactory.create_metadata_args_mock(name="category", metadata_type="string") # Mock query to return None (no existing metadata with same name) - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = None - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = None # Mock BuiltInField enum iteration with patch("services.metadata_service.BuiltInField") as mock_builtin: @@ -417,10 +414,6 @@ class TestMetadataServiceCreateMetadata: assert result is not None assert isinstance(result, DatasetMetadata) - # Verify query was made to check for duplicates - mock_db_session.query.assert_called() - mock_query.filter_by.assert_called() - # Verify metadata was added and committed mock_db_session.add.assert_called_once() mock_db_session.commit.assert_called_once() @@ -468,10 +461,7 @@ class TestMetadataServiceCreateMetadata: # Mock existing metadata with same name existing_metadata = MetadataTestDataFactory.create_metadata_mock(name="category") - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = existing_metadata - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = existing_metadata # Act & Assert with pytest.raises(ValueError, match="Metadata name already exists"): @@ -500,10 +490,7 @@ class TestMetadataServiceCreateMetadata: ) # Mock query to return None (no duplicate in database) - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = None - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = None # Mock BuiltInField to include the conflicting name with patch("services.metadata_service.BuiltInField") as mock_builtin: @@ -597,27 +584,11 @@ class TestMetadataServiceUpdateMetadataName: existing_metadata = MetadataTestDataFactory.create_metadata_mock(metadata_id=metadata_id, name="category") - # Mock query for duplicate check (no duplicate) - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = None - mock_db_session.query.return_value = mock_query - - # Mock metadata retrieval - def query_side_effect(model): - if model == DatasetMetadata: - mock_meta_query = Mock() - mock_meta_query.filter_by.return_value = mock_meta_query - mock_meta_query.first.return_value = existing_metadata - return mock_meta_query - return mock_query - - mock_db_session.query.side_effect = query_side_effect + # Mock scalar calls: first for duplicate check (None), second for metadata retrieval + mock_db_session.scalar.side_effect = [None, existing_metadata] # Mock no metadata bindings (no documents to update) - mock_binding_query = Mock() - mock_binding_query.filter_by.return_value = mock_binding_query - mock_binding_query.all.return_value = [] + mock_db_session.scalars.return_value.all.return_value = [] # Mock BuiltInField enum with patch("services.metadata_service.BuiltInField") as mock_builtin: @@ -655,22 +626,8 @@ class TestMetadataServiceUpdateMetadataName: metadata_id = "non-existent-metadata" new_name = "updated_category" - # Mock query for duplicate check (no duplicate) - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = None - mock_db_session.query.return_value = mock_query - - # Mock metadata retrieval to return None - def query_side_effect(model): - if model == DatasetMetadata: - mock_meta_query = Mock() - mock_meta_query.filter_by.return_value = mock_meta_query - mock_meta_query.first.return_value = None # Not found - return mock_meta_query - return mock_query - - mock_db_session.query.side_effect = query_side_effect + # Mock scalar calls: first for duplicate check (None), second for metadata retrieval (None = not found) + mock_db_session.scalar.side_effect = [None, None] # Mock BuiltInField enum with patch("services.metadata_service.BuiltInField") as mock_builtin: @@ -746,15 +703,10 @@ class TestMetadataServiceDeleteMetadata: existing_metadata = MetadataTestDataFactory.create_metadata_mock(metadata_id=metadata_id, name="category") # Mock metadata retrieval - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = existing_metadata - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = existing_metadata # Mock no metadata bindings (no documents to update) - mock_binding_query = Mock() - mock_binding_query.filter_by.return_value = mock_binding_query - mock_binding_query.all.return_value = [] + mock_db_session.scalars.return_value.all.return_value = [] # Act result = MetadataService.delete_metadata(dataset_id, metadata_id) @@ -788,10 +740,7 @@ class TestMetadataServiceDeleteMetadata: metadata_id = "non-existent-metadata" # Mock metadata retrieval to return None - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.first.return_value = None - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = None # Act & Assert with pytest.raises(ValueError, match="Metadata not found"): @@ -1013,10 +962,7 @@ class TestMetadataServiceGetDatasetMetadatas: ) # Mock usage count queries - mock_query = Mock() - mock_query.filter_by.return_value = mock_query - mock_query.count.return_value = 5 # 5 documents use this metadata - mock_db_session.query.return_value = mock_query + mock_db_session.scalar.return_value = 5 # 5 documents use this metadata # Act result = MetadataService.get_dataset_metadatas(dataset) From dbfb474eab3aaaf1b2e5131a4af06e9b73c27531 Mon Sep 17 00:00:00 2001 From: Renzo <170978465+RenzoMXD@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:35:04 +0200 Subject: [PATCH 005/122] refactor: select in workflow_tools_manage_service (#34477) --- .../tools/workflow_tools_manage_service.py | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/api/services/tools/workflow_tools_manage_service.py b/api/services/tools/workflow_tools_manage_service.py index fb6b5bea24..dc0b281e15 100644 --- a/api/services/tools/workflow_tools_manage_service.py +++ b/api/services/tools/workflow_tools_manage_service.py @@ -3,7 +3,7 @@ import logging from datetime import datetime from graphon.model_runtime.utils.encoders import jsonable_encoder -from sqlalchemy import or_, select +from sqlalchemy import delete, or_, select from sqlalchemy.orm import Session from core.tools.__base.tool_provider import ToolProviderController @@ -42,20 +42,22 @@ class WorkflowToolManageService: labels: list[str] | None = None, ): # check if the name is unique - existing_workflow_tool_provider = ( - db.session.query(WorkflowToolProvider) + existing_workflow_tool_provider = db.session.scalar( + select(WorkflowToolProvider) .where( WorkflowToolProvider.tenant_id == tenant_id, # name or app_id or_(WorkflowToolProvider.name == name, WorkflowToolProvider.app_id == workflow_app_id), ) - .first() + .limit(1) ) if existing_workflow_tool_provider is not None: raise ValueError(f"Tool with name {name} or app_id {workflow_app_id} already exists") - app: App | None = db.session.query(App).where(App.id == workflow_app_id, App.tenant_id == tenant_id).first() + app: App | None = db.session.scalar( + select(App).where(App.id == workflow_app_id, App.tenant_id == tenant_id).limit(1) + ) if app is None: raise ValueError(f"App {workflow_app_id} not found") @@ -122,30 +124,30 @@ class WorkflowToolManageService: :return: the updated tool """ # check if the name is unique - existing_workflow_tool_provider = ( - db.session.query(WorkflowToolProvider) + existing_workflow_tool_provider = db.session.scalar( + select(WorkflowToolProvider) .where( WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.name == name, WorkflowToolProvider.id != workflow_tool_id, ) - .first() + .limit(1) ) if existing_workflow_tool_provider is not None: raise ValueError(f"Tool with name {name} already exists") - workflow_tool_provider: WorkflowToolProvider | None = ( - db.session.query(WorkflowToolProvider) + workflow_tool_provider: WorkflowToolProvider | None = db.session.scalar( + select(WorkflowToolProvider) .where(WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.id == workflow_tool_id) - .first() + .limit(1) ) if workflow_tool_provider is None: raise ValueError(f"Tool {workflow_tool_id} not found") - app: App | None = ( - db.session.query(App).where(App.id == workflow_tool_provider.app_id, App.tenant_id == tenant_id).first() + app: App | None = db.session.scalar( + select(App).where(App.id == workflow_tool_provider.app_id, App.tenant_id == tenant_id).limit(1) ) if app is None: @@ -234,9 +236,11 @@ class WorkflowToolManageService: :param tenant_id: the tenant id :param workflow_tool_id: the workflow tool id """ - db.session.query(WorkflowToolProvider).where( - WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.id == workflow_tool_id - ).delete() + db.session.execute( + delete(WorkflowToolProvider).where( + WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.id == workflow_tool_id + ) + ) db.session.commit() @@ -251,10 +255,10 @@ class WorkflowToolManageService: :param workflow_tool_id: the workflow tool id :return: the tool """ - db_tool: WorkflowToolProvider | None = ( - db.session.query(WorkflowToolProvider) + db_tool: WorkflowToolProvider | None = db.session.scalar( + select(WorkflowToolProvider) .where(WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.id == workflow_tool_id) - .first() + .limit(1) ) return cls._get_workflow_tool(tenant_id, db_tool) @@ -267,10 +271,10 @@ class WorkflowToolManageService: :param workflow_app_id: the workflow app id :return: the tool """ - db_tool: WorkflowToolProvider | None = ( - db.session.query(WorkflowToolProvider) + db_tool: WorkflowToolProvider | None = db.session.scalar( + select(WorkflowToolProvider) .where(WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.app_id == workflow_app_id) - .first() + .limit(1) ) return cls._get_workflow_tool(tenant_id, db_tool) @@ -284,8 +288,8 @@ class WorkflowToolManageService: if db_tool is None: raise ValueError("Tool not found") - workflow_app: App | None = ( - db.session.query(App).where(App.id == db_tool.app_id, App.tenant_id == db_tool.tenant_id).first() + workflow_app: App | None = db.session.scalar( + select(App).where(App.id == db_tool.app_id, App.tenant_id == db_tool.tenant_id).limit(1) ) if workflow_app is None: @@ -331,10 +335,10 @@ class WorkflowToolManageService: :param workflow_tool_id: the workflow tool id :return: the list of tools """ - db_tool: WorkflowToolProvider | None = ( - db.session.query(WorkflowToolProvider) + db_tool: WorkflowToolProvider | None = db.session.scalar( + select(WorkflowToolProvider) .where(WorkflowToolProvider.tenant_id == tenant_id, WorkflowToolProvider.id == workflow_tool_id) - .first() + .limit(1) ) if db_tool is None: From 2e29ac2829f2177803de0436b9cda34e2609d619 Mon Sep 17 00:00:00 2001 From: lif <1835304752@qq.com> Date: Thu, 2 Apr 2026 20:36:21 +0800 Subject: [PATCH 006/122] fix: remove redundant cast in MCP base session (#34461) Signed-off-by: majiayu000 <1835304752@qq.com> --- api/core/mcp/session/base_session.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/core/mcp/session/base_session.py b/api/core/mcp/session/base_session.py index e50fd42198..0b3aa79838 100644 --- a/api/core/mcp/session/base_session.py +++ b/api/core/mcp/session/base_session.py @@ -4,7 +4,7 @@ from collections.abc import Callable from concurrent.futures import Future, ThreadPoolExecutor, TimeoutError from datetime import timedelta from types import TracebackType -from typing import Any, Self, cast +from typing import Any, Self from httpx import HTTPStatusError from pydantic import BaseModel @@ -338,12 +338,11 @@ class BaseSession[ validated_request = self._receive_request_type.model_validate( message.message.root.model_dump(by_alias=True, mode="json", exclude_none=True) ) - validated_request = cast(ReceiveRequestT, validated_request) responder = RequestResponder[ReceiveRequestT, SendResultT]( request_id=message.message.root.id, request_meta=validated_request.root.params.meta if validated_request.root.params else None, - request=validated_request, + request=validated_request, # type: ignore[arg-type] # mypy can't narrow constrained TypeVar from model_validate session=self, on_complete=lambda r: self._in_flight.pop(r.request_id, None), ) @@ -359,15 +358,14 @@ class BaseSession[ notification = self._receive_notification_type.model_validate( message.message.root.model_dump(by_alias=True, mode="json", exclude_none=True) ) - notification = cast(ReceiveNotificationT, notification) # Handle cancellation notifications if isinstance(notification.root, CancelledNotification): cancelled_id = notification.root.params.requestId if cancelled_id in self._in_flight: self._in_flight[cancelled_id].cancel() else: - self._received_notification(notification) - self._handle_incoming(notification) + self._received_notification(notification) # type: ignore[arg-type] + self._handle_incoming(notification) # type: ignore[arg-type] except Exception as e: # For other validation errors, log and continue logger.warning("Failed to validate notification: %s. Message was: %s", e, message.message.root) From 985b41c40bf33408c7ff63b17fbda4777c77f4be Mon Sep 17 00:00:00 2001 From: Tim Ren <137012659+xr843@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:17:02 +0800 Subject: [PATCH 007/122] fix(security): add tenant_id validation to prevent IDOR in data source binding (#34456) Co-authored-by: Claude Opus 4.6 (1M context) --- api/controllers/console/datasets/data_source.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/controllers/console/datasets/data_source.py b/api/controllers/console/datasets/data_source.py index ac14349045..e623722b23 100644 --- a/api/controllers/console/datasets/data_source.py +++ b/api/controllers/console/datasets/data_source.py @@ -158,10 +158,11 @@ class DataSourceApi(Resource): @login_required @account_initialization_required def patch(self, binding_id, action: Literal["enable", "disable"]): + _, current_tenant_id = current_account_with_tenant() binding_id = str(binding_id) with sessionmaker(db.engine, expire_on_commit=False).begin() as session: data_source_binding = session.execute( - select(DataSourceOauthBinding).filter_by(id=binding_id) + select(DataSourceOauthBinding).filter_by(id=binding_id, tenant_id=current_tenant_id) ).scalar_one_or_none() if data_source_binding is None: raise NotFound("Data source binding not found.") From 36e840cd87e8de78ed306d8a5851c734afa352df Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Thu, 2 Apr 2026 23:03:42 +0800 Subject: [PATCH 008/122] chore: knip fix (#34481) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .vite-hooks/pre-commit | 6 + .../(appDetailLayout)/[appId]/layout-main.tsx | 2 +- .../[appId]/overview/card-view.tsx | 2 +- .../[appId]/overview/chart-view.tsx | 2 +- .../[datasetId]/documents/style.module.css | 9 - .../[datasetId]/layout-main.tsx | 2 +- web/app/account/(commonLayout)/avatar.tsx | 4 - .../components/app-sidebar/app-info/index.tsx | 2 +- web/app/components/app-sidebar/basic.tsx | 2 +- web/app/components/app-sidebar/index.tsx | 2 +- web/app/components/app/annotation/type.ts | 2 - .../app/app-publisher/suggested-action.tsx | 2 +- .../base/feature-panel/index.tsx | 2 +- .../configuration/base/group-name/index.tsx | 2 +- .../base/operation-btn/index.tsx | 2 +- .../base/var-highlight/index.tsx | 2 +- .../warning-mask/cannot-query-dataset.tsx | 2 +- .../base/warning-mask/formatting-changed.tsx | 2 +- .../base/warning-mask/has-not-set-api.tsx | 2 +- .../configuration/base/warning-mask/index.tsx | 2 +- .../config-prompt/confirm-add-var/index.tsx | 2 +- .../config-prompt/simple-prompt-input.tsx | 2 +- .../config-var/config-modal/config.ts | 7 - .../config-var/config-modal/index.tsx | 2 +- .../config-var/config-select/index.tsx | 2 +- .../configuration/config-var/modal-foot.tsx | 2 +- .../config-var/select-type-item/index.tsx | 2 +- .../config/agent/prompt-editor.tsx | 152 ----------- .../config/automatic/automatic-btn.tsx | 2 +- .../config/automatic/get-automatic-res.tsx | 2 +- .../code-generator/get-code-generator-res.tsx | 2 +- .../configuration/ctrl-btn-group/index.tsx | 2 +- .../dataset-config/select-dataset/index.tsx | 2 +- .../debug-with-multiple-model/context.ts | 2 - .../app/configuration/style.module.css | 14 - .../app/configuration/tools/index.tsx | 204 --------------- .../app/create-app-dialog/app-card/index.tsx | 2 +- .../app/create-from-dsl-modal/uploader.tsx | 2 +- web/app/components/app/log/index.tsx | 2 +- .../apikey-info-panel.test-utils.tsx | 10 +- web/app/components/app/overview/app-chart.tsx | 6 +- .../app/overview/settings/index.tsx | 2 +- .../components/app/overview/trigger-card.tsx | 2 +- .../app/text-generate/item/index.tsx | 8 +- .../saved-items/no-data/index.tsx | 2 +- .../components/app/type-selector/index.tsx | 2 +- web/app/components/apps/app-card.tsx | 2 +- web/app/components/apps/new-app-card.tsx | 2 +- .../base/agent-log-modal/detail.tsx | 2 +- web/app/components/base/amplitude/index.ts | 2 +- web/app/components/base/answer-icon/index.tsx | 2 +- web/app/components/base/app-icon/index.tsx | 2 +- .../auto-height-textarea/style.module.scss | 0 web/app/components/base/avatar/index.tsx | 12 +- web/app/components/base/block-input/index.tsx | 2 +- .../base/chat/chat-with-history/index.tsx | 2 +- .../sidebar/rename-modal.tsx | 2 +- web/app/components/base/chat/chat/context.ts | 2 - .../base/chat/chat/loading-anim/index.tsx | 2 +- web/app/components/base/chat/chat/type.ts | 11 - .../chat/embedded-chatbot/header/index.tsx | 2 +- web/app/components/base/chat/types.ts | 30 +-- .../components/base/checkbox-list/index.tsx | 4 +- .../calendar/days-of-week.tsx | 2 - .../base/date-and-time-picker/utils/dayjs.ts | 2 +- web/app/components/base/divider/index.tsx | 2 +- .../components/base/file-uploader/index.ts | 4 +- .../base/form/form-scenarios/demo/types.ts | 2 - web/app/components/base/form/index.tsx | 4 +- web/app/components/base/form/types.ts | 2 - web/app/components/base/ga/index.tsx | 8 +- web/app/components/base/icons/IconBase.tsx | 2 +- .../base/icons/src/image/llm/index.ts | 9 - .../base/icons/src/public/billing/index.ts | 9 +- .../base/icons/src/public/common/index.ts | 13 +- .../public/knowledge/dataset-card/index.ts | 2 +- .../base/icons/src/public/knowledge/index.ts | 2 - .../base/icons/src/public/llm/index.ts | 46 +--- .../base/icons/src/public/model/index.ts | 1 - .../base/icons/src/public/other/index.ts | 2 +- .../base/icons/src/public/plugins/index.ts | 7 - .../base/icons/src/public/thought/index.ts | 4 - .../base/icons/src/vender/knowledge/index.ts | 2 +- .../vender/line/alertsAndFeedback/index.ts | 2 - .../icons/src/vender/line/arrows/index.ts | 4 +- .../src/vender/line/communication/index.ts | 4 +- .../src/vender/line/development/index.ts | 12 - .../icons/src/vender/line/editor/index.ts | 7 - .../base/icons/src/vender/line/files/index.ts | 7 +- .../vender/line/financeAndECommerce/index.ts | 5 +- .../icons/src/vender/line/general/index.ts | 25 +- .../icons/src/vender/line/layout/index.ts | 3 - .../src/vender/line/mediaAndDevices/index.ts | 4 - .../icons/src/vender/line/others/index.ts | 4 +- .../icons/src/vender/line/shapes/index.ts | 1 - .../base/icons/src/vender/line/time/index.ts | 2 - .../base/icons/src/vender/line/users/index.ts | 2 - .../icons/src/vender/line/weather/index.ts | 1 - .../base/icons/src/vender/other/index.ts | 1 - .../vender/solid/FinanceAndECommerce/index.ts | 1 - .../icons/src/vender/solid/arrows/index.ts | 2 - .../src/vender/solid/communication/index.ts | 8 +- .../src/vender/solid/development/index.ts | 10 +- .../icons/src/vender/solid/editor/index.ts | 4 - .../icons/src/vender/solid/education/index.ts | 2 +- .../icons/src/vender/solid/files/index.ts | 2 +- .../icons/src/vender/solid/general/index.ts | 10 +- .../icons/src/vender/solid/layout/index.ts | 1 - .../src/vender/solid/mediaAndDevices/index.ts | 11 +- .../icons/src/vender/solid/shapes/index.ts | 2 - .../icons/src/vender/solid/users/index.ts | 3 - .../base/icons/src/vender/workflow/index.ts | 2 +- web/app/components/base/icons/utils.ts | 2 +- .../base/inline-delete-confirm/index.tsx | 2 +- .../components/base/input-with-copy/index.tsx | 2 +- .../components/base/markdown-blocks/index.ts | 2 +- .../markdown-with-directive-schema.ts | 4 +- web/app/components/base/node-status/index.tsx | 2 +- .../components/base/pagination/pagination.tsx | 6 +- .../base/portal-to-follow-elem/index.tsx | 4 +- .../components/base/premium-badge/index.tsx | 1 - .../components/base/prompt-editor/hooks.ts | 10 +- .../plugins/context-block/node.tsx | 2 +- .../plugins/current-block/node.tsx | 2 +- .../plugins/error-message-block/node.tsx | 2 +- .../plugins/history-block/index.tsx | 7 - .../plugins/hitl-input-block/index.tsx | 5 - .../plugins/hitl-input-block/node.tsx | 2 +- .../plugins/last-run-block/node.tsx | 2 +- .../plugins/query-block/index.tsx | 5 - .../plugins/query-block/node.tsx | 2 +- .../plugins/request-url-block/node.tsx | 2 +- .../plugins/workflow-variable-block/index.tsx | 10 +- .../plugins/workflow-variable-block/node.tsx | 2 +- .../base/radio/component/group/index.tsx | 2 +- web/app/components/base/select/index.tsx | 2 +- web/app/components/base/sort/index.tsx | 2 +- web/app/components/base/tag/index.tsx | 2 +- .../components/base/text-generation/types.ts | 30 --- web/app/components/base/textarea/index.tsx | 2 +- web/app/components/base/theme-switcher.tsx | 2 +- .../components/base/timezone-label/index.tsx | 2 +- web/app/components/base/tooltip/content.tsx | 2 +- web/app/components/base/tooltip/index.tsx | 2 +- .../components/base/ui/context-menu/index.tsx | 24 +- .../base/ui/dropdown-menu/index.tsx | 1 - .../components/base/ui/number-field/index.tsx | 4 +- .../components/base/ui/scroll-area/index.tsx | 23 +- web/app/components/base/ui/select/index.tsx | 5 +- web/app/components/base/ui/slider/index.tsx | 2 +- web/app/components/base/ui/toast/index.tsx | 16 +- web/app/components/base/ui/tooltip/index.tsx | 2 +- web/app/components/base/zendesk/utils.ts | 2 +- web/app/components/billing/type.ts | 21 -- .../billing/upgrade-btn/style.module.css | 9 - .../custom-web-app-brand/style.module.css | 3 - web/app/components/datasets/chunk.tsx | 6 +- .../image-uploader-in-chunk/index.tsx | 2 +- .../index.tsx | 2 +- .../datasets/common/image-uploader/store.tsx | 2 +- .../hooks/use-dsl-import.ts | 4 +- .../create-from-dsl-modal/uploader.tsx | 2 +- .../create/embedding-process/index.module.css | 91 ------- .../file-uploader/hooks/use-file-upload.ts | 4 +- .../create/file-uploader/index.module.css | 133 ---------- .../datasets/create/index.module.css | 0 .../datasets/create/step-one/hooks/index.ts | 1 - .../step-one/hooks/use-preview-state.ts | 6 +- .../create/step-three/index.module.css | 77 ------ .../datasets/create/step-two/hooks/index.ts | 6 +- .../step-two/hooks/use-document-creation.ts | 5 +- .../step-two/hooks/use-indexing-config.ts | 4 +- .../step-two/hooks/use-indexing-estimate.ts | 4 +- .../step-two/hooks/use-preview-state.ts | 4 +- .../step-two/hooks/use-segmentation-state.ts | 4 +- .../document-list/components/index.ts | 2 - .../components/document-list/index.tsx | 3 - .../data-source/local-file/constants.ts | 1 - .../local-file/hooks/use-local-file-upload.ts | 2 +- .../data-source/local-file/index.tsx | 2 +- .../data-source/website-crawl/index.tsx | 2 +- .../detail/batch-modal/csv-uploader.tsx | 2 +- .../documents/detail/batch-modal/index.tsx | 2 +- .../documents/detail/completed/hooks/index.ts | 5 - .../completed/hooks/use-child-segment-data.ts | 4 +- .../detail/completed/hooks/use-modal-state.ts | 6 +- .../completed/hooks/use-search-filter.ts | 8 +- .../completed/hooks/use-segment-list-data.ts | 4 +- .../completed/hooks/use-segment-selection.ts | 2 +- .../documents/detail/embedding/hooks/index.ts | 7 +- .../embedding/hooks/use-embedding-status.ts | 2 - .../detail/embedding/style.module.css | 61 ----- .../documents/detail/segment-add/index.tsx | 2 +- .../formatted-text/flavours/shared.tsx | 8 +- .../datasets/formatted-text/formatted.tsx | 2 +- .../datasets/hit-testing/components/mask.tsx | 2 +- .../components/datasets/preview/container.tsx | 2 +- .../components/datasets/preview/header.tsx | 2 +- .../settings/permission-selector/index.tsx | 2 +- .../components/devtools/react-grab/loader.tsx | 17 -- web/app/components/explore/category.tsx | 2 +- .../explore/item-operation/index.tsx | 2 +- .../explore/sidebar/app-nav-item/index.tsx | 2 +- .../actions/commands/command-bus.ts | 2 +- .../goto-anything/actions/commands/index.ts | 12 +- .../goto-anything/actions/commands/slash.tsx | 4 +- .../components/goto-anything/actions/index.ts | 1 - .../goto-anything/components/empty-state.tsx | 4 +- .../goto-anything/components/footer.tsx | 2 +- .../goto-anything/components/index.ts | 7 - .../goto-anything/components/result-item.tsx | 2 +- .../goto-anything/components/result-list.tsx | 2 +- .../goto-anything/components/search-input.tsx | 2 +- .../components/goto-anything/hooks/index.ts | 4 - .../hooks/use-goto-anything-modal.ts | 2 +- .../hooks/use-goto-anything-navigation.ts | 4 +- .../hooks/use-goto-anything-results.ts | 6 +- .../hooks/use-goto-anything-search.ts | 2 +- .../account-dropdown/menu-item-content.tsx | 2 +- .../workplace-selector/index.module.css | 5 - .../key-validator/declarations.ts | 8 - .../account-setting/key-validator/index.tsx | 2 +- .../language-page/index.module.css | 24 -- .../invite-modal/role-selector.tsx | 2 +- .../members-page/invited-modal/index.tsx | 2 +- .../model-provider-page/declarations.ts | 25 -- .../derive-model-status.ts | 2 +- .../model-provider-page/model-auth/index.tsx | 2 +- .../agent-model-trigger.tsx | 2 +- .../derive-trigger-status.ts | 3 - .../provider-added-card/cooldown-timer.tsx | 2 +- .../provider-added-card/model-list-item.tsx | 2 +- .../model-load-balancing-configs.tsx | 2 +- .../model-provider-page/status-mapping.ts | 9 - .../components/header/nav/index.module.css | 0 web/app/components/plugins/card/index.tsx | 2 +- .../components/plugins/marketplace/types.ts | 19 -- .../detail-header/hooks/index.ts | 2 +- .../hooks/use-detail-header-state.ts | 4 +- .../model-selector/index.tsx | 2 +- .../create/components/modal-steps.tsx | 8 +- .../create/hooks/use-common-modal-state.ts | 2 +- .../subscription-list/index.tsx | 1 - .../tool-selector/components/index.ts | 1 - .../tool-selector/hooks/index.ts | 1 - .../hooks/use-tool-selector-state.ts | 4 +- .../components/plugins/plugin-page/context.ts | 2 +- .../plugin-tasks/components/plugin-item.tsx | 2 +- .../components/plugin-section.tsx | 2 +- .../components/task-status-indicator.tsx | 2 +- .../reference-setting-modal/style.module.css | 7 - web/app/components/plugins/types.ts | 35 --- .../components/rag-pipeline/store/index.ts | 1 - .../share/text-generation/index.tsx | 2 +- .../share/text-generation/no-data/index.tsx | 2 +- .../share/text-generation/result/index.tsx | 2 +- .../run-batch/csv-download/index.tsx | 2 +- .../run-batch/csv-reader/index.tsx | 2 +- .../share/text-generation/run-batch/index.tsx | 2 +- .../run-batch/res-download/index.tsx | 2 +- .../share/text-generation/run-once/index.tsx | 2 +- .../tools/mcp/hooks/use-mcp-modal-form.ts | 4 +- .../components/tools/mcp/mcp-server-modal.tsx | 2 +- .../components/tools/mcp/mcp-service-card.tsx | 2 +- web/app/components/tools/mcp/modal.tsx | 4 +- web/app/components/tools/types.ts | 5 - .../hooks/use-workflow-run-utils.ts | 8 +- .../store/workflow/workflow-slice.ts | 1 - .../components/workflow/__tests__/fixtures.ts | 55 +--- .../workflow/__tests__/workflow-test-env.tsx | 2 +- .../workflow/block-selector/hooks.ts | 13 +- .../workflow/block-selector/tabs.tsx | 2 +- .../workflow/block-selector/types.ts | 59 ----- web/app/components/workflow/context.tsx | 2 +- .../components/workflow/header/undo-redo.tsx | 2 +- .../components/workflow/hooks-store/store.ts | 4 - web/app/components/workflow/hooks/index.ts | 1 - .../hooks/use-node-plugin-installation.ts | 2 +- .../workflow/hooks/use-nodes-layout.ts | 96 ------- .../_base/components/add-variable-popup.tsx | 4 +- .../components/agent-strategy-selector.tsx | 2 +- .../nodes/_base/components/agent-strategy.tsx | 2 +- .../components/before-run-form/panel-wrap.tsx | 2 +- .../components/form-input-item.helpers.ts | 2 +- .../workflow/nodes/_base/components/group.tsx | 4 +- .../components/mcp-tool-availability.tsx | 2 +- .../nodes/_base/components/retry/hooks.ts | 15 -- .../nodes/_base/components/retry/utils.ts | 1 - .../nodes/_base/components/setting-item.tsx | 2 +- .../components/switch-plugin-version.tsx | 2 +- .../nodes/_base/components/variable/utils.ts | 2 +- .../nodes/_base/hooks/use-resize-panel.ts | 2 +- .../components/workflow/nodes/_base/types.ts | 13 - .../nodes/agent/components/model-bar.tsx | 2 +- .../components/workflow/nodes/agent/panel.tsx | 2 +- .../workflow/nodes/agent/use-config.ts | 2 +- .../components/workflow/nodes/answer/utils.ts | 5 - .../components/var-list/use-var-list.ts | 39 --- .../workflow/nodes/assigner/utils.ts | 10 - .../components/workflow/nodes/code/utils.ts | 3 - .../components/workflow/nodes/constants.ts | 2 - .../workflow/nodes/data-source/types.ts | 3 - .../components/workflow/nodes/end/utils.ts | 5 - .../workflow/nodes/if-else/utils.ts | 4 +- web/app/components/workflow/nodes/index.tsx | 2 +- .../metadata/condition-list/utils.ts | 6 +- .../nodes/knowledge-retrieval/utils.ts | 4 - .../json-schema-generator/prompt-editor.tsx | 2 +- .../visual-editor/context.tsx | 2 +- .../components/workflow/nodes/llm/utils.ts | 31 +-- .../components/workflow/nodes/loop/types.ts | 1 - .../components/workflow/nodes/loop/utils.ts | 25 +- .../nodes/question-classifier/utils.ts | 3 - .../components/workflow/nodes/start/utils.ts | 5 - .../nodes/template-transform/utils.ts | 5 - .../components/workflow/nodes/tool/utils.ts | 5 - .../hooks/use-trigger-auth-flow.ts | 174 ------------- .../workflow/nodes/trigger-plugin/types.ts | 2 +- .../utils/execution-time-calculator.ts | 8 +- .../workflow/nodes/trigger-webhook/types.ts | 8 - .../trigger-webhook/use-config.helpers.ts | 2 +- .../utils/parameter-type-utils.ts | 4 +- .../trigger-webhook/utils/raw-variable.ts | 2 +- .../components/add-variable/index.tsx | 2 +- .../components/var-list/use-var-list.ts | 34 --- .../workflow/nodes/variable-assigner/utils.ts | 4 - .../components/workflow/operator/index.tsx | 2 +- .../components/variable-modal.sections.tsx | 2 +- .../components/variable-modal.tsx | 2 +- .../conversation-variable-modal.tsx | 2 +- .../panel/env-panel/variable-modal.tsx | 2 +- web/app/components/workflow/run/index.tsx | 2 +- web/app/components/workflow/types.ts | 11 - .../workflow/utils/gen-node-meta-data.ts | 2 +- .../workflow/utils/node-navigation.ts | 2 +- .../workflow/utils/plugin-install-check.ts | 4 +- web/app/components/workflow/utils/trigger.ts | 2 +- .../workflow/variable-inspect/listening.tsx | 2 +- .../workflow/workflow-history-store.tsx | 4 +- .../education-apply/verify-state-modal.tsx | 2 +- web/context/app-context-provider.tsx | 2 +- web/context/datasets-context.ts | 21 -- web/context/event-emitter.ts | 2 - .../external-knowledge-api-context.tsx | 2 +- web/context/global-public-context.tsx | 2 +- web/context/mitt-context.ts | 6 +- web/context/modal-context-provider.tsx | 2 - web/context/modal-context.ts | 2 - web/context/provider-context.ts | 2 - web/context/workspace-context.ts | 4 +- web/contract/console/explore.ts | 8 +- web/contract/console/notification.ts | 4 +- web/contract/router.ts | 2 - web/eslint-suppressions.json | 242 +++++------------- web/hooks/use-mitt.ts | 8 +- web/hooks/use-moderate.ts | 49 ---- web/hooks/use-pay.tsx | 8 +- web/i18n-config/language.ts | 6 - web/knip.config.ts | 23 +- web/models/app.ts | 12 +- web/models/common.ts | 73 ------ web/models/datasets.ts | 31 --- web/models/debug.ts | 84 ------ web/models/log.ts | 11 - web/models/pipeline.ts | 11 +- web/models/share.ts | 2 - web/plugins/dev-proxy/server.ts | 4 +- web/plugins/eslint/namespaces.js | 4 +- web/plugins/vite/inject-target.ts | 2 +- web/plugins/vite/react-grab-open-file.ts | 92 ------- web/scripts/analyze-component.js | 2 +- web/service/apps.ts | 65 +---- web/service/base.ts | 15 +- web/service/datasets.ts | 73 +----- web/service/debug.ts | 17 +- web/service/knowledge/use-dataset.ts | 9 - web/service/knowledge/use-document.ts | 2 +- web/service/knowledge/use-hit-testing.ts | 21 +- web/service/knowledge/use-metadata.ts | 4 +- web/service/plugins.ts | 31 --- web/service/share.ts | 4 - web/service/tools.ts | 8 - web/service/use-apps.ts | 12 - web/service/use-common.ts | 37 --- web/service/use-oauth.ts | 4 +- web/service/use-pipeline.ts | 45 +--- web/service/use-plugins-auth.ts | 9 - web/service/use-plugins.ts | 82 +----- web/service/use-share.ts | 2 +- web/service/use-strategy.ts | 4 - web/service/use-tools.ts | 66 ----- web/service/use-triggers.ts | 33 +-- web/service/use-workflow.ts | 1 - web/service/webapp-auth.ts | 4 +- web/service/workflow-payload.ts | 193 -------------- web/test/i18n-mock.ts | 6 +- web/types/app.ts | 36 --- web/types/doc-paths.ts | 2 +- web/types/pipeline.tsx | 6 - web/types/workflow.ts | 10 - web/utils/download.ts | 2 +- web/utils/encryption.ts | 2 +- web/utils/var.ts | 2 +- 403 files changed, 475 insertions(+), 3679 deletions(-) delete mode 100644 web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css delete mode 100644 web/app/components/app/configuration/config/agent/prompt-editor.tsx delete mode 100644 web/app/components/app/configuration/style.module.css delete mode 100644 web/app/components/app/configuration/tools/index.tsx delete mode 100644 web/app/components/base/auto-height-textarea/style.module.scss delete mode 100644 web/app/components/base/icons/src/image/llm/index.ts delete mode 100644 web/app/components/base/icons/src/public/model/index.ts delete mode 100644 web/app/components/base/icons/src/public/plugins/index.ts delete mode 100644 web/app/components/base/icons/src/vender/line/shapes/index.ts delete mode 100644 web/app/components/base/icons/src/vender/line/users/index.ts delete mode 100644 web/app/components/base/icons/src/vender/line/weather/index.ts delete mode 100644 web/app/components/base/icons/src/vender/solid/layout/index.ts delete mode 100644 web/app/components/billing/upgrade-btn/style.module.css delete mode 100644 web/app/components/custom/custom-web-app-brand/style.module.css delete mode 100644 web/app/components/datasets/create/embedding-process/index.module.css delete mode 100644 web/app/components/datasets/create/file-uploader/index.module.css delete mode 100644 web/app/components/datasets/create/index.module.css delete mode 100644 web/app/components/datasets/create/step-three/index.module.css delete mode 100644 web/app/components/datasets/documents/components/document-list/index.tsx delete mode 100644 web/app/components/datasets/documents/detail/embedding/style.module.css delete mode 100644 web/app/components/devtools/react-grab/loader.tsx delete mode 100644 web/app/components/header/account-dropdown/workplace-selector/index.module.css delete mode 100644 web/app/components/header/account-setting/language-page/index.module.css delete mode 100644 web/app/components/header/account-setting/model-provider-page/status-mapping.ts delete mode 100644 web/app/components/header/nav/index.module.css delete mode 100644 web/app/components/plugins/reference-setting-modal/style.module.css delete mode 100644 web/app/components/workflow/hooks/use-nodes-layout.ts delete mode 100644 web/app/components/workflow/nodes/_base/components/retry/utils.ts delete mode 100644 web/app/components/workflow/nodes/answer/utils.ts delete mode 100644 web/app/components/workflow/nodes/assigner/components/var-list/use-var-list.ts delete mode 100644 web/app/components/workflow/nodes/code/utils.ts delete mode 100644 web/app/components/workflow/nodes/end/utils.ts delete mode 100644 web/app/components/workflow/nodes/question-classifier/utils.ts delete mode 100644 web/app/components/workflow/nodes/start/utils.ts delete mode 100644 web/app/components/workflow/nodes/template-transform/utils.ts delete mode 100644 web/app/components/workflow/nodes/tool/utils.ts delete mode 100644 web/app/components/workflow/nodes/trigger-plugin/hooks/use-trigger-auth-flow.ts delete mode 100644 web/app/components/workflow/nodes/variable-assigner/components/var-list/use-var-list.ts delete mode 100644 web/context/datasets-context.ts delete mode 100644 web/hooks/use-moderate.ts delete mode 100644 web/plugins/vite/react-grab-open-file.ts delete mode 100644 web/service/workflow-payload.ts diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit index 54e09f80d6..a4b5531ab1 100755 --- a/.vite-hooks/pre-commit +++ b/.vite-hooks/pre-commit @@ -89,6 +89,12 @@ if $web_modified; then echo "No staged TypeScript changes detected, skipping type-check:tsgo" fi + echo "Running knip" + if ! pnpm run knip; then + echo "Knip check failed. Please run 'pnpm run knip' to fix the errors." + exit 1 + fi + echo "Running unit tests check" modified_files=$(git diff --cached --name-only -- utils | grep -v '\.spec\.ts$' || true) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx index 0c87fd1a4d..d3f15bdf46 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx @@ -35,7 +35,7 @@ const TagManagementModal = dynamic(() => import('@/app/components/base/tag-manag ssr: false, }) -export type IAppDetailLayoutProps = { +type IAppDetailLayoutProps = { children: React.ReactNode appId: string } diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx index 26373bd42a..fb2edf0102 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx @@ -25,7 +25,7 @@ import { useAppWorkflow } from '@/service/use-workflow' import { AppModeEnum } from '@/types/app' import { asyncRunSafe } from '@/utils' -export type ICardViewProps = { +type ICardViewProps = { appId: string isInPanel?: boolean className?: string diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx index b6e902f456..0d33de2972 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx @@ -27,7 +27,7 @@ const TIME_PERIOD_MAPPING: { value: number, name: TimePeriodName }[] = [ const queryDateFormat = 'YYYY-MM-DD HH:mm' -export type IChartViewProps = { +type IChartViewProps = { appId: string headerRight: React.ReactNode } diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css deleted file mode 100644 index 67a9fe3bf5..0000000000 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.logTable td { - padding: 7px 8px; - box-sizing: border-box; - max-width: 200px; -} - -.pagination li { - list-style: none; -} diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx index 730b76ee19..092e47278f 100644 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx +++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx @@ -26,7 +26,7 @@ import { usePathname } from '@/next/navigation' import { useDatasetDetail, useDatasetRelatedApps } from '@/service/knowledge/use-dataset' import { cn } from '@/utils/classnames' -export type IAppDetailLayoutProps = { +type IAppDetailLayoutProps = { children: React.ReactNode datasetId: string } diff --git a/web/app/account/(commonLayout)/avatar.tsx b/web/app/account/(commonLayout)/avatar.tsx index 5461ce739c..36a510cf63 100644 --- a/web/app/account/(commonLayout)/avatar.tsx +++ b/web/app/account/(commonLayout)/avatar.tsx @@ -13,10 +13,6 @@ import { useProviderContext } from '@/context/provider-context' import { useRouter } from '@/next/navigation' import { useLogout, useUserProfile } from '@/service/use-common' -export type IAppSelector = { - isMobile: boolean -} - export default function AppSelector() { const router = useRouter() const { t } = useTranslation() diff --git a/web/app/components/app-sidebar/app-info/index.tsx b/web/app/components/app-sidebar/app-info/index.tsx index 2530add2dc..a0628ec786 100644 --- a/web/app/components/app-sidebar/app-info/index.tsx +++ b/web/app/components/app-sidebar/app-info/index.tsx @@ -5,7 +5,7 @@ import AppInfoModals from './app-info-modals' import AppInfoTrigger from './app-info-trigger' import { useAppInfoActions } from './use-app-info-actions' -export type IAppInfoProps = { +type IAppInfoProps = { expand: boolean onlyShowDetail?: boolean openState?: boolean diff --git a/web/app/components/app-sidebar/basic.tsx b/web/app/components/app-sidebar/basic.tsx index 24746aa687..29a08f8a01 100644 --- a/web/app/components/app-sidebar/basic.tsx +++ b/web/app/components/app-sidebar/basic.tsx @@ -7,7 +7,7 @@ import { import Tooltip from '@/app/components/base/tooltip' import AppIcon from '../base/app-icon' -export type IAppBasicProps = { +type IAppBasicProps = { iconType?: 'app' | 'api' | 'dataset' | 'webapp' | 'notion' icon?: string icon_background?: string | null diff --git a/web/app/components/app-sidebar/index.tsx b/web/app/components/app-sidebar/index.tsx index bbf71c6cf9..f86cd617e3 100644 --- a/web/app/components/app-sidebar/index.tsx +++ b/web/app/components/app-sidebar/index.tsx @@ -17,7 +17,7 @@ import DatasetSidebarDropdown from './dataset-sidebar-dropdown' import NavLink from './nav-link' import ToggleButton from './toggle-button' -export type IAppDetailNavProps = { +type IAppDetailNavProps = { iconType?: 'app' | 'dataset' navigation: Array<{ name: string diff --git a/web/app/components/app/annotation/type.ts b/web/app/components/app/annotation/type.ts index e2f2264f07..076ef8f9bd 100644 --- a/web/app/components/app/annotation/type.ts +++ b/web/app/components/app/annotation/type.ts @@ -39,7 +39,5 @@ export enum AnnotationEnableStatus { } export enum JobStatus { - waiting = 'waiting', - processing = 'processing', completed = 'completed', } diff --git a/web/app/components/app/app-publisher/suggested-action.tsx b/web/app/components/app/app-publisher/suggested-action.tsx index 71ddceec01..56879d8fea 100644 --- a/web/app/components/app/app-publisher/suggested-action.tsx +++ b/web/app/components/app/app-publisher/suggested-action.tsx @@ -2,7 +2,7 @@ import type { HTMLProps, PropsWithChildren } from 'react' import { RiArrowRightUpLine } from '@remixicon/react' import { cn } from '@/utils/classnames' -export type SuggestedActionProps = PropsWithChildren & { +type SuggestedActionProps = PropsWithChildren & { icon?: React.ReactNode link?: string disabled?: boolean diff --git a/web/app/components/app/configuration/base/feature-panel/index.tsx b/web/app/components/app/configuration/base/feature-panel/index.tsx index 7f337c1572..77ee7bc8dd 100644 --- a/web/app/components/app/configuration/base/feature-panel/index.tsx +++ b/web/app/components/app/configuration/base/feature-panel/index.tsx @@ -3,7 +3,7 @@ import type { FC, ReactNode } from 'react' import * as React from 'react' import { cn } from '@/utils/classnames' -export type IFeaturePanelProps = { +type IFeaturePanelProps = { className?: string headerIcon?: ReactNode title: ReactNode diff --git a/web/app/components/app/configuration/base/group-name/index.tsx b/web/app/components/app/configuration/base/group-name/index.tsx index b21b0c5825..210ba4ca87 100644 --- a/web/app/components/app/configuration/base/group-name/index.tsx +++ b/web/app/components/app/configuration/base/group-name/index.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react' import * as React from 'react' -export type IGroupNameProps = { +type IGroupNameProps = { name: string } diff --git a/web/app/components/app/configuration/base/operation-btn/index.tsx b/web/app/components/app/configuration/base/operation-btn/index.tsx index d33b632071..e3bdfd01ba 100644 --- a/web/app/components/app/configuration/base/operation-btn/index.tsx +++ b/web/app/components/app/configuration/base/operation-btn/index.tsx @@ -9,7 +9,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { cn } from '@/utils/classnames' -export type IOperationBtnProps = { +type IOperationBtnProps = { className?: string type: 'add' | 'edit' actionName?: string diff --git a/web/app/components/app/configuration/base/var-highlight/index.tsx b/web/app/components/app/configuration/base/var-highlight/index.tsx index 697007d0b0..fda58f0b65 100644 --- a/web/app/components/app/configuration/base/var-highlight/index.tsx +++ b/web/app/components/app/configuration/base/var-highlight/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import s from './style.module.css' -export type IVarHighlightProps = { +type IVarHighlightProps = { name: string className?: string } diff --git a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx index 791230566b..d5fbd9e78f 100644 --- a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx +++ b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import WarningMask from '.' -export type IFormattingChangedProps = { +type IFormattingChangedProps = { onConfirm: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx index 1fe7b9c182..56ccae5ade 100644 --- a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx +++ b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import WarningMask from '.' -export type IFormattingChangedProps = { +type IFormattingChangedProps = { onConfirm: () => void onCancel: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx index 06c81a9f95..25587c5e58 100644 --- a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx +++ b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx @@ -3,7 +3,7 @@ import type { FC } from 'react' import * as React from 'react' import { useTranslation } from 'react-i18next' -export type IHasNotSetAPIProps = { +type IHasNotSetAPIProps = { onSetting: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/index.tsx b/web/app/components/app/configuration/base/warning-mask/index.tsx index 6d6aeceb97..5275f022cb 100644 --- a/web/app/components/app/configuration/base/warning-mask/index.tsx +++ b/web/app/components/app/configuration/base/warning-mask/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import s from './style.module.css' -export type IWarningMaskProps = { +type IWarningMaskProps = { title: string description: string footer: React.ReactNode diff --git a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx index c2f0cb000a..47d9aaa4d2 100644 --- a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx +++ b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import VarHighlight from '../../base/var-highlight' -export type IConfirmAddVarProps = { +type IConfirmAddVarProps = { varNameArr: string[] onConfirm: () => void onCancel: () => void diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx index e5f1556cc5..da1949af60 100644 --- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx +++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx @@ -33,7 +33,7 @@ import { getNewVar, getVars } from '@/utils/var' import ConfirmAddVar from './confirm-add-var' import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap' -export type ISimplePromptInput = { +type ISimplePromptInput = { mode: AppModeEnum promptTemplate: string promptVariables: PromptVariable[] diff --git a/web/app/components/app/configuration/config-var/config-modal/config.ts b/web/app/components/app/configuration/config-var/config-modal/config.ts index 6586c2fd54..e03464d453 100644 --- a/web/app/components/app/configuration/config-var/config-modal/config.ts +++ b/web/app/components/app/configuration/config-var/config-modal/config.ts @@ -1,10 +1,3 @@ -export const jsonObjectWrap = { - type: 'object', - properties: {}, - required: [], - additionalProperties: true, -} - export const jsonConfigPlaceHolder = JSON.stringify( { type: 'object', diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 31b936f3e4..3495494676 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -52,7 +52,7 @@ const normalizeSelectDefaultValue = (inputVar: InputVar) => { return inputVar } -export type IConfigModalProps = { +type IConfigModalProps = { isCreate?: boolean payload?: InputVar isShow: boolean diff --git a/web/app/components/app/configuration/config-var/config-select/index.tsx b/web/app/components/app/configuration/config-var/config-select/index.tsx index 847d530375..6a5b12c417 100644 --- a/web/app/components/app/configuration/config-var/config-select/index.tsx +++ b/web/app/components/app/configuration/config-var/config-select/index.tsx @@ -8,7 +8,7 @@ import { ReactSortable } from 'react-sortablejs' import { cn } from '@/utils/classnames' export type Options = string[] -export type IConfigSelectProps = { +type IConfigSelectProps = { options: Options onChange: (options: Options) => void } diff --git a/web/app/components/app/configuration/config-var/modal-foot.tsx b/web/app/components/app/configuration/config-var/modal-foot.tsx index fbb00b72bf..1fcaebbc0d 100644 --- a/web/app/components/app/configuration/config-var/modal-foot.tsx +++ b/web/app/components/app/configuration/config-var/modal-foot.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type IModalFootProps = { +type IModalFootProps = { onConfirm: () => void onCancel: () => void } diff --git a/web/app/components/app/configuration/config-var/select-type-item/index.tsx b/web/app/components/app/configuration/config-var/select-type-item/index.tsx index e6ae34664f..7385dfd4c8 100644 --- a/web/app/components/app/configuration/config-var/select-type-item/index.tsx +++ b/web/app/components/app/configuration/config-var/select-type-item/index.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next' import InputVarTypeIcon from '@/app/components/workflow/nodes/_base/components/input-var-type-icon' import { cn } from '@/utils/classnames' -export type ISelectTypeItemProps = { +type ISelectTypeItemProps = { type: InputVarType selected: boolean onClick: () => void diff --git a/web/app/components/app/configuration/config/agent/prompt-editor.tsx b/web/app/components/app/configuration/config/agent/prompt-editor.tsx deleted file mode 100644 index e807c21518..0000000000 --- a/web/app/components/app/configuration/config/agent/prompt-editor.tsx +++ /dev/null @@ -1,152 +0,0 @@ -'use client' -import type { FC } from 'react' -import type { ExternalDataTool } from '@/models/common' -import copy from 'copy-to-clipboard' -import { noop } from 'es-toolkit/function' -import * as React from 'react' -import { useTranslation } from 'react-i18next' -import { useContext } from 'use-context-selector' -import s from '@/app/components/app/configuration/config-prompt/style.module.css' -import { - Copy, - CopyCheck, -} from '@/app/components/base/icons/src/vender/line/files' -import PromptEditor from '@/app/components/base/prompt-editor' -import { toast } from '@/app/components/base/ui/toast' -import ConfigContext from '@/context/debug-configuration' -import { useModalContext } from '@/context/modal-context' -import { cn } from '@/utils/classnames' - -type Props = { - className?: string - type: 'first-prompt' | 'next-iteration' - value: string - onChange: (value: string) => void -} - -const Editor: FC = ({ - className, - type, - value, - onChange, -}) => { - const { t } = useTranslation() - - const [isCopied, setIsCopied] = React.useState(false) - const { - modelConfig, - hasSetBlockStatus, - dataSets, - showSelectDataSet, - externalDataToolsConfig, - setExternalDataToolsConfig, - } = useContext(ConfigContext) - const promptVariables = modelConfig.configs.prompt_variables - const { setShowExternalDataToolModal } = useModalContext() - const isFirstPrompt = type === 'first-prompt' - const editorHeight = isFirstPrompt ? 'h-[336px]' : 'h-[52px]' - - const handleOpenExternalDataToolModal = () => { - setShowExternalDataToolModal({ - payload: {}, - onSaveCallback: (newExternalDataTool?: ExternalDataTool) => { - if (!newExternalDataTool) - return - setExternalDataToolsConfig([...externalDataToolsConfig, newExternalDataTool]) - }, - onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => { - for (let i = 0; i < promptVariables.length; i++) { - if (promptVariables[i].key === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key })) - return false - } - } - - for (let i = 0; i < externalDataToolsConfig.length; i++) { - if (externalDataToolsConfig[i].variable === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: externalDataToolsConfig[i].variable })) - return false - } - } - - return true - }, - }) - } - return ( -
-
-
-
{t(`agent.${isFirstPrompt ? 'firstPrompt' : 'nextIteration'}`, { ns: 'appDebug' })}
-
- {!isCopied - ? ( - { - copy(value) - setIsCopied(true) - }} - /> - ) - : ( - - )} -
-
-
- ({ - id: item.id, - name: item.name, - type: item.data_source_type, - })), - onAddContext: showSelectDataSet, - }} - variableBlock={{ - show: true, - variables: modelConfig.configs.prompt_variables.filter(item => item.key && item.key.trim() && item.name && item.name.trim()).map(item => ({ - name: item.name, - value: item.key, - })), - }} - externalToolBlock={{ - show: true, - externalTools: externalDataToolsConfig.map(item => ({ - name: item.label!, - variableName: item.variable!, - icon: item.icon, - icon_background: item.icon_background, - })), - onAddExternalTool: handleOpenExternalDataToolModal, - }} - historyBlock={{ - show: false, - selectable: false, - history: { - user: '', - assistant: '', - }, - onEditRole: noop, - }} - queryBlock={{ - show: false, - selectable: false, - }} - onChange={onChange} - onBlur={noop} - /> -
-
-
{value.length}
-
-
-
- ) -} -export default React.memo(Editor) diff --git a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx index 49d9bc4cc1..7999ba87af 100644 --- a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx +++ b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx @@ -7,7 +7,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type IAutomaticBtnProps = { +type IAutomaticBtnProps = { onClick: () => void } const AutomaticBtn: FC = ({ diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index a2ca99a9d0..d2522e875e 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -43,7 +43,7 @@ import useGenData from './use-gen-data' const i18nPrefix = 'generate' -export type IGetAutomaticResProps = { +type IGetAutomaticResProps = { mode: AppModeEnum isShow: boolean onClose: () => void diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index 4c7971dc1d..2d6b3efb3d 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -31,7 +31,7 @@ import { GeneratorType } from '../automatic/types' import useGenData from '../automatic/use-gen-data' const i18nPrefix = 'generate' -export type IGetCodeGeneratorResProps = { +type IGetCodeGeneratorResProps = { flowId: string nodeId: string currentCode?: string diff --git a/web/app/components/app/configuration/ctrl-btn-group/index.tsx b/web/app/components/app/configuration/ctrl-btn-group/index.tsx index ff8576cc43..53a07a9b1d 100644 --- a/web/app/components/app/configuration/ctrl-btn-group/index.tsx +++ b/web/app/components/app/configuration/ctrl-btn-group/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import s from './style.module.css' -export type IContrlBtnGroupProps = { +type IContrlBtnGroupProps = { onSave: () => void onReset: () => void } diff --git a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx index dd69774b2b..5fc594dc6b 100644 --- a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx +++ b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx @@ -17,7 +17,7 @@ import Link from '@/next/link' import { useInfiniteDatasets } from '@/service/knowledge/use-dataset' import { cn } from '@/utils/classnames' -export type ISelectDataSetProps = { +type ISelectDataSetProps = { isShow: boolean onClose: () => void selectedIds: string[] diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts index e3ad06f1b9..9e76067234 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts @@ -18,5 +18,3 @@ export const DebugWithMultipleModelContext = createContext useContext(DebugWithMultipleModelContext) - -export default DebugWithMultipleModelContext diff --git a/web/app/components/app/configuration/style.module.css b/web/app/components/app/configuration/style.module.css deleted file mode 100644 index 01f2c93167..0000000000 --- a/web/app/components/app/configuration/style.module.css +++ /dev/null @@ -1,14 +0,0 @@ -.advancedPromptMode { - position: relative; -} - -.advancedPromptMode::before { - content: ''; - position: absolute; - bottom: 0; - left: -1px; - width: 100%; - height: 3px; - background-color: rgba(68, 76, 231, 0.18); - transform: skewX(-30deg); -} diff --git a/web/app/components/app/configuration/tools/index.tsx b/web/app/components/app/configuration/tools/index.tsx deleted file mode 100644 index 2b4511a0c6..0000000000 --- a/web/app/components/app/configuration/tools/index.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import type { ExternalDataTool } from '@/models/common' -import { - RiAddLine, - RiArrowDownSLine, - RiDeleteBinLine, -} from '@remixicon/react' -import copy from 'copy-to-clipboard' -import { useState } from 'react' -import { useTranslation } from 'react-i18next' -import { useContext } from 'use-context-selector' -import AppIcon from '@/app/components/base/app-icon' -import { - Settings01, -} from '@/app/components/base/icons/src/vender/line/general' -import { Tool03 } from '@/app/components/base/icons/src/vender/solid/general' -import Switch from '@/app/components/base/switch' -import { toast } from '@/app/components/base/ui/toast' -import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from '@/app/components/base/ui/tooltip' -import ConfigContext from '@/context/debug-configuration' -import { useModalContext } from '@/context/modal-context' - -const Tools = () => { - const { t } = useTranslation() - const { setShowExternalDataToolModal } = useModalContext() - const { - externalDataToolsConfig, - setExternalDataToolsConfig, - modelConfig, - } = useContext(ConfigContext) - const [expanded, setExpanded] = useState(true) - const [copied, setCopied] = useState(false) - - const handleSaveExternalDataToolModal = (externalDataTool: ExternalDataTool, index: number) => { - if (index > -1) { - setExternalDataToolsConfig([ - ...externalDataToolsConfig.slice(0, index), - externalDataTool, - ...externalDataToolsConfig.slice(index + 1), - ]) - } - else { - setExternalDataToolsConfig([...externalDataToolsConfig, externalDataTool]) - } - } - const handleValidateBeforeSaveExternalDataToolModal = (newExternalDataTool: ExternalDataTool, index: number) => { - const promptVariables = modelConfig?.configs?.prompt_variables || [] - for (let i = 0; i < promptVariables.length; i++) { - if (promptVariables[i].key === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key })) - return false - } - } - - let existedExternalDataTools = [] - if (index > -1) { - existedExternalDataTools = [ - ...externalDataToolsConfig.slice(0, index), - ...externalDataToolsConfig.slice(index + 1), - ] - } - else { - existedExternalDataTools = [...externalDataToolsConfig] - } - - for (let i = 0; i < existedExternalDataTools.length; i++) { - if (existedExternalDataTools[i].variable === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: existedExternalDataTools[i].variable })) - return false - } - } - - return true - } - const handleOpenExternalDataToolModal = (payload: ExternalDataTool, index: number) => { - setShowExternalDataToolModal({ - payload, - onSaveCallback: (externalDataTool?: ExternalDataTool) => { - if (!externalDataTool) - return - handleSaveExternalDataToolModal(externalDataTool, index) - }, - onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => handleValidateBeforeSaveExternalDataToolModal(newExternalDataTool, index), - }) - } - - return ( -
-
-
-
setExpanded(v => !v)} - > - { - externalDataToolsConfig.length - ? - : - } - { - !!externalDataToolsConfig.length && ( - - ) - } -
-
- {t('feature.tools.title', { ns: 'appDebug' })} -
- - } /> - -
- {t('feature.tools.tips', { ns: 'appDebug' })} -
-
-
-
- { - !expanded && !!externalDataToolsConfig.length && ( - <> -
{t('feature.tools.toolsInUse', { ns: 'appDebug', count: externalDataToolsConfig.length })}
-
- - ) - } -
handleOpenExternalDataToolModal({}, -1)} - > - - {t('operation.add', { ns: 'common' })} -
-
- { - expanded && !!externalDataToolsConfig.length && ( -
- { - externalDataToolsConfig.map((item, index: number) => ( -
-
- -
{item.label}
- - { - copy(item.variable || '') - setCopied(true) - }} - > - {item.variable} -
- )} - /> - - {copied ? t('copied', { ns: 'appApi' }) : `${item.variable}, ${t('copy', { ns: 'appApi' })}`} - - -
-
handleOpenExternalDataToolModal(item, index)} - > - -
-
setExternalDataToolsConfig([...externalDataToolsConfig.slice(0, index), ...externalDataToolsConfig.slice(index + 1)])} - > - -
-
- handleSaveExternalDataToolModal({ ...item, enabled }, index)} - /> -
- )) - } -
- ) - } -
- ) -} - -export default Tools diff --git a/web/app/components/app/create-app-dialog/app-card/index.tsx b/web/app/components/app/create-app-dialog/app-card/index.tsx index 8afb5cbf4b..f0633288fd 100644 --- a/web/app/components/app/create-app-dialog/app-card/index.tsx +++ b/web/app/components/app/create-app-dialog/app-card/index.tsx @@ -12,7 +12,7 @@ import { useGlobalPublicStore } from '@/context/global-public-context' import { cn } from '@/utils/classnames' import { AppTypeIcon, AppTypeLabel } from '../../type-selector' -export type AppCardProps = { +type AppCardProps = { app: App canCreate: boolean onCreate: () => void diff --git a/web/app/components/app/create-from-dsl-modal/uploader.tsx b/web/app/components/app/create-from-dsl-modal/uploader.tsx index e376d04a9f..7480da4b5f 100644 --- a/web/app/components/app/create-from-dsl-modal/uploader.tsx +++ b/web/app/components/app/create-from-dsl-modal/uploader.tsx @@ -13,7 +13,7 @@ import { toast } from '@/app/components/base/ui/toast' import { cn } from '@/utils/classnames' import { formatFileSize } from '@/utils/format' -export type Props = { +type Props = { file: File | undefined updateFile: (file?: File) => void className?: string diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx index 59f454f754..c30cf6cf51 100644 --- a/web/app/components/app/log/index.tsx +++ b/web/app/components/app/log/index.tsx @@ -17,7 +17,7 @@ import EmptyElement from './empty-element' import Filter, { TIME_PERIOD_MAPPING } from './filter' import List from './list' -export type ILogsProps = { +type ILogsProps = { appDetail: App } diff --git a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx index 54763907df..4bab54b711 100644 --- a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx +++ b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx @@ -72,17 +72,17 @@ const defaultModalContext: ModalContextState = { setShowTriggerEventsLimitModal: noop, } -export type MockOverrides = { +type MockOverrides = { providerContext?: Partial modalContext?: Partial } -export type APIKeyInfoPanelRenderOptions = { +type APIKeyInfoPanelRenderOptions = { mockOverrides?: MockOverrides } & Omit // Setup function to configure mocks -export function setupMocks(overrides: MockOverrides = {}) { +function setupMocks(overrides: MockOverrides = {}) { mockUseProviderContext.mockReturnValue({ ...defaultProviderContext, ...overrides.providerContext, @@ -95,7 +95,7 @@ export function setupMocks(overrides: MockOverrides = {}) { } // Custom render function -export function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) { +function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) { const { mockOverrides, ...renderOptions } = options setupMocks(mockOverrides) @@ -210,4 +210,4 @@ export function clearAllMocks() { } // Export mock functions for external access -export { defaultModalContext, mockUseModalContext, mockUseProviderContext } +export { defaultModalContext, mockUseModalContext } diff --git a/web/app/components/app/overview/app-chart.tsx b/web/app/components/app/overview/app-chart.tsx index 028753d41c..7ea94024ff 100644 --- a/web/app/components/app/overview/app-chart.tsx +++ b/web/app/components/app/overview/app-chart.tsx @@ -102,12 +102,12 @@ export type PeriodParamsWithTimeRange = { query?: TimeRange } -export type IBizChartProps = { +type IBizChartProps = { period: PeriodParams id: string } -export type IChartProps = { +type IChartProps = { className?: string basicInfo: { title: string, explanation: string, timePeriod: string } valueKey?: string @@ -508,5 +508,3 @@ export const AvgUserInteractions: FC = ({ id, period }) => { /> ) } - -export default Chart diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index db880839c9..cd50e7f8ee 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -29,7 +29,7 @@ import Link from '@/next/link' import { AppModeEnum } from '@/types/app' import { cn } from '@/utils/classnames' -export type ISettingsModalProps = { +type ISettingsModalProps = { isChat: boolean appInfo: AppDetailResponse & Partial isShow: boolean diff --git a/web/app/components/app/overview/trigger-card.tsx b/web/app/components/app/overview/trigger-card.tsx index 11f08cf994..53301a353a 100644 --- a/web/app/components/app/overview/trigger-card.tsx +++ b/web/app/components/app/overview/trigger-card.tsx @@ -22,7 +22,7 @@ import { import { useAllTriggerPlugins } from '@/service/use-triggers' import { canFindTool } from '@/utils' -export type ITriggerCardProps = { +type ITriggerCardProps = { appInfo: AppDetailResponse & Partial onToggleResult?: (err: Error | null, message?: I18nKeysByPrefix<'common', 'actionMsg.'>) => void } diff --git a/web/app/components/app/text-generate/item/index.tsx b/web/app/components/app/text-generate/item/index.tsx index 62f1e5752e..88599a5ef1 100644 --- a/web/app/components/app/text-generate/item/index.tsx +++ b/web/app/components/app/text-generate/item/index.tsx @@ -38,7 +38,7 @@ import ResultTab from './result-tab' const MAX_DEPTH = 3 -export type IGenerationItemProps = { +type IGenerationItemProps = { isWorkflow?: boolean workflowProcessData?: WorkflowProcess className?: string @@ -67,12 +67,6 @@ export type IGenerationItemProps = { inSidePanel?: boolean } -export const copyIcon = ( - - - -) - const GenerationItem: FC = ({ isWorkflow, workflowProcessData, diff --git a/web/app/components/app/text-generate/saved-items/no-data/index.tsx b/web/app/components/app/text-generate/saved-items/no-data/index.tsx index e73a1db1df..c6596c8ec3 100644 --- a/web/app/components/app/text-generate/saved-items/no-data/index.tsx +++ b/web/app/components/app/text-generate/saved-items/no-data/index.tsx @@ -8,7 +8,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type INoDataProps = { +type INoDataProps = { onStartCreateContent: () => void } diff --git a/web/app/components/app/type-selector/index.tsx b/web/app/components/app/type-selector/index.tsx index 2b0923a6a0..cb4db155d4 100644 --- a/web/app/components/app/type-selector/index.tsx +++ b/web/app/components/app/type-selector/index.tsx @@ -11,7 +11,7 @@ import { import { AppModeEnum } from '@/types/app' import { cn } from '@/utils/classnames' -export type AppSelectorProps = { +type AppSelectorProps = { value: Array onChange: (value: AppSelectorProps['value']) => void } diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsx index 079e8fa8bc..7227e412e7 100644 --- a/web/app/components/apps/app-card.tsx +++ b/web/app/components/apps/app-card.tsx @@ -62,7 +62,7 @@ const AccessControl = dynamic(() => import('@/app/components/app/app-access-cont ssr: false, }) -export type AppCardProps = { +type AppCardProps = { app: App onRefresh?: () => void } diff --git a/web/app/components/apps/new-app-card.tsx b/web/app/components/apps/new-app-card.tsx index 7741190b8c..31a374f6f7 100644 --- a/web/app/components/apps/new-app-card.tsx +++ b/web/app/components/apps/new-app-card.tsx @@ -25,7 +25,7 @@ const CreateFromDSLModal = dynamic(() => import('@/app/components/app/create-fro ssr: false, }) -export type CreateAppCardProps = { +type CreateAppCardProps = { className?: string isLoading?: boolean onSuccess?: () => void diff --git a/web/app/components/base/agent-log-modal/detail.tsx b/web/app/components/base/agent-log-modal/detail.tsx index 6550b305f8..45f34c9711 100644 --- a/web/app/components/base/agent-log-modal/detail.tsx +++ b/web/app/components/base/agent-log-modal/detail.tsx @@ -15,7 +15,7 @@ import { cn } from '@/utils/classnames' import ResultPanel from './result' import TracingPanel from './tracing' -export type AgentLogDetailProps = { +type AgentLogDetailProps = { activeTab?: 'DETAIL' | 'TRACING' conversationID: string log: IChatItem diff --git a/web/app/components/base/amplitude/index.ts b/web/app/components/base/amplitude/index.ts index 44cbf728e2..21152d1220 100644 --- a/web/app/components/base/amplitude/index.ts +++ b/web/app/components/base/amplitude/index.ts @@ -1,2 +1,2 @@ export { default } from './lazy-amplitude-provider' -export { resetUser, setUserId, setUserProperties, trackEvent } from './utils' +export { setUserId, setUserProperties, trackEvent } from './utils' diff --git a/web/app/components/base/answer-icon/index.tsx b/web/app/components/base/answer-icon/index.tsx index 56e932ad71..1ae1b4f076 100644 --- a/web/app/components/base/answer-icon/index.tsx +++ b/web/app/components/base/answer-icon/index.tsx @@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames' init({ data }) -export type AnswerIconProps = { +type AnswerIconProps = { iconType?: AppIconType | null icon?: string | null background?: string | null diff --git a/web/app/components/base/app-icon/index.tsx b/web/app/components/base/app-icon/index.tsx index b3fe5f3c4f..d4eaeb69d9 100644 --- a/web/app/components/base/app-icon/index.tsx +++ b/web/app/components/base/app-icon/index.tsx @@ -12,7 +12,7 @@ import { cn } from '@/utils/classnames' init({ data }) -export type AppIconProps = { +type AppIconProps = { size?: 'xs' | 'tiny' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' rounded?: boolean iconType?: AppIconType | null diff --git a/web/app/components/base/auto-height-textarea/style.module.scss b/web/app/components/base/auto-height-textarea/style.module.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/web/app/components/base/avatar/index.tsx b/web/app/components/base/avatar/index.tsx index f53e1f8985..885022dded 100644 --- a/web/app/components/base/avatar/index.tsx +++ b/web/app/components/base/avatar/index.tsx @@ -24,11 +24,11 @@ export type AvatarProps = { onLoadingStatusChange?: (status: ImageLoadingStatus) => void } -export type AvatarRootProps = React.ComponentPropsWithRef & { +type AvatarRootProps = React.ComponentPropsWithRef & { size?: AvatarSize } -export function AvatarRoot({ +function AvatarRoot({ size = 'md', className, ...props @@ -45,9 +45,9 @@ export function AvatarRoot({ ) } -export type AvatarImageProps = React.ComponentPropsWithRef +type AvatarImageProps = React.ComponentPropsWithRef -export function AvatarImage({ +function AvatarImage({ className, ...props }: AvatarImageProps) { @@ -59,11 +59,11 @@ export function AvatarImage({ ) } -export type AvatarFallbackProps = React.ComponentPropsWithRef & { +type AvatarFallbackProps = React.ComponentPropsWithRef & { size?: AvatarSize } -export function AvatarFallback({ +function AvatarFallback({ size = 'md', className, ...props diff --git a/web/app/components/base/block-input/index.tsx b/web/app/components/base/block-input/index.tsx index 2a917306cd..cf832d9f94 100644 --- a/web/app/components/base/block-input/index.tsx +++ b/web/app/components/base/block-input/index.tsx @@ -29,7 +29,7 @@ export const getInputKeys = (value: string) => { return res } -export type IBlockInputProps = { +type IBlockInputProps = { value: string className?: string // wrapper class highLightClassName?: string // class for the highlighted text default is text-blue-500 diff --git a/web/app/components/base/chat/chat-with-history/index.tsx b/web/app/components/base/chat/chat-with-history/index.tsx index a645775965..562502a573 100644 --- a/web/app/components/base/chat/chat-with-history/index.tsx +++ b/web/app/components/base/chat/chat-with-history/index.tsx @@ -97,7 +97,7 @@ const ChatWithHistory: FC = ({ ) } -export type ChatWithHistoryWrapProps = { +type ChatWithHistoryWrapProps = { installedAppInfo?: InstalledApp className?: string } diff --git a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx index 66a5ad6a36..e66ca351f2 100644 --- a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx +++ b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx @@ -7,7 +7,7 @@ import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' import Modal from '@/app/components/base/modal' -export type IRenameModalProps = { +type IRenameModalProps = { isShow: boolean saveLoading: boolean name: string diff --git a/web/app/components/base/chat/chat/context.ts b/web/app/components/base/chat/chat/context.ts index ff0bd26336..c4fbf9dd3e 100644 --- a/web/app/components/base/chat/chat/context.ts +++ b/web/app/components/base/chat/chat/context.ts @@ -26,5 +26,3 @@ export const ChatContext = createContext({ }) export const useChatContext = () => useContext(ChatContext) - -export default ChatContext diff --git a/web/app/components/base/chat/chat/loading-anim/index.tsx b/web/app/components/base/chat/chat/loading-anim/index.tsx index 74cc3444de..6ba37288e7 100644 --- a/web/app/components/base/chat/chat/loading-anim/index.tsx +++ b/web/app/components/base/chat/chat/loading-anim/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { cn } from '@/utils/classnames' import s from './style.module.css' -export type ILoadingAnimProps = { +type ILoadingAnimProps = { type: 'text' | 'avatar' } diff --git a/web/app/components/base/chat/chat/type.ts b/web/app/components/base/chat/chat/type.ts index 7bd4de5b05..6ddb4f958e 100644 --- a/web/app/components/base/chat/chat/type.ts +++ b/web/app/components/base/chat/chat/type.ts @@ -29,8 +29,6 @@ export type SubmitAnnotationFunc = ( content: string, ) => Promise -export type DisplayScene = 'web' | 'console' - export type ToolInfoInThought = { name: string label: string @@ -151,15 +149,6 @@ export type MessageReplace = { conversation_id: string } -export type AnnotationReply = { - id: string - task_id: string - answer: string - conversation_id: string - annotation_id: string - annotation_author_name: string -} - export type InputForm = { type: InputVarType label: string diff --git a/web/app/components/base/chat/embedded-chatbot/header/index.tsx b/web/app/components/base/chat/embedded-chatbot/header/index.tsx index 9cca48b42a..7b1fb46fa0 100644 --- a/web/app/components/base/chat/embedded-chatbot/header/index.tsx +++ b/web/app/components/base/chat/embedded-chatbot/header/index.tsx @@ -16,7 +16,7 @@ import { } from '../context' import { CssTransform } from '../theme/utils' -export type IHeaderProps = { +type IHeaderProps = { isMobile?: boolean allowResetChat?: boolean customerIcon?: React.ReactNode diff --git a/web/app/components/base/chat/types.ts b/web/app/components/base/chat/types.ts index 1502a32e92..341dd3c689 100644 --- a/web/app/components/base/chat/types.ts +++ b/web/app/components/base/chat/types.ts @@ -3,42 +3,16 @@ import type { FileEntity } from '@/app/components/base/file-uploader/types' import type { WorkflowRunningStatus } from '@/app/components/workflow/types' import type { ModelConfig, - VisionSettings, } from '@/types/app' import type { HumanInputFilledFormData, HumanInputFormData, NodeTracing } from '@/types/workflow' export type { Inputs, - PromptVariable, + } from '@/models/debug' -export type { VisionFile } from '@/types/app' + export { TransferMethod } from '@/types/app' -export type UserInputForm = { - default: string - label: string - required: boolean - variable: string -} - -export type UserInputFormTextInput = { - 'text-input': UserInputForm & { - max_length: number - } -} - -export type UserInputFormSelect = { - select: UserInputForm & { - options: string[] - } -} - -export type UserInputFormParagraph = { - paragraph: UserInputForm -} - -export type VisionConfig = VisionSettings - export type EnableType = { enabled: boolean } diff --git a/web/app/components/base/checkbox-list/index.tsx b/web/app/components/base/checkbox-list/index.tsx index 6eda2aebd0..5fb5ca6028 100644 --- a/web/app/components/base/checkbox-list/index.tsx +++ b/web/app/components/base/checkbox-list/index.tsx @@ -9,13 +9,13 @@ import SearchMenu from '@/assets/search-menu.svg' import { cn } from '@/utils/classnames' import Button from '../button' -export type CheckboxListOption = { +type CheckboxListOption = { label: string value: string disabled?: boolean } -export type CheckboxListProps = { +type CheckboxListProps = { title?: string label?: string description?: string diff --git a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx index ac14d49ead..46670b27b3 100644 --- a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx +++ b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx @@ -17,5 +17,3 @@ export const DaysOfWeek = () => {
) } - -export default React.memo(DaysOfWeek) diff --git a/web/app/components/base/date-and-time-picker/utils/dayjs.ts b/web/app/components/base/date-and-time-picker/utils/dayjs.ts index f1c77ecc57..3e20e51cf3 100644 --- a/web/app/components/base/date-and-time-picker/utils/dayjs.ts +++ b/web/app/components/base/date-and-time-picker/utils/dayjs.ts @@ -126,7 +126,7 @@ export const convertTimezoneToOffsetStr = (timezone?: string) => { export const isDayjsObject = (value: unknown): value is Dayjs => dayjs.isDayjs(value) -export type ToDayjsOptions = { +type ToDayjsOptions = { timezone?: string format?: string formats?: string[] diff --git a/web/app/components/base/divider/index.tsx b/web/app/components/base/divider/index.tsx index d3693e9ffd..b096844079 100644 --- a/web/app/components/base/divider/index.tsx +++ b/web/app/components/base/divider/index.tsx @@ -21,7 +21,7 @@ const dividerVariants = cva('', { }, }) -export type DividerProps = { +type DividerProps = { className?: string style?: CSSProperties } & VariantProps diff --git a/web/app/components/base/file-uploader/index.ts b/web/app/components/base/file-uploader/index.ts index 1ab4fdae3b..5f27f61d90 100644 --- a/web/app/components/base/file-uploader/index.ts +++ b/web/app/components/base/file-uploader/index.ts @@ -1,7 +1,7 @@ export { default as FileTypeIcon } from './file-type-icon' export { default as FileUploaderInAttachmentWrapper } from './file-uploader-in-attachment' -export { default as FileItemInAttachment } from './file-uploader-in-attachment/file-item' + export { default as FileUploaderInChatInput } from './file-uploader-in-chat-input' -export { default as FileItem } from './file-uploader-in-chat-input/file-item' + export { FileListInChatInput } from './file-uploader-in-chat-input/file-list' export { FileList } from './file-uploader-in-chat-input/file-list' diff --git a/web/app/components/base/form/form-scenarios/demo/types.ts b/web/app/components/base/form/form-scenarios/demo/types.ts index 91ab1c7747..a8aa18b27d 100644 --- a/web/app/components/base/form/form-scenarios/demo/types.ts +++ b/web/app/components/base/form/form-scenarios/demo/types.ts @@ -30,5 +30,3 @@ export const UserSchema = z.object({ preferredContactMethod: ContactMethod, }), }) - -export type User = z.infer diff --git a/web/app/components/base/form/index.tsx b/web/app/components/base/form/index.tsx index 6c60826c32..663b7f1fe8 100644 --- a/web/app/components/base/form/index.tsx +++ b/web/app/components/base/form/index.tsx @@ -14,9 +14,11 @@ import UploadMethodField from './components/field/upload-method' import VariableOrConstantInputField from './components/field/variable-selector' import Actions from './components/form/actions' -export const { fieldContext, useFieldContext, formContext, useFormContext } +const { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts() +export { formContext, useFieldContext, useFormContext } + export const { useAppForm, withForm } = createFormHook({ fieldComponents: { TextField, diff --git a/web/app/components/base/form/types.ts b/web/app/components/base/form/types.ts index a2b434f3cf..4b83b9e4c9 100644 --- a/web/app/components/base/form/types.ts +++ b/web/app/components/base/form/types.ts @@ -82,8 +82,6 @@ export type FormSchema = { } } -export type FormValues = Record - export type GetValuesOptions = { needTransformWhenSecretFieldIsPristine?: boolean needCheckValidatedValues?: boolean diff --git a/web/app/components/base/ga/index.tsx b/web/app/components/base/ga/index.tsx index 3e19afd974..79783c75cc 100644 --- a/web/app/components/base/ga/index.tsx +++ b/web/app/components/base/ga/index.tsx @@ -9,16 +9,16 @@ export enum GaType { webapp = 'webapp', } -export const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V' -export const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT' -export const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js' +const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V' +const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT' +const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js' const gaIdMaps = { [GaType.admin]: GA_MEASUREMENT_ID_ADMIN, [GaType.webapp]: GA_MEASUREMENT_ID_WEBAPP, } -export type IGAProps = { +type IGAProps = { gaType: GaType } diff --git a/web/app/components/base/icons/IconBase.tsx b/web/app/components/base/icons/IconBase.tsx index 13ab7c816b..2de0f3239e 100644 --- a/web/app/components/base/icons/IconBase.tsx +++ b/web/app/components/base/icons/IconBase.tsx @@ -6,7 +6,7 @@ export type IconData = { icon: AbstractNode } -export type IconBaseProps = { +type IconBaseProps = { data: IconData className?: string onClick?: React.MouseEventHandler diff --git a/web/app/components/base/icons/src/image/llm/index.ts b/web/app/components/base/icons/src/image/llm/index.ts deleted file mode 100644 index 1b7f8c48eb..0000000000 --- a/web/app/components/base/icons/src/image/llm/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { default as BaichuanTextCn } from './BaichuanTextCn' -export { default as Minimax } from './Minimax' -export { default as MinimaxText } from './MinimaxText' -export { default as Tongyi } from './Tongyi' -export { default as TongyiText } from './TongyiText' -export { default as TongyiTextCn } from './TongyiTextCn' -export { default as Wxyy } from './Wxyy' -export { default as WxyyText } from './WxyyText' -export { default as WxyyTextCn } from './WxyyTextCn' diff --git a/web/app/components/base/icons/src/public/billing/index.ts b/web/app/components/base/icons/src/public/billing/index.ts index bd8fdc10dd..c80933b0db 100644 --- a/web/app/components/base/icons/src/public/billing/index.ts +++ b/web/app/components/base/icons/src/public/billing/index.ts @@ -1,12 +1,5 @@ -export { default as ArCube1 } from './ArCube1' -export { default as Asterisk } from './Asterisk' export { default as AwsMarketplaceDark } from './AwsMarketplaceDark' export { default as AwsMarketplaceLight } from './AwsMarketplaceLight' export { default as Azure } from './Azure' -export { default as Buildings } from './Buildings' -export { default as Diamond } from './Diamond' + export { default as GoogleCloud } from './GoogleCloud' -export { default as Group2 } from './Group2' -export { default as Keyframe } from './Keyframe' -export { default as Sparkles } from './Sparkles' -export { default as SparklesSoft } from './SparklesSoft' diff --git a/web/app/components/base/icons/src/public/common/index.ts b/web/app/components/base/icons/src/public/common/index.ts index c19ab569fa..894570bc8f 100644 --- a/web/app/components/base/icons/src/public/common/index.ts +++ b/web/app/components/base/icons/src/public/common/index.ts @@ -1,16 +1,9 @@ -export { default as D } from './D' -export { default as DiagonalDividingLine } from './DiagonalDividingLine' -export { default as Dify } from './Dify' -export { default as Gdpr } from './Gdpr' export { default as Github } from './Github' export { default as Highlight } from './Highlight' -export { default as Iso } from './Iso' + export { default as Line3 } from './Line3' -export { default as Lock } from './Lock' -export { default as MessageChatSquare } from './MessageChatSquare' -export { default as MultiPathRetrieval } from './MultiPathRetrieval' + export { default as Notion } from './Notion' -export { default as NTo1Retrieval } from './NTo1Retrieval' -export { default as Soc2 } from './Soc2' + export { default as SparklesSoft } from './SparklesSoft' export { default as SparklesSoftAccent } from './SparklesSoftAccent' diff --git a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts index 9f45717e73..50d6bac1ed 100644 --- a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts +++ b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts @@ -1,5 +1,5 @@ export { default as ExternalKnowledgeBase } from './ExternalKnowledgeBase' export { default as General } from './General' -export { default as Graph } from './Graph' + export { default as ParentChild } from './ParentChild' export { default as Qa } from './Qa' diff --git a/web/app/components/base/icons/src/public/knowledge/index.ts b/web/app/components/base/icons/src/public/knowledge/index.ts index 4acde1663b..c0d35e9ef3 100644 --- a/web/app/components/base/icons/src/public/knowledge/index.ts +++ b/web/app/components/base/icons/src/public/knowledge/index.ts @@ -1,8 +1,6 @@ -export { default as File } from './File' export { default as OptionCardEffectBlue } from './OptionCardEffectBlue' export { default as OptionCardEffectBlueLight } from './OptionCardEffectBlueLight' export { default as OptionCardEffectOrange } from './OptionCardEffectOrange' export { default as OptionCardEffectPurple } from './OptionCardEffectPurple' export { default as OptionCardEffectTeal } from './OptionCardEffectTeal' export { default as SelectionMod } from './SelectionMod' -export { default as Watercrawl } from './Watercrawl' diff --git a/web/app/components/base/icons/src/public/llm/index.ts b/web/app/components/base/icons/src/public/llm/index.ts index 0c5cef4a36..6b77aefe51 100644 --- a/web/app/components/base/icons/src/public/llm/index.ts +++ b/web/app/components/base/icons/src/public/llm/index.ts @@ -1,50 +1,14 @@ -export { default as Anthropic } from './Anthropic' export { default as AnthropicDark } from './AnthropicDark' export { default as AnthropicLight } from './AnthropicLight' export { default as AnthropicShortLight } from './AnthropicShortLight' -export { default as AnthropicText } from './AnthropicText' -export { default as Azureai } from './Azureai' -export { default as AzureaiText } from './AzureaiText' -export { default as AzureOpenaiService } from './AzureOpenaiService' -export { default as AzureOpenaiServiceText } from './AzureOpenaiServiceText' -export { default as Baichuan } from './Baichuan' -export { default as BaichuanText } from './BaichuanText' -export { default as Chatglm } from './Chatglm' -export { default as ChatglmText } from './ChatglmText' -export { default as Cohere } from './Cohere' -export { default as CohereText } from './CohereText' + export { default as Deepseek } from './Deepseek' export { default as Gemini } from './Gemini' -export { default as Gpt3 } from './Gpt3' -export { default as Gpt4 } from './Gpt4' + export { default as Grok } from './Grok' -export { default as Huggingface } from './Huggingface' -export { default as HuggingfaceText } from './HuggingfaceText' -export { default as HuggingfaceTextHub } from './HuggingfaceTextHub' -export { default as IflytekSpark } from './IflytekSpark' -export { default as IflytekSparkText } from './IflytekSparkText' -export { default as IflytekSparkTextCn } from './IflytekSparkTextCn' -export { default as Jina } from './Jina' -export { default as JinaText } from './JinaText' -export { default as Localai } from './Localai' -export { default as LocalaiText } from './LocalaiText' -export { default as Microsoft } from './Microsoft' -export { default as OpenaiBlack } from './OpenaiBlack' -export { default as OpenaiBlue } from './OpenaiBlue' -export { default as OpenaiGreen } from './OpenaiGreen' + export { default as OpenaiSmall } from './OpenaiSmall' -export { default as OpenaiTeal } from './OpenaiTeal' -export { default as OpenaiText } from './OpenaiText' -export { default as OpenaiTransparent } from './OpenaiTransparent' -export { default as OpenaiViolet } from './OpenaiViolet' + export { default as OpenaiYellow } from './OpenaiYellow' -export { default as Openllm } from './Openllm' -export { default as OpenllmText } from './OpenllmText' -export { default as Replicate } from './Replicate' -export { default as ReplicateText } from './ReplicateText' + export { default as Tongyi } from './Tongyi' -export { default as XorbitsInference } from './XorbitsInference' -export { default as XorbitsInferenceText } from './XorbitsInferenceText' -export { default as Zhipuai } from './Zhipuai' -export { default as ZhipuaiText } from './ZhipuaiText' -export { default as ZhipuaiTextCn } from './ZhipuaiTextCn' diff --git a/web/app/components/base/icons/src/public/model/index.ts b/web/app/components/base/icons/src/public/model/index.ts deleted file mode 100644 index 719a6f0309..0000000000 --- a/web/app/components/base/icons/src/public/model/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Checked } from './Checked' diff --git a/web/app/components/base/icons/src/public/other/index.ts b/web/app/components/base/icons/src/public/other/index.ts index 10987368fb..a8f91dd98b 100644 --- a/web/app/components/base/icons/src/public/other/index.ts +++ b/web/app/components/base/icons/src/public/other/index.ts @@ -1,5 +1,5 @@ export { default as DefaultToolIcon } from './DefaultToolIcon' -export { default as Icon3Dots } from './Icon3Dots' + export { default as Message3Fill } from './Message3Fill' export { default as RowStruct } from './RowStruct' export { default as Slack } from './Slack' diff --git a/web/app/components/base/icons/src/public/plugins/index.ts b/web/app/components/base/icons/src/public/plugins/index.ts deleted file mode 100644 index 87dc37167c..0000000000 --- a/web/app/components/base/icons/src/public/plugins/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { default as Google } from './Google' -export { default as PartnerDark } from './PartnerDark' -export { default as PartnerLight } from './PartnerLight' -export { default as VerifiedDark } from './VerifiedDark' -export { default as VerifiedLight } from './VerifiedLight' -export { default as WebReader } from './WebReader' -export { default as Wikipedia } from './Wikipedia' diff --git a/web/app/components/base/icons/src/public/thought/index.ts b/web/app/components/base/icons/src/public/thought/index.ts index 8a45489dbf..10f5e3f5c3 100644 --- a/web/app/components/base/icons/src/public/thought/index.ts +++ b/web/app/components/base/icons/src/public/thought/index.ts @@ -1,5 +1 @@ -export { default as DataSet } from './DataSet' export { default as Loading } from './Loading' -export { default as Search } from './Search' -export { default as ThoughtList } from './ThoughtList' -export { default as WebReader } from './WebReader' diff --git a/web/app/components/base/icons/src/vender/knowledge/index.ts b/web/app/components/base/icons/src/vender/knowledge/index.ts index 44055c4975..99a4f26ed5 100644 --- a/web/app/components/base/icons/src/vender/knowledge/index.ts +++ b/web/app/components/base/icons/src/vender/knowledge/index.ts @@ -3,7 +3,7 @@ export { default as ApiAggregate } from './ApiAggregate' export { default as ArrowShape } from './ArrowShape' export { default as Chunk } from './Chunk' export { default as Collapse } from './Collapse' -export { default as Divider } from './Divider' + export { default as Economic } from './Economic' export { default as FullTextSearch } from './FullTextSearch' export { default as GeneralChunk } from './GeneralChunk' diff --git a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts index 4e721d70eb..27f8709bed 100644 --- a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts +++ b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts @@ -1,4 +1,2 @@ -export { default as AlertTriangle } from './AlertTriangle' -export { default as ThumbsDown } from './ThumbsDown' export { default as ThumbsUp } from './ThumbsUp' export { default as Warning } from './Warning' diff --git a/web/app/components/base/icons/src/vender/line/arrows/index.ts b/web/app/components/base/icons/src/vender/line/arrows/index.ts index 174c69bd95..b27efc2e9c 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/index.ts +++ b/web/app/components/base/icons/src/vender/line/arrows/index.ts @@ -3,7 +3,5 @@ export { default as ArrowUpRight } from './ArrowUpRight' export { default as ChevronDownDouble } from './ChevronDownDouble' export { default as ChevronRight } from './ChevronRight' export { default as ChevronSelectorVertical } from './ChevronSelectorVertical' -export { default as IconR } from './IconR' + export { default as RefreshCcw01 } from './RefreshCcw01' -export { default as RefreshCw05 } from './RefreshCw05' -export { default as ReverseLeft } from './ReverseLeft' diff --git a/web/app/components/base/icons/src/vender/line/communication/index.ts b/web/app/components/base/icons/src/vender/line/communication/index.ts index a6844c2b69..45a762a1dd 100644 --- a/web/app/components/base/icons/src/vender/line/communication/index.ts +++ b/web/app/components/base/icons/src/vender/line/communication/index.ts @@ -1,6 +1,4 @@ -export { default as AiText } from './AiText' -export { default as ChatBot } from './ChatBot' export { default as ChatBotSlim } from './ChatBotSlim' -export { default as CuteRobot } from './CuteRobot' + export { default as MessageCheckRemove } from './MessageCheckRemove' export { default as MessageFastPlus } from './MessageFastPlus' diff --git a/web/app/components/base/icons/src/vender/line/development/index.ts b/web/app/components/base/icons/src/vender/line/development/index.ts index 93bb1956bb..7c3c48aa5e 100644 --- a/web/app/components/base/icons/src/vender/line/development/index.ts +++ b/web/app/components/base/icons/src/vender/line/development/index.ts @@ -1,14 +1,2 @@ -export { default as ArtificialBrain } from './ArtificialBrain' -export { default as BarChartSquare02 } from './BarChartSquare02' export { default as BracketsX } from './BracketsX' export { default as CodeBrowser } from './CodeBrowser' -export { default as Container } from './Container' -export { default as Database01 } from './Database01' -export { default as Database03 } from './Database03' -export { default as FileHeart02 } from './FileHeart02' -export { default as GitBranch01 } from './GitBranch01' -export { default as PromptEngineering } from './PromptEngineering' -export { default as PuzzlePiece01 } from './PuzzlePiece01' -export { default as TerminalSquare } from './TerminalSquare' -export { default as Variable } from './Variable' -export { default as Webhooks } from './Webhooks' diff --git a/web/app/components/base/icons/src/vender/line/editor/index.ts b/web/app/components/base/icons/src/vender/line/editor/index.ts index b31c42e390..c968aa814c 100644 --- a/web/app/components/base/icons/src/vender/line/editor/index.ts +++ b/web/app/components/base/icons/src/vender/line/editor/index.ts @@ -1,8 +1 @@ -export { default as AlignLeft } from './AlignLeft' -export { default as BezierCurve03 } from './BezierCurve03' -export { default as Collapse } from './Collapse' -export { default as Colors } from './Colors' export { default as ImageIndentLeft } from './ImageIndentLeft' -export { default as LeftIndent02 } from './LeftIndent02' -export { default as LetterSpacing01 } from './LetterSpacing01' -export { default as TypeSquare } from './TypeSquare' diff --git a/web/app/components/base/icons/src/vender/line/files/index.ts b/web/app/components/base/icons/src/vender/line/files/index.ts index 8455f7b56a..afdc65cb24 100644 --- a/web/app/components/base/icons/src/vender/line/files/index.ts +++ b/web/app/components/base/icons/src/vender/line/files/index.ts @@ -1,11 +1,10 @@ export { default as Copy } from './Copy' export { default as CopyCheck } from './CopyCheck' -export { default as File02 } from './File02' + export { default as FileArrow01 } from './FileArrow01' -export { default as FileCheck02 } from './FileCheck02' + export { default as FileDownload02 } from './FileDownload02' export { default as FilePlus01 } from './FilePlus01' export { default as FilePlus02 } from './FilePlus02' -export { default as FileText } from './FileText' -export { default as FileUpload } from './FileUpload' + export { default as Folder } from './Folder' diff --git a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts index 8a98a4612c..736eeca453 100644 --- a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts +++ b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts @@ -1,7 +1,6 @@ export { default as Balance } from './Balance' -export { default as CoinsStacked01 } from './CoinsStacked01' + export { default as CreditsCoin } from './CreditsCoin' -export { default as GoldCoin } from './GoldCoin' -export { default as ReceiptList } from './ReceiptList' + export { default as Tag01 } from './Tag01' export { default as Tag03 } from './Tag03' diff --git a/web/app/components/base/icons/src/vender/line/general/index.ts b/web/app/components/base/icons/src/vender/line/general/index.ts index 2409367264..33f67f01a5 100644 --- a/web/app/components/base/icons/src/vender/line/general/index.ts +++ b/web/app/components/base/icons/src/vender/line/general/index.ts @@ -1,30 +1,19 @@ -export { default as AtSign } from './AtSign' -export { default as Bookmark } from './Bookmark' export { default as Check } from './Check' -export { default as CheckDone01 } from './CheckDone01' -export { default as ChecklistSquare } from './ChecklistSquare' + export { default as CodeAssistant } from './CodeAssistant' -export { default as DotsGrid } from './DotsGrid' -export { default as Edit02 } from './Edit02' -export { default as Edit04 } from './Edit04' -export { default as Edit05 } from './Edit05' -export { default as Hash02 } from './Hash02' -export { default as InfoCircle } from './InfoCircle' + export { default as Link03 } from './Link03' export { default as LinkExternal02 } from './LinkExternal02' -export { default as LogIn04 } from './LogIn04' + export { default as LogOut01 } from './LogOut01' -export { default as LogOut04 } from './LogOut04' + export { default as MagicEdit } from './MagicEdit' -export { default as Menu01 } from './Menu01' -export { default as Pin01 } from './Pin01' + export { default as Pin02 } from './Pin02' export { default as Plus02 } from './Plus02' -export { default as Refresh } from './Refresh' + export { default as SearchMenu } from './SearchMenu' export { default as Settings01 } from './Settings01' export { default as Settings04 } from './Settings04' -export { default as Target04 } from './Target04' -export { default as Upload03 } from './Upload03' -export { default as UploadCloud01 } from './UploadCloud01' + export { default as X } from './X' diff --git a/web/app/components/base/icons/src/vender/line/layout/index.ts b/web/app/components/base/icons/src/vender/line/layout/index.ts index 7c12b1f58f..a6aa205faa 100644 --- a/web/app/components/base/icons/src/vender/line/layout/index.ts +++ b/web/app/components/base/icons/src/vender/line/layout/index.ts @@ -1,4 +1 @@ -export { default as AlignLeft01 } from './AlignLeft01' -export { default as AlignRight01 } from './AlignRight01' -export { default as Grid01 } from './Grid01' export { default as LayoutGrid02 } from './LayoutGrid02' diff --git a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts index 163c433ac8..35052d6564 100644 --- a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts +++ b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts @@ -1,6 +1,2 @@ -export { default as Microphone01 } from './Microphone01' -export { default as PlayCircle } from './PlayCircle' -export { default as SlidersH } from './SlidersH' -export { default as Speaker } from './Speaker' export { default as Stop } from './Stop' export { default as StopCircle } from './StopCircle' diff --git a/web/app/components/base/icons/src/vender/line/others/index.ts b/web/app/components/base/icons/src/vender/line/others/index.ts index 99db66b397..0425327c6c 100644 --- a/web/app/components/base/icons/src/vender/line/others/index.ts +++ b/web/app/components/base/icons/src/vender/line/others/index.ts @@ -1,10 +1,8 @@ export { default as BubbleX } from './BubbleX' -export { default as Colors } from './Colors' + export { default as DragHandle } from './DragHandle' export { default as Env } from './Env' export { default as GlobalVariable } from './GlobalVariable' export { default as Icon3Dots } from './Icon3Dots' export { default as LongArrowLeft } from './LongArrowLeft' export { default as LongArrowRight } from './LongArrowRight' -export { default as SearchMenu } from './SearchMenu' -export { default as Tools } from './Tools' diff --git a/web/app/components/base/icons/src/vender/line/shapes/index.ts b/web/app/components/base/icons/src/vender/line/shapes/index.ts deleted file mode 100644 index daf43bcaf7..0000000000 --- a/web/app/components/base/icons/src/vender/line/shapes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as CubeOutline } from './CubeOutline' diff --git a/web/app/components/base/icons/src/vender/line/time/index.ts b/web/app/components/base/icons/src/vender/line/time/index.ts index 7fd91f2b2e..2187814bbf 100644 --- a/web/app/components/base/icons/src/vender/line/time/index.ts +++ b/web/app/components/base/icons/src/vender/line/time/index.ts @@ -1,4 +1,2 @@ export { default as ClockFastForward } from './ClockFastForward' export { default as ClockPlay } from './ClockPlay' -export { default as ClockPlaySlim } from './ClockPlaySlim' -export { default as ClockRefresh } from './ClockRefresh' diff --git a/web/app/components/base/icons/src/vender/line/users/index.ts b/web/app/components/base/icons/src/vender/line/users/index.ts deleted file mode 100644 index 9f8a35152f..0000000000 --- a/web/app/components/base/icons/src/vender/line/users/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as User01 } from './User01' -export { default as Users01 } from './Users01' diff --git a/web/app/components/base/icons/src/vender/line/weather/index.ts b/web/app/components/base/icons/src/vender/line/weather/index.ts deleted file mode 100644 index 1a68bce765..0000000000 --- a/web/app/components/base/icons/src/vender/line/weather/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Stars02 } from './Stars02' diff --git a/web/app/components/base/icons/src/vender/other/index.ts b/web/app/components/base/icons/src/vender/other/index.ts index 0ca5f22bcf..493bac1931 100644 --- a/web/app/components/base/icons/src/vender/other/index.ts +++ b/web/app/components/base/icons/src/vender/other/index.ts @@ -1,4 +1,3 @@ -export { default as AnthropicText } from './AnthropicText' export { default as Generator } from './Generator' export { default as Group } from './Group' export { default as HourglassShape } from './HourglassShape' diff --git a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts index 777fe96845..7770962bfa 100644 --- a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts +++ b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts @@ -1,2 +1 @@ -export { default as GoldCoin } from './GoldCoin' export { default as Scales02 } from './Scales02' diff --git a/web/app/components/base/icons/src/vender/solid/arrows/index.ts b/web/app/components/base/icons/src/vender/solid/arrows/index.ts index 58ce9aa8ac..d89a969bd4 100644 --- a/web/app/components/base/icons/src/vender/solid/arrows/index.ts +++ b/web/app/components/base/icons/src/vender/solid/arrows/index.ts @@ -1,5 +1,3 @@ export { default as ArrowDownDoubleLine } from './ArrowDownDoubleLine' export { default as ArrowDownRoundFill } from './ArrowDownRoundFill' export { default as ArrowUpDoubleLine } from './ArrowUpDoubleLine' -export { default as ChevronDown } from './ChevronDown' -export { default as HighPriority } from './HighPriority' diff --git a/web/app/components/base/icons/src/vender/solid/communication/index.ts b/web/app/components/base/icons/src/vender/solid/communication/index.ts index 7d2a3a5a95..2da1ac57e8 100644 --- a/web/app/components/base/icons/src/vender/solid/communication/index.ts +++ b/web/app/components/base/icons/src/vender/solid/communication/index.ts @@ -1,12 +1,8 @@ -export { default as AiText } from './AiText' export { default as BubbleTextMod } from './BubbleTextMod' export { default as ChatBot } from './ChatBot' export { default as CuteRobot } from './CuteRobot' -export { default as EditList } from './EditList' + export { default as ListSparkle } from './ListSparkle' export { default as Logic } from './Logic' -export { default as MessageDotsCircle } from './MessageDotsCircle' + export { default as MessageFast } from './MessageFast' -export { default as MessageHeartCircle } from './MessageHeartCircle' -export { default as MessageSmileSquare } from './MessageSmileSquare' -export { default as Send03 } from './Send03' diff --git a/web/app/components/base/icons/src/vender/solid/development/index.ts b/web/app/components/base/icons/src/vender/solid/development/index.ts index f67d854beb..25eb3d2736 100644 --- a/web/app/components/base/icons/src/vender/solid/development/index.ts +++ b/web/app/components/base/icons/src/vender/solid/development/index.ts @@ -1,13 +1,5 @@ export { default as ApiConnection } from './ApiConnection' export { default as ApiConnectionMod } from './ApiConnectionMod' -export { default as BarChartSquare02 } from './BarChartSquare02' -export { default as Container } from './Container' -export { default as Database02 } from './Database02' -export { default as Database03 } from './Database03' -export { default as FileHeart02 } from './FileHeart02' -export { default as PatternRecognition } from './PatternRecognition' -export { default as PromptEngineering } from './PromptEngineering' -export { default as PuzzlePiece01 } from './PuzzlePiece01' -export { default as Semantic } from './Semantic' + export { default as TerminalSquare } from './TerminalSquare' export { default as Variable02 } from './Variable02' diff --git a/web/app/components/base/icons/src/vender/solid/editor/index.ts b/web/app/components/base/icons/src/vender/solid/editor/index.ts index 6b1a0a1afa..8b6debe736 100644 --- a/web/app/components/base/icons/src/vender/solid/editor/index.ts +++ b/web/app/components/base/icons/src/vender/solid/editor/index.ts @@ -1,5 +1 @@ export { default as Brush01 } from './Brush01' -export { default as Citations } from './Citations' -export { default as Colors } from './Colors' -export { default as Paragraph } from './Paragraph' -export { default as TypeSquare } from './TypeSquare' diff --git a/web/app/components/base/icons/src/vender/solid/education/index.ts b/web/app/components/base/icons/src/vender/solid/education/index.ts index 2c8a3b6046..e67b631335 100644 --- a/web/app/components/base/icons/src/vender/solid/education/index.ts +++ b/web/app/components/base/icons/src/vender/solid/education/index.ts @@ -1,4 +1,4 @@ export { default as Beaker02 } from './Beaker02' export { default as BubbleText } from './BubbleText' -export { default as Heart02 } from './Heart02' + export { default as Unblur } from './Unblur' diff --git a/web/app/components/base/icons/src/vender/solid/files/index.ts b/web/app/components/base/icons/src/vender/solid/files/index.ts index fa93cd68dc..7677ba6761 100644 --- a/web/app/components/base/icons/src/vender/solid/files/index.ts +++ b/web/app/components/base/icons/src/vender/solid/files/index.ts @@ -1,4 +1,4 @@ export { default as File05 } from './File05' -export { default as FileSearch02 } from './FileSearch02' + export { default as FileZip } from './FileZip' export { default as Folder } from './Folder' diff --git a/web/app/components/base/icons/src/vender/solid/general/index.ts b/web/app/components/base/icons/src/vender/solid/general/index.ts index 4c4dd9a437..273fb7e876 100644 --- a/web/app/components/base/icons/src/vender/solid/general/index.ts +++ b/web/app/components/base/icons/src/vender/solid/general/index.ts @@ -1,18 +1,14 @@ -export { default as AnswerTriangle } from './AnswerTriangle' export { default as ArrowDownRoundFill } from './ArrowDownRoundFill' export { default as CheckCircle } from './CheckCircle' -export { default as CheckDone01 } from './CheckDone01' + export { default as Download02 } from './Download02' export { default as Edit03 } from './Edit03' -export { default as Edit04 } from './Edit04' + export { default as Eye } from './Eye' export { default as Github } from './Github' export { default as MessageClockCircle } from './MessageClockCircle' -export { default as PlusCircle } from './PlusCircle' -export { default as QuestionTriangle } from './QuestionTriangle' -export { default as SearchMd } from './SearchMd' + export { default as Target04 } from './Target04' export { default as Tool03 } from './Tool03' export { default as XCircle } from './XCircle' export { default as ZapFast } from './ZapFast' -export { default as ZapNarrow } from './ZapNarrow' diff --git a/web/app/components/base/icons/src/vender/solid/layout/index.ts b/web/app/components/base/icons/src/vender/solid/layout/index.ts deleted file mode 100644 index 73a2513d51..0000000000 --- a/web/app/components/base/icons/src/vender/solid/layout/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Grid01 } from './Grid01' diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts index 7c313fecfb..7d1bf786e9 100644 --- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts +++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts @@ -1,12 +1,3 @@ -export { default as AudioSupportIcon } from './AudioSupportIcon' -export { default as DocumentSupportIcon } from './DocumentSupportIcon' export { default as MagicBox } from './MagicBox' -export { default as MagicEyes } from './MagicEyes' -export { default as MagicWand } from './MagicWand' -export { default as Microphone01 } from './Microphone01' -export { default as Play } from './Play' -export { default as Robot } from './Robot' -export { default as Sliders02 } from './Sliders02' -export { default as Speaker } from './Speaker' + export { default as StopCircle } from './StopCircle' -export { default as VideoSupportIcon } from './VideoSupportIcon' diff --git a/web/app/components/base/icons/src/vender/solid/shapes/index.ts b/web/app/components/base/icons/src/vender/solid/shapes/index.ts index 2768e3949a..f25784ab02 100644 --- a/web/app/components/base/icons/src/vender/solid/shapes/index.ts +++ b/web/app/components/base/icons/src/vender/solid/shapes/index.ts @@ -1,3 +1 @@ export { default as Corner } from './Corner' -export { default as Star04 } from './Star04' -export { default as Star06 } from './Star06' diff --git a/web/app/components/base/icons/src/vender/solid/users/index.ts b/web/app/components/base/icons/src/vender/solid/users/index.ts index 4c969bffd7..1691fc8401 100644 --- a/web/app/components/base/icons/src/vender/solid/users/index.ts +++ b/web/app/components/base/icons/src/vender/solid/users/index.ts @@ -1,4 +1 @@ -export { default as User01 } from './User01' export { default as UserEdit02 } from './UserEdit02' -export { default as Users01 } from './Users01' -export { default as UsersPlus } from './UsersPlus' diff --git a/web/app/components/base/icons/src/vender/workflow/index.ts b/web/app/components/base/icons/src/vender/workflow/index.ts index c21e865a09..c2511d3816 100644 --- a/web/app/components/base/icons/src/vender/workflow/index.ts +++ b/web/app/components/base/icons/src/vender/workflow/index.ts @@ -13,7 +13,7 @@ export { default as Http } from './Http' export { default as HumanInLoop } from './HumanInLoop' export { default as IfElse } from './IfElse' export { default as Iteration } from './Iteration' -export { default as IterationStart } from './IterationStart' + export { default as Jinja } from './Jinja' export { default as KnowledgeBase } from './KnowledgeBase' export { default as KnowledgeRetrieval } from './KnowledgeRetrieval' diff --git a/web/app/components/base/icons/utils.ts b/web/app/components/base/icons/utils.ts index 9a15a0816d..51a1d70568 100644 --- a/web/app/components/base/icons/utils.ts +++ b/web/app/components/base/icons/utils.ts @@ -8,7 +8,7 @@ export type AbstractNode = { children?: AbstractNode[] } -export type Attrs = { +type Attrs = { [key: string]: string | undefined } diff --git a/web/app/components/base/inline-delete-confirm/index.tsx b/web/app/components/base/inline-delete-confirm/index.tsx index 529dec479d..a0e3b8eb96 100644 --- a/web/app/components/base/inline-delete-confirm/index.tsx +++ b/web/app/components/base/inline-delete-confirm/index.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import { cn } from '@/utils/classnames' -export type InlineDeleteConfirmProps = { +type InlineDeleteConfirmProps = { title?: string confirmText?: string cancelText?: string diff --git a/web/app/components/base/input-with-copy/index.tsx b/web/app/components/base/input-with-copy/index.tsx index 7c2177d5d2..e85a7bd6f4 100644 --- a/web/app/components/base/input-with-copy/index.tsx +++ b/web/app/components/base/input-with-copy/index.tsx @@ -7,7 +7,7 @@ import { cn } from '@/utils/classnames' import ActionButton from '../action-button' import Tooltip from '../tooltip' -export type InputWithCopyProps = { +type InputWithCopyProps = { showCopyButton?: boolean copyValue?: string // Value to copy, defaults to input value onCopy?: (value: string) => void // Callback when copy is triggered diff --git a/web/app/components/base/markdown-blocks/index.ts b/web/app/components/base/markdown-blocks/index.ts index 73c9fdf13f..10e98c9ad9 100644 --- a/web/app/components/base/markdown-blocks/index.ts +++ b/web/app/components/base/markdown-blocks/index.ts @@ -6,7 +6,7 @@ export { default as AudioBlock } from './audio-block' // Assuming these are also standalone components in this directory intended for Markdown rendering export { default as MarkdownButton } from './button' -export { default as CodeBlock } from './code-block' + export { default as MarkdownForm } from './form' export { default as Img } from './img' export { default as Link } from './link' diff --git a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts index 5e31a7afa9..4e721b214e 100644 --- a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts +++ b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts @@ -15,12 +15,12 @@ export const withIconCardItemPropsSchema = z.object({ ), }).strict() -export const directivePropsSchemas = { +const directivePropsSchemas = { withiconcardlist: withIconCardListPropsSchema, withiconcarditem: withIconCardItemPropsSchema, } as const -export type DirectiveName = keyof typeof directivePropsSchemas +type DirectiveName = keyof typeof directivePropsSchemas function isDirectiveName(name: string): name is DirectiveName { return Object.hasOwn(directivePropsSchemas, name) diff --git a/web/app/components/base/node-status/index.tsx b/web/app/components/base/node-status/index.tsx index 3c39fa1fb3..1616f350b0 100644 --- a/web/app/components/base/node-status/index.tsx +++ b/web/app/components/base/node-status/index.tsx @@ -32,7 +32,7 @@ const StatusIconMap: Record = React.createContext(defaultState) -export const PrevButton = ({ +const PrevButton = ({ className, children, dataTestId, @@ -61,7 +61,7 @@ export const PrevButton = ({ ) } -export const NextButton = ({ +const NextButton = ({ className, children, dataTestId, @@ -117,7 +117,7 @@ const TruncableElement = ({ prev }: ITruncableElementProps) => { : null } -export const PageButton = ({ +const PageButton = ({ as = , className, dataTestIdActive, diff --git a/web/app/components/base/portal-to-follow-elem/index.tsx b/web/app/components/base/portal-to-follow-elem/index.tsx index 7d4f6baa9b..932eceee2b 100644 --- a/web/app/components/base/portal-to-follow-elem/index.tsx +++ b/web/app/components/base/portal-to-follow-elem/index.tsx @@ -46,7 +46,7 @@ export type PortalToFollowElemOptions = { } /** @deprecated Use semantic overlay primitives instead. See #32767. */ -export function usePortalToFollowElem({ +function usePortalToFollowElem({ placement = 'bottom', open: controlledOpen, offset: offsetValue = 0, @@ -114,7 +114,7 @@ type ContextType = ReturnType | null const PortalToFollowElemContext = React.createContext(null) -export function usePortalToFollowElemContext() { +function usePortalToFollowElemContext() { const context = React.useContext(PortalToFollowElemContext) if (context == null) diff --git a/web/app/components/base/premium-badge/index.tsx b/web/app/components/base/premium-badge/index.tsx index 297e05fe42..1ffff2f7a9 100644 --- a/web/app/components/base/premium-badge/index.tsx +++ b/web/app/components/base/premium-badge/index.tsx @@ -66,4 +66,3 @@ const PremiumBadge: React.FC = ({ PremiumBadge.displayName = 'PremiumBadge' export default PremiumBadge -export { PremiumBadge, PremiumBadgeVariants } diff --git a/web/app/components/base/prompt-editor/hooks.ts b/web/app/components/base/prompt-editor/hooks.ts index 6984d30ee8..49fc6a8eb0 100644 --- a/web/app/components/base/prompt-editor/hooks.ts +++ b/web/app/components/base/prompt-editor/hooks.ts @@ -35,7 +35,7 @@ import { DELETE_QUERY_BLOCK_COMMAND } from './plugins/query-block' import { $isQueryBlockNode } from './plugins/query-block/node' import { registerLexicalTextEntity } from './utils' -export type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => [RefObject, boolean] +type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => [RefObject, boolean] export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => { const ref = useRef(null) const [editor] = useLexicalComposerContext() @@ -110,7 +110,7 @@ export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, com return [ref, isSelected] } -export type UseTriggerHandler = () => [RefObject, boolean, Dispatch>] +type UseTriggerHandler = () => [RefObject, boolean, Dispatch>] export const useTrigger: UseTriggerHandler = () => { const triggerRef = useRef(null) const [open, setOpen] = useState(false) @@ -145,16 +145,16 @@ export function useLexicalTextEntity( }, [createNode, editor, getMatch, targetNode]) } -export type MenuTextMatch = { +type MenuTextMatch = { leadOffset: number matchingString: string replaceableString: string } -export type TriggerFn = ( +type TriggerFn = ( text: string, editor: LexicalEditor, ) => MenuTextMatch | null -export const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;' +const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;' export function useBasicTypeaheadTriggerMatch( trigger: string, { minLength = 1, maxLength = 75 }: { minLength?: number, maxLength?: number }, diff --git a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx index 231a72ca14..958415d843 100644 --- a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx @@ -3,7 +3,7 @@ import type { Dataset } from './index' import { DecoratorNode } from 'lexical' import ContextBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean } +type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean } export class ContextBlockNode extends DecoratorNode { __datasets: Dataset[] diff --git a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx index 554bf1a2e9..916e3b5169 100644 --- a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx @@ -3,7 +3,7 @@ import type { GeneratorType } from '@/app/components/app/configuration/config/au import { DecoratorNode } from 'lexical' import CurrentBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType } +type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType } export class CurrentBlockNode extends DecoratorNode { __generatorType: GeneratorType diff --git a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx index b8042e5e54..d253cf7ff3 100644 --- a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import ErrorMessageBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class ErrorMessageBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx index a1d788c8cd..f6fd01f0d9 100644 --- a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx @@ -24,13 +24,6 @@ export type RoleName = { assistant: string } -export type HistoryBlockProps = { - roleName: RoleName - onEditRole: () => void - onInsert?: () => void - onDelete?: () => void -} - const HistoryBlock = memo(({ history = { user: '', assistant: '' }, onEditRole = noop, diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx index 49b0e3d150..2c10fdbd5a 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx @@ -22,11 +22,6 @@ import { export const INSERT_HITL_INPUT_BLOCK_COMMAND = createCommand('INSERT_HITL_INPUT_BLOCK_COMMAND') export const DELETE_HITL_INPUT_BLOCK_COMMAND = createCommand('DELETE_HITL_INPUT_BLOCK_COMMAND') export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP') - -export type HITLInputProps = { - onInsert?: () => void - onDelete?: () => void -} const HITLInputBlock = memo(({ onInsert, onDelete, diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx index bf3c44acf3..9f2d25b446 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx @@ -21,7 +21,7 @@ export type HITLNodeProps = { readonly?: boolean } -export type SerializedNode = SerializedLexicalNode & HITLNodeProps +type SerializedNode = SerializedLexicalNode & HITLNodeProps export class HITLInputNode extends DecoratorNode { __variableName: string diff --git a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx index 5f61c3138b..0606adbe2e 100644 --- a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import LastRunBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class LastRunBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx index d5953d16c4..adabf0bc6e 100644 --- a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx @@ -17,11 +17,6 @@ import { export const INSERT_QUERY_BLOCK_COMMAND = createCommand('INSERT_QUERY_BLOCK_COMMAND') export const DELETE_QUERY_BLOCK_COMMAND = createCommand('DELETE_QUERY_BLOCK_COMMAND') - -export type QueryBlockProps = { - onInsert?: () => void - onDelete?: () => void -} const QueryBlock = memo(({ onInsert, onDelete, diff --git a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx index fc560451dd..519d6bab92 100644 --- a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import QueryBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class QueryBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx index b1e74aa3a6..b24e653bbc 100644 --- a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import RequestURLBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class RequestURLBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx index c8cac64d19..dfbd238dbf 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx @@ -1,5 +1,4 @@ -import type { GetVarType, WorkflowVariableBlockType } from '../../types' -import type { Node } from '@/app/components/workflow/types' +import type { WorkflowVariableBlockType } from '../../types' import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext' import { mergeRegister } from '@lexical/utils' import { @@ -19,13 +18,6 @@ import { export const INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND') export const DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND') export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP') - -export type WorkflowVariableBlockProps = { - getWorkflowNode: (nodeId: string) => Node - onInsert?: () => void - onDelete?: () => void - getVarType: GetVarType -} const WorkflowVariableBlock = memo(({ workflowNodesMap, onInsert, diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx index a241e75233..743937d8a6 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx @@ -6,7 +6,7 @@ import WorkflowVariableBlockComponent from './component' export type WorkflowNodesMap = WorkflowVariableBlockType['workflowNodesMap'] -export type SerializedNode = SerializedLexicalNode & { +type SerializedNode = SerializedLexicalNode & { variables: string[] workflowNodesMap: WorkflowNodesMap getVarType?: GetVarType diff --git a/web/app/components/base/radio/component/group/index.tsx b/web/app/components/base/radio/component/group/index.tsx index 53ccd5e833..aff9e5e3c6 100644 --- a/web/app/components/base/radio/component/group/index.tsx +++ b/web/app/components/base/radio/component/group/index.tsx @@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames' import RadioGroupContext from '../../context' import s from '../../style.module.css' -export type TRadioGroupProps = { +type TRadioGroupProps = { children?: ReactNode | ReactNode[] value?: string | number | boolean className?: string diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index 2cfdcf74bc..70ed726c38 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -37,7 +37,7 @@ export type Item = { extra?: React.ReactNode } & Record -export type ISelectProps = { +type ISelectProps = { className?: string wrapperClassName?: string renderTrigger?: (value: Item | null, isOpen: boolean) => React.JSX.Element | null diff --git a/web/app/components/base/sort/index.tsx b/web/app/components/base/sort/index.tsx index 69562e2f3e..901d353ec2 100644 --- a/web/app/components/base/sort/index.tsx +++ b/web/app/components/base/sort/index.tsx @@ -9,7 +9,7 @@ import { } from '@/app/components/base/portal-to-follow-elem' import { cn } from '@/utils/classnames' -export type Item = { +type Item = { value: number | string name: string } & Record diff --git a/web/app/components/base/tag/index.tsx b/web/app/components/base/tag/index.tsx index 21e2a9c982..dee85c998c 100644 --- a/web/app/components/base/tag/index.tsx +++ b/web/app/components/base/tag/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { cn } from '@/utils/classnames' -export type ITagProps = { +type ITagProps = { children: string | React.ReactNode color?: keyof typeof COLOR_MAP className?: string diff --git a/web/app/components/base/text-generation/types.ts b/web/app/components/base/text-generation/types.ts index d7c03ab3eb..62a401c3cb 100644 --- a/web/app/components/base/text-generation/types.ts +++ b/web/app/components/base/text-generation/types.ts @@ -2,41 +2,11 @@ import type { ExternalDataTool } from '@/models/common' import type { ModelConfig, VisionFile, - VisionSettings, } from '@/types/app' export type { VisionFile } from '@/types/app' export { TransferMethod } from '@/types/app' -export type UserInputForm = { - default: string - label: string - required: boolean - variable: string -} - -export type UserInputFormTextInput = { - 'text-input': UserInputForm & { - max_length: number - } -} - -export type UserInputFormSelect = { - select: UserInputForm & { - options: string[] - } -} - -export type UserInputFormParagraph = { - paragraph: UserInputForm -} - -export type VisionConfig = VisionSettings - -export type EnableType = { - enabled: boolean -} - export type TextGenerationConfig = Omit & { external_data_tools: ExternalDataTool[] } diff --git a/web/app/components/base/textarea/index.tsx b/web/app/components/base/textarea/index.tsx index 73c6865903..d991acb28b 100644 --- a/web/app/components/base/textarea/index.tsx +++ b/web/app/components/base/textarea/index.tsx @@ -58,4 +58,4 @@ const Textarea = React.forwardRef( Textarea.displayName = 'Textarea' export default Textarea -export { Textarea, textareaVariants } +export { textareaVariants } diff --git a/web/app/components/base/theme-switcher.tsx b/web/app/components/base/theme-switcher.tsx index 91fb5ff2c9..a6b6972210 100644 --- a/web/app/components/base/theme-switcher.tsx +++ b/web/app/components/base/theme-switcher.tsx @@ -2,7 +2,7 @@ import { useTheme } from 'next-themes' import { cn } from '@/utils/classnames' -export type Theme = 'light' | 'dark' | 'system' +type Theme = 'light' | 'dark' | 'system' export default function ThemeSwitcher() { const { theme, setTheme } = useTheme() diff --git a/web/app/components/base/timezone-label/index.tsx b/web/app/components/base/timezone-label/index.tsx index bb4355f338..385e4c782a 100644 --- a/web/app/components/base/timezone-label/index.tsx +++ b/web/app/components/base/timezone-label/index.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react' import { convertTimezoneToOffsetStr } from '@/app/components/base/date-and-time-picker/utils/dayjs' import { cn } from '@/utils/classnames' -export type TimezoneLabelProps = { +type TimezoneLabelProps = { /** IANA timezone identifier (e.g., 'Asia/Shanghai', 'America/New_York') */ timezone: string /** Additional CSS classes to apply */ diff --git a/web/app/components/base/tooltip/content.tsx b/web/app/components/base/tooltip/content.tsx index a5a31a2a5c..191ee933f1 100644 --- a/web/app/components/base/tooltip/content.tsx +++ b/web/app/components/base/tooltip/content.tsx @@ -1,6 +1,6 @@ import type { FC, PropsWithChildren, ReactNode } from 'react' -export type ToolTipContentProps = { +type ToolTipContentProps = { title?: ReactNode action?: ReactNode } & PropsWithChildren diff --git a/web/app/components/base/tooltip/index.tsx b/web/app/components/base/tooltip/index.tsx index 1588c99812..da373dea83 100644 --- a/web/app/components/base/tooltip/index.tsx +++ b/web/app/components/base/tooltip/index.tsx @@ -14,7 +14,7 @@ import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigge import { cn } from '@/utils/classnames' import { tooltipManager } from './TooltipManager' -export type TooltipProps = { +type TooltipProps = { position?: Placement triggerMethod?: 'hover' | 'click' triggerClassName?: string diff --git a/web/app/components/base/ui/context-menu/index.tsx b/web/app/components/base/ui/context-menu/index.tsx index 5a0f580ca4..4e164b08b9 100644 --- a/web/app/components/base/ui/context-menu/index.tsx +++ b/web/app/components/base/ui/context-menu/index.tsx @@ -17,8 +17,6 @@ import { cn } from '@/utils/classnames' export const ContextMenu = BaseContextMenu.Root export const ContextMenuTrigger = BaseContextMenu.Trigger -export const ContextMenuPortal = BaseContextMenu.Portal -export const ContextMenuBackdrop = BaseContextMenu.Backdrop export const ContextMenuSub = BaseContextMenu.SubmenuRoot export const ContextMenuGroup = BaseContextMenu.Group export const ContextMenuRadioGroup = BaseContextMenu.RadioGroup @@ -175,26 +173,6 @@ export function ContextMenuCheckboxItem({ ) } -type ContextMenuIndicatorProps = Omit, 'children'> & { - children?: React.ReactNode -} - -export function ContextMenuItemIndicator({ - className, - children, - ...props -}: ContextMenuIndicatorProps) { - return ( - - {children ?? } - - ) -} - export function ContextMenuCheckboxItemIndicator({ className, ...props @@ -239,7 +217,7 @@ export function ContextMenuSubTrigger({ {...props} > {children} - + ) } diff --git a/web/app/components/base/ui/dropdown-menu/index.tsx b/web/app/components/base/ui/dropdown-menu/index.tsx index 13c2dab626..5db5833fd7 100644 --- a/web/app/components/base/ui/dropdown-menu/index.tsx +++ b/web/app/components/base/ui/dropdown-menu/index.tsx @@ -15,7 +15,6 @@ import { parsePlacement } from '@/app/components/base/ui/placement' import { cn } from '@/utils/classnames' export const DropdownMenu = Menu.Root -export const DropdownMenuPortal = Menu.Portal export const DropdownMenuTrigger = Menu.Trigger export const DropdownMenuSub = Menu.SubmenuRoot export const DropdownMenuGroup = Menu.Group diff --git a/web/app/components/base/ui/number-field/index.tsx b/web/app/components/base/ui/number-field/index.tsx index ac2ae0c7c6..924250ca22 100644 --- a/web/app/components/base/ui/number-field/index.tsx +++ b/web/app/components/base/ui/number-field/index.tsx @@ -113,7 +113,7 @@ export function NumberFieldUnit({ ) } -export const numberFieldControlsVariants = cva( +const numberFieldControlsVariants = cva( 'flex shrink-0 flex-col items-stretch border-l border-divider-subtle bg-transparent text-text-tertiary', ) @@ -131,7 +131,7 @@ export function NumberFieldControls({ ) } -export const numberFieldControlButtonVariants = cva( +const numberFieldControlButtonVariants = cva( [ 'flex touch-manipulation select-none items-center justify-center px-1.5 text-text-tertiary outline-hidden transition-colors', 'hover:bg-components-input-bg-hover focus-visible:bg-components-input-bg-hover', diff --git a/web/app/components/base/ui/scroll-area/index.tsx b/web/app/components/base/ui/scroll-area/index.tsx index 195f9b4e81..053d9e684a 100644 --- a/web/app/components/base/ui/scroll-area/index.tsx +++ b/web/app/components/base/ui/scroll-area/index.tsx @@ -6,18 +6,17 @@ import { cn } from '@/utils/classnames' import styles from './index.module.css' export const ScrollAreaRoot = BaseScrollArea.Root -export type ScrollAreaRootProps = React.ComponentPropsWithRef +type ScrollAreaRootProps = React.ComponentPropsWithRef export const ScrollAreaContent = BaseScrollArea.Content -export type ScrollAreaContentProps = React.ComponentPropsWithRef -export type ScrollAreaSlotClassNames = { +type ScrollAreaSlotClassNames = { viewport?: string content?: string scrollbar?: string } -export type ScrollAreaProps = Omit & { +type ScrollAreaProps = Omit & { children: React.ReactNode orientation?: 'vertical' | 'horizontal' slotClassNames?: ScrollAreaSlotClassNames @@ -25,7 +24,7 @@ export type ScrollAreaProps = Omit & { labelledBy?: string } -export const scrollAreaScrollbarClassName = cn( +const scrollAreaScrollbarClassName = cn( styles.scrollbar, 'flex touch-none select-none overflow-clip p-1 opacity-100 transition-opacity motion-reduce:transition-none', 'pointer-events-none data-hovering:pointer-events-auto', @@ -34,20 +33,20 @@ export const scrollAreaScrollbarClassName = cn( 'data-[orientation=horizontal]:absolute data-[orientation=horizontal]:inset-x-0 data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:items-center', ) -export const scrollAreaThumbClassName = cn( +const scrollAreaThumbClassName = cn( 'shrink-0 radius-xs bg-state-base-handle transition-[background-color] motion-reduce:transition-none', 'data-[orientation=vertical]:w-1', 'data-[orientation=horizontal]:h-1', ) -export const scrollAreaViewportClassName = cn( +const scrollAreaViewportClassName = cn( 'size-full min-h-0 min-w-0 outline-hidden', 'focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-components-input-border-hover', ) -export const scrollAreaCornerClassName = 'bg-transparent' +const scrollAreaCornerClassName = 'bg-transparent' -export type ScrollAreaViewportProps = React.ComponentPropsWithRef +type ScrollAreaViewportProps = React.ComponentPropsWithRef export function ScrollAreaViewport({ className, @@ -61,7 +60,7 @@ export function ScrollAreaViewport({ ) } -export type ScrollAreaScrollbarProps = React.ComponentPropsWithRef +type ScrollAreaScrollbarProps = React.ComponentPropsWithRef export function ScrollAreaScrollbar({ className, @@ -75,7 +74,7 @@ export function ScrollAreaScrollbar({ ) } -export type ScrollAreaThumbProps = React.ComponentPropsWithRef +type ScrollAreaThumbProps = React.ComponentPropsWithRef export function ScrollAreaThumb({ className, @@ -89,7 +88,7 @@ export function ScrollAreaThumb({ ) } -export type ScrollAreaCornerProps = React.ComponentPropsWithRef +type ScrollAreaCornerProps = React.ComponentPropsWithRef export function ScrollAreaCorner({ className, diff --git a/web/app/components/base/ui/select/index.tsx b/web/app/components/base/ui/select/index.tsx index 83dfe817dc..b9441b2d6b 100644 --- a/web/app/components/base/ui/select/index.tsx +++ b/web/app/components/base/ui/select/index.tsx @@ -10,11 +10,8 @@ import { cn } from '@/utils/classnames' export const Select = BaseSelect.Root export const SelectValue = BaseSelect.Value -export const SelectGroup = BaseSelect.Group -export const SelectGroupLabel = BaseSelect.GroupLabel -export const SelectSeparator = BaseSelect.Separator -export const selectTriggerVariants = cva( +const selectTriggerVariants = cva( '', { variants: { diff --git a/web/app/components/base/ui/slider/index.tsx b/web/app/components/base/ui/slider/index.tsx index d44f553254..b0a8c2f376 100644 --- a/web/app/components/base/ui/slider/index.tsx +++ b/web/app/components/base/ui/slider/index.tsx @@ -24,7 +24,7 @@ type UncontrolledSliderProps = SliderBaseProps & { defaultValue?: number } -export type SliderProps = ControlledSliderProps | UncontrolledSliderProps +type SliderProps = ControlledSliderProps | UncontrolledSliderProps const sliderRootClassName = 'group/slider relative inline-flex w-full data-disabled:opacity-30' const sliderControlClassName = cn( diff --git a/web/app/components/base/ui/toast/index.tsx b/web/app/components/base/ui/toast/index.tsx index 0307e14dbc..abb71d371e 100644 --- a/web/app/components/base/ui/toast/index.tsx +++ b/web/app/components/base/ui/toast/index.tsx @@ -35,28 +35,28 @@ const TOAST_TONE_STYLES = { }, } satisfies Record -export type ToastType = keyof typeof TOAST_TONE_STYLES +type ToastType = keyof typeof TOAST_TONE_STYLES -export type ToastAddOptions = Omit, 'data' | 'positionerProps' | 'type'> & { +type ToastAddOptions = Omit, 'data' | 'positionerProps' | 'type'> & { type?: ToastType } -export type ToastUpdateOptions = Omit, 'data' | 'positionerProps' | 'type'> & { +type ToastUpdateOptions = Omit, 'data' | 'positionerProps' | 'type'> & { type?: ToastType } -export type ToastOptions = Omit -export type TypedToastOptions = Omit +type ToastOptions = Omit +type TypedToastOptions = Omit type ToastPromiseResultOption = string | ToastUpdateOptions | ((value: Value) => string | ToastUpdateOptions) -export type ToastPromiseOptions = { +type ToastPromiseOptions = { loading: string | ToastUpdateOptions success: ToastPromiseResultOption error: ToastPromiseResultOption } -export type ToastHostProps = { +type ToastHostProps = { timeout?: number limit?: number } @@ -65,7 +65,7 @@ type ToastDismiss = (toastId?: string) => void type ToastCall = (title: ReactNode, options?: ToastOptions) => string type TypedToastCall = (title: ReactNode, options?: TypedToastOptions) => string -export type ToastApi = { +type ToastApi = { (title: ReactNode, options?: ToastOptions): string success: TypedToastCall error: TypedToastCall diff --git a/web/app/components/base/ui/tooltip/index.tsx b/web/app/components/base/ui/tooltip/index.tsx index b100c594c6..693a61ca1f 100644 --- a/web/app/components/base/ui/tooltip/index.tsx +++ b/web/app/components/base/ui/tooltip/index.tsx @@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames' type TooltipContentVariant = 'default' | 'plain' -export type TooltipContentProps = { +type TooltipContentProps = { children: React.ReactNode placement?: Placement sideOffset?: number diff --git a/web/app/components/base/zendesk/utils.ts b/web/app/components/base/zendesk/utils.ts index 961f4b96f6..35f3da7411 100644 --- a/web/app/components/base/zendesk/utils.ts +++ b/web/app/components/base/zendesk/utils.ts @@ -1,6 +1,6 @@ import { IS_CE_EDITION } from '@/config' -export type ConversationField = { +type ConversationField = { id: string value: any } diff --git a/web/app/components/billing/type.ts b/web/app/components/billing/type.ts index e3eb8b6799..15eda0bbf6 100644 --- a/web/app/components/billing/type.ts +++ b/web/app/components/billing/type.ts @@ -37,22 +37,6 @@ export enum SelfHostedPlan { enterprise = 'enterprise', } -export type SelfHostedPlanInfo = { - level: number - price: number - modelProviders: string - teamWorkspace: number - teamMembers: number - buildApps: number - documents: number - vectorSpace: string - documentsRequestQuota: number - documentProcessingPriority: Priority - logHistory: number - messageRequest: number - annotatedResponse: number -} - export type UsagePlanInfo = Pick & { vectorSpace: number } export type UsageResetInfo = { @@ -121,11 +105,6 @@ export type CurrentPlanInfoBackend = { human_input_email_delivery_enabled: boolean } -export type SubscriptionItem = { - plan: Plan - url: string -} - export type SubscriptionUrlsBackend = { url: string } diff --git a/web/app/components/billing/upgrade-btn/style.module.css b/web/app/components/billing/upgrade-btn/style.module.css deleted file mode 100644 index ab8c30ebd5..0000000000 --- a/web/app/components/billing/upgrade-btn/style.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.upgradeBtn { - background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #00B2FF 12.96%, #132BFF 90.95%); - box-shadow: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(0, 162, 253, 0.12); - -} -.upgradeBtn:hover { - background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #02C2FF 12.96%, #001AFF 90.95%); - box-shadow: 0px 4px 6px -2px rgba(16, 18, 40, 0.08), 0px 12px 16px -4px rgba(0, 209, 255, 0.08); -} diff --git a/web/app/components/custom/custom-web-app-brand/style.module.css b/web/app/components/custom/custom-web-app-brand/style.module.css deleted file mode 100644 index bdc7d7cfbf..0000000000 --- a/web/app/components/custom/custom-web-app-brand/style.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.mask { - background: linear-gradient(273deg, rgba(255, 255, 255, 0.00) 51.75%, rgba(255, 255, 255, 0.80) 115.32%); -} diff --git a/web/app/components/datasets/chunk.tsx b/web/app/components/datasets/chunk.tsx index 74184c8d07..e0d820a4f3 100644 --- a/web/app/components/datasets/chunk.tsx +++ b/web/app/components/datasets/chunk.tsx @@ -2,7 +2,7 @@ import type { FC, PropsWithChildren } from 'react' import type { QA } from '@/models/datasets' import { SelectionMod } from '../base/icons/src/public/knowledge' -export type ChunkLabelProps = { +type ChunkLabelProps = { label: string characterCount: number } @@ -27,7 +27,7 @@ export const ChunkLabel: FC = (props) => { ) } -export type ChunkContainerProps = ChunkLabelProps & PropsWithChildren +type ChunkContainerProps = ChunkLabelProps & PropsWithChildren export const ChunkContainer: FC = (props) => { const { label, characterCount, children } = props @@ -41,7 +41,7 @@ export const ChunkContainer: FC = (props) => { ) } -export type QAPreviewProps = { +type QAPreviewProps = { qa: QA } diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx index 17ff348c64..ba2ede9f08 100644 --- a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx +++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx @@ -72,7 +72,7 @@ const ImageUploaderInChunk = ({ ) } -export type ImageUploaderInChunkWrapperProps = { +type ImageUploaderInChunkWrapperProps = { value?: FileEntity[] onChange: (files: FileEntity[]) => void } & ImageUploaderInChunkProps diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx index 5f395f3e54..0c4da5a7e4 100644 --- a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx +++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx @@ -110,7 +110,7 @@ const ImageUploaderInRetrievalTesting = ({ ) } -export type ImageUploaderInRetrievalTestingWrapperProps = { +type ImageUploaderInRetrievalTestingWrapperProps = { value?: FileEntity[] onChange: (files: FileEntity[]) => void } & ImageUploaderInRetrievalTestingProps diff --git a/web/app/components/datasets/common/image-uploader/store.tsx b/web/app/components/datasets/common/image-uploader/store.tsx index 93470190a4..45c338d8bc 100644 --- a/web/app/components/datasets/common/image-uploader/store.tsx +++ b/web/app/components/datasets/common/image-uploader/store.tsx @@ -30,7 +30,7 @@ export const createFileStore = ( } type FileStore = ReturnType -export const FileContext = createContext(null) +const FileContext = createContext(null) export function useFileStoreWithSelector(selector: (state: Shape) => T): T { const store = useContext(FileContext) diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts index 19023ccfe3..992d0526be 100644 --- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts +++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts @@ -12,13 +12,13 @@ export enum CreateFromDSLModalTab { FROM_FILE = 'from-file', FROM_URL = 'from-url', } -export type UseDSLImportOptions = { +type UseDSLImportOptions = { activeTab?: CreateFromDSLModalTab dslUrl?: string onSuccess?: () => void onClose?: () => void } -export type DSLVersions = { +type DSLVersions = { importedVersion: string systemVersion: string } diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx index 74a51d488a..7089c8293a 100644 --- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx +++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx @@ -9,7 +9,7 @@ import { toast } from '@/app/components/base/ui/toast' import { cn } from '@/utils/classnames' import { formatFileSize } from '@/utils/format' -export type Props = { +type Props = { file: File | undefined updateFile: (file?: File) => void className?: string diff --git a/web/app/components/datasets/create/embedding-process/index.module.css b/web/app/components/datasets/create/embedding-process/index.module.css deleted file mode 100644 index 74251cacd2..0000000000 --- a/web/app/components/datasets/create/embedding-process/index.module.css +++ /dev/null @@ -1,91 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.progressContainer { - @apply relative pb-4 w-full; - border-bottom: 0.5px solid #EAECF0; -} -.sourceItem { - position: relative; - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 4px; - padding: 0 4px; - height: 24px; - background: #EFF4FF; - border-radius: 6px; - overflow: hidden; -} - -.sourceItem .info .name { - font-weight: 500; - font-size: 12px; - line-height: 18px; - color: #101828; -} -.sourceItem.success .info .name { - color: #05603A; -} -.sourceItem .percent { - font-weight: 500; - font-size: 12px; - line-height: 18px; - color: #344054; - z-index: 1; -} -.sourceItem .error { - color: #D92D20; -} -.sourceItem .success { - color: #05603A; -} - -.commonIcon { - @apply w-3 h-3 mr-1 inline-block align-middle; -} -.highIcon { - mask-image: url(../assets/star.svg); - @apply bg-orange-500; -} -.economyIcon { - background-color: #444ce7; - mask-image: url(../assets/normal.svg); -} -.tokens { - @apply text-xs font-medium px-1; -} -.price { - color: #f79009; - @apply text-xs font-medium; -} - -.unknownFileIcon { - background-image: url(../assets/unknown.svg); -} -.csv { - background-image: url(../assets/csv.svg); -} -.docx { - background-image: url(../assets/docx.svg); -} -.xlsx, -.xls { - background-image: url(../assets/xlsx.svg); -} -.pdf { - background-image: url(../assets/pdf.svg); -} -.html, -.htm { - background-image: url(../assets/html.svg); -} -.md, -.markdown { - background-image: url(../assets/md.svg); -} -.txt { - background-image: url(../assets/txt.svg); -} -.json { - background-image: url(../assets/json.svg); -} diff --git a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts index a202d85b61..05827d0a9e 100644 --- a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts +++ b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts @@ -19,7 +19,7 @@ export type FileUploadConfig = { file_upload_limit: number } -export type UseFileUploadOptions = { +type UseFileUploadOptions = { fileList: FileItem[] prepareFileList: (files: FileItem[]) => void onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void @@ -33,7 +33,7 @@ export type UseFileUploadOptions = { allowedExtensions?: string[] } -export type UseFileUploadReturn = { +type UseFileUploadReturn = { // Refs dropRef: RefObject dragRef: RefObject diff --git a/web/app/components/datasets/create/file-uploader/index.module.css b/web/app/components/datasets/create/file-uploader/index.module.css deleted file mode 100644 index a75274594d..0000000000 --- a/web/app/components/datasets/create/file-uploader/index.module.css +++ /dev/null @@ -1,133 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.file { - @apply box-border relative flex items-center justify-between; - padding: 8px 12px 8px 8px; - max-width: 640px; - height: 40px; - background: #ffffff; - border: 0.5px solid #EAECF0; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); - border-radius: 8px; - overflow: hidden; - cursor: pointer; -} - -.progressbar { - position: absolute; - top: 0; - left: 0; - height: 100%; - background-color: #F2F4F7; -} - -.file.uploading, -.file.uploading:hover { - background: #FCFCFD; - border: 0.5px solid #EAECF0; -} - -.file.active { - background: #F5F8FF; - border: 1px solid #D1E0FF; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); -} - -.file:hover { - background: #F5F8FF; - border: 1px solid #D1E0FF; - box-shadow: 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06); -} - -.fileIcon { - @apply shrink-0 w-6 h-6 mr-2 bg-center bg-no-repeat; - background-image: url(../assets/unknown.svg); - background-size: 24px; -} - -.fileIcon.csv { - background-image: url(../assets/csv.svg); -} - -.fileIcon.doc { - background-image: url(../assets/doc.svg); -} - -.fileIcon.docx { - background-image: url(../assets/docx.svg); -} - -.fileIcon.xlsx, -.fileIcon.xls { - background-image: url(../assets/xlsx.svg); -} - -.fileIcon.pdf { - background-image: url(../assets/pdf.svg); -} - -.fileIcon.html, -.fileIcon.htm { - background-image: url(../assets/html.svg); -} - -.fileIcon.md, -.fileIcon.markdown { - background-image: url(../assets/md.svg); -} - -.fileIcon.txt { - background-image: url(../assets/txt.svg); -} - -.fileIcon.json { - background-image: url(../assets/json.svg); -} - -.fileInfo { - @apply grow flex items-center; - z-index: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.filename { - font-weight: 500; - font-size: 13px; - line-height: 18px; - color: #1D2939; -} - -.size { - @apply ml-3; - font-weight: 400; - font-size: 12px; - line-height: 18px; - color: #667085; -} - -.actionWrapper { - @apply flex items-center shrink-0; - z-index: 1; -} - -.actionWrapper .percent { - font-weight: 400; - font-size: 13px; - line-height: 18px; - color: #344054; -} - -.actionWrapper .remove { - display: none; - width: 24px; - height: 24px; - background: center no-repeat url(../assets/trash.svg); - background-size: 16px; - cursor: pointer; -} - -.file:hover .actionWrapper .remove { - display: block; -} diff --git a/web/app/components/datasets/create/index.module.css b/web/app/components/datasets/create/index.module.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/web/app/components/datasets/create/step-one/hooks/index.ts b/web/app/components/datasets/create/step-one/hooks/index.ts index bae5ce4fce..bccd40e542 100644 --- a/web/app/components/datasets/create/step-one/hooks/index.ts +++ b/web/app/components/datasets/create/step-one/hooks/index.ts @@ -1,2 +1 @@ export { default as usePreviewState } from './use-preview-state' -export type { PreviewActions, PreviewState, UsePreviewStateReturn } from './use-preview-state' diff --git a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts index 3984947ab1..79249fd84d 100644 --- a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts +++ b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts @@ -4,13 +4,13 @@ import type { NotionPage } from '@/models/common' import type { CrawlResultItem } from '@/models/datasets' import { useCallback, useState } from 'react' -export type PreviewState = { +type PreviewState = { currentFile: File | undefined currentNotionPage: NotionPage | undefined currentWebsite: CrawlResultItem | undefined } -export type PreviewActions = { +type PreviewActions = { showFilePreview: (file: File) => void hideFilePreview: () => void showNotionPagePreview: (page: NotionPage) => void @@ -19,7 +19,7 @@ export type PreviewActions = { hideWebsitePreview: () => void } -export type UsePreviewStateReturn = PreviewState & PreviewActions +type UsePreviewStateReturn = PreviewState & PreviewActions /** * Custom hook for managing preview state across different data source types. diff --git a/web/app/components/datasets/create/step-three/index.module.css b/web/app/components/datasets/create/step-three/index.module.css deleted file mode 100644 index 221c77bb05..0000000000 --- a/web/app/components/datasets/create/step-three/index.module.css +++ /dev/null @@ -1,77 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.creationInfo { - padding-top: 42px; -} -.creationInfo .title { - @apply mb-2; - font-weight: 500; - font-size: 20px; - line-height: 30px; - color: #101828; -} -.creationInfo .content { - margin-bottom: 44px; - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #667085; -} -.creationInfo .label { - @apply mb-2; - font-weight: 500; - font-size: 14px; - line-height: 20px; - color: #101828; -} -.datasetName { - padding: 8px 12px; - background: #F9FAFB; - border-radius: 8px; - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #101828; - word-break: break-all; -} - -.dividerLine { - margin: 24px 0; - height: 1px; - background-color: #eaecf0; -} - -.sideTip { - @apply flex flex-col items-center shrink-0 ; - padding-top: 108px; - width: 524px; - border-left: 0.5px solid #F2F4F7; -} -.tipCard { - @apply flex flex-col items-start p-6; - width: 320px; - background-color: #F9FAFB; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); - border-radius: 12px; -} -.tipCard .icon { - width: 32px; - height: 32px; - border: 1px solid #EAECF0; - border-radius: 6px; - background: center no-repeat url(../assets/book-open-01.svg); - background-size: 16px; -} -.tipCard .title { - margin: 12px 0; - font-weight: 500; - font-size: 16px; - line-height: 24px; - color: #344054; -} -.tipCard .content { - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #344054; -} diff --git a/web/app/components/datasets/create/step-two/hooks/index.ts b/web/app/components/datasets/create/step-two/hooks/index.ts index f16daaaea5..b216ead2e6 100644 --- a/web/app/components/datasets/create/step-two/hooks/index.ts +++ b/web/app/components/datasets/create/step-two/hooks/index.ts @@ -1,14 +1,10 @@ export { useDocumentCreation } from './use-document-creation' -export type { DocumentCreation, ValidationParams } from './use-document-creation' export { IndexingType, useIndexingConfig } from './use-indexing-config' -export type { IndexingConfig } from './use-indexing-config' export { useIndexingEstimate } from './use-indexing-estimate' -export type { IndexingEstimate } from './use-indexing-estimate' export { usePreviewState } from './use-preview-state' -export type { PreviewState } from './use-preview-state' export { DEFAULT_MAXIMUM_CHUNK_LENGTH, DEFAULT_OVERLAP, DEFAULT_SEGMENT_IDENTIFIER, defaultParentChildConfig, MAXIMUM_CHUNK_TOKEN_LENGTH, useSegmentationState } from './use-segmentation-state' -export type { ParentChildConfig, SegmentationState } from './use-segmentation-state' +export type { ParentChildConfig } from './use-segmentation-state' diff --git a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts index eb1994276c..1c80a188e5 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts @@ -14,7 +14,7 @@ import { useInvalidDatasetList } from '@/service/knowledge/use-dataset' import { IndexingType } from './use-indexing-config' import { MAXIMUM_CHUNK_TOKEN_LENGTH } from './use-segmentation-state' -export type UseDocumentCreationOptions = { +type UseDocumentCreationOptions = { datasetId?: string isSetting?: boolean documentDetail?: FullDocumentDetail @@ -34,7 +34,7 @@ export type UseDocumentCreationOptions = { onSave?: () => void mutateDatasetRes?: () => void } -export type ValidationParams = { +type ValidationParams = { segmentationType: string maxChunkLength: number limitMaxChunkLength: number @@ -197,4 +197,3 @@ export const useDocumentCreation = (options: UseDocumentCreationOptions) => { validatePreviewParams, } } -export type DocumentCreation = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts index 97fc9c260f..a8dd5f2217 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts @@ -23,7 +23,7 @@ const DEFAULT_RETRIEVAL_CONFIG: RetrievalConfig = { score_threshold: 0.5, } -export type UseIndexingConfigOptions = { +type UseIndexingConfigOptions = { initialIndexType?: IndexingType initialEmbeddingModel?: DefaultModel initialRetrievalConfig?: RetrievalConfig @@ -139,5 +139,3 @@ export const useIndexingConfig = (options: UseIndexingConfigOptions) => { showMultiModalTip, } } - -export type IndexingConfig = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts index cc5a2bcf33..ea14ef2c99 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts @@ -10,7 +10,7 @@ import { useFetchFileIndexingEstimateForWeb, } from '@/service/knowledge/use-create-dataset' -export type UseIndexingEstimateOptions = { +type UseIndexingEstimateOptions = { dataSourceType: DataSourceType datasetId?: string // Document settings @@ -119,5 +119,3 @@ export const useIndexingEstimate = (options: UseIndexingEstimateOptions) => { reset: currentMutation.reset, } } - -export type IndexingEstimate = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts index 94171c5947..8ac1b7904d 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts @@ -3,7 +3,7 @@ import type { CrawlResultItem, CustomFile, DocumentItem, FullDocumentDetail } fr import { useCallback, useState } from 'react' import { DataSourceType } from '@/models/datasets' -export type UsePreviewStateOptions = { +type UsePreviewStateOptions = { dataSourceType: DataSourceType files: CustomFile[] notionPages: NotionPage[] @@ -123,5 +123,3 @@ export const usePreviewState = (options: UsePreviewStateOptions) => { handlePreviewChange, } } - -export type PreviewState = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts index abef8a98cb..cdd2f61c0c 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts @@ -35,7 +35,7 @@ export const defaultParentChildConfig: ParentChildConfig = { }, } -export type UseSegmentationStateOptions = { +type UseSegmentationStateOptions = { initialSegmentationType?: ProcessMode initialSummaryIndexSetting?: SummaryIndexSettingType } @@ -230,5 +230,3 @@ export const useSegmentationState = (options: UseSegmentationStateOptions = {}) getProcessRule, } } - -export type SegmentationState = ReturnType diff --git a/web/app/components/datasets/documents/components/document-list/components/index.ts b/web/app/components/datasets/documents/components/document-list/components/index.ts index 377f64a27f..9a279e410f 100644 --- a/web/app/components/datasets/documents/components/document-list/components/index.ts +++ b/web/app/components/datasets/documents/components/document-list/components/index.ts @@ -1,4 +1,2 @@ -export { default as DocumentSourceIcon } from './document-source-icon' export { default as DocumentTableRow } from './document-table-row' export { default as SortHeader } from './sort-header' -export { renderTdValue } from './utils' diff --git a/web/app/components/datasets/documents/components/document-list/index.tsx b/web/app/components/datasets/documents/components/document-list/index.tsx deleted file mode 100644 index 46fd7a02d5..0000000000 --- a/web/app/components/datasets/documents/components/document-list/index.tsx +++ /dev/null @@ -1,3 +0,0 @@ -// Re-export from parent for backwards compatibility -export { default } from '../list' -export { renderTdValue } from './components' diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts index cda2dae868..5714f4d899 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts @@ -1,3 +1,2 @@ export const PROGRESS_NOT_STARTED = -1 export const PROGRESS_ERROR = -2 -export const PROGRESS_COMPLETE = 100 diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts index 1f7c9ecfed..667010f661 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts @@ -4,7 +4,7 @@ import { useCallback, useRef } from 'react' import { useFileUpload } from '@/app/components/datasets/create/file-uploader/hooks/use-file-upload' import { useDataSourceStore, useDataSourceStoreWithSelector } from '../../store' -export type UseLocalFileUploadOptions = { +type UseLocalFileUploadOptions = { allowedExtensions: string[] supportBatchUpload?: boolean } diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx index cb3632ba9d..93a48f6be7 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx @@ -3,7 +3,7 @@ import FileListItem from './components/file-list-item' import UploadDropzone from './components/upload-dropzone' import { useLocalFileUpload } from './hooks/use-local-file-upload' -export type LocalFileProps = { +type LocalFileProps = { allowedExtensions: string[] supportBatchUpload?: boolean } diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx index b0f25d94b7..fc56e05b43 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx @@ -31,7 +31,7 @@ import Options from './base/options' const I18N_PREFIX = 'stepOne.website' -export type WebsiteCrawlProps = { +type WebsiteCrawlProps = { nodeId: string nodeData: DataSourceNodeType onCredentialChange: (credentialId: string) => void diff --git a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx index 2e85dad26a..7382d1abd1 100644 --- a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx +++ b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx @@ -16,7 +16,7 @@ import { useFileUploadConfig } from '@/service/use-common' import { Theme } from '@/types/app' import { cn } from '@/utils/classnames' -export type Props = { +type Props = { file: FileItem | undefined updateFile: (file?: FileItem) => void } diff --git a/web/app/components/datasets/documents/detail/batch-modal/index.tsx b/web/app/components/datasets/documents/detail/batch-modal/index.tsx index 1fc006831e..ff43f5f67d 100644 --- a/web/app/components/datasets/documents/detail/batch-modal/index.tsx +++ b/web/app/components/datasets/documents/detail/batch-modal/index.tsx @@ -11,7 +11,7 @@ import Modal from '@/app/components/base/modal' import CSVDownloader from './csv-downloader' import CSVUploader from './csv-uploader' -export type IBatchModalProps = { +type IBatchModalProps = { isShow: boolean docForm: ChunkingMode onCancel: () => void diff --git a/web/app/components/datasets/documents/detail/completed/hooks/index.ts b/web/app/components/datasets/documents/detail/completed/hooks/index.ts index 858b448563..1a6ed8bd0e 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/index.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/index.ts @@ -1,14 +1,9 @@ export { useChildSegmentData } from './use-child-segment-data' -export type { UseChildSegmentDataReturn } from './use-child-segment-data' export { useModalState } from './use-modal-state' -export type { CurrChildChunkType, CurrSegmentType, UseModalStateReturn } from './use-modal-state' export { useSearchFilter } from './use-search-filter' -export type { UseSearchFilterReturn } from './use-search-filter' export { useSegmentListData } from './use-segment-list-data' -export type { UseSegmentListDataReturn } from './use-segment-list-data' export { useSegmentSelection } from './use-segment-selection' -export type { UseSegmentSelectionReturn } from './use-segment-selection' diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts index 50a22fc71f..fab8b16019 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts @@ -8,7 +8,7 @@ import { useChildSegmentList, useChildSegmentListKey, useDeleteChildSegment, use import { useInvalid } from '@/service/use-base' import { useDocumentContext } from '../../context' -export type UseChildSegmentDataOptions = { +type UseChildSegmentDataOptions = { searchValue: string currentPage: number limit: number @@ -19,7 +19,7 @@ export type UseChildSegmentDataOptions = { refreshChunkListDataWithDetailChanged: () => void updateSegmentInCache: (segmentId: string, updater: (seg: SegmentDetailModel) => SegmentDetailModel) => void } -export type UseChildSegmentDataReturn = { +type UseChildSegmentDataReturn = { childSegments: ChildChunkDetail[] isLoadingChildSegmentList: boolean childChunkListData: ReturnType['data'] diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts index ecb45ac1ee..fa314bec25 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts @@ -1,18 +1,18 @@ import type { ChildChunkDetail, SegmentDetailModel } from '@/models/datasets' import { useCallback, useState } from 'react' -export type CurrSegmentType = { +type CurrSegmentType = { segInfo?: SegmentDetailModel showModal: boolean isEditMode?: boolean } -export type CurrChildChunkType = { +type CurrChildChunkType = { childChunkInfo?: ChildChunkDetail showModal: boolean } -export type UseModalStateReturn = { +type UseModalStateReturn = { // Segment detail modal currSegment: CurrSegmentType onClickCard: (detail: SegmentDetailModel, isEditMode?: boolean) => void diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts index e7fafa692d..310e326fc1 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts @@ -3,13 +3,7 @@ import { useDebounceFn } from 'ahooks' import { useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -export type SearchFilterState = { - inputValue: string - searchValue: string - selectedStatus: boolean | 'all' -} - -export type UseSearchFilterReturn = { +type UseSearchFilterReturn = { inputValue: string searchValue: string selectedStatus: boolean | 'all' diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts index fb5db4497e..3a3c486070 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts @@ -14,7 +14,7 @@ import { useDocumentContext } from '../../context' import { ProcessStatus } from '../../segment-add' const DEFAULT_LIMIT = 10 -export type UseSegmentListDataOptions = { +type UseSegmentListDataOptions = { searchValue: string selectedStatus: boolean | 'all' selectedSegmentIds: string[] @@ -24,7 +24,7 @@ export type UseSegmentListDataOptions = { onCloseSegmentDetail: () => void clearSelection: () => void } -export type UseSegmentListDataReturn = { +type UseSegmentListDataReturn = { segments: SegmentDetailModel[] isLoadingSegmentList: boolean segmentListData: ReturnType['data'] diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts index b1adeedaf4..e0fb0b036f 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts @@ -1,7 +1,7 @@ import type { SegmentDetailModel } from '@/models/datasets' import { useCallback, useMemo, useState } from 'react' -export type UseSegmentSelectionReturn = { +type UseSegmentSelectionReturn = { selectedSegmentIds: string[] isAllSelected: boolean isSomeSelected: boolean diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts index 603c16dda5..2d0c4fa25e 100644 --- a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts +++ b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts @@ -1,10 +1,7 @@ export { - calculatePercent, - isEmbeddingStatus, - isTerminalStatus, + useEmbeddingStatus, - useInvalidateEmbeddingStatus, + usePauseIndexing, useResumeIndexing, } from './use-embedding-status' -export type { EmbeddingStatusType } from './use-embedding-status' diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts index e55cd8f9aa..5f9314e695 100644 --- a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts +++ b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts @@ -10,8 +10,6 @@ import { const NAME_SPACE = 'embedding' -export type EmbeddingStatusType = 'indexing' | 'splitting' | 'parsing' | 'cleaning' | 'completed' | 'paused' | 'error' | 'waiting' | '' - const EMBEDDING_STATUSES = ['indexing', 'splitting', 'parsing', 'cleaning'] as const const TERMINAL_STATUSES = ['completed', 'error', 'paused'] as const diff --git a/web/app/components/datasets/documents/detail/embedding/style.module.css b/web/app/components/datasets/documents/detail/embedding/style.module.css deleted file mode 100644 index a60a583ebe..0000000000 --- a/web/app/components/datasets/documents/detail/embedding/style.module.css +++ /dev/null @@ -1,61 +0,0 @@ -@reference "../../../../../styles/globals.css"; - -.progressBar { - @apply absolute top-0 h-4; -} -.barPaused { - background: linear-gradient( - 270deg, - rgba(208, 213, 221, 0.8) -2.21%, - rgba(208, 213, 221, 0.5) 100% - ); -} -.barProcessing { - background: linear-gradient( - 90deg, - rgba(41, 112, 255, 0.9) 0%, - rgba(21, 94, 239, 0.9) 100% - ); -} -.opBtn { - @apply !h-6 !w-fit !px-2 !py-1 !text-xs !text-gray-700 rounded-md; -} -.opIcon { - @apply mr-1 stroke-current text-gray-700 w-3 h-3; -} -.progressContainer { - @apply relative flex mb-2 h-4 rounded-md w-full; -} -.progressBgItem { - @apply flex-1 border-r border-r-white first:rounded-l-md; -} -.progressBgItem:nth-last-child(2) { - @apply rounded-r-md; -} -.progressData { - @apply w-full flex items-center text-xs text-gray-700; -} -.previewTip { - @apply pb-1 pt-12 text-gray-900 text-sm font-medium; -} -.embeddingStatus { - @apply flex items-center justify-between text-gray-900 font-medium text-base mb-3; -} -.commonIcon { - @apply w-3 h-3 mr-1 inline-block align-middle; -} -.highIcon { - mask-image: url(../../assets/star.svg); - @apply bg-orange-500; -} -.economyIcon { - background-color: #444ce7; - mask-image: url(../../assets/normal.svg); -} -.tokens { - @apply text-xs font-medium px-1; -} -.price { - color: #f79009; - @apply text-xs font-medium; -} diff --git a/web/app/components/datasets/documents/detail/segment-add/index.tsx b/web/app/components/datasets/documents/detail/segment-add/index.tsx index 0abfda328b..dbd9f0b5e5 100644 --- a/web/app/components/datasets/documents/detail/segment-add/index.tsx +++ b/web/app/components/datasets/documents/detail/segment-add/index.tsx @@ -17,7 +17,7 @@ import { Plan } from '@/app/components/billing/type' import { useProviderContext } from '@/context/provider-context' import { cn } from '@/utils/classnames' -export type ISegmentAddProps = { +type ISegmentAddProps = { importStatus: ProcessStatus | string | undefined clearProcessStatus: () => void showNewSegmentModal: () => void diff --git a/web/app/components/datasets/formatted-text/flavours/shared.tsx b/web/app/components/datasets/formatted-text/flavours/shared.tsx index 77637f4bb2..4f68177ea3 100644 --- a/web/app/components/datasets/formatted-text/flavours/shared.tsx +++ b/web/app/components/datasets/formatted-text/flavours/shared.tsx @@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames' const baseStyle = 'py-[3px]' -export type SliceContainerProps = ComponentProps<'span'> +type SliceContainerProps = ComponentProps<'span'> export const SliceContainer: FC = ( { @@ -22,7 +22,7 @@ export const SliceContainer: FC = ( } SliceContainer.displayName = 'SliceContainer' -export type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string } +type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string } export const SliceLabel: FC = ( { @@ -45,7 +45,7 @@ export const SliceLabel: FC = ( } SliceLabel.displayName = 'SliceLabel' -export type SliceContentProps = ComponentProps<'span'> +type SliceContentProps = ComponentProps<'span'> export const SliceContent: FC = ( { @@ -66,7 +66,7 @@ export const SliceContent: FC = ( } SliceContent.displayName = 'SliceContent' -export type SliceDividerProps = ComponentProps<'span'> +type SliceDividerProps = ComponentProps<'span'> export const SliceDivider: FC = ( { diff --git a/web/app/components/datasets/formatted-text/formatted.tsx b/web/app/components/datasets/formatted-text/formatted.tsx index 0c1aad6d21..21036ac6f3 100644 --- a/web/app/components/datasets/formatted-text/formatted.tsx +++ b/web/app/components/datasets/formatted-text/formatted.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC } from 'react' import { cn } from '@/utils/classnames' -export type FormattedTextProps = ComponentProps<'p'> +type FormattedTextProps = ComponentProps<'p'> export const FormattedText: FC = (props) => { const { className, ...rest } = props diff --git a/web/app/components/datasets/hit-testing/components/mask.tsx b/web/app/components/datasets/hit-testing/components/mask.tsx index 4568bce5a9..4510e38430 100644 --- a/web/app/components/datasets/hit-testing/components/mask.tsx +++ b/web/app/components/datasets/hit-testing/components/mask.tsx @@ -5,7 +5,7 @@ type MaskProps = { className?: string } -export const Mask = ({ +const Mask = ({ className, }: MaskProps) => { return ( diff --git a/web/app/components/datasets/preview/container.tsx b/web/app/components/datasets/preview/container.tsx index 9bba6054a9..ed63bbc8c5 100644 --- a/web/app/components/datasets/preview/container.tsx +++ b/web/app/components/datasets/preview/container.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC, ReactNode } from 'react' import { cn } from '@/utils/classnames' -export type PreviewContainerProps = ComponentProps<'div'> & { +type PreviewContainerProps = ComponentProps<'div'> & { header: ReactNode mainClassName?: string ref?: React.Ref diff --git a/web/app/components/datasets/preview/header.tsx b/web/app/components/datasets/preview/header.tsx index 0124d03e88..2da4e497a4 100644 --- a/web/app/components/datasets/preview/header.tsx +++ b/web/app/components/datasets/preview/header.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC } from 'react' import { cn } from '@/utils/classnames' -export type PreviewHeaderProps = Omit, 'title'> & { +type PreviewHeaderProps = Omit, 'title'> & { title: string } diff --git a/web/app/components/datasets/settings/permission-selector/index.tsx b/web/app/components/datasets/settings/permission-selector/index.tsx index 5afb56f0a9..a83beffbb4 100644 --- a/web/app/components/datasets/settings/permission-selector/index.tsx +++ b/web/app/components/datasets/settings/permission-selector/index.tsx @@ -17,7 +17,7 @@ import { cn } from '@/utils/classnames' import MemberItem from './member-item' import Item from './permission-item' -export type RoleSelectorProps = { +type RoleSelectorProps = { disabled?: boolean permission?: DatasetPermission value: string[] diff --git a/web/app/components/devtools/react-grab/loader.tsx b/web/app/components/devtools/react-grab/loader.tsx deleted file mode 100644 index 4ee9ad1236..0000000000 --- a/web/app/components/devtools/react-grab/loader.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { IS_DEV } from '@/config' -import Script from '@/next/script' - -export function ReactGrabLoader() { - if (!IS_DEV) - return null - - return ( - <> -