diff --git a/.github/actions/setup-web/action.yml b/.github/actions/setup-web/action.yml index 085b39ebfb..2979c3ddb8 100644 --- a/.github/actions/setup-web/action.yml +++ b/.github/actions/setup-web/action.yml @@ -1,8 +1,13 @@ name: Setup Web Environment +description: Set up Node.js, Vite+, pnpm, and web dependencies runs: using: composite steps: + - name: Setup pnpm + uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d # v6.0.5 + with: + run_install: false - name: Setup Vite+ uses: voidzero-dev/setup-vp@4f5aa3e38c781f1b01e78fb9255527cee8a6efa6 # v1.8.0 with: diff --git a/.github/scripts/check-hotfix-cherry-picks.sh b/.github/scripts/check-hotfix-cherry-picks.sh new file mode 100644 index 0000000000..11dc024ccf --- /dev/null +++ b/.github/scripts/check-hotfix-cherry-picks.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_SHA=${BASE_SHA:-} +HEAD_SHA=${HEAD_SHA:-} +MAIN_REF=${MAIN_REF:-origin/main} +REMEDIATION_HINT="Changes should be made from the main branch using git cherry-pick -x." + +error() { + printf 'ERROR: %s\n' "$1" >&2 +} + +if [[ -z "$BASE_SHA" || -z "$HEAD_SHA" ]]; then + error "BASE_SHA and HEAD_SHA are required. $REMEDIATION_HINT" + exit 2 +fi + +if ! git rev-parse --verify "$BASE_SHA^{commit}" > /dev/null 2>&1; then + error "Base commit '$BASE_SHA' is not available in the local git checkout." + exit 2 +fi + +if ! git rev-parse --verify "$HEAD_SHA^{commit}" > /dev/null 2>&1; then + error "Head commit '$HEAD_SHA' is not available in the local git checkout." + exit 2 +fi + +if ! git rev-parse --verify "$MAIN_REF^{commit}" > /dev/null 2>&1; then + error "Main ref '$MAIN_REF' is not available in the local git checkout. $REMEDIATION_HINT" + exit 2 +fi + +failed=0 +checked=0 + +while IFS= read -r commit_sha; do + [[ -n "$commit_sha" ]] || continue + + checked=$((checked + 1)) + subject=$(git log -1 --format=%s "$commit_sha") + source_sha=$( + git log -1 --format=%B "$commit_sha" \ + | sed -nE 's/^\(cherry picked from commit ([0-9a-fA-F]{7,64})\)$/\1/p' \ + | tail -n 1 + ) + + if [[ -z "$source_sha" ]]; then + error "Commit $commit_sha ($subject) is missing cherry-pick provenance. $REMEDIATION_HINT" + failed=1 + continue + fi + + if ! git cat-file -e "$source_sha^{commit}" 2> /dev/null; then + error "Commit $commit_sha ($subject) references source $source_sha, but that commit is not available locally. $REMEDIATION_HINT" + failed=1 + continue + fi + + if ! git merge-base --is-ancestor "$source_sha" "$MAIN_REF"; then + error "Commit $commit_sha ($subject) references source $source_sha, but that source is not reachable from main ($MAIN_REF). $REMEDIATION_HINT" + failed=1 + fi +done < <(git rev-list --reverse "$BASE_SHA..$HEAD_SHA") + +if [[ "$failed" -ne 0 ]]; then + exit 1 +fi + +if [[ "$checked" -eq 0 ]]; then + echo "No PR commits to check." +else + echo "Verified $checked PR commit(s) include cherry-pick provenance from main." +fi diff --git a/.github/workflows/hotfix-cherry-pick.yml b/.github/workflows/hotfix-cherry-pick.yml new file mode 100644 index 0000000000..594b10c743 --- /dev/null +++ b/.github/workflows/hotfix-cherry-pick.yml @@ -0,0 +1,49 @@ +name: Hotfix Cherry-Pick Provenance + +on: + pull_request: + branches: + - 'hotfix/**' + - 'lts/**' + types: + - opened + - edited + - reopened + - ready_for_review + - synchronize + +permissions: + contents: read + +concurrency: + group: hotfix-cherry-pick-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + check-cherry-pick-provenance: + name: Require cherry-pick provenance + runs-on: depot-ubuntu-24.04 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Fetch PR base, PR head, and main + env: + BASE_REF: ${{ github.base_ref }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + git fetch --no-tags --prune origin \ + "+refs/heads/main:refs/remotes/origin/main" \ + "+refs/heads/${BASE_REF}:refs/remotes/origin/${BASE_REF}" \ + "+refs/pull/${PR_NUMBER}/head:refs/remotes/pull/${PR_NUMBER}/head" + + - name: Load checker from main + run: git show origin/main:.github/scripts/check-hotfix-cherry-picks.sh > "$RUNNER_TEMP/check-hotfix-cherry-picks.sh" + + - name: Check PR commits + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + MAIN_REF: origin/main + run: bash "$RUNNER_TEMP/check-hotfix-cherry-picks.sh" diff --git a/api/AGENTS.md b/api/AGENTS.md index eb4404509d..7cd60b0281 100644 --- a/api/AGENTS.md +++ b/api/AGENTS.md @@ -195,7 +195,7 @@ Before opening a PR / submitting: - Document non-obvious behaviour with concise docstrings and comments. - For Flask-RESTX controller request, query, and response schemas, follow `controllers/API_SCHEMA_GUIDE.md`. In short: use Pydantic models, document GET query params with `query_params_from_model(...)`, register response - DTOs with `register_response_schema_models(...)`, serialize with `ResponseModel.model_validate(...).model_dump(...)`, + DTOs with `register_response_schema_models(...)`, serialize response DTOs with `dump_response(...)`, and avoid adding new legacy `ns.model(...)`, `@marshal_with(...)`, or GET `@ns.expect(...)` patterns. ### Miscellaneous diff --git a/api/controllers/API_SCHEMA_GUIDE.md b/api/controllers/API_SCHEMA_GUIDE.md index 5b1b055b09..6cfbab4b1c 100644 --- a/api/controllers/API_SCHEMA_GUIDE.md +++ b/api/controllers/API_SCHEMA_GUIDE.md @@ -34,6 +34,7 @@ from controllers.common.schema import ( register_response_schema_models, register_schema_models, ) +from libs.helper import dump_response ``` Register request payload and query models with `register_schema_models(...)`: @@ -82,7 +83,7 @@ register_schema_models(console_ns, DraftWorkflowNodeRunPayload) def post(self, app_model: App, node_id: str): payload = DraftWorkflowNodeRunPayload.model_validate(console_ns.payload or {}) result = service.run(..., inputs=payload.inputs, query=payload.query) - return WorkflowRunNodeExecutionResponse.model_validate(result, from_attributes=True).model_dump(mode="json") + return dump_response(WorkflowRunNodeExecutionResponse, result) ``` ## Query Parameters @@ -105,7 +106,7 @@ class WorkflowRunListQuery(BaseModel): def get(self, app_model: App): query = WorkflowRunListQuery.model_validate(request.args.to_dict(flat=True)) result = service.list(..., limit=query.limit, last_id=query.last_id) - return WorkflowRunPaginationResponse.model_validate(result, from_attributes=True).model_dump(mode="json") + return dump_response(WorkflowRunPaginationResponse, result) ``` Do not do this for GET query parameters: @@ -145,10 +146,25 @@ def post(...): Serialize explicitly: ```python -return WorkflowRunNodeExecutionResponse.model_validate( - workflow_node_execution, - from_attributes=True, -).model_dump(mode="json") +return dump_response(WorkflowRunNodeExecutionResponse, workflow_node_execution) +``` + +`dump_response(...)` is the preferred response serialization helper for a single Pydantic response DTO. It validates +with `from_attributes=True` and returns `model_dump(mode="json")`, so SQLAlchemy models, plain objects, dictionaries, +Pydantic aliases, computed fields, and `datetime` values are serialized consistently. + +For wrapper responses, pass a dictionary with the public wrapper fields: + +```python +return dump_response( + WorkflowRunPaginationResponse, + { + "data": workflow_runs, + "page": page, + "limit": limit, + "has_more": has_more, + }, +) ``` If the service can return `None`, translate that into the expected HTTP error before validation: @@ -158,9 +174,12 @@ workflow_run = service.get_workflow_run(...) if workflow_run is None: raise NotFound("Workflow run not found") -return WorkflowRunDetailResponse.model_validate(workflow_run, from_attributes=True).model_dump(mode="json") +return dump_response(WorkflowRunDetailResponse, workflow_run) ``` +Use manual `model_validate(...).model_dump(...)` only when the endpoint needs behavior that `dump_response(...)` does +not provide, such as returning a non-dict payload, intentionally excluding fields, or composing a `(body, status)` tuple. + ## Legacy Flask-RESTX Patterns Avoid adding these patterns to new or migrated endpoints: @@ -190,4 +209,3 @@ Inspect affected endpoints with `jq`. Check that: - Request bodies appear only where the endpoint has a body. - Responses reference the expected `*Response` schema. - Response schemas use public serialized names, not internal validation aliases like `inputs_dict`. - diff --git a/api/controllers/console/app/workflow.py b/api/controllers/console/app/workflow.py index 4f532b437c..8d065ece67 100644 --- a/api/controllers/console/app/workflow.py +++ b/api/controllers/console/app/workflow.py @@ -1,17 +1,22 @@ import json import logging from collections.abc import Sequence -from typing import Any +from datetime import datetime +from typing import Any, NotRequired, TypedDict from flask import abort, request -from flask_restx import Resource, fields, marshal, marshal_with -from pydantic import BaseModel, Field, ValidationError, field_validator +from flask_restx import Resource, fields +from pydantic import AliasChoices, BaseModel, Field, ValidationError, field_validator from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import BadRequest, Forbidden, InternalServerError, NotFound import services from controllers.common.controller_schemas import DefaultBlockConfigQuery, WorkflowListQuery, WorkflowUpdatePayload -from controllers.common.schema import register_response_schema_model, register_schema_models +from controllers.common.schema import ( + register_response_schema_model, + register_response_schema_models, + register_schema_models, +) from controllers.console import console_ns from controllers.console.app.error import ConversationCompletedError, DraftWorkflowNotExist, DraftWorkflowNotSync from controllers.console.app.wraps import get_app_model @@ -22,6 +27,7 @@ from core.app.apps.base_app_queue_manager import AppQueueManager from core.app.apps.workflow.app_generator import SKIP_PREPARE_USER_INPUTS_KEY from core.app.entities.app_invoke_entities import InvokeFrom from core.app.file_access import DatabaseFileAccessController +from core.helper import encrypter from core.helper.trace_id_helper import get_external_trace_id from core.plugin.impl.exc import PluginInvokeError from core.trigger.constants import TRIGGER_SCHEDULE_NODE_TYPE @@ -34,18 +40,18 @@ from core.trigger.debug.event_selectors import ( from extensions.ext_database import db from extensions.ext_redis import redis_client from factories import file_factory, variable_factory -from fields.member_fields import simple_account_fields -from fields.online_user_fields import online_user_list_fields -from fields.workflow_fields import workflow_fields, workflow_pagination_fields +from fields.base import ResponseModel +from fields.member_fields import SimpleAccount from fields.workflow_run_fields import WorkflowRunNodeExecutionResponse from graphon.enums import NodeType from graphon.file import File from graphon.file import helpers as file_helpers from graphon.graph_engine.manager import GraphEngineManager from graphon.model_runtime.utils.encoders import jsonable_encoder +from graphon.variables import SecretVariable, SegmentType, VariableBase from libs import helper from libs.datetime_utils import naive_utc_now -from libs.helper import TimestampField, uuid_value +from libs.helper import TimestampField, dump_response, to_timestamp, uuid_value from libs.login import current_account_with_tenant, login_required from models import App from models.model import AppMode @@ -64,42 +70,15 @@ LISTENING_RETRY_IN = 2000 RESTORE_SOURCE_WORKFLOW_MUST_BE_PUBLISHED_MESSAGE = "source workflow must be published" MAX_WORKFLOW_ONLINE_USERS_REQUEST_IDS = 1000 WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE = 50 +ENVIRONMENT_VARIABLE_SUPPORTED_TYPES = (SegmentType.STRING, SegmentType.NUMBER, SegmentType.SECRET) -# Register models for flask_restx to avoid dict type issues in Swagger -# Register in dependency order: base models first, then dependent models -# Base models -simple_account_model = console_ns.model("SimpleAccount", simple_account_fields) - -from fields.workflow_fields import pipeline_variable_fields, serialize_value_type - -conversation_variable_model = console_ns.model( - "ConversationVariable", - { - "id": fields.String, - "name": fields.String, - "value_type": fields.String(attribute=serialize_value_type), - "value": fields.Raw, - "description": fields.String, - }, -) - -pipeline_variable_model = console_ns.model("PipelineVariable", pipeline_variable_fields) - -# Workflow model with nested dependencies -workflow_fields_copy = workflow_fields.copy() -workflow_fields_copy["created_by"] = fields.Nested(simple_account_model, attribute="created_by_account") -workflow_fields_copy["updated_by"] = fields.Nested( - simple_account_model, attribute="updated_by_account", allow_null=True -) -workflow_fields_copy["conversation_variables"] = fields.List(fields.Nested(conversation_variable_model)) -workflow_fields_copy["rag_pipeline_variables"] = fields.List(fields.Nested(pipeline_variable_model)) -workflow_model = console_ns.model("Workflow", workflow_fields_copy) - -# Workflow pagination model -workflow_pagination_fields_copy = workflow_pagination_fields.copy() -workflow_pagination_fields_copy["items"] = fields.List(fields.Nested(workflow_model), attribute="items") -workflow_pagination_model = console_ns.model("WorkflowPagination", workflow_pagination_fields_copy) +class EnvironmentVariableResponseDict(TypedDict): + value_type: str + id: NotRequired[str] + name: NotRequired[str] + value: NotRequired[Any] + description: NotRequired[str | None] class SyncDraftWorkflowPayload(BaseModel): @@ -170,6 +149,110 @@ class WorkflowOnlineUsersPayload(BaseModel): return list(dict.fromkeys(app_id.strip() for app_id in app_ids if app_id.strip())) +class WorkflowConversationVariableResponse(ResponseModel): + id: str + name: str + value_type: str + value: Any = Field(json_schema_extra={"type": "object"}) + description: str + + @field_validator("value_type", mode="before") + @classmethod + def _serialize_value_type(cls, value: Any) -> str: + if hasattr(value, "exposed_type"): + return str(value.exposed_type()) + return str(value) + + +class PipelineVariableResponse(ResponseModel): + label: str + variable: str + type: str + belong_to_node_id: str + max_length: int | None = None + required: bool + unit: str | None = None + default_value: Any = Field(default=None, json_schema_extra={"type": "object"}) + options: list[str] | None = None + placeholder: str | None = None + tooltips: str | None = None + allowed_file_types: list[str] | None = None + allowed_file_extensions: list[str] | None = Field( + default=None, validation_alias=AliasChoices("allowed_file_extensions", "allow_file_extension") + ) + allowed_file_upload_methods: list[str] | None = Field( + default=None, validation_alias=AliasChoices("allowed_file_upload_methods", "allow_file_upload_methods") + ) + + +class WorkflowEnvironmentVariableResponse(ResponseModel): + value_type: str + id: str + name: str + value: Any = Field(json_schema_extra={"type": "object"}) + description: str + + +class WorkflowResponse(ResponseModel): + id: str + graph: dict[str, Any] = Field(validation_alias=AliasChoices("graph_dict", "graph")) + features: dict[str, Any] = Field(validation_alias=AliasChoices("features_dict", "features")) + hash: str = Field(validation_alias=AliasChoices("unique_hash", "hash")) + version: str + marked_name: str + marked_comment: str + created_by: SimpleAccount | None = Field( + default=None, validation_alias=AliasChoices("created_by_account", "created_by") + ) + created_at: int + updated_by: SimpleAccount | None = Field( + default=None, validation_alias=AliasChoices("updated_by_account", "updated_by") + ) + updated_at: int + tool_published: bool + environment_variables: list[WorkflowEnvironmentVariableResponse] + conversation_variables: list[WorkflowConversationVariableResponse] + rag_pipeline_variables: list[PipelineVariableResponse] + + @field_validator("created_at", "updated_at", mode="before") + @classmethod + def _normalize_timestamp(cls, value: datetime | int | None) -> int: + timestamp = to_timestamp(value) + if timestamp is None: + raise ValueError("timestamp is required") + return timestamp + + @field_validator("environment_variables", mode="before") + @classmethod + def _serialize_environment_variables(cls, value: Any) -> list[Any]: + if value is None: + return [] + + return [_serialize_environment_variable(item) for item in value] + + +class WorkflowPaginationResponse(ResponseModel): + items: list[WorkflowResponse] + page: int + limit: int + has_more: bool + + +class WorkflowOnlineUser(ResponseModel): + user_id: str + username: str + avatar: str | None = None + + +class WorkflowOnlineUsersByApp(ResponseModel): + app_id: str + users: list[WorkflowOnlineUser] + + +class WorkflowOnlineUsersResponse(ResponseModel): + data: list[WorkflowOnlineUsersByApp] + + class DraftWorkflowTriggerRunPayload(BaseModel): node_id: str @@ -197,6 +280,17 @@ register_schema_models( DraftWorkflowTriggerRunAllPayload, ) register_response_schema_model(console_ns, WorkflowRunNodeExecutionResponse) +register_response_schema_models( + console_ns, + WorkflowConversationVariableResponse, + PipelineVariableResponse, + WorkflowEnvironmentVariableResponse, + WorkflowResponse, + WorkflowPaginationResponse, + WorkflowOnlineUser, + WorkflowOnlineUsersByApp, + WorkflowOnlineUsersResponse, +) # TODO(QuantumGhost): Refactor existing node run API to handle file parameter parsing @@ -218,18 +312,56 @@ def _parse_file(workflow: Workflow, files: list[dict] | None = None) -> Sequence return file_objs +def _serialize_environment_variable(value: Any) -> EnvironmentVariableResponseDict | Any: + match value: + case SecretVariable(): + return { + "id": value.id, + "name": value.name, + "value": encrypter.full_mask_token(), + "value_type": value.value_type.value, + "description": value.description, + } + + case VariableBase(): + return { + "id": value.id, + "name": value.name, + "value": value.value, + "value_type": str(value.value_type.exposed_type()), + "description": value.description, + } + + case dict(): + value_type_str = value.get("value_type") + if not isinstance(value_type_str, str): + raise TypeError( + f"unexpected type for value_type field, value={value_type_str}, type={type(value_type_str)}" + ) + value_type = SegmentType(value_type_str).exposed_type() + if value_type not in ENVIRONMENT_VARIABLE_SUPPORTED_TYPES: + raise ValueError(f"Unsupported environment variable value type: {value_type}") + return value + + case _: + return value + + @console_ns.route("/apps//workflows/draft") class DraftWorkflowApi(Resource): @console_ns.doc("get_draft_workflow") @console_ns.doc(description="Get draft workflow for an application") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Draft workflow retrieved successfully", workflow_model) + @console_ns.response( + 200, + "Draft workflow retrieved successfully", + console_ns.models[WorkflowResponse.__name__], + ) @console_ns.response(404, "Draft workflow not found") @setup_required @login_required @account_initialization_required @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW]) - @marshal_with(workflow_model) @edit_permission_required def get(self, app_model: App): """ @@ -242,8 +374,8 @@ class DraftWorkflowApi(Resource): if not workflow: raise DraftWorkflowNotExist() - # return workflow, if not found, return None (initiate graph by frontend) - return workflow + # return workflow, if not found, return 404 + return dump_response(WorkflowResponse, workflow) @setup_required @login_required @@ -817,13 +949,15 @@ class PublishedWorkflowApi(Resource): @console_ns.doc("get_published_workflow") @console_ns.doc(description="Get published workflow for an application") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Published workflow retrieved successfully", workflow_model) - @console_ns.response(404, "Published workflow not found") + @console_ns.response( + 200, + "Published workflow retrieved successfully, or null if not found", + console_ns.models[WorkflowResponse.__name__], + ) @setup_required @login_required @account_initialization_required @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW]) - @marshal_with(workflow_model) @edit_permission_required def get(self, app_model: App): """ @@ -834,7 +968,10 @@ class PublishedWorkflowApi(Resource): workflow = workflow_service.get_published_workflow(app_model=app_model) # return workflow, if not found, return None - return workflow + if workflow is None: + return None + + return dump_response(WorkflowResponse, workflow) @console_ns.expect(console_ns.models[PublishWorkflowPayload.__name__]) @setup_required @@ -993,7 +1130,11 @@ class PublishedAllWorkflowApi(Resource): @console_ns.doc("get_all_published_workflows") @console_ns.doc(description="Get all published workflows for an application") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Published workflows retrieved successfully", workflow_pagination_model) + @console_ns.response( + 200, + "Published workflows retrieved successfully", + console_ns.models[WorkflowPaginationResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -1025,14 +1166,14 @@ class PublishedAllWorkflowApi(Resource): user_id=user_id, named_only=named_only, ) - serialized_workflows = marshal(workflows, workflow_fields_copy) - - return { - "items": serialized_workflows, - "page": page, - "limit": limit, - "has_more": has_more, - } + return WorkflowPaginationResponse.model_validate( + { + "items": workflows, + "page": page, + "limit": limit, + "has_more": has_more, + } + ).model_dump(mode="json") @console_ns.route("/apps//workflows//restore") @@ -1078,14 +1219,13 @@ class WorkflowByIdApi(Resource): @console_ns.doc(description="Update workflow by ID") @console_ns.doc(params={"app_id": "Application ID", "workflow_id": "Workflow ID"}) @console_ns.expect(console_ns.models[WorkflowUpdatePayload.__name__]) - @console_ns.response(200, "Workflow updated successfully", workflow_model) + @console_ns.response(200, "Workflow updated successfully", console_ns.models[WorkflowResponse.__name__]) @console_ns.response(404, "Workflow not found") @console_ns.response(403, "Permission denied") @setup_required @login_required @account_initialization_required @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW]) - @marshal_with(workflow_model) @edit_permission_required def patch(self, app_model: App, workflow_id: str): """ @@ -1119,7 +1259,7 @@ class WorkflowByIdApi(Resource): if not workflow: raise NotFound("Workflow not found") - return workflow + return dump_response(WorkflowResponse, workflow) @setup_required @login_required @@ -1404,12 +1544,16 @@ class DraftWorkflowTriggerRunAllApi(Resource): @console_ns.route("/apps/workflows/online-users") class WorkflowOnlineUsersApi(Resource): @console_ns.expect(console_ns.models[WorkflowOnlineUsersPayload.__name__]) + @console_ns.response( + 200, + "Workflow online users retrieved successfully", + console_ns.models[WorkflowOnlineUsersResponse.__name__], + ) @console_ns.doc("get_workflow_online_users") @console_ns.doc(description="Get workflow online users") @setup_required @login_required @account_initialization_required - @marshal_with(online_user_list_fields) def post(self): args = WorkflowOnlineUsersPayload.model_validate(console_ns.payload or {}) @@ -1452,10 +1596,18 @@ class WorkflowOnlineUsersApi(Resource): if not isinstance(user_info, dict): continue + user_id = user_info.get("user_id") + username = user_info.get("username") + if not isinstance(user_id, str) or not isinstance(username, str): + continue + avatar = user_info.get("avatar") + if avatar is not None and not isinstance(avatar, str): + avatar = None + if isinstance(avatar, str) and avatar and not avatar.startswith(("http://", "https://")): try: - user_info["avatar"] = file_helpers.get_signed_file_url(avatar) + avatar = file_helpers.get_signed_file_url(avatar) except Exception as exc: logger.warning( "Failed to sign workflow online user avatar; using original value. " @@ -1465,7 +1617,7 @@ class WorkflowOnlineUsersApi(Resource): exc, ) - users.append(user_info) + users.append({"user_id": user_id, "username": username, "avatar": avatar}) results.append({"app_id": app_id, "users": users}) - return {"data": results} + return WorkflowOnlineUsersResponse.model_validate({"data": results}).model_dump(mode="json") diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py index 8eff32c555..77dbf0be3f 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py @@ -3,7 +3,7 @@ import logging from typing import Any, Literal, cast from flask import abort, request -from flask_restx import Resource, marshal_with # type: ignore +from flask_restx import Resource from pydantic import BaseModel, Field, ValidationError from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import BadRequest, Forbidden, InternalServerError, NotFound @@ -19,8 +19,8 @@ from controllers.console.app.error import ( ) from controllers.console.app.workflow import ( RESTORE_SOURCE_WORKFLOW_MUST_BE_PUBLISHED_MESSAGE, - workflow_model, - workflow_pagination_model, + WorkflowPaginationResponse, + WorkflowResponse, ) from controllers.console.datasets.wraps import get_rag_pipeline from controllers.console.wraps import ( @@ -42,7 +42,7 @@ from fields.workflow_run_fields import ( ) from graphon.model_runtime.utils.encoders import jsonable_encoder from libs import helper -from libs.helper import TimestampField, UUIDStrOrEmpty +from libs.helper import TimestampField, UUIDStrOrEmpty, dump_response from libs.login import current_account_with_tenant, current_user, login_required from models import Account from models.dataset import Pipeline @@ -142,12 +142,17 @@ register_response_schema_models( @console_ns.route("/rag/pipelines//workflows/draft") class DraftRagPipelineApi(Resource): + @console_ns.response( + 200, + "Draft workflow retrieved successfully", + console_ns.models[WorkflowResponse.__name__], + ) + @console_ns.response(404, "Draft workflow not found") @setup_required @login_required @account_initialization_required @get_rag_pipeline @edit_permission_required - @marshal_with(workflow_model) def get(self, pipeline: Pipeline): """ Get draft rag pipeline's workflow @@ -159,8 +164,8 @@ class DraftRagPipelineApi(Resource): if not workflow: raise DraftWorkflowNotExist() - # return workflow, if not found, return None (initiate graph by frontend) - return workflow + # return workflow, if not found, return 404 + return dump_response(WorkflowResponse, workflow) @setup_required @login_required @@ -476,12 +481,16 @@ class RagPipelineTaskStopApi(Resource): @console_ns.route("/rag/pipelines//workflows/publish") class PublishedRagPipelineApi(Resource): + @console_ns.response( + 200, + "Published workflow retrieved successfully, or null if not exist", + console_ns.models[WorkflowResponse.__name__], + ) @setup_required @login_required @account_initialization_required @edit_permission_required @get_rag_pipeline - @marshal_with(workflow_model) def get(self, pipeline: Pipeline): """ Get published pipeline @@ -494,7 +503,10 @@ class PublishedRagPipelineApi(Resource): workflow = rag_pipeline_service.get_published_workflow(pipeline=pipeline) # return workflow, if not found, return None - return workflow + if workflow is None: + return None + + return dump_response(WorkflowResponse, workflow) @setup_required @login_required @@ -567,12 +579,17 @@ class DefaultRagPipelineBlockConfigApi(Resource): @console_ns.route("/rag/pipelines//workflows") class PublishedAllRagPipelineApi(Resource): + @console_ns.response( + 200, + "Published workflows retrieved successfully", + console_ns.models[WorkflowPaginationResponse.__name__], + ) + @console_ns.response(403, "Permission denied") @setup_required @login_required @account_initialization_required @edit_permission_required @get_rag_pipeline - @marshal_with(workflow_pagination_model) def get(self, pipeline: Pipeline): """ Get published workflows @@ -601,12 +618,14 @@ class PublishedAllRagPipelineApi(Resource): named_only=named_only, ) - return { - "items": workflows, - "page": page, - "limit": limit, - "has_more": has_more, - } + return WorkflowPaginationResponse.model_validate( + { + "items": workflows, + "page": page, + "limit": limit, + "has_more": has_more, + } + ).model_dump(mode="json") @console_ns.route("/rag/pipelines//workflows//restore") @@ -641,12 +660,15 @@ class RagPipelineDraftWorkflowRestoreApi(Resource): @console_ns.route("/rag/pipelines//workflows/") class RagPipelineByIdApi(Resource): + @console_ns.response(200, "Workflow updated successfully", console_ns.models[WorkflowResponse.__name__]) + @console_ns.response(400, "No valid fields to update") + @console_ns.response(403, "Permission denied") + @console_ns.response(404, "Workflow not found") @setup_required @login_required @account_initialization_required @edit_permission_required @get_rag_pipeline - @marshal_with(workflow_model) def patch(self, pipeline: Pipeline, workflow_id: str): """ Update workflow attributes @@ -675,7 +697,7 @@ class RagPipelineByIdApi(Resource): if not workflow: raise NotFound("Workflow not found") - return workflow + return dump_response(WorkflowResponse, workflow) @setup_required @login_required diff --git a/api/controllers/console/workspace/tool_providers.py b/api/controllers/console/workspace/tool_providers.py index e653c9064c..cb01a02318 100644 --- a/api/controllers/console/workspace/tool_providers.py +++ b/api/controllers/console/workspace/tool_providers.py @@ -874,6 +874,7 @@ class ToolBuiltinProviderSetDefaultApi(Resource): @console_ns.expect(console_ns.models[BuiltinProviderDefaultCredentialPayload.__name__]) @setup_required @login_required + @is_admin_or_owner_required @account_initialization_required def post(self, provider): _, current_tenant_id = current_account_with_tenant() diff --git a/api/core/app/apps/base_app_generator.py b/api/core/app/apps/base_app_generator.py index 8e8ccf2b90..d7ef5165f0 100644 --- a/api/core/app/apps/base_app_generator.py +++ b/api/core/app/apps/base_app_generator.py @@ -195,22 +195,23 @@ class BaseAppGenerator: ) if variable_entity.type == VariableEntityType.NUMBER: - if isinstance(value, (int, float)): - return value - elif isinstance(value, str): - # handle empty string case - if not value.strip(): - return None - # may raise ValueError if user_input_value is not a valid number - try: - if "." in value: - return float(value) - else: - return int(value) - except ValueError: - raise ValueError(f"{variable_entity.variable} in input form must be a valid number") - else: - raise TypeError(f"expected value type int, float or str, got {type(value)}, value: {value}") + match value: + case int() | float(): + return value + case str(): + # handle empty string case + if not value.strip(): + return None + # may raise ValueError if user_input_value is not a valid number + try: + if "." in value: + return float(value) + else: + return int(value) + except ValueError: + raise ValueError(f"{variable_entity.variable} in input form must be a valid number") + case _: + raise TypeError(f"expected value type int, float or str, got {type(value)}, value: {value}") match variable_entity.type: case VariableEntityType.SELECT: @@ -241,17 +242,18 @@ class BaseAppGenerator: f"{variable_entity.variable} in input form must be less than {variable_entity.max_length} files" ) case VariableEntityType.CHECKBOX: - if isinstance(value, str): - normalized_value = value.strip().lower() - if normalized_value in {"true", "1", "yes", "on"}: - value = True - elif normalized_value in {"false", "0", "no", "off"}: - value = False - elif isinstance(value, (int, float)): - if value == 1: - value = True - elif value == 0: - value = False + match value: + case str(): + normalized_value = value.strip().lower() + if normalized_value in {"true", "1", "yes", "on"}: + value = True + elif normalized_value in {"false", "0", "no", "off"}: + value = False + case int() | float(): + if value == 1: + value = True + elif value == 0: + value = False case VariableEntityType.JSON_OBJECT: if value and not isinstance(value, dict): raise ValueError(f"{variable_entity.variable} in input form must be a dict") diff --git a/api/core/app/workflow/layers/persistence.py b/api/core/app/workflow/layers/persistence.py index 19152cebae..c5dba65232 100644 --- a/api/core/app/workflow/layers/persistence.py +++ b/api/core/app/workflow/layers/persistence.py @@ -105,52 +105,31 @@ class WorkflowPersistenceLayer(GraphEngineLayer): self._node_sequence = 0 def on_event(self, event: GraphEngineEvent) -> None: - if isinstance(event, GraphRunStartedEvent): - self._handle_graph_run_started() - return - - if isinstance(event, GraphRunSucceededEvent): - self._handle_graph_run_succeeded(event) - return - - if isinstance(event, GraphRunPartialSucceededEvent): - self._handle_graph_run_partial_succeeded(event) - return - - if isinstance(event, GraphRunFailedEvent): - self._handle_graph_run_failed(event) - return - - if isinstance(event, GraphRunAbortedEvent): - self._handle_graph_run_aborted(event) - return - - if isinstance(event, GraphRunPausedEvent): - self._handle_graph_run_paused(event) - return - - if isinstance(event, NodeRunRetryEvent): - self._handle_node_retry(event) - return - - if isinstance(event, NodeRunStartedEvent): - self._handle_node_started(event) - return - - if isinstance(event, NodeRunSucceededEvent): - self._handle_node_succeeded(event) - return - - if isinstance(event, NodeRunFailedEvent): - self._handle_node_failed(event) - return - - if isinstance(event, NodeRunExceptionEvent): - self._handle_node_exception(event) - return - - if isinstance(event, NodeRunPauseRequestedEvent): - self._handle_node_pause_requested(event) + match event: + case GraphRunStartedEvent(): + self._handle_graph_run_started() + case GraphRunSucceededEvent(): + self._handle_graph_run_succeeded(event) + case GraphRunPartialSucceededEvent(): + self._handle_graph_run_partial_succeeded(event) + case GraphRunFailedEvent(): + self._handle_graph_run_failed(event) + case GraphRunAbortedEvent(): + self._handle_graph_run_aborted(event) + case GraphRunPausedEvent(): + self._handle_graph_run_paused(event) + case NodeRunRetryEvent(): + self._handle_node_retry(event) + case NodeRunStartedEvent(): + self._handle_node_started(event) + case NodeRunSucceededEvent(): + self._handle_node_succeeded(event) + case NodeRunFailedEvent(): + self._handle_node_failed(event) + case NodeRunExceptionEvent(): + self._handle_node_exception(event) + case NodeRunPauseRequestedEvent(): + self._handle_node_pause_requested(event) def on_graph_end(self, error: Exception | None) -> None: return diff --git a/api/core/llm_generator/output_parser/structured_output.py b/api/core/llm_generator/output_parser/structured_output.py index d2e375626f..6cba4fbdf6 100644 --- a/api/core/llm_generator/output_parser/structured_output.py +++ b/api/core/llm_generator/output_parser/structured_output.py @@ -288,11 +288,13 @@ def _parse_structured_output(result_text: str) -> Mapping[str, Any]: except ValidationError: # if the result_text is not a valid json, try to repair it temp_parsed = json_repair.loads(result_text) - if not isinstance(temp_parsed, dict): - # handle reasoning model like deepseek-r1 got '\n\n\n' prefix - if isinstance(temp_parsed, list): + match temp_parsed: + case dict(): + pass + case list(): + # handle reasoning model like deepseek-r1 got '\n\n\n' prefix temp_parsed = next((item for item in temp_parsed if isinstance(item, dict)), {}) - else: + case _: raise OutputParserError(f"Failed to parse structured output: {result_text}") structured_output = cast(dict, temp_parsed) return structured_output @@ -341,12 +343,13 @@ def remove_additional_properties(schema: dict[str, Any]) -> None: # Process nested structures recursively for value in schema.values(): - if isinstance(value, dict): - remove_additional_properties(value) - elif isinstance(value, list): - for item in value: - if isinstance(item, dict): - remove_additional_properties(item) + match value: + case dict(): + remove_additional_properties(value) + case list(): + for item in value: + if isinstance(item, dict): + remove_additional_properties(item) def convert_boolean_to_string(schema: dict[str, Any]) -> None: @@ -364,9 +367,10 @@ def convert_boolean_to_string(schema: dict[str, Any]) -> None: # Process nested dictionaries and lists recursively for value in schema.values(): - if isinstance(value, dict): - convert_boolean_to_string(value) - elif isinstance(value, list): - for item in value: - if isinstance(item, dict): - convert_boolean_to_string(item) + match value: + case dict(): + convert_boolean_to_string(value) + case list(): + for item in value: + if isinstance(item, dict): + convert_boolean_to_string(item) diff --git a/api/core/workflow/node_runtime.py b/api/core/workflow/node_runtime.py index 7d6ac74791..7ea03a4a33 100644 --- a/api/core/workflow/node_runtime.py +++ b/api/core/workflow/node_runtime.py @@ -608,64 +608,67 @@ class DifyToolNodeRuntime(ToolNodeRuntimeProtocol): from core.tools.entities.tool_entities import ToolInvokeMessage as CoreToolInvokeMessage - if isinstance(message, CoreToolInvokeMessage.TextMessage): - return ToolRuntimeMessage.TextMessage(text=message.text) - if isinstance(message, CoreToolInvokeMessage.JsonMessage): - return ToolRuntimeMessage.JsonMessage( - json_object=message.json_object, - suppress_output=message.suppress_output, - ) - if isinstance(message, CoreToolInvokeMessage.BlobMessage): - return ToolRuntimeMessage.BlobMessage(blob=message.blob) - if isinstance(message, CoreToolInvokeMessage.BlobChunkMessage): - return ToolRuntimeMessage.BlobChunkMessage( - id=message.id, - sequence=message.sequence, - total_length=message.total_length, - blob=message.blob, - end=message.end, - ) - if isinstance(message, CoreToolInvokeMessage.FileMessage): - return ToolRuntimeMessage.FileMessage(file_marker=message.file_marker) - if isinstance(message, CoreToolInvokeMessage.VariableMessage): - return ToolRuntimeMessage.VariableMessage( - variable_name=message.variable_name, - variable_value=message.variable_value, - stream=message.stream, - ) - if isinstance(message, CoreToolInvokeMessage.LogMessage): - return ToolRuntimeMessage.LogMessage( - id=message.id, - label=message.label, - parent_id=message.parent_id, - error=message.error, - status=ToolRuntimeMessage.LogMessage.LogStatus(message.status.value), - data=dict(message.data), - metadata=dict(message.metadata), - ) - if isinstance(message, CoreToolInvokeMessage.RetrieverResourceMessage): - retriever_resources = [ - resource.model_dump() if hasattr(resource, "model_dump") else dict(resource) - for resource in message.retriever_resources - ] - return ToolRuntimeMessage.RetrieverResourceMessage( - retriever_resources=retriever_resources, - context=message.context, - ) - - raise TypeError(f"unsupported tool message payload: {type(message).__name__}") + match message: + case CoreToolInvokeMessage.TextMessage(): + return ToolRuntimeMessage.TextMessage(text=message.text) + case CoreToolInvokeMessage.JsonMessage(): + return ToolRuntimeMessage.JsonMessage( + json_object=message.json_object, + suppress_output=message.suppress_output, + ) + case CoreToolInvokeMessage.BlobMessage(): + return ToolRuntimeMessage.BlobMessage(blob=message.blob) + case CoreToolInvokeMessage.BlobChunkMessage(): + return ToolRuntimeMessage.BlobChunkMessage( + id=message.id, + sequence=message.sequence, + total_length=message.total_length, + blob=message.blob, + end=message.end, + ) + case CoreToolInvokeMessage.FileMessage(): + return ToolRuntimeMessage.FileMessage(file_marker=message.file_marker) + case CoreToolInvokeMessage.VariableMessage(): + return ToolRuntimeMessage.VariableMessage( + variable_name=message.variable_name, + variable_value=message.variable_value, + stream=message.stream, + ) + case CoreToolInvokeMessage.LogMessage(): + return ToolRuntimeMessage.LogMessage( + id=message.id, + label=message.label, + parent_id=message.parent_id, + error=message.error, + status=ToolRuntimeMessage.LogMessage.LogStatus(message.status.value), + data=dict(message.data), + metadata=dict(message.metadata), + ) + case CoreToolInvokeMessage.RetrieverResourceMessage(): + retriever_resources = [ + resource.model_dump() if hasattr(resource, "model_dump") else dict(resource) + for resource in message.retriever_resources + ] + return ToolRuntimeMessage.RetrieverResourceMessage( + retriever_resources=retriever_resources, + context=message.context, + ) + case _: + raise TypeError(f"unsupported tool message payload: {type(message).__name__}") @staticmethod def _map_invocation_exception(exc: Exception, *, provider_name: str) -> ToolNodeError: - if isinstance(exc, ToolNodeError): - return exc - if isinstance(exc, PluginInvokeError): - return ToolRuntimeInvocationError(exc.to_user_friendly_error(plugin_name=provider_name)) - if isinstance(exc, PluginDaemonClientSideError): - return ToolRuntimeInvocationError(f"Failed to invoke tool, error: {exc.description}") - if isinstance(exc, ToolInvokeError): - return ToolRuntimeInvocationError(f"Failed to invoke tool {provider_name}: {exc}") - return ToolRuntimeInvocationError(str(exc)) + match exc: + case ToolNodeError(): + return exc + case PluginInvokeError(): + return ToolRuntimeInvocationError(exc.to_user_friendly_error(plugin_name=provider_name)) + case PluginDaemonClientSideError(): + return ToolRuntimeInvocationError(f"Failed to invoke tool, error: {exc.description}") + case ToolInvokeError(): + return ToolRuntimeInvocationError(f"Failed to invoke tool {provider_name}: {exc}") + case _: + return ToolRuntimeInvocationError(str(exc)) class DifyHumanInputNodeRuntime(HumanInputNodeRuntimeProtocol): diff --git a/api/fields/online_user_fields.py b/api/fields/online_user_fields.py deleted file mode 100644 index bdbe19679c..0000000000 --- a/api/fields/online_user_fields.py +++ /dev/null @@ -1,16 +0,0 @@ -from flask_restx import fields - -online_user_partial_fields = { - "user_id": fields.String, - "username": fields.String, - "avatar": fields.String, -} - -workflow_online_users_fields = { - "app_id": fields.String, - "users": fields.List(fields.Nested(online_user_partial_fields)), -} - -online_user_list_fields = { - "data": fields.List(fields.Nested(workflow_online_users_fields)), -} diff --git a/api/libs/helper.py b/api/libs/helper.py index 7b9128ab7a..04900f385c 100644 --- a/api/libs/helper.py +++ b/api/libs/helper.py @@ -98,12 +98,13 @@ def extract_tenant_id(user: "Account | EndUser") -> str | None: from models import Account from models.model import EndUser - if isinstance(user, Account): - return user.current_tenant_id - elif isinstance(user, EndUser): - return user.tenant_id - else: - raise ValueError(f"Invalid user type: {type(user)}. Expected Account or EndUser.") + match user: + case Account(): + return user.current_tenant_id + case EndUser(): + return user.tenant_id + case _: + raise ValueError(f"Invalid user type: {type(user)}. Expected Account or EndUser.") def run(script): @@ -422,18 +423,19 @@ def length_prefixed_response( # | Magic Number 1byte | Reserved 1byte | Header Length 2bytes | Data Length 4bytes | Reserved 6bytes | Data return struct.pack(" FileType: - if isinstance(value, FileType): - return value - if isinstance(value, str): - return FileType.value_of(value) - raise ValueError("file type is required in file mapping") + match value: + case FileType(): + return value + case str(): + return FileType.value_of(value) + case _: + raise ValueError("file type is required in file mapping") mapping = dict(file_mapping) transfer_method_value = mapping.get("transfer_method") - if isinstance(transfer_method_value, FileTransferMethod): - transfer_method = transfer_method_value - elif isinstance(transfer_method_value, str): - transfer_method = FileTransferMethod.value_of(transfer_method_value) - else: - raise ValueError("transfer_method is required in file mapping") + match transfer_method_value: + case FileTransferMethod(): + transfer_method = transfer_method_value + case str(): + transfer_method = FileTransferMethod.value_of(transfer_method_value) + case _: + raise ValueError("transfer_method is required in file mapping") file_id = mapping.get("file_id") if not isinstance(file_id, str) or not file_id: @@ -151,15 +154,15 @@ def rebuild_serialized_graph_files_without_lookup(value: Any) -> Any: so historical JSON blobs remain readable without reintroducing global graph patches or test-local coercion. """ - if isinstance(value, list): - return [rebuild_serialized_graph_files_without_lookup(item) for item in value] - - if isinstance(value, dict): - if maybe_file_object(value): - return build_file_from_mapping_without_lookup(file_mapping=value) - return {key: rebuild_serialized_graph_files_without_lookup(item) for key, item in value.items()} - - return value + match value: + case list(): + return [rebuild_serialized_graph_files_without_lookup(item) for item in value] + case dict(): + if maybe_file_object(value): + return build_file_from_mapping_without_lookup(file_mapping=value) + return {key: rebuild_serialized_graph_files_without_lookup(item) for key, item in value.items()} + case _: + return value def build_file_from_stored_mapping( diff --git a/api/openapi/markdown/console-swagger.md b/api/openapi/markdown/console-swagger.md index 098acd8376..dc055c5823 100644 --- a/api/openapi/markdown/console-swagger.md +++ b/api/openapi/markdown/console-swagger.md @@ -607,9 +607,9 @@ Get workflow online users ##### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow online users retrieved successfully | [WorkflowOnlineUsersResponse](#workflowonlineusersresponse) | ### /apps/{app_id} @@ -2720,7 +2720,7 @@ Get all published workflows for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Published workflows retrieved successfully | [WorkflowPagination](#workflowpagination) | +| 200 | Published workflows retrieved successfully | [WorkflowPaginationResponse](#workflowpaginationresponse) | ### /apps/{app_id}/workflows/default-workflow-block-configs @@ -2792,7 +2792,7 @@ Get draft workflow for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Draft workflow retrieved successfully | [Workflow](#workflow) | +| 200 | Draft workflow retrieved successfully | [WorkflowResponse](#workflowresponse) | | 404 | Draft workflow not found | | #### POST @@ -3403,8 +3403,7 @@ Get published workflow for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Published workflow retrieved successfully | [Workflow](#workflow) | -| 404 | Published workflow not found | | +| 200 | Published workflow retrieved successfully, or null if not found | [WorkflowResponse](#workflowresponse) | #### POST ##### Summary @@ -3485,7 +3484,7 @@ Update workflow by ID | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Workflow updated successfully | [Workflow](#workflow) | +| 200 | Workflow updated successfully | [WorkflowResponse](#workflowresponse) | | 403 | Permission denied | | | 404 | Workflow not found | | @@ -6685,9 +6684,10 @@ Get published workflows ##### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Published workflows retrieved successfully | [WorkflowPaginationResponse](#workflowpaginationresponse) | +| 403 | Permission denied | | ### /rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs @@ -6743,9 +6743,10 @@ Get draft rag pipeline's workflow ##### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Draft workflow retrieved successfully | [WorkflowResponse](#workflowresponse) | +| 404 | Draft workflow not found | | #### POST ##### Summary @@ -7105,9 +7106,9 @@ Get published pipeline ##### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Published workflow retrieved successfully, or null if not exist | [WorkflowResponse](#workflowresponse) | #### POST ##### Summary @@ -7260,9 +7261,12 @@ Update workflow attributes ##### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow updated successfully | [WorkflowResponse](#workflowresponse) | +| 400 | No valid fields to update | | +| 403 | Permission denied | | +| 404 | Workflow not found | | ### /rag/pipelines/{pipeline_id}/workflows/{workflow_id}/restore @@ -10955,16 +10959,6 @@ Condition detail | auto_generate | boolean | | No | | name | string | | No | -#### ConversationVariable - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| description | string | | No | -| id | string | | No | -| name | string | | No | -| value | object | | No | -| value_type | string | | No | - #### ConversationVariableResponse | Name | Type | Description | Required | @@ -12993,24 +12987,24 @@ Form input definition. | icon_info | object | | No | | name | string | | Yes | -#### PipelineVariable +#### PipelineVariableResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| allow_file_extension | [ string ] | | No | -| allow_file_upload_methods | [ string ] | | No | +| allowed_file_extensions | [ string ] | | No | | allowed_file_types | [ string ] | | No | -| belong_to_node_id | string | | No | +| allowed_file_upload_methods | [ string ] | | No | +| belong_to_node_id | string | | Yes | | default_value | object | | No | -| label | string | | No | +| label | string | | Yes | | max_length | integer | | No | | options | [ string ] | | No | | placeholder | string | | No | -| required | boolean | | No | +| required | boolean | | Yes | | tooltips | string | | No | -| type | string | | No | +| type | string | | Yes | | unit | string | | No | -| variable | string | | No | +| variable | string | | Yes | #### PluginAutoUpgradeSettingsPayload @@ -13906,26 +13900,6 @@ in form definiton, or a variable while the workflow is running. | embedding_provider_name | string | | Yes | | vector_weight | number | | Yes | -#### Workflow - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| conversation_variables | [ [ConversationVariable](#conversationvariable) ] | | No | -| created_at | object | | No | -| created_by | [SimpleAccount](#simpleaccount) | | No | -| environment_variables | [ object ] | | No | -| features | object | | No | -| graph | object | | No | -| hash | string | | No | -| id | string | | No | -| marked_comment | string | | No | -| marked_name | string | | No | -| rag_pipeline_variables | [ [PipelineVariable](#pipelinevariable) ] | | No | -| tool_published | boolean | | No | -| updated_at | object | | No | -| updated_by | [SimpleAccount](#simpleaccount) | | No | -| version | string | | No | - #### WorkflowAppLogPaginationResponse | Name | Type | Description | Required | @@ -14124,6 +14098,16 @@ in form definiton, or a variable while the workflow is running. | position_x | number | Comment X position | No | | position_y | number | Comment Y position | No | +#### WorkflowConversationVariableResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | string | | Yes | +| id | string | | Yes | +| name | string | | Yes | +| value | object | | Yes | +| value_type | string | | Yes | + #### WorkflowDraftEnvVariable | Name | Type | Description | Required | @@ -14207,6 +14191,16 @@ in form definiton, or a variable while the workflow is running. | value_type | string | | No | | visible | boolean | | No | +#### WorkflowEnvironmentVariableResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | string | | Yes | +| id | string | | Yes | +| name | string | | Yes | +| value | object | | Yes | +| value_type | string | | Yes | + #### WorkflowExecutionStatus | Name | Type | Description | Required | @@ -14228,20 +14222,41 @@ in form definiton, or a variable while the workflow is running. | page | integer | | No | | user_id | string | | No | +#### WorkflowOnlineUser + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| avatar | string | | No | +| user_id | string | | Yes | +| username | string | | Yes | + +#### WorkflowOnlineUsersByApp + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_id | string | | Yes | +| users | [ [WorkflowOnlineUser](#workflowonlineuser) ] | | Yes | + #### WorkflowOnlineUsersPayload | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | app_ids | [ string ] | App IDs | No | -#### WorkflowPagination +#### WorkflowOnlineUsersResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| has_more | boolean | | No | -| items | [ [Workflow](#workflow) ] | | No | -| limit | integer | | No | -| page | integer | | No | +| data | [ [WorkflowOnlineUsersByApp](#workflowonlineusersbyapp) ] | | Yes | + +#### WorkflowPaginationResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| has_more | boolean | | Yes | +| items | [ [WorkflowResponse](#workflowresponse) ] | | Yes | +| limit | integer | | Yes | +| page | integer | | Yes | #### WorkflowPartial @@ -14260,6 +14275,26 @@ in form definiton, or a variable while the workflow is running. | paused_at | string | | No | | paused_nodes | [ [PausedNodeResponse](#pausednoderesponse) ] | | Yes | +#### WorkflowResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| conversation_variables | [ [WorkflowConversationVariableResponse](#workflowconversationvariableresponse) ] | | Yes | +| created_at | integer | | Yes | +| created_by | [SimpleAccount](#simpleaccount) | | No | +| environment_variables | [ [WorkflowEnvironmentVariableResponse](#workflowenvironmentvariableresponse) ] | | Yes | +| features | object | | Yes | +| graph | object | | Yes | +| hash | string | | Yes | +| id | string | | Yes | +| marked_comment | string | | Yes | +| marked_name | string | | Yes | +| rag_pipeline_variables | [ [PipelineVariableResponse](#pipelinevariableresponse) ] | | Yes | +| tool_published | boolean | | Yes | +| updated_at | integer | | Yes | +| updated_by | [SimpleAccount](#simpleaccount) | | No | +| version | string | | Yes | + #### WorkflowRunCountQuery | Name | Type | Description | Required | diff --git a/api/providers/trace/trace-arize-phoenix/src/dify_trace_arize_phoenix/arize_phoenix_trace.py b/api/providers/trace/trace-arize-phoenix/src/dify_trace_arize_phoenix/arize_phoenix_trace.py index a0d150e1b6..9b35612b52 100644 --- a/api/providers/trace/trace-arize-phoenix/src/dify_trace_arize_phoenix/arize_phoenix_trace.py +++ b/api/providers/trace/trace-arize-phoenix/src/dify_trace_arize_phoenix/arize_phoenix_trace.py @@ -15,6 +15,7 @@ from openinference.semconv.trace import ( SpanAttributes, ToolCallAttributes, ) +from opentelemetry.context import Context from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter as GrpcOTLPSpanExporter from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter as HttpOTLPSpanExporter from opentelemetry.sdk import trace as trace_sdk @@ -45,8 +46,8 @@ from dify_trace_arize_phoenix.config import ArizeConfig, PhoenixConfig from extensions.ext_database import db from extensions.ext_redis import redis_client from graphon.enums import WorkflowNodeExecutionStatus -from models.model import EndUser, MessageFile -from models.workflow import WorkflowNodeExecutionTriggeredFrom +from models.model import App, EndUser, MessageFile +from models.workflow import WorkflowNodeExecutionTriggeredFrom, WorkflowRun logger = logging.getLogger(__name__) @@ -139,6 +140,48 @@ def _resolve_published_parent_span_context(parent_node_execution_id: str) -> dic return normalized_carrier +def _app_uses_phoenix_provider(app_tracing_config: Mapping[str, Any] | None) -> bool: + if not app_tracing_config or not app_tracing_config.get("enabled"): + return False + return app_tracing_config.get("tracing_provider") in {"arize", "phoenix"} + + +def _parent_workflow_can_publish_span_context(parent_workflow_run_id: str) -> bool: + parent_run = db.session.query(WorkflowRun).where(WorkflowRun.id == parent_workflow_run_id).first() + if parent_run is None: + return True + + parent_app = db.session.query(App).where(App.id == parent_run.app_id).first() + if parent_app is None or not parent_app.tracing: + return False + + try: + app_tracing_config = json.loads(parent_app.tracing) + except (TypeError, json.JSONDecodeError): + return False + if not isinstance(app_tracing_config, Mapping): + return False + + return _app_uses_phoenix_provider(app_tracing_config) + + +def _resolve_workflow_parent_carrier( + parent_node_execution_id: str, parent_workflow_run_id: str | None +) -> dict[str, str] | None: + try: + return _resolve_published_parent_span_context(parent_node_execution_id) + except PendingTraceParentContextError: + if parent_workflow_run_id and not _parent_workflow_can_publish_span_context(parent_workflow_run_id): + logger.info( + "[Arize/Phoenix] Parent workflow cannot publish Phoenix span context; falling back to root span: " + "parent_workflow_run_id=%s parent_node_execution_id=%s", + parent_workflow_run_id, + parent_node_execution_id, + ) + return None + raise + + def setup_tracer(arize_phoenix_config: ArizeConfig | PhoenixConfig) -> tuple[trace_sdk.Tracer, SimpleSpanProcessor]: """Configure OpenTelemetry tracer with OTLP exporter for Arize/Phoenix.""" try: @@ -581,9 +624,11 @@ class ArizePhoenixDataTrace(BaseTraceInstance): workflow_session_id, ) + workflow_parent_carrier: dict[str, str] | None = None if parent_node_execution_id: - workflow_parent_carrier = _resolve_published_parent_span_context(parent_node_execution_id) - else: + workflow_parent_carrier = _resolve_workflow_parent_carrier(parent_node_execution_id, parent_workflow_run_id) + + if workflow_parent_carrier is None: root_trace_id = _resolve_workflow_root_trace_id(trace_info) workflow_root_span_name: str | None = trace_info.workflow_run_id if not isinstance(workflow_root_span_name, str) or not workflow_root_span_name.strip(): @@ -1176,7 +1221,7 @@ class ArizePhoenixDataTrace(BaseTraceInstance): if root_span_attributes: root_span_attributes_dict.update(root_span_attributes) - root_span = self.tracer.start_span(name=span_name, attributes=root_span_attributes_dict) + root_span = self.tracer.start_span(name=span_name, attributes=root_span_attributes_dict, context=Context()) with use_span(root_span, end_on_exit=False): self.propagator.inject(carrier=carrier) diff --git a/api/providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py b/api/providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py index dd260aeee5..9b244e3008 100644 --- a/api/providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py +++ b/api/providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py @@ -1,3 +1,5 @@ +import json +from collections.abc import Sequence from datetime import UTC, datetime, timedelta from types import SimpleNamespace from typing import Any, cast @@ -8,8 +10,10 @@ import pytest from dify_trace_arize_phoenix.arize_phoenix_trace import ( _NODE_TYPE_TO_SPAN_KIND, ArizePhoenixDataTrace, + _app_uses_phoenix_provider, _build_graph_parent_index, _get_node_span_kind, + _parent_workflow_can_publish_span_context, _phoenix_parent_span_redis_key, _resolve_node_parent, _resolve_published_parent_span_context, @@ -25,9 +29,13 @@ from dify_trace_arize_phoenix.arize_phoenix_trace import ( ) from dify_trace_arize_phoenix.config import ArizeConfig, PhoenixConfig from openinference.semconv.trace import OpenInferenceSpanKindValues, SpanAttributes -from opentelemetry.sdk.trace import Tracer +from opentelemetry.context import Context +from opentelemetry.sdk import trace as trace_sdk +from opentelemetry.sdk.trace import ReadableSpan, Tracer +from opentelemetry.sdk.trace.export import SimpleSpanProcessor, SpanExporter, SpanExportResult from opentelemetry.semconv.trace import SpanAttributes as OTELSpanAttributes -from opentelemetry.trace import StatusCode +from opentelemetry.trace import NonRecordingSpan, SpanContext, StatusCode, TraceFlags, TraceState, use_span +from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator from core.ops.entities.trace_entity import ( DatasetRetrievalTraceInfo, @@ -96,6 +104,32 @@ def _get_start_span_call(start_span_mock, *, span_name: str): raise AssertionError(f"Could not find start_span call with name={span_name!r}") +class _FakeQuery: + def __init__(self, result): + self._result = result + + def filter(self, *args, **kwargs): + return self + + def where(self, *args, **kwargs): + return self + + def first(self): + return self._result + + +class _CollectingSpanExporter(SpanExporter): + def __init__(self): + self.spans: list[ReadableSpan] = [] + + def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: + self.spans.extend(spans) + return SpanExportResult.SUCCESS + + def shutdown(self) -> None: + return None + + def _make_node_execution(**kwargs): defaults = { "node_type": "tool", @@ -233,6 +267,45 @@ def test_wrap_span_metadata(): assert res == {"a": 1, "b": 2, "created_from": "Dify"} +def test_app_uses_phoenix_provider_only_for_enabled_arize_or_phoenix(): + assert _app_uses_phoenix_provider({"enabled": True, "tracing_provider": "phoenix"}) is True + assert _app_uses_phoenix_provider({"enabled": True, "tracing_provider": "arize"}) is True + assert _app_uses_phoenix_provider({"enabled": False, "tracing_provider": "phoenix"}) is False + assert _app_uses_phoenix_provider({"enabled": True, "tracing_provider": "langfuse"}) is False + assert _app_uses_phoenix_provider(None) is False + + +def test_parent_workflow_can_publish_span_context_keeps_unknown_parent_retryable(monkeypatch): + monkeypatch.setattr( + "dify_trace_arize_phoenix.arize_phoenix_trace.db.session.query", + lambda model: _FakeQuery(None), + ) + + assert _parent_workflow_can_publish_span_context("missing-run") is True + + +def test_parent_workflow_can_publish_span_context_checks_parent_app_tracing(monkeypatch): + parent_run = SimpleNamespace(app_id="parent-app") + parent_app = SimpleNamespace(tracing=json.dumps({"enabled": True, "tracing_provider": "phoenix"})) + + def fake_query(model): + if getattr(model, "__tablename__", None) == "workflow_runs": + return _FakeQuery(parent_run) + if getattr(model, "__tablename__", None) == "apps": + return _FakeQuery(parent_app) + raise AssertionError(f"Unexpected model query: {model}") + + monkeypatch.setattr("dify_trace_arize_phoenix.arize_phoenix_trace.db.session.query", fake_query) + + assert _parent_workflow_can_publish_span_context("parent-run") is True + + parent_app.tracing = json.dumps({"enabled": False, "tracing_provider": "phoenix"}) + assert _parent_workflow_can_publish_span_context("parent-run") is False + + parent_app.tracing = json.dumps({"enabled": True, "tracing_provider": "langfuse"}) + assert _parent_workflow_can_publish_span_context("parent-run") is False + + class TestGetNodeSpanKind: def test_all_node_types_are_mapped_correctly(self): special_mappings = { @@ -839,6 +912,10 @@ def test_workflow_trace_raises_pending_parent_error_when_parent_node_context_is_ with ( patch.object(trace_instance, "get_service_account_with_tenant", return_value=MagicMock()), + patch( + "dify_trace_arize_phoenix.arize_phoenix_trace._parent_workflow_can_publish_span_context", + return_value=True, + ), patch.object(trace_instance, "ensure_root_span") as mock_ensure_root_span, pytest.raises(PendingTraceParentContextError) as exc_info, ): @@ -851,6 +928,102 @@ def test_workflow_trace_raises_pending_parent_error_when_parent_node_context_is_ mock_ensure_root_span.assert_not_called() +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.db") +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.DifyCoreRepositoryFactory") +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.sessionmaker") +def test_workflow_trace_falls_back_when_parent_app_tracing_cannot_publish_parent_context( + mock_sessionmaker, + mock_repo_factory, + mock_db, + trace_instance, +): + mock_db.engine = MagicMock() + info = _make_workflow_info( + message_id="message-1", + workflow_run_id="workflow-run-1", + metadata={ + "app_id": "app1", + "parent_trace_context": { + "parent_workflow_run_id": "outer-workflow-run-1", + "parent_node_execution_id": "outer-node-execution-1", + }, + }, + ) + repo = MagicMock() + repo.get_by_workflow_execution.return_value = [] + mock_repo_factory.create_workflow_node_execution_repository.return_value = repo + trace_instance._mock_redis_client.get.return_value = None + + parent_carrier = {} + parent_context = object() + + with ( + patch.object(trace_instance, "get_service_account_with_tenant", return_value=MagicMock()), + patch( + "dify_trace_arize_phoenix.arize_phoenix_trace._parent_workflow_can_publish_span_context", + return_value=False, + ), + patch.object(trace_instance, "ensure_root_span", return_value=parent_carrier) as mock_ensure_root_span, + patch.object(trace_instance.propagator, "extract", return_value=parent_context) as mock_extract, + ): + trace_instance.workflow_trace(info) + + mock_ensure_root_span.assert_called_once_with( + "outer-workflow-run-1", + root_span_name="workflow-run-1", + root_span_attributes={ + SpanAttributes.INPUT_VALUE: safe_json_dumps(info.workflow_run_inputs), + SpanAttributes.INPUT_MIME_TYPE: "application/json", + SpanAttributes.OUTPUT_VALUE: safe_json_dumps(info.workflow_run_outputs), + SpanAttributes.OUTPUT_MIME_TYPE: "application/json", + }, + ) + mock_extract.assert_called_once_with(carrier=parent_carrier) + workflow_span_call = _get_start_span_call(trace_instance.tracer.start_span, span_name="workflow_workflow-run-1") + assert workflow_span_call.kwargs["context"] is parent_context + + +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.db") +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.DifyCoreRepositoryFactory") +@patch("dify_trace_arize_phoenix.arize_phoenix_trace.sessionmaker") +def test_workflow_trace_still_retries_when_parent_app_can_publish_parent_context( + mock_sessionmaker, + mock_repo_factory, + mock_db, + trace_instance, +): + mock_db.engine = MagicMock() + info = _make_workflow_info( + message_id="message-1", + workflow_run_id="workflow-run-1", + metadata={ + "app_id": "app1", + "parent_trace_context": { + "parent_workflow_run_id": "outer-workflow-run-1", + "parent_node_execution_id": "outer-node-execution-1", + }, + }, + ) + repo = MagicMock() + repo.get_by_workflow_execution.return_value = [] + mock_repo_factory.create_workflow_node_execution_repository.return_value = repo + trace_instance._mock_redis_client.get.return_value = None + + with ( + patch.object(trace_instance, "get_service_account_with_tenant", return_value=MagicMock()), + patch( + "dify_trace_arize_phoenix.arize_phoenix_trace._parent_workflow_can_publish_span_context", + return_value=True, + ), + patch.object(trace_instance, "ensure_root_span") as mock_ensure_root_span, + pytest.raises(PendingTraceParentContextError) as exc_info, + ): + trace_instance.workflow_trace(info) + + assert exc_info.value.parent_node_execution_id == "outer-node-execution-1" + mock_ensure_root_span.assert_not_called() + + @patch("dify_trace_arize_phoenix.arize_phoenix_trace.db") @patch("dify_trace_arize_phoenix.arize_phoenix_trace.DifyCoreRepositoryFactory") @patch("dify_trace_arize_phoenix.arize_phoenix_trace.sessionmaker") @@ -1544,6 +1717,38 @@ def test_ensure_root_span_basic(trace_instance): assert "tid" in trace_instance.dify_trace_ids +def test_ensure_root_span_ignores_unsampled_ambient_otel_parent(): + exporter = _CollectingSpanExporter() + provider = trace_sdk.TracerProvider() + provider.add_span_processor(SimpleSpanProcessor(exporter)) + trace_instance = ArizePhoenixDataTrace.__new__(ArizePhoenixDataTrace) + trace_instance.tracer = cast(Tracer, provider.get_tracer("test-phoenix-root-span")) + trace_instance.propagator = TraceContextTextMapPropagator() + trace_instance.project = "p" + trace_instance.dify_trace_ids = set() + trace_instance.root_span_carriers = {} + trace_instance.carrier = {} + + ambient_span_context = SpanContext( + trace_id=0x11111111111111111111111111111111, + span_id=0x2222222222222222, + is_remote=True, + trace_flags=TraceFlags(0), + trace_state=TraceState(), + ) + + with use_span(NonRecordingSpan(ambient_span_context), end_on_exit=False): + carrier = trace_instance.ensure_root_span("tid") + + assert len(exporter.spans) == 1 + root_span = exporter.spans[0] + root_span_context = root_span.get_span_context() + assert root_span_context is not None + assert root_span.parent is None + assert root_span_context.trace_id != ambient_span_context.trace_id + assert carrier["traceparent"].split("-")[1] == f"{root_span_context.trace_id:032x}" + + def test_ensure_root_span_uses_custom_name_and_attributes(trace_instance): root_attributes = { SpanAttributes.INPUT_VALUE: '{"input":"value"}', @@ -1561,6 +1766,7 @@ def test_ensure_root_span_uses_custom_name_and_attributes(trace_instance): SpanAttributes.INPUT_VALUE: '{"input":"value"}', SpanAttributes.OUTPUT_VALUE: '{"output":"value"}', }, + context=Context(), ) diff --git a/api/services/attachment_service.py b/api/services/attachment_service.py index 54e664e944..dad7163739 100644 --- a/api/services/attachment_service.py +++ b/api/services/attachment_service.py @@ -22,10 +22,11 @@ class AttachmentService: raise AssertionError("must be a sessionmaker or an Engine.") def get_file_base64(self, file_id: str) -> str: - upload_file = self._session_maker(expire_on_commit=False).scalar( - select(UploadFile).where(UploadFile.id == file_id).limit(1) - ) - if not upload_file: - raise NotFound("File not found") - blob = storage.load_once(upload_file.key) + with self._session_maker(expire_on_commit=False) as session: + upload_file = session.scalar(select(UploadFile).where(UploadFile.id == file_id).limit(1)) + if not upload_file: + raise NotFound("File not found") + upload_file_key = upload_file.key + + blob = storage.load_once(upload_file_key) return base64.b64encode(blob).decode() diff --git a/api/services/file_service.py b/api/services/file_service.py index cd412638e0..4d3afcc9ad 100644 --- a/api/services/file_service.py +++ b/api/services/file_service.py @@ -131,12 +131,13 @@ class FileService: return file_size <= file_size_limit def get_file_base64(self, file_id: str) -> str: - upload_file = self._session_maker(expire_on_commit=False).scalar( - select(UploadFile).where(UploadFile.id == file_id).limit(1) - ) - if not upload_file: - raise NotFound("File not found") - blob = storage.load_once(upload_file.key) + with self._session_maker(expire_on_commit=False) as session: + upload_file = session.scalar(select(UploadFile).where(UploadFile.id == file_id).limit(1)) + if not upload_file: + raise NotFound("File not found") + upload_file_key = upload_file.key + + blob = storage.load_once(upload_file_key) return base64.b64encode(blob).decode() def upload_text(self, text: str, text_name: str, user_id: str, tenant_id: str) -> UploadFile: diff --git a/api/services/plugin/plugin_migration.py b/api/services/plugin/plugin_migration.py index 43a726b100..8fa3c3d4ef 100644 --- a/api/services/plugin/plugin_migration.py +++ b/api/services/plugin/plugin_migration.py @@ -16,6 +16,7 @@ from pydantic import TypeAdapter from sqlalchemy import func, select from sqlalchemy.orm import Session +from configs import dify_config from core.agent.entities import AgentToolEntity from core.helper import marketplace from core.plugin.entities.plugin import PluginInstallationSource @@ -310,6 +311,8 @@ class PluginMigration: """ Fetch plugin unique identifier using plugin id. """ + if not dify_config.MARKETPLACE_ENABLED: + return None plugin_manifest = marketplace.batch_fetch_plugin_manifests([plugin_id]) if not plugin_manifest: return None @@ -542,6 +545,11 @@ class PluginMigration: """ Install plugins for a tenant. """ + if plugin_identifiers_map and not dify_config.MARKETPLACE_ENABLED: + raise ValueError( + "Marketplace disabled in offline mode; cannot bulk-install plugins. " + "Pre-upload plugin packages via Console first." + ) manager = PluginInstaller() # download all the plugins and upload diff --git a/api/services/plugin/plugin_service.py b/api/services/plugin/plugin_service.py index ca83742d65..72271c55d8 100644 --- a/api/services/plugin/plugin_service.py +++ b/api/services/plugin/plugin_service.py @@ -73,35 +73,43 @@ class PluginService: cache_not_exists.append(plugin_id) if cache_not_exists: - manifests = { - manifest.plugin_id: manifest - for manifest in marketplace.batch_fetch_plugin_manifests(cache_not_exists) - } - - for plugin_id, manifest in manifests.items(): - latest_plugin = PluginService.LatestPluginCache( - plugin_id=plugin_id, - version=manifest.latest_version, - unique_identifier=manifest.latest_package_identifier, - status=manifest.status, - deprecated_reason=manifest.deprecated_reason, - alternative_plugin_id=manifest.alternative_plugin_id, + if not dify_config.MARKETPLACE_ENABLED: + logger.info( + "Marketplace disabled; skipping latest-plugins metadata fetch for %d ids", + len(cache_not_exists), ) + for plugin_id in cache_not_exists: + result[plugin_id] = None + else: + manifests = { + manifest.plugin_id: manifest + for manifest in marketplace.batch_fetch_plugin_manifests(cache_not_exists) + } - # Store in Redis - redis_client.setex( - f"{PluginService.REDIS_KEY_PREFIX}{plugin_id}", - PluginService.REDIS_TTL, - latest_plugin.model_dump_json(), - ) + for plugin_id, manifest in manifests.items(): + latest_plugin = PluginService.LatestPluginCache( + plugin_id=plugin_id, + version=manifest.latest_version, + unique_identifier=manifest.latest_package_identifier, + status=manifest.status, + deprecated_reason=manifest.deprecated_reason, + alternative_plugin_id=manifest.alternative_plugin_id, + ) - result[plugin_id] = latest_plugin + # Store in Redis + redis_client.setex( + f"{PluginService.REDIS_KEY_PREFIX}{plugin_id}", + PluginService.REDIS_TTL, + latest_plugin.model_dump_json(), + ) - # pop plugin_id from cache_not_exists - cache_not_exists.remove(plugin_id) + result[plugin_id] = latest_plugin - for plugin_id in cache_not_exists: - result[plugin_id] = None + # pop plugin_id from cache_not_exists + cache_not_exists.remove(plugin_id) + + for plugin_id in cache_not_exists: + result[plugin_id] = None return result except Exception: diff --git a/api/services/rag_pipeline/rag_pipeline.py b/api/services/rag_pipeline/rag_pipeline.py index 9db6682e10..91d917b0b1 100644 --- a/api/services/rag_pipeline/rag_pipeline.py +++ b/api/services/rag_pipeline/rag_pipeline.py @@ -1350,6 +1350,12 @@ class RagPipelineService: ) return workflow_node_execution_db_model + def _fetch_recommended_plugin_manifests(self, plugin_ids: list[str]) -> list[Any]: + if not dify_config.MARKETPLACE_ENABLED: + logger.info("Marketplace disabled; recommended-plugins list empty") + return [] + return marketplace.batch_fetch_plugin_by_ids(plugin_ids) + def get_recommended_plugins(self, type: str) -> dict[str, Any]: # Query active recommended plugins stmt = select(PipelineRecommendedPlugin).where(PipelineRecommendedPlugin.active == True) @@ -1372,7 +1378,7 @@ class RagPipelineService: ) providers_map = {provider.plugin_id: provider.to_dict() for provider in providers} - plugin_manifests = marketplace.batch_fetch_plugin_by_ids(plugin_ids) + plugin_manifests = self._fetch_recommended_plugin_manifests(plugin_ids) plugin_manifests_map = {manifest["plugin_id"]: manifest for manifest in plugin_manifests} installed_plugin_list = [] diff --git a/api/services/rag_pipeline/rag_pipeline_transform_service.py b/api/services/rag_pipeline/rag_pipeline_transform_service.py index f08ec7474b..f95519fc9e 100644 --- a/api/services/rag_pipeline/rag_pipeline_transform_service.py +++ b/api/services/rag_pipeline/rag_pipeline_transform_service.py @@ -9,6 +9,7 @@ import yaml from flask_login import current_user from sqlalchemy import select +from configs import dify_config from constants import DOCUMENT_EXTENSIONS from core.plugin.impl.plugin import PluginInstaller from core.rag.index_processor.constant.index_type import IndexStructureType, IndexTechniqueType @@ -273,6 +274,13 @@ class RagPipelineTransformService: plugin_unique_identifier = dependency.get("value", {}).get("plugin_unique_identifier") plugin_id = plugin_unique_identifier.split(":")[0] if plugin_id not in installed_plugins_ids: + if not dify_config.MARKETPLACE_ENABLED: + logger.warning( + "Marketplace disabled; skipping auto-install of %s. " + "Pre-install via Console if pipeline requires it.", + plugin_id, + ) + continue plugin_unique_identifier = plugin_migration._fetch_plugin_unique_identifier(plugin_id) # type: ignore if plugin_unique_identifier: need_install_plugin_unique_identifiers.append(plugin_unique_identifier) diff --git a/api/tests/test_containers_integration_tests/conftest.py b/api/tests/test_containers_integration_tests/conftest.py index 901da9cbe2..ee953fcbfe 100644 --- a/api/tests/test_containers_integration_tests/conftest.py +++ b/api/tests/test_containers_integration_tests/conftest.py @@ -496,6 +496,51 @@ def db_session_with_containers(flask_app_with_containers: Flask) -> Generator[Se logger.debug("Database session closed") +def _truncate_container_database(app: Flask) -> None: + """ + Reset application tables after a container integration test. + + Tests in this package share one PostgreSQL container for performance, while + application code may commit through db.session, Session(db.engine), or + session_factory-created sessions. Truncating after each test gives the suite + a central DB isolation contract that does not depend on which session a test used. + This only covers SQLAlchemy application tables in db.metadata for now; + Redis, object storage, and custom ad hoc metadata still need their own cleanup. + """ + with app.app_context(): + db.session.remove() + + tables = db.metadata.sorted_tables + if not tables: + return + + preparer = db.engine.dialect.identifier_preparer + table_names = ", ".join(preparer.format_table(table) for table in tables) + + with db.engine.begin() as conn: + conn.execute(text("SET LOCAL lock_timeout = '5s'")) + conn.execute(text(f"TRUNCATE TABLE {table_names} RESTART IDENTITY CASCADE")) + + db.session.remove() + + +@pytest.fixture(autouse=True) +def isolate_container_database(request: pytest.FixtureRequest) -> Generator[None, None, None]: + """ + Clean DB state after tests that use the containerized Flask app. + + This fixture intentionally does not depend on flask_app_with_containers so + non-DB tests under this package do not start the full app/container stack. + """ + yield + + if "flask_app_with_containers" not in request.fixturenames: + return + + app = request.getfixturevalue("flask_app_with_containers") + _truncate_container_database(app) + + @pytest.fixture(scope="package", autouse=True) def mock_ssrf_proxy_requests(): """ diff --git a/api/tests/test_containers_integration_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py b/api/tests/test_containers_integration_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py index ba59780d59..77b3c72e5e 100644 --- a/api/tests/test_containers_integration_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py +++ b/api/tests/test_containers_integration_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py @@ -2,8 +2,10 @@ from __future__ import annotations +import json from datetime import datetime from types import SimpleNamespace +from typing import TypedDict, Unpack from unittest.mock import MagicMock, patch from uuid import uuid4 @@ -35,9 +37,54 @@ from controllers.console.datasets.rag_pipeline.rag_pipeline_workflow import ( ) from controllers.web.error import InvokeRateLimitError as InvokeRateLimitHttpError from libs.datetime_utils import naive_utc_now +from models.account import Account +from models.workflow import Workflow from services.errors.app import IsDraftWorkflowError, WorkflowHashNotEqualError, WorkflowNotFoundError from services.errors.llm import InvokeRateLimitError +DEFAULT_WORKFLOW_TENANT_ID = "00000000-0000-0000-0000-000000000001" +DEFAULT_WORKFLOW_APP_ID = "00000000-0000-0000-0000-000000000002" +DEFAULT_WORKFLOW_CREATED_BY = "00000000-0000-0000-0000-000000000003" +type WorkflowVariablePayload = dict[str, object] + + +class WorkflowFactoryPayload(TypedDict): + id: str + tenant_id: str + app_id: str + type: str + version: str + marked_name: str + marked_comment: str + graph: str + features: str + created_by: str + created_at: datetime + updated_by: str | None + updated_at: datetime + environment_variables: list[WorkflowVariablePayload] + conversation_variables: list[WorkflowVariablePayload] + rag_pipeline_variables: list[WorkflowVariablePayload] + + +class WorkflowFactoryOverrides(TypedDict, total=False): + id: str + tenant_id: str + app_id: str + type: str + version: str + marked_name: str + marked_comment: str + graph: str + features: str + created_by: str + created_at: datetime + updated_by: str | None + updated_at: datetime + environment_variables: list[WorkflowVariablePayload] + conversation_variables: list[WorkflowVariablePayload] + rag_pipeline_variables: list[WorkflowVariablePayload] + def unwrap(func): while hasattr(func, "__wrapped__"): @@ -74,17 +121,52 @@ def make_node_execution(**overrides): return SimpleNamespace(**payload) +def default_workflow_payload() -> WorkflowFactoryPayload: + return { + "id": "workflow-1", + "tenant_id": DEFAULT_WORKFLOW_TENANT_ID, + "app_id": DEFAULT_WORKFLOW_APP_ID, + "type": "workflow", + "version": "1", + "marked_name": "Release 1", + "marked_comment": "Initial release", + "graph": json.dumps({"nodes": [], "edges": []}), + "features": json.dumps({"file_upload": {"enabled": False}}), + "created_by": DEFAULT_WORKFLOW_CREATED_BY, + "created_at": datetime(2024, 1, 1, 12, 0, 0), + "updated_by": None, + "updated_at": datetime(2024, 1, 1, 12, 1, 0), + "environment_variables": [], + "conversation_variables": [], + "rag_pipeline_variables": [], + } + + +def make_workflow(**overrides: Unpack[WorkflowFactoryOverrides]) -> Workflow: + payload = default_workflow_payload() + payload.update(overrides) + return Workflow(**payload) + + +@pytest.fixture +def workflow_author(db_session_with_containers: Session) -> Account: + account = Account(name="Alice", email=f"alice-{uuid4()}@example.com") + db_session_with_containers.add(account) + db_session_with_containers.commit() + return account + + class TestDraftWorkflowApi: @pytest.fixture def app(self, flask_app_with_containers: Flask): return flask_app_with_containers - def test_get_draft_success(self, app: Flask): + def test_get_draft_success(self, app: Flask, workflow_author: Account): api = DraftRagPipelineApi() method = unwrap(api.get) pipeline = MagicMock() - workflow = MagicMock() + workflow = make_workflow(created_by=workflow_author.id) service = MagicMock() service.get_draft_workflow.return_value = workflow @@ -97,7 +179,17 @@ class TestDraftWorkflowApi: ), ): result = method(api, pipeline) - assert result == workflow + + assert result["id"] == "workflow-1" + assert result["graph"] == {"nodes": [], "edges": []} + assert result["features"] == {"file_upload": {"enabled": False}} + assert result["hash"] == workflow.unique_hash + assert result["created_by"] == { + "id": workflow_author.id, + "name": workflow_author.name, + "email": workflow_author.email, + } + assert result["updated_by"] is None def test_get_draft_not_exist(self, app: Flask): api = DraftRagPipelineApi() @@ -642,7 +734,7 @@ class TestPublishedAllRagPipelineApi: user = MagicMock(id="u1") service = MagicMock() - service.get_all_published_workflow.return_value = ([{"id": "w1"}], False) + service.get_all_published_workflow.return_value = ([make_workflow(id="w1")], False) with ( app.test_request_context("/"), @@ -657,7 +749,8 @@ class TestPublishedAllRagPipelineApi: ): result = method(api, pipeline) - assert result["items"] == [{"id": "w1"}] + assert result["items"][0]["id"] == "w1" + assert result["items"][0]["graph"] == {"nodes": [], "edges": []} assert result["has_more"] is False def test_get_published_workflows_forbidden(self, app: Flask): @@ -690,7 +783,7 @@ class TestRagPipelineByIdApi: pipeline = MagicMock(tenant_id="t1") user = MagicMock(id="u1") - workflow = MagicMock() + workflow = make_workflow(id="w1", marked_name="test") service = MagicMock() service.update_workflow.return_value = workflow @@ -711,7 +804,9 @@ class TestRagPipelineByIdApi: ): result = method(api, pipeline, "w1") - assert result == workflow + assert result["id"] == "w1" + assert result["marked_name"] == "test" + assert result["hash"] == workflow.unique_hash def test_patch_no_fields(self, app: Flask): api = RagPipelineByIdApi() diff --git a/api/tests/test_containers_integration_tests/controllers/console/test_apikey.py b/api/tests/test_containers_integration_tests/controllers/console/test_apikey.py index 7df63aae1a..b55eaa1d58 100644 --- a/api/tests/test_containers_integration_tests/controllers/console/test_apikey.py +++ b/api/tests/test_containers_integration_tests/controllers/console/test_apikey.py @@ -5,6 +5,7 @@ from __future__ import annotations from unittest.mock import MagicMock, patch import pytest +from flask import Flask from flask.testing import FlaskClient from sqlalchemy import delete from sqlalchemy.orm import Session @@ -126,7 +127,7 @@ class TestAppApiKeyResource: def test_delete_forbidden_for_non_admin( self, - flask_app_with_containers, + flask_app_with_containers: Flask, ) -> None: """A non-admin member cannot delete API keys via the controller permission check.""" from werkzeug.exceptions import Forbidden diff --git a/api/tests/test_containers_integration_tests/controllers/console/workspace/test_trigger_providers.py b/api/tests/test_containers_integration_tests/controllers/console/workspace/test_trigger_providers.py index e41adccf3c..e155b711a7 100644 --- a/api/tests/test_containers_integration_tests/controllers/console/workspace/test_trigger_providers.py +++ b/api/tests/test_containers_integration_tests/controllers/console/workspace/test_trigger_providers.py @@ -575,7 +575,7 @@ class TestTriggerSubscriptionVerifyApi: assert method(api, "github", "s1") == {"ok": True} @pytest.mark.parametrize("raised_exception", [ValueError("bad"), Exception("boom")]) - def test_verify_errors(self, app, raised_exception): + def test_verify_errors(self, app: Flask, raised_exception): api = TriggerSubscriptionVerifyApi() method = unwrap(api.post) diff --git a/api/tests/test_containers_integration_tests/controllers/web/test_wraps.py b/api/tests/test_containers_integration_tests/controllers/web/test_wraps.py index 0a4e495f36..1bc4253cb9 100644 --- a/api/tests/test_containers_integration_tests/controllers/web/test_wraps.py +++ b/api/tests/test_containers_integration_tests/controllers/web/test_wraps.py @@ -277,7 +277,7 @@ class TestDecodeJwtToken: mock_extract: MagicMock, mock_passport_cls: MagicMock, mock_features: MagicMock, - app, + app: Flask, ) -> None: non_existent_id = str(uuid4()) mock_extract.return_value = "jwt-token" diff --git a/api/tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py b/api/tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py index e71079829f..9d588d4c73 100644 --- a/api/tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py +++ b/api/tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py @@ -5,6 +5,7 @@ from unittest.mock import Mock, patch from uuid import uuid4 import pytest +from flask import Flask from sqlalchemy.orm import Session from models.source import DataSourceApiKeyAuthBinding @@ -45,7 +46,7 @@ class TestApiKeyAuthService: return binding def test_get_provider_auth_list_success( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, category, provider + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, provider ): self._create_binding(db_session_with_containers, tenant_id=tenant_id, category=category, provider=provider) db_session_with_containers.expire_all() @@ -58,7 +59,7 @@ class TestApiKeyAuthService: assert tenant_results[0].provider == provider def test_get_provider_auth_list_empty( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id ): result = ApiKeyAuthService.get_provider_auth_list(tenant_id) @@ -66,7 +67,7 @@ class TestApiKeyAuthService: assert tenant_results == [] def test_get_provider_auth_list_filters_disabled( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, category, provider + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, provider ): self._create_binding( db_session_with_containers, tenant_id=tenant_id, category=category, provider=provider, disabled=True @@ -84,7 +85,7 @@ class TestApiKeyAuthService: self, mock_encrypter, mock_factory, - flask_app_with_containers, + flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, mock_args, @@ -106,7 +107,7 @@ class TestApiKeyAuthService: @patch("services.auth.api_key_auth_service.ApiKeyAuthFactory") def test_create_provider_auth_validation_failed( - self, mock_factory, flask_app_with_containers, db_session_with_containers: Session, tenant_id, mock_args + self, mock_factory, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, mock_args ): mock_auth_instance = Mock() mock_auth_instance.validate_credentials.return_value = False @@ -124,7 +125,7 @@ class TestApiKeyAuthService: self, mock_encrypter, mock_factory, - flask_app_with_containers, + flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, mock_args, @@ -144,7 +145,7 @@ class TestApiKeyAuthService: def test_get_auth_credentials_success( self, - flask_app_with_containers, + flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, @@ -165,14 +166,14 @@ class TestApiKeyAuthService: assert result == mock_credentials def test_get_auth_credentials_not_found( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, category, provider + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, provider ): result = ApiKeyAuthService.get_auth_credentials(tenant_id, category, provider) assert result is None def test_get_auth_credentials_json_parsing( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, category, provider + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, provider ): special_credentials = {"auth_type": "api_key", "config": {"api_key": "key_with_中文_and_special_chars_!@#$%"}} self._create_binding( @@ -190,7 +191,7 @@ class TestApiKeyAuthService: assert result["config"]["api_key"] == "key_with_中文_and_special_chars_!@#$%" def test_delete_provider_auth_success( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, category, provider + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id, category, provider ): binding = self._create_binding( db_session_with_containers, tenant_id=tenant_id, category=category, provider=provider @@ -205,7 +206,7 @@ class TestApiKeyAuthService: assert remaining is None def test_delete_provider_auth_not_found( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id ): # Should not raise when binding not found ApiKeyAuthService.delete_provider_auth(tenant_id, str(uuid4())) @@ -275,7 +276,7 @@ class TestApiKeyAuthService: @patch("services.auth.api_key_auth_service.ApiKeyAuthFactory") @patch("services.auth.api_key_auth_service.encrypter") def test_create_provider_auth_database_error_handling( - self, mock_encrypter, mock_factory, flask_app_with_containers, tenant_id, mock_args + self, mock_encrypter, mock_factory, flask_app_with_containers: Flask, tenant_id, mock_args ): mock_auth_instance = Mock() mock_auth_instance.validate_credentials.return_value = True diff --git a/api/tests/test_containers_integration_tests/services/auth/test_auth_integration.py b/api/tests/test_containers_integration_tests/services/auth/test_auth_integration.py index e78fa27976..1de9ce38a0 100644 --- a/api/tests/test_containers_integration_tests/services/auth/test_auth_integration.py +++ b/api/tests/test_containers_integration_tests/services/auth/test_auth_integration.py @@ -10,6 +10,7 @@ from uuid import uuid4 import httpx import pytest +from flask import Flask from sqlalchemy.orm import Session from models.source import DataSourceApiKeyAuthBinding @@ -45,8 +46,8 @@ class TestAuthIntegration: self, mock_encrypt, mock_http, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, tenant_id_1, category, firecrawl_credentials, @@ -86,8 +87,8 @@ class TestAuthIntegration: mock_jina_http, mock_fc_http, mock_encrypt, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, tenant_id_1, tenant_id_2, category, @@ -115,7 +116,7 @@ class TestAuthIntegration: assert result2[0].tenant_id == tenant_id_2 def test_cross_tenant_access_prevention( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id_2, category + self, flask_app_with_containers: Flask, db_session_with_containers: Session, tenant_id_2, category ): result = ApiKeyAuthService.get_auth_credentials(tenant_id_2, category, AuthType.FIRECRAWL) @@ -139,8 +140,8 @@ class TestAuthIntegration: self, mock_encrypt, mock_http, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, tenant_id_1, category, firecrawl_credentials, @@ -201,8 +202,8 @@ class TestAuthIntegration: def test_network_failure_recovery( self, mock_http, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, tenant_id_1, category, firecrawl_credentials, @@ -239,8 +240,8 @@ class TestAuthIntegration: self, mock_http, mock_encrypt, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, tenant_id_1, category, firecrawl_credentials, diff --git a/api/tests/test_containers_integration_tests/services/dataset_service_update_delete.py b/api/tests/test_containers_integration_tests/services/dataset_service_update_delete.py index 02c3d1a80e..1cffc43658 100644 --- a/api/tests/test_containers_integration_tests/services/dataset_service_update_delete.py +++ b/api/tests/test_containers_integration_tests/services/dataset_service_update_delete.py @@ -14,7 +14,7 @@ from sqlalchemy.orm import Session from werkzeug.exceptions import NotFound from core.rag.index_processor.constant.index_type import IndexTechniqueType -from models import Account, Tenant, TenantAccountJoin, TenantAccountRole +from models import Account, AccountStatus, Tenant, TenantAccountJoin, TenantAccountRole, TenantStatus from models.dataset import AppDatasetJoin, Dataset, DatasetPermissionEnum from models.enums import DataSourceType from models.model import App @@ -38,13 +38,13 @@ class DatasetUpdateDeleteTestDataFactory: email=f"{uuid4()}@example.com", name=f"user-{uuid4()}", interface_language="en-US", - status="active", + status=AccountStatus.ACTIVE, ) db_session_with_containers.add(account) db_session_with_containers.commit() if tenant is None: - tenant = Tenant(name=f"tenant-{uuid4()}", status="normal") + tenant = Tenant(name=f"tenant-{uuid4()}", status=TenantStatus.NORMAL) db_session_with_containers.add(tenant) db_session_with_containers.commit() diff --git a/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py b/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py index e73c2afe7f..075f43d63a 100644 --- a/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py +++ b/api/tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py @@ -10,6 +10,7 @@ from unittest.mock import patch from uuid import uuid4 import pytest +from flask import Flask from redis import RedisError from sqlalchemy.orm import Session @@ -123,7 +124,7 @@ class TestSyncAccountDeletion: mock_queue_task.assert_not_called() def test_sync_account_deletion_multiple_workspaces( - self, flask_app_with_containers, db_session_with_containers: Session, mock_queue_task + self, flask_app_with_containers: Flask, db_session_with_containers: Session, mock_queue_task ): account_id = str(uuid4()) tenant_ids = [str(uuid4()) for _ in range(3)] @@ -145,7 +146,7 @@ class TestSyncAccountDeletion: assert queued_workspace_ids == set(tenant_ids) def test_sync_account_deletion_no_workspaces( - self, flask_app_with_containers, db_session_with_containers: Session, mock_queue_task + self, flask_app_with_containers: Flask, db_session_with_containers: Session, mock_queue_task ): with patch("services.enterprise.account_deletion_sync.dify_config") as mock_config: mock_config.ENTERPRISE_ENABLED = True @@ -156,7 +157,7 @@ class TestSyncAccountDeletion: mock_queue_task.assert_not_called() def test_sync_account_deletion_partial_failure( - self, flask_app_with_containers, db_session_with_containers: Session, mock_queue_task + self, flask_app_with_containers: Flask, db_session_with_containers: Session, mock_queue_task ): account_id = str(uuid4()) tenant_ids = [str(uuid4()) for _ in range(3)] @@ -181,7 +182,7 @@ class TestSyncAccountDeletion: assert mock_queue_task.call_count == 3 def test_sync_account_deletion_all_failures( - self, flask_app_with_containers, db_session_with_containers: Session, mock_queue_task + self, flask_app_with_containers: Flask, db_session_with_containers: Session, mock_queue_task ): account_id = str(uuid4()) tenant_id = str(uuid4()) diff --git a/api/tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py b/api/tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py index ce9f10e207..48830c0f43 100644 --- a/api/tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py +++ b/api/tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py @@ -11,6 +11,7 @@ from unittest.mock import MagicMock, patch from uuid import uuid4 import pytest +from flask import Flask from core.plugin.entities.plugin_daemon import CredentialType from models.tools import BuiltinToolProvider @@ -49,8 +50,8 @@ class TestGetDynamicSelectOptionsTool: mock_tool_mgr, mock_encrypter_fn, mock_client_cls, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, ): tenant_id = str(uuid4()) provider_ctrl = MagicMock() @@ -91,8 +92,8 @@ class TestGetDynamicSelectOptionsTool: self, mock_tool_mgr, mock_encrypter_fn, - flask_app_with_containers, - db_session_with_containers, + flask_app_with_containers: Flask, + db_session_with_containers: Session, ): provider_ctrl = MagicMock() provider_ctrl.need_credentials = True diff --git a/api/tests/test_containers_integration_tests/services/plugin/test_plugin_service.py b/api/tests/test_containers_integration_tests/services/plugin/test_plugin_service.py index 0cdae572fb..0fa4d9043b 100644 --- a/api/tests/test_containers_integration_tests/services/plugin/test_plugin_service.py +++ b/api/tests/test_containers_integration_tests/services/plugin/test_plugin_service.py @@ -11,10 +11,13 @@ from unittest.mock import MagicMock, patch from uuid import uuid4 import pytest +from flask import Flask from sqlalchemy import select +from sqlalchemy.orm import Session from core.plugin.entities.plugin import PluginInstallationSource from core.plugin.entities.plugin_daemon import PluginVerification +from models import ProviderType from models.provider import Provider, ProviderCredential, TenantPreferredModelProvider from services.errors.plugin import PluginInstallationForbiddenError from services.feature_service import PluginInstallationScope @@ -346,7 +349,7 @@ class TestUninstall: @patch("services.plugin.plugin_service.PluginInstaller") def test_cleans_credentials_when_plugin_found( - self, mock_installer_cls, flask_app_with_containers, db_session_with_containers + self, mock_installer_cls, flask_app_with_containers: Flask, db_session_with_containers: Session ): tenant_id = str(uuid4()) plugin_id = "org/myplugin" @@ -374,7 +377,7 @@ class TestUninstall: pref = TenantPreferredModelProvider( tenant_id=tenant_id, provider_name=provider_name, - preferred_provider_type="custom", + preferred_provider_type=ProviderType.CUSTOM, ) db_session_with_containers.add(pref) db_session_with_containers.commit() diff --git a/api/tests/test_containers_integration_tests/services/recommend_app/test_database_retrieval.py b/api/tests/test_containers_integration_tests/services/recommend_app/test_database_retrieval.py index 11e864176a..e4a106694b 100644 --- a/api/tests/test_containers_integration_tests/services/recommend_app/test_database_retrieval.py +++ b/api/tests/test_containers_integration_tests/services/recommend_app/test_database_retrieval.py @@ -3,6 +3,7 @@ from __future__ import annotations from unittest.mock import patch from uuid import uuid4 +from flask import Flask from sqlalchemy.orm import Session from models.model import App, RecommendedApp, Site @@ -10,7 +11,7 @@ from services.recommend_app.database.database_retrieval import DatabaseRecommend from services.recommend_app.recommend_app_type import RecommendAppType -def _create_app(db_session, *, tenant_id: str, is_public: bool = True) -> App: +def _create_app(db_session: Session, *, tenant_id: str, is_public: bool = True) -> App: app = App( tenant_id=tenant_id, name=f"app-{uuid4()}", @@ -25,7 +26,7 @@ def _create_app(db_session, *, tenant_id: str, is_public: bool = True) -> App: return app -def _create_site(db_session, *, app_id: str) -> Site: +def _create_site(db_session: Session, *, app_id: str) -> Site: site = Site( app_id=app_id, title=f"site-{uuid4()}", @@ -95,7 +96,9 @@ class TestDatabaseRecommendAppRetrieval: class TestFetchRecommendedAppsFromDb: - def test_returns_apps_and_sorted_categories(self, flask_app_with_containers, db_session_with_containers: Session): + def test_returns_apps_and_sorted_categories( + self, flask_app_with_containers: Flask, db_session_with_containers: Session + ): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id) _create_site(db_session_with_containers, app_id=app1.id) @@ -116,7 +119,7 @@ class TestFetchRecommendedAppsFromDb: assert "writing" in result["categories"] def test_returns_multiple_categories_for_one_app( - self, flask_app_with_containers, db_session_with_containers: Session + self, flask_app_with_containers: Flask, db_session_with_containers: Session ): tenant_id = str(uuid4()) created_app = _create_app(db_session_with_containers, tenant_id=tenant_id) @@ -139,7 +142,7 @@ class TestFetchRecommendedAppsFromDb: def test_ignores_legacy_category_when_categories_are_empty( self, - flask_app_with_containers, + flask_app_with_containers: Flask, db_session_with_containers: Session, ): legacy_category = f"legacy-empty-{uuid4()}" @@ -163,7 +166,7 @@ class TestFetchRecommendedAppsFromDb: assert legacy_category not in result["categories"] def test_falls_back_to_default_language_when_empty( - self, flask_app_with_containers, db_session_with_containers: Session + self, flask_app_with_containers: Flask, db_session_with_containers: Session ): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id) @@ -177,7 +180,7 @@ class TestFetchRecommendedAppsFromDb: app_ids = {r["app_id"] for r in result["recommended_apps"]} assert app1.id in app_ids - def test_skips_non_public_apps(self, flask_app_with_containers, db_session_with_containers: Session): + def test_skips_non_public_apps(self, flask_app_with_containers: Flask, db_session_with_containers: Session): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id, is_public=False) _create_site(db_session_with_containers, app_id=app1.id) @@ -190,7 +193,7 @@ class TestFetchRecommendedAppsFromDb: app_ids = {r["app_id"] for r in result["recommended_apps"]} assert app1.id not in app_ids - def test_skips_apps_without_site(self, flask_app_with_containers, db_session_with_containers: Session): + def test_skips_apps_without_site(self, flask_app_with_containers: Flask, db_session_with_containers: Session): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id) _create_recommended_app(db_session_with_containers, app_id=app1.id) @@ -204,12 +207,14 @@ class TestFetchRecommendedAppsFromDb: class TestFetchRecommendedAppDetailFromDb: - def test_returns_none_when_not_listed(self, flask_app_with_containers, db_session_with_containers: Session): + def test_returns_none_when_not_listed(self, flask_app_with_containers: Flask, db_session_with_containers: Session): result = DatabaseRecommendAppRetrieval.fetch_recommended_app_detail_from_db(str(uuid4())) assert result is None - def test_returns_none_when_app_not_public(self, flask_app_with_containers, db_session_with_containers: Session): + def test_returns_none_when_app_not_public( + self, flask_app_with_containers: Flask, db_session_with_containers: Session + ): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id, is_public=False) _create_recommended_app(db_session_with_containers, app_id=app1.id) @@ -221,7 +226,9 @@ class TestFetchRecommendedAppDetailFromDb: assert result is None @patch("services.recommend_app.database.database_retrieval.AppDslService") - def test_returns_detail_on_success(self, mock_dsl, flask_app_with_containers, db_session_with_containers: Session): + def test_returns_detail_on_success( + self, mock_dsl, flask_app_with_containers: Flask, db_session_with_containers: Session + ): tenant_id = str(uuid4()) app1 = _create_app(db_session_with_containers, tenant_id=tenant_id) _create_site(db_session_with_containers, app_id=app1.id) diff --git a/api/tests/test_containers_integration_tests/services/test_agent_service.py b/api/tests/test_containers_integration_tests/services/test_agent_service.py index 670b4d00da..27e793915a 100644 --- a/api/tests/test_containers_integration_tests/services/test_agent_service.py +++ b/api/tests/test_containers_integration_tests/services/test_agent_service.py @@ -6,7 +6,7 @@ from faker import Faker from sqlalchemy.orm import Session from core.plugin.impl.exc import PluginDaemonClientSideError -from models import Account, CreatorUserRole +from models import Account, AppMode, CreatorUserRole from models.enums import ConversationFromSource, MessageFileBelongsTo from models.model import AppModelConfig, Conversation, EndUser, Message, MessageAgentThought from services.account_service import AccountService, TenantService @@ -134,7 +134,7 @@ class TestAgentService: app = app_service.create_app(tenant.id, app_args, account) # Update the app model config to set agent_mode for agent-chat mode - if app.mode == "agent-chat" and app.app_model_config: + if app.mode == AppMode.AGENT_CHAT and app.app_model_config: app.app_model_config.agent_mode = json.dumps({"enabled": True, "strategy": "react", "tools": []}) db_session_with_containers.commit() @@ -272,7 +272,7 @@ class TestAgentService: tool_input=json.dumps({"dataset_tool": {"query": "test_query"}}), observation=json.dumps({"dataset_tool": {"results": "test_results"}}), tokens=30, - created_by_role="account", + created_by_role=CreatorUserRole.ACCOUNT, created_by=message.from_account_id, ) db_session_with_containers.add(thought2) diff --git a/api/tests/test_containers_integration_tests/services/test_api_token_service.py b/api/tests/test_containers_integration_tests/services/test_api_token_service.py index a2028d3ed3..9d0082a421 100644 --- a/api/tests/test_containers_integration_tests/services/test_api_token_service.py +++ b/api/tests/test_containers_integration_tests/services/test_api_token_service.py @@ -5,6 +5,7 @@ from unittest.mock import MagicMock, patch from uuid import uuid4 import pytest +from flask import Flask from werkzeug.exceptions import Unauthorized import services.api_token_service as api_token_service_module @@ -14,7 +15,7 @@ from services.api_token_service import ApiTokenCache, CachedApiToken class TestQueryTokenFromDb: def test_should_return_api_token_and_cache_when_token_exists( - self, flask_app_with_containers, db_session_with_containers + self, flask_app_with_containers: Flask, db_session_with_containers ): tenant_id = str(uuid4()) app_id = str(uuid4()) @@ -41,7 +42,7 @@ class TestQueryTokenFromDb: mock_record_usage.assert_called_once_with(token_value, "app") def test_should_cache_null_and_raise_unauthorized_when_token_not_found( - self, flask_app_with_containers, db_session_with_containers + self, flask_app_with_containers: Flask, db_session_with_containers ): with ( patch.object(api_token_service_module.ApiTokenCache, "set") as mock_cache_set, diff --git a/api/tests/test_containers_integration_tests/services/test_file_service_zip_and_lookup.py b/api/tests/test_containers_integration_tests/services/test_file_service_zip_and_lookup.py index 4e0a726cc7..1101d834a0 100644 --- a/api/tests/test_containers_integration_tests/services/test_file_service_zip_and_lookup.py +++ b/api/tests/test_containers_integration_tests/services/test_file_service_zip_and_lookup.py @@ -15,6 +15,7 @@ from uuid import uuid4 from zipfile import ZipFile import pytest +from sqlalchemy.orm import Session import services.file_service as file_service_module from extensions.storage.storage_type import StorageType @@ -23,7 +24,7 @@ from models.model import UploadFile from services.file_service import FileService -def _create_upload_file(db_session, *, tenant_id: str, key: str, name: str) -> UploadFile: +def _create_upload_file(db_session: Session, *, tenant_id: str, key: str, name: str) -> UploadFile: upload_file = UploadFile( tenant_id=tenant_id, storage_type=StorageType.OPENDAL, @@ -66,12 +67,12 @@ def test_build_upload_files_zip_tempfile_sanitizes_and_dedupes_names(monkeypatch assert zf.read("b (2).txt") == b"three" -def test_get_upload_files_by_ids_returns_empty_when_no_ids(db_session_with_containers) -> None: +def test_get_upload_files_by_ids_returns_empty_when_no_ids(db_session_with_containers: Session) -> None: """Ensure empty input returns an empty mapping without hitting the database.""" assert FileService.get_upload_files_by_ids(str(uuid4()), []) == {} -def test_get_upload_files_by_ids_returns_id_keyed_mapping(db_session_with_containers) -> None: +def test_get_upload_files_by_ids_returns_id_keyed_mapping(db_session_with_containers: Session) -> None: """Ensure batch lookup returns a dict keyed by stringified UploadFile ids.""" tenant_id = str(uuid4()) file1 = _create_upload_file(db_session_with_containers, tenant_id=tenant_id, key="k1", name="file1.txt") @@ -84,7 +85,7 @@ def test_get_upload_files_by_ids_returns_id_keyed_mapping(db_session_with_contai assert result[file2.id].id == file2.id -def test_get_upload_files_by_ids_filters_by_tenant(db_session_with_containers) -> None: +def test_get_upload_files_by_ids_filters_by_tenant(db_session_with_containers: Session) -> None: """Ensure files from other tenants are not returned.""" tenant_a = str(uuid4()) tenant_b = str(uuid4()) diff --git a/api/tests/test_containers_integration_tests/services/test_human_input_delivery_test_service.py b/api/tests/test_containers_integration_tests/services/test_human_input_delivery_test_service.py index bfc2af6509..454b8096d1 100644 --- a/api/tests/test_containers_integration_tests/services/test_human_input_delivery_test_service.py +++ b/api/tests/test_containers_integration_tests/services/test_human_input_delivery_test_service.py @@ -5,6 +5,7 @@ from unittest.mock import MagicMock, patch from uuid import uuid4 import pytest +from flask import Flask from sqlalchemy.engine import Engine from sqlalchemy.orm import Session @@ -89,7 +90,7 @@ class TestDeliveryTestRegistry: with pytest.raises(DeliveryTestUnsupportedError, match="Delivery method does not support test send."): registry.dispatch(context=context, method=method) - def test_default(self, flask_app_with_containers, db_session_with_containers: Session): + def test_default(self, flask_app_with_containers: Flask, db_session_with_containers: Session): registry = DeliveryTestRegistry.default() assert len(registry._handlers) == 1 assert isinstance(registry._handlers[0], EmailDeliveryTestHandler) @@ -261,7 +262,7 @@ class TestEmailDeliveryTestHandler: ) assert handler._resolve_recipients(tenant_id="t1", method=method) == ["ext@example.com"] - def test_resolve_recipients_member(self, flask_app_with_containers, db_session_with_containers: Session): + def test_resolve_recipients_member(self, flask_app_with_containers: Flask, db_session_with_containers: Session): tenant_id = str(uuid4()) account = Account(name="Test User", email="member@example.com") db_session_with_containers.add(account) @@ -283,7 +284,9 @@ class TestEmailDeliveryTestHandler: ) assert handler._resolve_recipients(tenant_id=tenant_id, method=method) == ["member@example.com"] - def test_resolve_recipients_whole_workspace(self, flask_app_with_containers, db_session_with_containers: Session): + def test_resolve_recipients_whole_workspace( + self, flask_app_with_containers: Flask, db_session_with_containers: Session + ): tenant_id = str(uuid4()) account1 = Account(name="User 1", email=f"u1-{uuid4()}@example.com") account2 = Account(name="User 2", email=f"u2-{uuid4()}@example.com") diff --git a/api/tests/test_containers_integration_tests/services/test_metadata_partial_update.py b/api/tests/test_containers_integration_tests/services/test_metadata_partial_update.py index fffa82bf5c..f3ab9eb3da 100644 --- a/api/tests/test_containers_integration_tests/services/test_metadata_partial_update.py +++ b/api/tests/test_containers_integration_tests/services/test_metadata_partial_update.py @@ -4,6 +4,7 @@ from unittest.mock import Mock, patch from uuid import uuid4 import pytest +from flask import Flask from sqlalchemy import select from sqlalchemy.orm import Session @@ -17,7 +18,7 @@ from services.entities.knowledge_entities.knowledge_entities import ( from services.metadata_service import MetadataService -def _create_dataset(db_session, *, tenant_id: str, built_in_field_enabled: bool = False) -> Dataset: +def _create_dataset(db_session: Session, *, tenant_id: str, built_in_field_enabled: bool = False) -> Dataset: dataset = Dataset( tenant_id=tenant_id, name=f"dataset-{uuid4()}", @@ -31,7 +32,9 @@ def _create_dataset(db_session, *, tenant_id: str, built_in_field_enabled: bool return dataset -def _create_document(db_session, *, dataset_id: str, tenant_id: str, doc_metadata: dict | None = None) -> Document: +def _create_document( + db_session: Session, *, dataset_id: str, tenant_id: str, doc_metadata: dict | None = None +) -> Document: document = Document( tenant_id=tenant_id, dataset_id=dataset_id, @@ -66,7 +69,11 @@ class TestMetadataPartialUpdate: yield account def test_partial_update_merges_metadata( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, mock_current_account + self, + flask_app_with_containers: Flask, + db_session_with_containers: Session, + tenant_id: str, + mock_current_account, ): dataset = _create_dataset(db_session_with_containers, tenant_id=tenant_id) document = _create_document( @@ -93,7 +100,11 @@ class TestMetadataPartialUpdate: assert updated_doc.doc_metadata["new_key"] == "new_value" def test_full_update_replaces_metadata( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, mock_current_account + self, + flask_app_with_containers: Flask, + db_session_with_containers: Session, + tenant_id: str, + mock_current_account, ): dataset = _create_dataset(db_session_with_containers, tenant_id=tenant_id) document = _create_document( @@ -120,7 +131,12 @@ class TestMetadataPartialUpdate: assert "existing_key" not in updated_doc.doc_metadata def test_partial_update_skips_existing_binding( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, user_id, mock_current_account + self, + flask_app_with_containers: Flask, + db_session_with_containers: Session, + tenant_id, + user_id, + mock_current_account, ): dataset = _create_dataset(db_session_with_containers, tenant_id=tenant_id) document = _create_document( @@ -160,7 +176,11 @@ class TestMetadataPartialUpdate: assert len(bindings) == 1 def test_rollback_called_on_commit_failure( - self, flask_app_with_containers, db_session_with_containers: Session, tenant_id, mock_current_account + self, + flask_app_with_containers: Flask, + db_session_with_containers: Session, + tenant_id: str, + mock_current_account, ): dataset = _create_dataset(db_session_with_containers, tenant_id=tenant_id) document = _create_document( diff --git a/api/tests/unit_tests/controllers/console/app/test_app_import_api.py b/api/tests/unit_tests/controllers/console/app/test_app_import_api.py index 9c4678aed3..e690968ffb 100644 --- a/api/tests/unit_tests/controllers/console/app/test_app_import_api.py +++ b/api/tests/unit_tests/controllers/console/app/test_app_import_api.py @@ -6,6 +6,7 @@ from types import SimpleNamespace from unittest.mock import MagicMock import pytest +from flask import Flask from controllers.console.app import app_import as app_import_module from services.app_dsl_service import ImportStatus @@ -48,7 +49,9 @@ class TestAppImportApi: def api(self): return app_import_module.AppImportApi() - def test_import_post_returns_failed_status_and_rolls_back(self, api, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_import_post_returns_failed_status_and_rolls_back( + self, api, app: Flask, monkeypatch: pytest.MonkeyPatch + ) -> None: method = _unwrap(api.post) _install_features(monkeypatch, enabled=False) @@ -68,7 +71,9 @@ class TestAppImportApi: assert status == 400 assert response["status"] == ImportStatus.FAILED - def test_import_post_returns_pending_status_and_commits(self, api, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_import_post_returns_pending_status_and_commits( + self, api, app: Flask, monkeypatch: pytest.MonkeyPatch + ) -> None: method = _unwrap(api.post) _install_features(monkeypatch, enabled=False) @@ -88,7 +93,9 @@ class TestAppImportApi: assert status == 202 assert response["status"] == ImportStatus.PENDING - def test_import_post_updates_webapp_auth_when_enabled(self, api, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_import_post_updates_webapp_auth_when_enabled( + self, api, app: Flask, monkeypatch: pytest.MonkeyPatch + ) -> None: method = _unwrap(api.post) _install_features(monkeypatch, enabled=True) @@ -118,7 +125,7 @@ class TestAppImportConfirmApi: return app_import_module.AppImportConfirmApi() def test_import_confirm_returns_failed_status_and_rolls_back( - self, api, app, monkeypatch: pytest.MonkeyPatch + self, api, app: Flask, monkeypatch: pytest.MonkeyPatch ) -> None: method = _unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py b/api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py index 1a412aff29..71b6a1aa37 100644 --- a/api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py +++ b/api/tests/unit_tests/controllers/console/app/test_conversation_variables_api.py @@ -5,6 +5,7 @@ from datetime import UTC, datetime from types import SimpleNamespace import pytest +from flask import Flask from pydantic import ValidationError from controllers.console.app import conversation_variables as conversation_variables_module @@ -20,7 +21,7 @@ def _unwrap(func): return func -def test_get_conversation_variables_returns_paginated_response(app, monkeypatch: pytest.MonkeyPatch) -> None: +def test_get_conversation_variables_returns_paginated_response(app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: api = conversation_variables_module.ConversationVariablesApi() method = _unwrap(api.get) @@ -63,7 +64,9 @@ def test_get_conversation_variables_returns_paginated_response(app, monkeypatch: assert response["data"][0]["updated_at"] == int(updated_at.timestamp()) -def test_get_conversation_variables_normalizes_value_type_and_value(app, monkeypatch: pytest.MonkeyPatch) -> None: +def test_get_conversation_variables_normalizes_value_type_and_value( + app: Flask, monkeypatch: pytest.MonkeyPatch +) -> None: api = conversation_variables_module.ConversationVariablesApi() method = _unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/console/app/test_workflow.py b/api/tests/unit_tests/controllers/console/app/test_workflow.py index 7c470eb9a8..e7fc1f8042 100644 --- a/api/tests/unit_tests/controllers/console/app/test_workflow.py +++ b/api/tests/unit_tests/controllers/console/app/test_workflow.py @@ -3,14 +3,18 @@ from __future__ import annotations import json from datetime import datetime from types import SimpleNamespace +from typing import cast from unittest.mock import Mock import pytest +from pydantic import ValidationError from werkzeug.exceptions import HTTPException, NotFound from controllers.console.app import workflow as workflow_module from controllers.console.app.error import DraftWorkflowNotExist, DraftWorkflowNotSync from graphon.file import File, FileTransferMethod, FileType +from graphon.variables import SecretVariable, StringVariable +from graphon.variables.variables import RAGPipelineVariable def _unwrap(func): @@ -19,11 +23,67 @@ def _unwrap(func): return func +def _make_workflow(**overrides): + workflow = SimpleNamespace( + id="workflow-1", + graph_dict={"nodes": [], "edges": []}, + features_dict={"file_upload": {"enabled": False}}, + unique_hash="hash-1", + version="1", + marked_name="Release 1", + marked_comment="Initial release", + created_by_account=SimpleNamespace(id="user-1", name="Alice", email="alice@example.com"), + created_at=datetime(2024, 1, 1, 12, 0, 0), + updated_by_account=None, + updated_at=datetime(2024, 1, 1, 12, 1, 0), + tool_published=False, + environment_variables=[ + { + "id": "env-1", + "name": "API_KEY", + "value": "[__HIDDEN__]", + "value_type": "secret", + "description": "API key", + } + ], + conversation_variables=[ + { + "id": "conv-1", + "name": "topic", + "value": "hello", + "value_type": "string", + "description": "Topic", + } + ], + rag_pipeline_variables=[ + { + "variable": "query", + "type": "text-input", + "label": "Query", + "belong_to_node_id": "shared", + "max_length": 0, + "required": False, + "unit": "", + "default_value": "", + "options": [], + "placeholder": "", + "tooltips": "", + "allowed_file_types": ["custom"], + "allowed_file_extensions": [".pdf"], + "allowed_file_upload_methods": ["local_file"], + } + ], + ) + for key, value in overrides.items(): + setattr(workflow, key, value) + return workflow + + def test_parse_file_no_config(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(workflow_module.FileUploadConfigManager, "convert", lambda *_args, **_kwargs: None) workflow = SimpleNamespace(features_dict={}, tenant_id="t1") - assert workflow_module._parse_file(workflow, files=[{"id": "f"}]) == [] + assert workflow_module._parse_file(cast(workflow_module.Workflow, workflow), files=[{"id": "f"}]) == [] def test_parse_file_with_config(monkeypatch: pytest.MonkeyPatch) -> None: @@ -41,7 +101,7 @@ def test_parse_file_with_config(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(workflow_module.file_factory, "build_from_mappings", build_mock) workflow = SimpleNamespace(features_dict={}, tenant_id="t1") - result = workflow_module._parse_file(workflow, files=[{"id": "f"}]) + result = workflow_module._parse_file(cast(workflow_module.Workflow, workflow), files=[{"id": "f"}]) assert result == file_list build_mock.assert_called_once() @@ -259,7 +319,7 @@ def test_restore_published_workflow_to_draft_returns_400_for_invalid_structure( assert exc.value.description == "invalid workflow graph" -def test_get_published_workflows_marshals_items_before_session_closes(app, monkeypatch: pytest.MonkeyPatch) -> None: +def test_get_published_workflows_serializes_items_before_session_closes(app, monkeypatch: pytest.MonkeyPatch) -> None: api = workflow_module.PublishedAllWorkflowApi() handler = _unwrap(api.get) @@ -278,7 +338,12 @@ def test_get_published_workflows_marshals_items_before_session_closes(app, monke def begin(self): return _SessionContext() + base_workflow = _make_workflow() + class _Workflow: + def __getattr__(self, name): + return getattr(base_workflow, name) + @property def id(self): assert session_state["open"] is True @@ -295,12 +360,6 @@ def test_get_published_workflows_marshals_items_before_session_closes(app, monke ), ) - def _fake_marshal(items, fields): - assert session_state["open"] is True - return [{"id": item.id} for item in items] - - monkeypatch.setattr(workflow_module, "marshal", _fake_marshal) - with app.test_request_context( "/apps/app/workflows", method="GET", @@ -308,12 +367,153 @@ def test_get_published_workflows_marshals_items_before_session_closes(app, monke ): response = handler(api, app_model=SimpleNamespace(id="app", workflow_id="wf-1")) - assert response == { - "items": [{"id": "w1"}], - "page": 1, - "limit": 10, - "has_more": False, - } + assert response["items"][0]["id"] == "w1" + assert response["page"] == 1 + assert response["limit"] == 10 + assert response["has_more"] is False + + +def test_draft_workflow_get_serializes_response_model(monkeypatch: pytest.MonkeyPatch) -> None: + workflow = _make_workflow() + monkeypatch.setattr( + workflow_module, "WorkflowService", lambda: SimpleNamespace(get_draft_workflow=lambda **_kwargs: workflow) + ) + + api = workflow_module.DraftWorkflowApi() + handler = _unwrap(api.get) + + response = handler(api, app_model=SimpleNamespace(id="app")) + + assert response["id"] == "workflow-1" + assert response["graph"] == {"nodes": [], "edges": []} + assert response["features"] == {"file_upload": {"enabled": False}} + assert response["hash"] == "hash-1" + assert response["created_by"] == {"id": "user-1", "name": "Alice", "email": "alice@example.com"} + assert response["updated_by"] is None + assert response["created_at"] == int(datetime(2024, 1, 1, 12, 0, 0).timestamp()) + assert response["updated_at"] == int(datetime(2024, 1, 1, 12, 1, 0).timestamp()) + assert response["environment_variables"] == [ + { + "id": "env-1", + "name": "API_KEY", + "value": "[__HIDDEN__]", + "value_type": "secret", + "description": "API key", + } + ] + assert response["conversation_variables"] == [ + { + "id": "conv-1", + "name": "topic", + "value": "hello", + "value_type": "string", + "description": "Topic", + } + ] + assert response["rag_pipeline_variables"] == [ + { + "label": "Query", + "variable": "query", + "type": "text-input", + "belong_to_node_id": "shared", + "max_length": 0, + "required": False, + "unit": "", + "default_value": "", + "options": [], + "placeholder": "", + "tooltips": "", + "allowed_file_types": ["custom"], + "allowed_file_extensions": [".pdf"], + "allowed_file_upload_methods": ["local_file"], + } + ] + + +def test_pipeline_variable_response_accepts_legacy_file_field_names() -> None: + response = workflow_module.PipelineVariableResponse.model_validate( + { + "label": "Query", + "variable": "query", + "type": "single-file", + "belong_to_node_id": "shared", + "max_length": 0, + "required": False, + "unit": "", + "default_value": "", + "options": [], + "placeholder": "", + "tooltips": "", + "allowed_file_types": [], + "allow_file_extension": [".txt"], + "allow_file_upload_methods": ["remote_url"], + } + ).model_dump(mode="json") + + assert response["allowed_file_extensions"] == [".txt"] + assert response["allowed_file_upload_methods"] == ["remote_url"] + + +def test_pipeline_variable_response_accepts_explicit_null_optional_fields() -> None: + pipeline_variable = RAGPipelineVariable.model_validate( + { + "label": "Query", + "variable": "query", + "type": "text-input", + "belong_to_node_id": "shared", + "max_length": None, + "unit": None, + "default_value": None, + "options": None, + "placeholder": None, + "tooltips": None, + "allowed_file_types": None, + "allowed_file_extensions": None, + "allowed_file_upload_methods": None, + } + ).model_dump(mode="json") + + response = workflow_module.PipelineVariableResponse.model_validate(pipeline_variable).model_dump(mode="json") + + assert response["max_length"] is None + assert response["allowed_file_types"] is None + assert response["allowed_file_extensions"] is None + assert response["allowed_file_upload_methods"] is None + + +def test_workflow_response_masks_secret_environment_variables() -> None: + workflow = _make_workflow( + environment_variables=[ + SecretVariable(id="env-secret", name="API_KEY", value="plain-token", selector=["env", "API_KEY"]), + StringVariable(id="env-string", name="REGION", value="us-east-1", selector=["env", "REGION"]), + ] + ) + + response = workflow_module.WorkflowResponse.model_validate(workflow, from_attributes=True).model_dump(mode="json") + + assert response["environment_variables"] == [ + { + "id": "env-secret", + "name": "API_KEY", + "value": workflow_module.encrypter.full_mask_token(), + "value_type": "secret", + "description": "", + }, + { + "id": "env-string", + "name": "REGION", + "value": "us-east-1", + "value_type": "string", + "description": "", + }, + ] + + +def test_workflow_response_rejects_invalid_environment_variable_dict() -> None: + workflow = _make_workflow(environment_variables=[{"value_type": "not-a-segment-type"}]) + + with pytest.raises(ValidationError): + workflow_module.WorkflowResponse.model_validate(workflow, from_attributes=True) def test_draft_workflow_get_not_found(monkeypatch: pytest.MonkeyPatch) -> None: @@ -373,10 +573,33 @@ def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: p "avatar": "avatar-file-id", "sid": "sid-1", } - ) + ), + b"sid-malformed": json.dumps({"avatar": "avatar-file-id", "sid": "sid-malformed"}), + b"sid-invalid-avatar": json.dumps( + { + "user_id": "u-2", + "username": "Bob", + "avatar": {"file_id": "avatar-file-id"}, + } + ), + b"sid-invalid-user-id": json.dumps( + { + "user_id": 42, + "username": "Carol", + "avatar": "avatar-file-id", + } + ), + b"sid-invalid-username": json.dumps( + { + "user_id": "u-4", + "username": ["Dave"], + "avatar": "avatar-file-id", + } + ), } ] - workflow_module.redis_client.pipeline.return_value = redis_pipeline + redis_pipeline_factory = Mock(return_value=redis_pipeline) + monkeypatch.setattr(workflow_module.redis_client, "pipeline", redis_pipeline_factory) api = workflow_module.WorkflowOnlineUsersApi() handler = _unwrap(api.post) @@ -397,13 +620,17 @@ def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: p "user_id": "u-1", "username": "Alice", "avatar": signed_avatar_url, - "sid": "sid-1", - } + }, + { + "user_id": "u-2", + "username": "Bob", + "avatar": None, + }, ], } ] } - workflow_module.redis_client.pipeline.assert_called_once_with(transaction=False) + redis_pipeline_factory.assert_called_once_with(transaction=False) redis_pipeline.hgetall.assert_called_once_with(f"{workflow_module.WORKFLOW_ONLINE_USERS_PREFIX}{app_id_1}") redis_pipeline.execute.assert_called_once_with() sign_avatar.assert_called_once_with("avatar-file-id") @@ -422,7 +649,8 @@ def test_workflow_online_users_batches_redis_reads(app, monkeypatch: pytest.Monk first_pipeline.execute.return_value = [{} for _ in range(workflow_module.WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE)] second_pipeline = Mock() second_pipeline.execute.return_value = [{}] - workflow_module.redis_client.pipeline.side_effect = [first_pipeline, second_pipeline] + redis_pipeline_factory = Mock(side_effect=[first_pipeline, second_pipeline]) + monkeypatch.setattr(workflow_module.redis_client, "pipeline", redis_pipeline_factory) api = workflow_module.WorkflowOnlineUsersApi() handler = _unwrap(api.post) @@ -435,7 +663,7 @@ def test_workflow_online_users_batches_redis_reads(app, monkeypatch: pytest.Monk response = handler(api) assert len(response["data"]) == len(app_ids) - assert workflow_module.redis_client.pipeline.call_count == 2 + assert redis_pipeline_factory.call_count == 2 assert first_pipeline.hgetall.call_count == workflow_module.WORKFLOW_ONLINE_USERS_REDIS_BATCH_SIZE assert second_pipeline.hgetall.call_count == 1 @@ -463,5 +691,6 @@ def test_workflow_online_users_rejects_excessive_workflow_ids(app, monkeypatch: handler(api) assert exc.value.code == 400 + assert exc.value.description is not None assert "Maximum" in exc.value.description accessible_app_ids.assert_not_called() diff --git a/api/tests/unit_tests/controllers/console/app/test_workflow_pause_details_api.py b/api/tests/unit_tests/controllers/console/app/test_workflow_pause_details_api.py index f265a4f68d..58274f1688 100644 --- a/api/tests/unit_tests/controllers/console/app/test_workflow_pause_details_api.py +++ b/api/tests/unit_tests/controllers/console/app/test_workflow_pause_details_api.py @@ -20,8 +20,11 @@ from models.workflow import WorkflowRun def _make_account() -> Account: - account = Account(name="tester", email="tester@example.com") - account.status = AccountStatus.ACTIVE + account = Account( + name="tester", + email="tester@example.com", + status=AccountStatus.ACTIVE, + ) account.role = TenantAccountRole.OWNER account.id = "account-123" # type: ignore[assignment] account._current_tenant = SimpleNamespace(id="tenant-123") # type: ignore[attr-defined] diff --git a/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_draft_variable.py b/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_draft_variable.py index 63950736c5..8a65c4bbe5 100644 --- a/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_draft_variable.py +++ b/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_draft_variable.py @@ -1,7 +1,7 @@ from unittest.mock import MagicMock, patch import pytest -from flask import Response +from flask import Flask, Response from controllers.console import console_ns from controllers.console.app.error import DraftWorkflowNotExist @@ -46,7 +46,7 @@ def restx_config(app): class TestRagPipelineVariableCollectionApi: - def test_get_variables_success(self, app, fake_db, editor_user, restx_config): + def test_get_variables_success(self, app: Flask, fake_db, editor_user, restx_config): api = RagPipelineVariableCollectionApi() method = unwrap(api.get) @@ -80,7 +80,7 @@ class TestRagPipelineVariableCollectionApi: assert result["items"] == [] - def test_get_variables_workflow_not_exist(self, app, fake_db, editor_user): + def test_get_variables_workflow_not_exist(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableCollectionApi() method = unwrap(api.get) @@ -101,7 +101,7 @@ class TestRagPipelineVariableCollectionApi: with pytest.raises(DraftWorkflowNotExist): method(api, pipeline) - def test_delete_variables_success(self, app, fake_db, editor_user): + def test_delete_variables_success(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableCollectionApi() method = unwrap(api.delete) @@ -120,7 +120,7 @@ class TestRagPipelineVariableCollectionApi: class TestRagPipelineNodeVariableCollectionApi: - def test_get_node_variables_success(self, app, fake_db, editor_user, restx_config): + def test_get_node_variables_success(self, app: Flask, fake_db, editor_user, restx_config): api = RagPipelineNodeVariableCollectionApi() method = unwrap(api.get) @@ -146,7 +146,7 @@ class TestRagPipelineNodeVariableCollectionApi: assert result["items"] == [] - def test_get_node_variables_invalid_node(self, app, editor_user): + def test_get_node_variables_invalid_node(self, app: Flask, editor_user): api = RagPipelineNodeVariableCollectionApi() method = unwrap(api.get) @@ -159,7 +159,7 @@ class TestRagPipelineNodeVariableCollectionApi: class TestRagPipelineVariableApi: - def test_get_variable_not_found(self, app, fake_db, editor_user): + def test_get_variable_not_found(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableApi() method = unwrap(api.get) @@ -178,7 +178,7 @@ class TestRagPipelineVariableApi: with pytest.raises(NotFoundError): method(api, MagicMock(), "v1") - def test_patch_variable_invalid_file_payload(self, app, fake_db, editor_user): + def test_patch_variable_invalid_file_payload(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableApi() method = unwrap(api.patch) @@ -203,7 +203,7 @@ class TestRagPipelineVariableApi: with pytest.raises(InvalidArgumentError): method(api, pipeline, "v1") - def test_delete_variable_success(self, app, fake_db, editor_user): + def test_delete_variable_success(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableApi() method = unwrap(api.delete) @@ -228,7 +228,7 @@ class TestRagPipelineVariableApi: class TestRagPipelineVariableResetApi: - def test_reset_variable_success(self, app, fake_db, editor_user): + def test_reset_variable_success(self, app: Flask, fake_db, editor_user): api = RagPipelineVariableResetApi() method = unwrap(api.put) @@ -266,7 +266,7 @@ class TestRagPipelineVariableResetApi: class TestSystemAndEnvironmentVariablesApi: - def test_system_variables_success(self, app, fake_db, editor_user, restx_config): + def test_system_variables_success(self, app: Flask, fake_db, editor_user, restx_config): api = RagPipelineSystemVariableCollectionApi() method = unwrap(api.get) @@ -292,7 +292,7 @@ class TestSystemAndEnvironmentVariablesApi: assert result["items"] == [] - def test_environment_variables_success(self, app, editor_user): + def test_environment_variables_success(self, app: Flask, editor_user): api = RagPipelineEnvironmentVariableCollectionApi() method = unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py b/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py new file mode 100644 index 0000000000..322f1baa96 --- /dev/null +++ b/api/tests/unit_tests/controllers/console/datasets/rag_pipeline/test_rag_pipeline_workflow.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +from datetime import datetime +from types import SimpleNamespace +from unittest.mock import PropertyMock, patch + +import pytest + +from controllers.console.datasets.rag_pipeline import rag_pipeline_workflow as module + + +def _unwrap(func): + while hasattr(func, "__wrapped__"): + func = func.__wrapped__ + return func + + +def _make_workflow(**overrides): + workflow = SimpleNamespace( + id="workflow-1", + graph_dict={"nodes": [], "edges": []}, + features_dict={"file_upload": {"enabled": False}}, + unique_hash="hash-1", + version="1", + marked_name="Release 1", + marked_comment="Initial release", + created_by_account=SimpleNamespace(id="user-1", name="Alice", email="alice@example.com"), + created_at=datetime(2024, 1, 1, 12, 0, 0), + updated_by_account=None, + updated_at=datetime(2024, 1, 1, 12, 1, 0), + tool_published=False, + environment_variables=[], + conversation_variables=[], + rag_pipeline_variables=[], + ) + for key, value in overrides.items(): + setattr(workflow, key, value) + return workflow + + +def test_draft_rag_pipeline_workflow_get_serializes_response_model(monkeypatch: pytest.MonkeyPatch) -> None: + workflow = _make_workflow() + monkeypatch.setattr( + module, "RagPipelineService", lambda: SimpleNamespace(get_draft_workflow=lambda **_kwargs: workflow) + ) + + api = module.DraftRagPipelineApi() + handler = _unwrap(api.get) + + response = handler(api, pipeline=SimpleNamespace(id="pipeline-1")) + + assert response["id"] == "workflow-1" + assert response["graph"] == {"nodes": [], "edges": []} + assert response["features"] == {"file_upload": {"enabled": False}} + assert response["hash"] == "hash-1" + assert response["created_by"] == {"id": "user-1", "name": "Alice", "email": "alice@example.com"} + assert response["updated_by"] is None + assert response["created_at"] == int(datetime(2024, 1, 1, 12, 0, 0).timestamp()) + assert response["updated_at"] == int(datetime(2024, 1, 1, 12, 1, 0).timestamp()) + + +def test_published_rag_pipeline_workflows_serialize_items_before_session_closes( + app, monkeypatch: pytest.MonkeyPatch +) -> None: + api = module.PublishedAllRagPipelineApi() + handler = _unwrap(api.get) + session_state = {"open": False} + + class _SessionContext: + def __enter__(self): + session_state["open"] = True + return object() + + def __exit__(self, exc_type, exc, tb): + session_state["open"] = False + return False + + class _SessionMaker: + def begin(self): + return _SessionContext() + + base_workflow = _make_workflow() + + class _Workflow: + def __getattr__(self, name: str): + assert session_state["open"] is True + return getattr(base_workflow, name) + + monkeypatch.setattr(module, "db", SimpleNamespace(engine=object())) + monkeypatch.setattr(module, "sessionmaker", lambda *_args, **_kwargs: _SessionMaker()) + monkeypatch.setattr(module, "current_account_with_tenant", lambda: (SimpleNamespace(id="user-1"), "tenant-1")) + monkeypatch.setattr( + module, + "RagPipelineService", + lambda: SimpleNamespace(get_all_published_workflow=lambda **_kwargs: ([_Workflow()], False)), + ) + + with app.test_request_context( + "/rag/pipelines/pipeline-1/workflows", + method="GET", + query_string={"page": 1, "limit": 10, "user_id": "", "named_only": "false"}, + ): + response = handler(api, pipeline=SimpleNamespace(id="pipeline-1")) + + assert response["items"][0]["id"] == "workflow-1" + assert response["page"] == 1 + assert response["limit"] == 10 + assert response["has_more"] is False + + +def test_rag_pipeline_workflow_patch_serializes_response_model(app, monkeypatch: pytest.MonkeyPatch) -> None: + workflow = _make_workflow(marked_name="Updated release") + monkeypatch.setattr(module, "current_account_with_tenant", lambda: (SimpleNamespace(id="user-1"), "tenant-1")) + + class _SessionContext: + def __enter__(self): + return object() + + def __exit__(self, exc_type, exc, tb): + return False + + class _SessionMaker: + def begin(self): + return _SessionContext() + + monkeypatch.setattr(module, "db", SimpleNamespace(engine=object())) + monkeypatch.setattr(module, "sessionmaker", lambda *_args, **_kwargs: _SessionMaker()) + monkeypatch.setattr( + module, + "RagPipelineService", + lambda: SimpleNamespace(update_workflow=lambda **_kwargs: workflow), + ) + payload: dict[str, object] = {"marked_name": "Updated release"} + + api = module.RagPipelineByIdApi() + handler = _unwrap(api.patch) + + with ( + app.test_request_context("/rag/pipelines/pipeline-1/workflows/workflow-1", method="PATCH", json=payload), + patch.object(type(module.console_ns), "payload", new_callable=PropertyMock, return_value=payload), + ): + response = handler( + api, + pipeline=SimpleNamespace(id="pipeline-1", tenant_id="tenant-1"), + workflow_id="workflow-1", + ) + + assert response["id"] == "workflow-1" + assert response["marked_name"] == "Updated release" + assert response["hash"] == "hash-1" diff --git a/api/tests/unit_tests/controllers/console/datasets/test_datasets_document.py b/api/tests/unit_tests/controllers/console/datasets/test_datasets_document.py index ff9e1736d2..c77895d940 100644 --- a/api/tests/unit_tests/controllers/console/datasets/test_datasets_document.py +++ b/api/tests/unit_tests/controllers/console/datasets/test_datasets_document.py @@ -95,7 +95,7 @@ def patch_permission(): class TestGetProcessRuleApi: - def test_get_default_success(self, app, patch_tenant): + def test_get_default_success(self, app: Flask, patch_tenant): api = GetProcessRuleApi() method = unwrap(api.get) @@ -104,7 +104,7 @@ class TestGetProcessRuleApi: assert "rules" in response - def test_get_with_document_dataset_not_found(self, app, patch_tenant): + def test_get_with_document_dataset_not_found(self, app: Flask, patch_tenant): api = GetProcessRuleApi() method = unwrap(api.get) @@ -126,7 +126,7 @@ class TestGetProcessRuleApi: class TestDatasetDocumentListApi: - def test_get_with_fetch_true_counts_segments(self, app, patch_tenant, patch_dataset, patch_permission): + def test_get_with_fetch_true_counts_segments(self, app: Flask, patch_tenant, patch_dataset, patch_permission): api = DatasetDocumentListApi() method = unwrap(api.get) @@ -158,7 +158,9 @@ class TestDatasetDocumentListApi: assert resp["data"] - def test_get_with_search_status_and_created_at_sort(self, app, patch_tenant, patch_dataset, patch_permission): + def test_get_with_search_status_and_created_at_sort( + self, app: Flask, patch_tenant, patch_dataset, patch_permission + ): api = DatasetDocumentListApi() method = unwrap(api.get) @@ -187,7 +189,7 @@ class TestDatasetDocumentListApi: assert resp["total"] == 1 - def test_get_success(self, app, patch_tenant, patch_dataset, patch_permission): + def test_get_success(self, app: Flask, patch_tenant, patch_dataset, patch_permission): api = DatasetDocumentListApi() method = unwrap(api.get) @@ -212,7 +214,7 @@ class TestDatasetDocumentListApi: assert response["total"] == 1 - def test_post_success(self, app, patch_tenant, patch_dataset, patch_permission): + def test_post_success(self, app: Flask, patch_tenant, patch_dataset, patch_permission): api = DatasetDocumentListApi() method = unwrap(api.post) @@ -261,7 +263,7 @@ class TestDatasetDocumentListApi: with pytest.raises(Forbidden): method(api, "ds-1") - def test_get_with_fetch_true_and_invalid_fetch(self, app, patch_tenant, patch_dataset, patch_permission): + def test_get_with_fetch_true_and_invalid_fetch(self, app: Flask, patch_tenant, patch_dataset, patch_permission): api = DatasetDocumentListApi() method = unwrap(api.get) @@ -286,7 +288,7 @@ class TestDatasetDocumentListApi: assert response["total"] == 1 - def test_get_sort_hit_count(self, app, patch_tenant, patch_dataset, patch_permission): + def test_get_sort_hit_count(self, app: Flask, patch_tenant, patch_dataset, patch_permission): api = DatasetDocumentListApi() method = unwrap(api.get) @@ -309,7 +311,7 @@ class TestDatasetDocumentListApi: class TestDocumentApi: - def test_get_success(self, app, patch_tenant): + def test_get_success(self, app: Flask, patch_tenant): api = DocumentApi() method = unwrap(api.get) @@ -327,7 +329,7 @@ class TestDocumentApi: assert status == 200 - def test_get_invalid_metadata(self, app, patch_tenant): + def test_get_invalid_metadata(self, app: Flask, patch_tenant): api = DocumentApi() method = unwrap(api.get) @@ -335,7 +337,7 @@ class TestDocumentApi: with pytest.raises(InvalidMetadataError): method(api, "ds-1", "doc-1") - def test_delete_success(self, app, patch_tenant, patch_dataset): + def test_delete_success(self, app: Flask, patch_tenant, patch_dataset): api = DocumentApi() method = unwrap(api.delete) @@ -355,7 +357,7 @@ class TestDocumentApi: assert status == 204 - def test_delete_indexing_error(self, app, patch_tenant, patch_dataset): + def test_delete_indexing_error(self, app: Flask, patch_tenant, patch_dataset): api = DocumentApi() method = unwrap(api.delete) @@ -376,7 +378,7 @@ class TestDocumentApi: class TestDocumentDownloadApi: - def test_download_success(self, app, patch_tenant): + def test_download_success(self, app: Flask, patch_tenant): api = DocumentDownloadApi() method = unwrap(api.get) @@ -413,7 +415,7 @@ class TestDocumentProcessingApi: with pytest.raises(Forbidden): method(api, "ds-1", "doc-1", "pause") - def test_resume_from_error_state(self, app, patch_tenant): + def test_resume_from_error_state(self, app: Flask, patch_tenant): api = DocumentProcessingApi() method = unwrap(api.patch) @@ -431,7 +433,7 @@ class TestDocumentProcessingApi: assert status == 200 - def test_resume_success(self, app, patch_tenant): + def test_resume_success(self, app: Flask, patch_tenant): api = DocumentProcessingApi() method = unwrap(api.patch) @@ -449,7 +451,7 @@ class TestDocumentProcessingApi: assert status == 200 - def test_pause_success(self, app, patch_tenant): + def test_pause_success(self, app: Flask, patch_tenant): api = DocumentProcessingApi() method = unwrap(api.patch) @@ -467,7 +469,7 @@ class TestDocumentProcessingApi: assert status == 200 - def test_pause_invalid(self, app, patch_tenant): + def test_pause_invalid(self, app: Flask, patch_tenant): api = DocumentProcessingApi() method = unwrap(api.patch) @@ -479,7 +481,7 @@ class TestDocumentProcessingApi: class TestDocumentMetadataApi: - def test_put_metadata_schema_filtering(self, app, patch_tenant): + def test_put_metadata_schema_filtering(self, app: Flask, patch_tenant): api = DocumentMetadataApi() method = unwrap(api.put) @@ -508,7 +510,7 @@ class TestDocumentMetadataApi: assert doc.doc_metadata == {"amount": 10} - def test_put_success(self, app, patch_tenant): + def test_put_success(self, app: Flask, patch_tenant): api = DocumentMetadataApi() method = unwrap(api.put) @@ -532,7 +534,7 @@ class TestDocumentMetadataApi: assert status == 200 - def test_put_invalid_payload(self, app, patch_tenant): + def test_put_invalid_payload(self, app: Flask, patch_tenant): api = DocumentMetadataApi() method = unwrap(api.put) @@ -540,7 +542,7 @@ class TestDocumentMetadataApi: with pytest.raises(ValueError): method(api, "ds-1", "doc-1") - def test_put_invalid_doc_type(self, app, patch_tenant): + def test_put_invalid_doc_type(self, app: Flask, patch_tenant): api = DocumentMetadataApi() method = unwrap(api.put) @@ -559,7 +561,7 @@ class TestDocumentMetadataApi: class TestDocumentStatusApi: - def test_patch_success(self, app, patch_tenant, patch_dataset): + def test_patch_success(self, app: Flask, patch_tenant, patch_dataset): api = DocumentStatusApi() method = unwrap(api.patch) @@ -582,7 +584,7 @@ class TestDocumentStatusApi: assert status == 200 - def test_patch_invalid_action(self, app, patch_tenant, patch_dataset): + def test_patch_invalid_action(self, app: Flask, patch_tenant, patch_dataset): api = DocumentStatusApi() method = unwrap(api.patch) @@ -606,7 +608,7 @@ class TestDocumentStatusApi: class TestDocumentRetryApi: - def test_retry_archived_document_skipped(self, app, patch_tenant, patch_dataset): + def test_retry_archived_document_skipped(self, app: Flask, patch_tenant, patch_dataset): api = DocumentRetryApi() method = unwrap(api.post) @@ -634,7 +636,7 @@ class TestDocumentRetryApi: assert status == 204 retry_mock.assert_called_once_with("ds-1", []) - def test_retry_success(self, app, patch_tenant, patch_dataset): + def test_retry_success(self, app: Flask, patch_tenant, patch_dataset): api = DocumentRetryApi() method = unwrap(api.post) @@ -663,7 +665,7 @@ class TestDocumentRetryApi: assert status == 204 retry_mock.assert_called_once_with("ds-1", [document]) - def test_retry_skips_completed_document(self, app, patch_tenant, patch_dataset): + def test_retry_skips_completed_document(self, app: Flask, patch_tenant, patch_dataset): api = DocumentRetryApi() method = unwrap(api.post) @@ -690,7 +692,7 @@ class TestDocumentRetryApi: class TestDocumentPipelineExecutionLogApi: - def test_get_log_success(self, app, patch_tenant, patch_dataset): + def test_get_log_success(self, app: Flask, patch_tenant, patch_dataset): api = DocumentPipelineExecutionLogApi() method = unwrap(api.get) @@ -718,7 +720,7 @@ class TestDocumentPipelineExecutionLogApi: class TestDocumentGenerateSummaryApi: - def test_generate_summary_missing_documents(self, app, patch_tenant, patch_permission): + def test_generate_summary_missing_documents(self, app: Flask, patch_tenant, patch_permission): api = DocumentGenerateSummaryApi() method = unwrap(api.post) @@ -744,7 +746,7 @@ class TestDocumentGenerateSummaryApi: with pytest.raises(NotFound): method(api, "ds-1") - def test_generate_not_enabled(self, app, patch_tenant, patch_permission): + def test_generate_not_enabled(self, app: Flask, patch_tenant, patch_permission): api = DocumentGenerateSummaryApi() method = unwrap(api.post) @@ -763,7 +765,7 @@ class TestDocumentGenerateSummaryApi: with pytest.raises(ValueError): method(api, "ds-1") - def test_generate_summary_success_with_qa_skip(self, app, patch_tenant, patch_permission): + def test_generate_summary_success_with_qa_skip(self, app: Flask, patch_tenant, patch_permission): api = DocumentGenerateSummaryApi() method = unwrap(api.post) @@ -799,7 +801,7 @@ class TestDocumentGenerateSummaryApi: class TestDocumentSummaryStatusApi: - def test_get_success(self, app, patch_tenant, patch_permission): + def test_get_success(self, app: Flask, patch_tenant, patch_permission): api = DocumentSummaryStatusApi() method = unwrap(api.get) @@ -820,7 +822,7 @@ class TestDocumentSummaryStatusApi: class TestDocumentIndexingEstimateApi: - def test_indexing_estimate_file_not_found(self, app, patch_tenant): + def test_indexing_estimate_file_not_found(self, app: Flask, patch_tenant): api = DocumentIndexingEstimateApi() method = unwrap(api.get) @@ -844,7 +846,7 @@ class TestDocumentIndexingEstimateApi: with pytest.raises(NotFound): method(api, "ds-1", "doc-1") - def test_indexing_estimate_generic_exception(self, app, patch_tenant): + def test_indexing_estimate_generic_exception(self, app: Flask, patch_tenant): api = DocumentIndexingEstimateApi() method = unwrap(api.get) @@ -881,7 +883,7 @@ class TestDocumentIndexingEstimateApi: with pytest.raises(IndexingEstimateError): method(api, "ds-1", "doc-1") - def test_get_finished(self, app, patch_tenant): + def test_get_finished(self, app: Flask, patch_tenant): api = DocumentIndexingEstimateApi() method = unwrap(api.get) @@ -893,7 +895,7 @@ class TestDocumentIndexingEstimateApi: class TestDocumentBatchDownloadZipApi: - def test_post_no_documents(self, app, patch_tenant): + def test_post_no_documents(self, app: Flask, patch_tenant): api = DocumentBatchDownloadZipApi() method = unwrap(api.post) @@ -905,7 +907,7 @@ class TestDocumentBatchDownloadZipApi: class TestDatasetDocumentListApiDelete: - def test_delete_success(self, app, patch_tenant, patch_dataset): + def test_delete_success(self, app: Flask, patch_tenant, patch_dataset): """Test successful deletion of documents""" api = DatasetDocumentListApi() method = unwrap(api.delete) @@ -925,7 +927,7 @@ class TestDatasetDocumentListApiDelete: assert status == 204 - def test_delete_indexing_error(self, app, patch_tenant, patch_dataset): + def test_delete_indexing_error(self, app: Flask, patch_tenant, patch_dataset): """Test deletion with indexing error""" api = DatasetDocumentListApi() method = unwrap(api.delete) @@ -944,7 +946,7 @@ class TestDatasetDocumentListApiDelete: with pytest.raises(DocumentIndexingError): method(api, "ds-1") - def test_delete_dataset_not_found(self, app, patch_tenant): + def test_delete_dataset_not_found(self, app: Flask, patch_tenant): """Test deletion when dataset not found""" api = DatasetDocumentListApi() method = unwrap(api.delete) @@ -961,7 +963,7 @@ class TestDatasetDocumentListApiDelete: class TestDocumentBatchIndexingEstimateApi: - def test_batch_indexing_estimate_website(self, app, patch_tenant): + def test_batch_indexing_estimate_website(self, app: Flask, patch_tenant): api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -990,7 +992,7 @@ class TestDocumentBatchIndexingEstimateApi: assert status == 200 - def test_batch_indexing_estimate_notion(self, app, patch_tenant): + def test_batch_indexing_estimate_notion(self, app: Flask, patch_tenant): api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -1018,7 +1020,7 @@ class TestDocumentBatchIndexingEstimateApi: assert status == 200 - def test_batch_estimate_unsupported_datasource(self, app, patch_tenant): + def test_batch_estimate_unsupported_datasource(self, app: Flask, patch_tenant): api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -1033,7 +1035,7 @@ class TestDocumentBatchIndexingEstimateApi: with pytest.raises(ValueError): method(api, "ds-1", "batch-1") - def test_get_batch_estimate_invalid_batch(self, app, patch_tenant): + def test_get_batch_estimate_invalid_batch(self, app: Flask, patch_tenant): """Test batch estimation with invalid batch""" api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -1044,7 +1046,7 @@ class TestDocumentBatchIndexingEstimateApi: class TestDocumentBatchIndexingStatusApi: - def test_get_batch_status_invalid_batch(self, app, patch_tenant): + def test_get_batch_status_invalid_batch(self, app: Flask, patch_tenant): """Test batch status with invalid batch""" api = DocumentBatchIndexingStatusApi() method = unwrap(api.get) @@ -1055,7 +1057,7 @@ class TestDocumentBatchIndexingStatusApi: class TestDocumentIndexingStatusApi: - def test_get_status_document_not_found(self, app, patch_tenant): + def test_get_status_document_not_found(self, app: Flask, patch_tenant): """Test getting status for non-existent document""" api = DocumentIndexingStatusApi() method = unwrap(api.get) @@ -1066,7 +1068,7 @@ class TestDocumentIndexingStatusApi: class TestDocumentApiMetadata: - def test_get_with_only_option(self, app, patch_tenant): + def test_get_with_only_option(self, app: Flask, patch_tenant): """Test get with 'only' metadata option""" api = DocumentApi() method = unwrap(api.get) @@ -1085,7 +1087,7 @@ class TestDocumentApiMetadata: assert status == 200 - def test_get_with_without_option(self, app, patch_tenant): + def test_get_with_without_option(self, app: Flask, patch_tenant): """Test get with 'without' metadata option""" api = DocumentApi() method = unwrap(api.get) @@ -1106,7 +1108,7 @@ class TestDocumentApiMetadata: class TestDocumentGenerateSummaryApiSuccess: - def test_generate_not_enabled_high_quality(self, app, patch_tenant, patch_permission): + def test_generate_not_enabled_high_quality(self, app: Flask, patch_tenant, patch_permission): """Test summary generation on non-high-quality dataset""" api = DocumentGenerateSummaryApi() method = unwrap(api.post) @@ -1128,7 +1130,7 @@ class TestDocumentGenerateSummaryApiSuccess: class TestDocumentProcessingApiResume: - def test_resume_invalid_status(self, app, patch_tenant): + def test_resume_invalid_status(self, app: Flask, patch_tenant): """Test resume on non-paused document""" api = DocumentProcessingApi() method = unwrap(api.patch) @@ -1141,7 +1143,7 @@ class TestDocumentProcessingApiResume: class TestDocumentPermissionCases: - def test_document_batch_get_permission_denied(self, app, patch_tenant): + def test_document_batch_get_permission_denied(self, app: Flask, patch_tenant): api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -1159,7 +1161,7 @@ class TestDocumentPermissionCases: with pytest.raises(Forbidden): method(api, "ds-1", "batch-1") - def test_document_batch_get_documents_not_found(self, app, patch_tenant): + def test_document_batch_get_documents_not_found(self, app: Flask, patch_tenant): api = DocumentBatchIndexingEstimateApi() method = unwrap(api.get) @@ -1218,7 +1220,7 @@ class TestDocumentPermissionCases: with pytest.raises(Forbidden): method(api, "ds-1", "doc-1") - def test_process_rule_get_by_document_success(self, app, patch_tenant): + def test_process_rule_get_by_document_success(self, app: Flask, patch_tenant): api = GetProcessRuleApi() method = unwrap(api.get) @@ -1284,7 +1286,7 @@ class TestDocumentPermissionCases: class TestDocumentListAdvancedCases: - def test_document_list_with_multiple_sort_options(self, app, patch_tenant, patch_dataset, patch_permission): + def test_document_list_with_multiple_sort_options(self, app: Flask, patch_tenant, patch_dataset, patch_permission): """Test document list with different sort options""" api = DatasetDocumentListApi() method = unwrap(api.get) @@ -1310,7 +1312,7 @@ class TestDocumentListAdvancedCases: assert response["total"] == 1 - def test_document_metadata_with_schema_validation(self, app, patch_tenant): + def test_document_metadata_with_schema_validation(self, app: Flask, patch_tenant): """Test document metadata update with schema validation""" api = DocumentMetadataApi() method = unwrap(api.put) @@ -1342,7 +1344,7 @@ class TestDocumentListAdvancedCases: class TestDocumentIndexingEdgeCases: - def test_document_indexing_with_extraction_setting(self, app, patch_tenant): + def test_document_indexing_with_extraction_setting(self, app: Flask, patch_tenant): api = DocumentIndexingEstimateApi() method = unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/console/datasets/test_external.py b/api/tests/unit_tests/controllers/console/datasets/test_external.py index 7254bf7670..186b379cbc 100644 --- a/api/tests/unit_tests/controllers/console/datasets/test_external.py +++ b/api/tests/unit_tests/controllers/console/datasets/test_external.py @@ -292,7 +292,7 @@ class TestBedrockRetrievalApi: class TestExternalApiTemplateListApiAdvanced: - def test_post_duplicate_name_error(self, app, mock_auth, current_user): + def test_post_duplicate_name_error(self, app: Flask, mock_auth, current_user): api = ExternalApiTemplateListApi() method = unwrap(api.post) @@ -310,7 +310,7 @@ class TestExternalApiTemplateListApiAdvanced: with pytest.raises(DatasetNameDuplicateError): method(api) - def test_get_with_pagination(self, app, mock_auth, current_user): + def test_get_with_pagination(self, app: Flask, mock_auth, current_user): api = ExternalApiTemplateListApi() method = unwrap(api.get) @@ -331,7 +331,7 @@ class TestExternalApiTemplateListApiAdvanced: class TestExternalDatasetCreateApiAdvanced: - def test_create_forbidden(self, app, mock_auth, current_user): + def test_create_forbidden(self, app: Flask, mock_auth, current_user): """Test creating external dataset without permission""" api = ExternalDatasetCreateApi() method = unwrap(api.post) @@ -351,7 +351,7 @@ class TestExternalDatasetCreateApiAdvanced: class TestExternalKnowledgeHitTestingApiAdvanced: - def test_hit_testing_dataset_not_found(self, app, mock_auth, current_user): + def test_hit_testing_dataset_not_found(self, app: Flask, mock_auth, current_user): """Test hit testing on non-existent dataset""" api = ExternalKnowledgeHitTestingApi() method = unwrap(api.post) @@ -372,7 +372,7 @@ class TestExternalKnowledgeHitTestingApiAdvanced: with pytest.raises(NotFound): method(api, "ds-1") - def test_hit_testing_with_custom_retrieval_model(self, app, mock_auth, current_user): + def test_hit_testing_with_custom_retrieval_model(self, app: Flask, mock_auth, current_user): api = ExternalKnowledgeHitTestingApi() method = unwrap(api.post) @@ -402,7 +402,7 @@ class TestExternalKnowledgeHitTestingApiAdvanced: class TestBedrockRetrievalApiAdvanced: - def test_bedrock_retrieval_with_invalid_setting(self, app, mock_auth, current_user): + def test_bedrock_retrieval_with_invalid_setting(self, app: Flask, mock_auth, current_user): api = BedrockRetrievalApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/datasets/test_metadata.py b/api/tests/unit_tests/controllers/console/datasets/test_metadata.py index 4042190ff6..6322133536 100644 --- a/api/tests/unit_tests/controllers/console/datasets/test_metadata.py +++ b/api/tests/unit_tests/controllers/console/datasets/test_metadata.py @@ -82,7 +82,7 @@ def bypass_decorators(mocker: MockerFixture): class TestDatasetMetadataCreateApi: - def test_create_metadata_success(self, app, current_user, dataset, dataset_id): + def test_create_metadata_success(self, app: Flask, current_user, dataset, dataset_id): api = DatasetMetadataCreateApi() method = unwrap(api.post) @@ -125,7 +125,7 @@ class TestDatasetMetadataCreateApi: assert status == 201 assert result["name"] == "author" - def test_create_metadata_dataset_not_found(self, app, current_user, dataset_id): + def test_create_metadata_dataset_not_found(self, app: Flask, current_user, dataset_id): api = DatasetMetadataCreateApi() method = unwrap(api.post) @@ -162,7 +162,7 @@ class TestDatasetMetadataCreateApi: class TestDatasetMetadataGetApi: - def test_get_metadata_success(self, app, dataset, dataset_id): + def test_get_metadata_success(self, app: Flask, dataset, dataset_id): api = DatasetMetadataCreateApi() method = unwrap(api.get) @@ -184,7 +184,7 @@ class TestDatasetMetadataGetApi: assert status == 200 assert isinstance(result, list) - def test_get_metadata_dataset_not_found(self, app, dataset_id): + def test_get_metadata_dataset_not_found(self, app: Flask, dataset_id): api = DatasetMetadataCreateApi() method = unwrap(api.get) @@ -201,7 +201,7 @@ class TestDatasetMetadataGetApi: class TestDatasetMetadataApi: - def test_update_metadata_success(self, app, current_user, dataset, dataset_id, metadata_id): + def test_update_metadata_success(self, app: Flask, current_user, dataset, dataset_id, metadata_id): api = DatasetMetadataApi() method = unwrap(api.patch) @@ -239,7 +239,7 @@ class TestDatasetMetadataApi: assert status == 200 assert result["name"] == "updated-name" - def test_delete_metadata_success(self, app, current_user, dataset, dataset_id, metadata_id): + def test_delete_metadata_success(self, app: Flask, current_user, dataset, dataset_id, metadata_id): api = DatasetMetadataApi() method = unwrap(api.delete) @@ -289,7 +289,7 @@ class TestDatasetMetadataBuiltInFieldApi: class TestDatasetMetadataBuiltInFieldActionApi: - def test_enable_built_in_field(self, app, current_user, dataset, dataset_id): + def test_enable_built_in_field(self, app: Flask, current_user, dataset, dataset_id): api = DatasetMetadataBuiltInFieldActionApi() method = unwrap(api.post) @@ -320,7 +320,7 @@ class TestDatasetMetadataBuiltInFieldActionApi: class TestDocumentMetadataEditApi: - def test_update_document_metadata_success(self, app, current_user, dataset, dataset_id): + def test_update_document_metadata_success(self, app: Flask, current_user, dataset, dataset_id): api = DocumentMetadataEditApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/datasets/test_website.py b/api/tests/unit_tests/controllers/console/datasets/test_website.py index 9991a0d345..5c7b857c20 100644 --- a/api/tests/unit_tests/controllers/console/datasets/test_website.py +++ b/api/tests/unit_tests/controllers/console/datasets/test_website.py @@ -49,7 +49,7 @@ def bypass_auth_and_setup(mocker: MockerFixture): class TestWebsiteCrawlApi: - def test_crawl_success(self, app, mocker: MockerFixture): + def test_crawl_success(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlApi() method = unwrap(api.post) @@ -86,7 +86,7 @@ class TestWebsiteCrawlApi: assert status == 200 assert result["job_id"] == "job-1" - def test_crawl_invalid_payload(self, app, mocker: MockerFixture): + def test_crawl_invalid_payload(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlApi() method = unwrap(api.post) @@ -114,7 +114,7 @@ class TestWebsiteCrawlApi: with pytest.raises(WebsiteCrawlError, match="invalid payload"): method(api) - def test_crawl_service_error(self, app, mocker: MockerFixture): + def test_crawl_service_error(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlApi() method = unwrap(api.post) @@ -151,7 +151,7 @@ class TestWebsiteCrawlApi: class TestWebsiteCrawlStatusApi: - def test_get_status_success(self, app, mocker: MockerFixture): + def test_get_status_success(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlStatusApi() method = unwrap(api.get) @@ -182,7 +182,7 @@ class TestWebsiteCrawlStatusApi: assert status == 200 assert result["status"] == "completed" - def test_get_status_invalid_provider(self, app, mocker: MockerFixture): + def test_get_status_invalid_provider(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlStatusApi() method = unwrap(api.get) @@ -204,7 +204,7 @@ class TestWebsiteCrawlStatusApi: with pytest.raises(WebsiteCrawlError, match="invalid provider"): method(api, job_id) - def test_get_status_service_error(self, app, mocker: MockerFixture): + def test_get_status_service_error(self, app: Flask, mocker: MockerFixture): api = WebsiteCrawlStatusApi() method = unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/console/explore/test_audio.py b/api/tests/unit_tests/controllers/console/explore/test_audio.py index b4b57022e2..a6642f8582 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_audio.py +++ b/api/tests/unit_tests/controllers/console/explore/test_audio.py @@ -2,6 +2,7 @@ from io import BytesIO from unittest.mock import MagicMock, patch import pytest +from flask import Flask from werkzeug.exceptions import InternalServerError import controllers.console.explore.audio as audio_module @@ -52,7 +53,7 @@ class TestChatAudioApi: self.api = audio_module.ChatAudioApi() self.method = unwrap(self.api.post) - def test_post_success(self, app, installed_app, audio_file): + def test_post_success(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -69,7 +70,7 @@ class TestChatAudioApi: assert resp == {"text": "ok"} - def test_app_unavailable(self, app, installed_app, audio_file): + def test_app_unavailable(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -85,7 +86,7 @@ class TestChatAudioApi: with pytest.raises(AppUnavailableError): self.method(installed_app) - def test_no_audio_uploaded(self, app, installed_app, audio_file): + def test_no_audio_uploaded(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -101,7 +102,7 @@ class TestChatAudioApi: with pytest.raises(NoAudioUploadedError): self.method(installed_app) - def test_audio_too_large(self, app, installed_app, audio_file): + def test_audio_too_large(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -117,7 +118,7 @@ class TestChatAudioApi: with pytest.raises(AudioTooLargeError): self.method(installed_app) - def test_provider_quota_exceeded(self, app, installed_app, audio_file): + def test_provider_quota_exceeded(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -133,7 +134,7 @@ class TestChatAudioApi: with pytest.raises(ProviderQuotaExceededError): self.method(installed_app) - def test_unknown_exception(self, app, installed_app, audio_file): + def test_unknown_exception(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -149,7 +150,7 @@ class TestChatAudioApi: with pytest.raises(InternalServerError): self.method(installed_app) - def test_unsupported_audio_type(self, app, installed_app, audio_file): + def test_unsupported_audio_type(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -165,7 +166,7 @@ class TestChatAudioApi: with pytest.raises(audio_module.UnsupportedAudioTypeError): self.method(installed_app) - def test_provider_not_support_speech_to_text(self, app, installed_app, audio_file): + def test_provider_not_support_speech_to_text(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -181,7 +182,7 @@ class TestChatAudioApi: with pytest.raises(audio_module.ProviderNotSupportSpeechToTextError): self.method(installed_app) - def test_provider_not_initialized(self, app, installed_app, audio_file): + def test_provider_not_initialized(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -197,7 +198,7 @@ class TestChatAudioApi: with pytest.raises(ProviderNotInitializeError): self.method(installed_app) - def test_model_currently_not_supported(self, app, installed_app, audio_file): + def test_model_currently_not_supported(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -213,7 +214,7 @@ class TestChatAudioApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): self.method(installed_app) - def test_invoke_error_asr(self, app, installed_app, audio_file): + def test_invoke_error_asr(self, app: Flask, installed_app, audio_file): with ( app.test_request_context( "/", @@ -235,7 +236,7 @@ class TestChatTextApi: self.api = audio_module.ChatTextApi() self.method = unwrap(self.api.post) - def test_post_success(self, app, installed_app): + def test_post_success(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -251,7 +252,7 @@ class TestChatTextApi: assert resp == {"audio": "ok"} - def test_provider_not_initialized(self, app, installed_app): + def test_provider_not_initialized(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -266,7 +267,7 @@ class TestChatTextApi: with pytest.raises(ProviderNotInitializeError): self.method(installed_app) - def test_model_not_supported(self, app, installed_app): + def test_model_not_supported(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -281,7 +282,7 @@ class TestChatTextApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): self.method(installed_app) - def test_invoke_error(self, app, installed_app): + def test_invoke_error(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -296,7 +297,7 @@ class TestChatTextApi: with pytest.raises(CompletionRequestError): self.method(installed_app) - def test_unknown_exception(self, app, installed_app): + def test_unknown_exception(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -311,7 +312,7 @@ class TestChatTextApi: with pytest.raises(InternalServerError): self.method(installed_app) - def test_app_unavailable_tts(self, app, installed_app): + def test_app_unavailable_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -326,7 +327,7 @@ class TestChatTextApi: with pytest.raises(AppUnavailableError): self.method(installed_app) - def test_no_audio_uploaded_tts(self, app, installed_app): + def test_no_audio_uploaded_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -341,7 +342,7 @@ class TestChatTextApi: with pytest.raises(NoAudioUploadedError): self.method(installed_app) - def test_audio_too_large_tts(self, app, installed_app): + def test_audio_too_large_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -356,7 +357,7 @@ class TestChatTextApi: with pytest.raises(AudioTooLargeError): self.method(installed_app) - def test_unsupported_audio_type_tts(self, app, installed_app): + def test_unsupported_audio_type_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -371,7 +372,7 @@ class TestChatTextApi: with pytest.raises(audio_module.UnsupportedAudioTypeError): self.method(installed_app) - def test_provider_not_support_speech_to_text_tts(self, app, installed_app): + def test_provider_not_support_speech_to_text_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", @@ -386,7 +387,7 @@ class TestChatTextApi: with pytest.raises(audio_module.ProviderNotSupportSpeechToTextError): self.method(installed_app) - def test_quota_exceeded_tts(self, app, installed_app): + def test_quota_exceeded_tts(self, app: Flask, installed_app): with ( app.test_request_context( "/", diff --git a/api/tests/unit_tests/controllers/console/explore/test_completion.py b/api/tests/unit_tests/controllers/console/explore/test_completion.py index 1dd16f3c59..eac93b1c46 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_completion.py +++ b/api/tests/unit_tests/controllers/console/explore/test_completion.py @@ -1,6 +1,7 @@ from unittest.mock import MagicMock, PropertyMock, patch import pytest +from flask import Flask from werkzeug.exceptions import InternalServerError import controllers.console.explore.completion as completion_module @@ -51,7 +52,7 @@ def payload_patch(payload_data): class TestCompletionApi: - def test_post_success(self, app, completion_app, user, payload_patch): + def test_post_success(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -83,7 +84,7 @@ class TestCompletionApi: with pytest.raises(NotCompletionAppError): method(installed_app) - def test_conversation_completed(self, app, completion_app, user, payload_patch): + def test_conversation_completed(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -100,7 +101,7 @@ class TestCompletionApi: with pytest.raises(ConversationCompletedError): method(completion_app) - def test_internal_error(self, app, completion_app, user, payload_patch): + def test_internal_error(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -117,7 +118,7 @@ class TestCompletionApi: with pytest.raises(InternalServerError): method(completion_app) - def test_conversation_not_exists(self, app, completion_app, user, payload_patch): + def test_conversation_not_exists(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -134,7 +135,7 @@ class TestCompletionApi: with pytest.raises(completion_module.NotFound): method(completion_app) - def test_app_unavailable(self, app, completion_app, user, payload_patch): + def test_app_unavailable(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -151,7 +152,7 @@ class TestCompletionApi: with pytest.raises(completion_module.AppUnavailableError): method(completion_app) - def test_provider_not_initialized(self, app, completion_app, user, payload_patch): + def test_provider_not_initialized(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -168,7 +169,7 @@ class TestCompletionApi: with pytest.raises(completion_module.ProviderNotInitializeError): method(completion_app) - def test_quota_exceeded(self, app, completion_app, user, payload_patch): + def test_quota_exceeded(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -185,7 +186,7 @@ class TestCompletionApi: with pytest.raises(completion_module.ProviderQuotaExceededError): method(completion_app) - def test_model_not_supported(self, app, completion_app, user, payload_patch): + def test_model_not_supported(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -202,7 +203,7 @@ class TestCompletionApi: with pytest.raises(completion_module.ProviderModelCurrentlyNotSupportError): method(completion_app) - def test_invoke_error(self, app, completion_app, user, payload_patch): + def test_invoke_error(self, app: Flask, completion_app, user, payload_patch): api = completion_module.CompletionApi() method = unwrap(api.post) @@ -247,7 +248,7 @@ class TestCompletionStopApi: class TestChatApi: - def test_post_success(self, app, chat_app, user, payload_patch): + def test_post_success(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -279,7 +280,7 @@ class TestChatApi: with pytest.raises(NotChatAppError): method(installed_app) - def test_rate_limit_error(self, app, chat_app, user, payload_patch): + def test_rate_limit_error(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -296,7 +297,7 @@ class TestChatApi: with pytest.raises(InvokeRateLimitHttpError): method(chat_app) - def test_conversation_completed_chat(self, app, chat_app, user, payload_patch): + def test_conversation_completed_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -313,7 +314,7 @@ class TestChatApi: with pytest.raises(ConversationCompletedError): method(chat_app) - def test_conversation_not_exists_chat(self, app, chat_app, user, payload_patch): + def test_conversation_not_exists_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -330,7 +331,7 @@ class TestChatApi: with pytest.raises(completion_module.NotFound): method(chat_app) - def test_app_unavailable_chat(self, app, chat_app, user, payload_patch): + def test_app_unavailable_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -347,7 +348,7 @@ class TestChatApi: with pytest.raises(completion_module.AppUnavailableError): method(chat_app) - def test_provider_not_initialized_chat(self, app, chat_app, user, payload_patch): + def test_provider_not_initialized_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -364,7 +365,7 @@ class TestChatApi: with pytest.raises(completion_module.ProviderNotInitializeError): method(chat_app) - def test_quota_exceeded_chat(self, app, chat_app, user, payload_patch): + def test_quota_exceeded_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -381,7 +382,7 @@ class TestChatApi: with pytest.raises(completion_module.ProviderQuotaExceededError): method(chat_app) - def test_model_not_supported_chat(self, app, chat_app, user, payload_patch): + def test_model_not_supported_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -398,7 +399,7 @@ class TestChatApi: with pytest.raises(completion_module.ProviderModelCurrentlyNotSupportError): method(chat_app) - def test_invoke_error_chat(self, app, chat_app, user, payload_patch): + def test_invoke_error_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) @@ -415,7 +416,7 @@ class TestChatApi: with pytest.raises(completion_module.CompletionRequestError): method(chat_app) - def test_internal_error_chat(self, app, chat_app, user, payload_patch): + def test_internal_error_chat(self, app: Flask, chat_app, user, payload_patch): api = completion_module.ChatApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/explore/test_installed_app.py b/api/tests/unit_tests/controllers/console/explore/test_installed_app.py index 93652e75d2..ec82803be4 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_installed_app.py +++ b/api/tests/unit_tests/controllers/console/explore/test_installed_app.py @@ -2,6 +2,7 @@ from datetime import datetime from unittest.mock import MagicMock, PropertyMock, patch import pytest +from flask import Flask from werkzeug.exceptions import BadRequest, Forbidden, NotFound import controllers.console.explore.installed_app as module @@ -51,7 +52,7 @@ def payload_patch(): class TestInstalledAppsListApi: - def test_get_installed_apps(self, app, current_user, tenant_id, installed_app): + def test_get_installed_apps(self, app: Flask, current_user, tenant_id, installed_app): api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -75,7 +76,7 @@ class TestInstalledAppsListApi: assert result["installed_apps"][0]["editable"] is True assert result["installed_apps"][0]["uninstallable"] is False - def test_get_installed_apps_with_app_id_filter(self, app, current_user, tenant_id): + def test_get_installed_apps_with_app_id_filter(self, app: Flask, current_user, tenant_id): api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -97,7 +98,7 @@ class TestInstalledAppsListApi: assert result == {"installed_apps": []} - def test_get_installed_apps_with_webapp_auth_enabled(self, app, current_user, tenant_id, installed_app): + def test_get_installed_apps_with_webapp_auth_enabled(self, app: Flask, current_user, tenant_id, installed_app): """Test filtering when webapp_auth is enabled.""" api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -133,7 +134,7 @@ class TestInstalledAppsListApi: assert len(result["installed_apps"]) == 1 - def test_get_installed_apps_with_webapp_auth_user_denied(self, app, current_user, tenant_id, installed_app): + def test_get_installed_apps_with_webapp_auth_user_denied(self, app: Flask, current_user, tenant_id, installed_app): """Test filtering when user doesn't have access.""" api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -169,7 +170,7 @@ class TestInstalledAppsListApi: assert result["installed_apps"] == [] - def test_get_installed_apps_with_sso_verified_access(self, app, current_user, tenant_id, installed_app): + def test_get_installed_apps_with_sso_verified_access(self, app: Flask, current_user, tenant_id, installed_app): """Test that sso_verified access mode apps are skipped in filtering.""" api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -200,7 +201,7 @@ class TestInstalledAppsListApi: assert len(result["installed_apps"]) == 0 - def test_get_installed_apps_filters_null_apps(self, app, current_user, tenant_id): + def test_get_installed_apps_filters_null_apps(self, app: Flask, current_user, tenant_id): """Test that installed apps with null app are filtered out.""" api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -226,7 +227,7 @@ class TestInstalledAppsListApi: assert result["installed_apps"] == [] - def test_get_installed_apps_current_tenant_none(self, app, tenant_id, installed_app): + def test_get_installed_apps_current_tenant_none(self, app: Flask, tenant_id, installed_app): """Test error when current_user.current_tenant is None.""" api = module.InstalledAppsListApi() method = unwrap(api.get) @@ -247,7 +248,7 @@ class TestInstalledAppsListApi: class TestInstalledAppsCreateApi: - def test_post_success(self, app, tenant_id, payload_patch): + def test_post_success(self, app: Flask, tenant_id, payload_patch): api = module.InstalledAppsListApi() method = unwrap(api.post) @@ -276,7 +277,7 @@ class TestInstalledAppsCreateApi: assert result == {"message": "App installed successfully"} assert recommended.install_count == 1 - def test_post_recommended_not_found(self, app, payload_patch): + def test_post_recommended_not_found(self, app: Flask, payload_patch): api = module.InstalledAppsListApi() method = unwrap(api.post) @@ -291,7 +292,7 @@ class TestInstalledAppsCreateApi: with pytest.raises(NotFound): method(api) - def test_post_app_not_public(self, app, tenant_id, payload_patch): + def test_post_app_not_public(self, app: Flask, tenant_id, payload_patch): api = module.InstalledAppsListApi() method = unwrap(api.post) @@ -315,7 +316,7 @@ class TestInstalledAppsCreateApi: class TestInstalledAppApi: - def test_delete_success(self, tenant_id, installed_app): + def test_delete_success(self, tenant_id: str, installed_app): api = module.InstalledAppApi() method = unwrap(api.delete) @@ -328,7 +329,7 @@ class TestInstalledAppApi: assert status == 204 assert resp["result"] == "success" - def test_delete_owned_by_current_tenant(self, tenant_id): + def test_delete_owned_by_current_tenant(self, tenant_id: str): api = module.InstalledAppApi() method = unwrap(api.delete) @@ -338,7 +339,7 @@ class TestInstalledAppApi: with pytest.raises(BadRequest): method(installed_app) - def test_patch_update_pin(self, app, payload_patch, installed_app): + def test_patch_update_pin(self, app: Flask, payload_patch, installed_app): api = module.InstalledAppApi() method = unwrap(api.patch) @@ -352,7 +353,7 @@ class TestInstalledAppApi: assert installed_app.is_pinned is True assert result["result"] == "success" - def test_patch_no_change(self, app, payload_patch, installed_app): + def test_patch_no_change(self, app: Flask, payload_patch, installed_app): api = module.InstalledAppApi() method = unwrap(api.patch) diff --git a/api/tests/unit_tests/controllers/console/explore/test_saved_message.py b/api/tests/unit_tests/controllers/console/explore/test_saved_message.py index 71241890e9..49e5695e60 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_saved_message.py +++ b/api/tests/unit_tests/controllers/console/explore/test_saved_message.py @@ -82,7 +82,7 @@ class TestSavedMessageListApi: with pytest.raises(NotCompletionAppError): method(installed_app) - def test_post_success(self, app, payload_patch): + def test_post_success(self, app: Flask, payload_patch): api = module.SavedMessageListApi() method = unwrap(api.post) @@ -102,7 +102,7 @@ class TestSavedMessageListApi: save_mock.assert_called_once() assert result == {"result": "success"} - def test_post_message_not_exists(self, app, payload_patch): + def test_post_message_not_exists(self, app: Flask, payload_patch): api = module.SavedMessageListApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/explore/test_trial.py b/api/tests/unit_tests/controllers/console/explore/test_trial.py index 82a063307b..641209d1de 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_trial.py +++ b/api/tests/unit_tests/controllers/console/explore/test_trial.py @@ -102,7 +102,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(NotWorkflowAppError): method(api, MagicMock(mode=AppMode.CHAT)) - def test_success(self, app, trial_app_workflow, account): + def test_success(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -116,7 +116,7 @@ class TestTrialAppWorkflowRunApi: assert result is not None - def test_workflow_provider_not_init(self, app, trial_app_workflow, account): + def test_workflow_provider_not_init(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -132,7 +132,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_workflow) - def test_workflow_quota_exceeded(self, app, trial_app_workflow, account): + def test_workflow_quota_exceeded(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -148,7 +148,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(ProviderQuotaExceededError): method(api, trial_app_workflow) - def test_workflow_model_not_support(self, app, trial_app_workflow, account): + def test_workflow_model_not_support(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -164,7 +164,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): method(api, trial_app_workflow) - def test_workflow_invoke_error(self, app, trial_app_workflow, account): + def test_workflow_invoke_error(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -180,7 +180,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(CompletionRequestError): method(api, trial_app_workflow) - def test_workflow_rate_limit_error(self, app, trial_app_workflow, account): + def test_workflow_rate_limit_error(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -196,7 +196,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(InvokeRateLimitHttpError): method(api, trial_app_workflow) - def test_workflow_value_error(self, app, trial_app_workflow, account): + def test_workflow_value_error(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -212,7 +212,7 @@ class TestTrialAppWorkflowRunApi: with pytest.raises(ValueError): method(api, trial_app_workflow) - def test_workflow_generic_exception(self, app, trial_app_workflow, account): + def test_workflow_generic_exception(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowRunApi() method = unwrap(api.post) @@ -238,7 +238,7 @@ class TestTrialChatApi: with pytest.raises(NotChatAppError): method(api, MagicMock(mode="completion")) - def test_success(self, app, trial_app_chat, account): + def test_success(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -252,7 +252,7 @@ class TestTrialChatApi: assert result is not None - def test_chat_conversation_not_exists(self, app, trial_app_chat, account): + def test_chat_conversation_not_exists(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -268,7 +268,7 @@ class TestTrialChatApi: with pytest.raises(NotFound): method(api, trial_app_chat) - def test_chat_conversation_completed(self, app, trial_app_chat, account): + def test_chat_conversation_completed(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -284,7 +284,7 @@ class TestTrialChatApi: with pytest.raises(ConversationCompletedError): method(api, trial_app_chat) - def test_chat_app_config_broken(self, app, trial_app_chat, account): + def test_chat_app_config_broken(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -300,7 +300,7 @@ class TestTrialChatApi: with pytest.raises(AppUnavailableError): method(api, trial_app_chat) - def test_chat_provider_not_init(self, app, trial_app_chat, account): + def test_chat_provider_not_init(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -316,7 +316,7 @@ class TestTrialChatApi: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_chat) - def test_chat_quota_exceeded(self, app, trial_app_chat, account): + def test_chat_quota_exceeded(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -332,7 +332,7 @@ class TestTrialChatApi: with pytest.raises(ProviderQuotaExceededError): method(api, trial_app_chat) - def test_chat_model_not_support(self, app, trial_app_chat, account): + def test_chat_model_not_support(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -348,7 +348,7 @@ class TestTrialChatApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): method(api, trial_app_chat) - def test_chat_invoke_error(self, app, trial_app_chat, account): + def test_chat_invoke_error(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -364,7 +364,7 @@ class TestTrialChatApi: with pytest.raises(CompletionRequestError): method(api, trial_app_chat) - def test_chat_rate_limit_error(self, app, trial_app_chat, account): + def test_chat_rate_limit_error(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -380,7 +380,7 @@ class TestTrialChatApi: with pytest.raises(InvokeRateLimitHttpError): method(api, trial_app_chat) - def test_chat_value_error(self, app, trial_app_chat, account): + def test_chat_value_error(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -396,7 +396,7 @@ class TestTrialChatApi: with pytest.raises(ValueError): method(api, trial_app_chat) - def test_chat_generic_exception(self, app, trial_app_chat, account): + def test_chat_generic_exception(self, app: Flask, trial_app_chat, account): api = module.TrialChatApi() method = unwrap(api.post) @@ -422,7 +422,7 @@ class TestTrialCompletionApi: with pytest.raises(NotCompletionAppError): method(api, MagicMock(mode=AppMode.CHAT)) - def test_success(self, app, trial_app_completion, account): + def test_success(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -436,7 +436,7 @@ class TestTrialCompletionApi: assert result is not None - def test_completion_app_config_broken(self, app, trial_app_completion, account): + def test_completion_app_config_broken(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -452,7 +452,7 @@ class TestTrialCompletionApi: with pytest.raises(AppUnavailableError): method(api, trial_app_completion) - def test_completion_provider_not_init(self, app, trial_app_completion, account): + def test_completion_provider_not_init(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -468,7 +468,7 @@ class TestTrialCompletionApi: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_completion) - def test_completion_quota_exceeded(self, app, trial_app_completion, account): + def test_completion_quota_exceeded(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -484,7 +484,7 @@ class TestTrialCompletionApi: with pytest.raises(ProviderQuotaExceededError): method(api, trial_app_completion) - def test_completion_model_not_support(self, app, trial_app_completion, account): + def test_completion_model_not_support(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -500,7 +500,7 @@ class TestTrialCompletionApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): method(api, trial_app_completion) - def test_completion_invoke_error(self, app, trial_app_completion, account): + def test_completion_invoke_error(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -516,7 +516,7 @@ class TestTrialCompletionApi: with pytest.raises(CompletionRequestError): method(api, trial_app_completion) - def test_completion_rate_limit_error(self, app, trial_app_completion, account): + def test_completion_rate_limit_error(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -532,7 +532,7 @@ class TestTrialCompletionApi: with pytest.raises(InternalServerError): method(api, trial_app_completion) - def test_completion_value_error(self, app, trial_app_completion, account): + def test_completion_value_error(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -548,7 +548,7 @@ class TestTrialCompletionApi: with pytest.raises(ValueError): method(api, trial_app_completion) - def test_completion_generic_exception(self, app, trial_app_completion, account): + def test_completion_generic_exception(self, app: Flask, trial_app_completion, account): api = module.TrialCompletionApi() method = unwrap(api.post) @@ -574,7 +574,7 @@ class TestTrialMessageSuggestedQuestionApi: with pytest.raises(NotChatAppError): method(MagicMock(mode="completion"), str(uuid4())) - def test_success(self, app, trial_app_chat, account): + def test_success(self, app: Flask, trial_app_chat, account): api = module.TrialMessageSuggestedQuestionApi() method = unwrap(api.get) @@ -591,7 +591,7 @@ class TestTrialMessageSuggestedQuestionApi: assert result == {"data": ["q1", "q2"]} - def test_conversation_not_exists(self, app, trial_app_chat, account): + def test_conversation_not_exists(self, app: Flask, trial_app_chat, account): api = module.TrialMessageSuggestedQuestionApi() method = unwrap(api.get) @@ -643,7 +643,7 @@ class TestTrialAppParameterApi: class TestTrialChatAudioApi: - def test_success(self, app, trial_app_chat, account): + def test_success(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -662,7 +662,7 @@ class TestTrialChatAudioApi: assert result == {"text": "hello"} - def test_app_config_broken(self, app, trial_app_chat, account): + def test_app_config_broken(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -683,7 +683,7 @@ class TestTrialChatAudioApi: with pytest.raises(module.AppUnavailableError): method(api, trial_app_chat) - def test_no_audio_uploaded(self, app, trial_app_chat, account): + def test_no_audio_uploaded(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -704,7 +704,7 @@ class TestTrialChatAudioApi: with pytest.raises(module.NoAudioUploadedError): method(api, trial_app_chat) - def test_audio_too_large(self, app, trial_app_chat, account): + def test_audio_too_large(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -725,7 +725,7 @@ class TestTrialChatAudioApi: with pytest.raises(module.AudioTooLargeError): method(api, trial_app_chat) - def test_unsupported_audio_type(self, app, trial_app_chat, account): + def test_unsupported_audio_type(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -746,7 +746,7 @@ class TestTrialChatAudioApi: with pytest.raises(module.UnsupportedAudioTypeError): method(api, trial_app_chat) - def test_provider_not_support_tts(self, app, trial_app_chat, account): + def test_provider_not_support_tts(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -767,7 +767,7 @@ class TestTrialChatAudioApi: with pytest.raises(module.ProviderNotSupportSpeechToTextError): method(api, trial_app_chat) - def test_provider_not_init(self, app, trial_app_chat, account): + def test_provider_not_init(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -784,7 +784,7 @@ class TestTrialChatAudioApi: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_chat) - def test_quota_exceeded(self, app, trial_app_chat, account): + def test_quota_exceeded(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -803,7 +803,7 @@ class TestTrialChatAudioApi: class TestTrialChatTextApi: - def test_success(self, app, trial_app_chat, account): + def test_success(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -817,7 +817,7 @@ class TestTrialChatTextApi: assert result == {"audio": "base64_data"} - def test_app_config_broken(self, app, trial_app_chat, account): + def test_app_config_broken(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -833,7 +833,7 @@ class TestTrialChatTextApi: with pytest.raises(module.AppUnavailableError): method(api, trial_app_chat) - def test_provider_not_support(self, app, trial_app_chat, account): + def test_provider_not_support(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -849,7 +849,7 @@ class TestTrialChatTextApi: with pytest.raises(module.ProviderNotSupportSpeechToTextError): method(api, trial_app_chat) - def test_audio_too_large(self, app, trial_app_chat, account): + def test_audio_too_large(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -865,7 +865,7 @@ class TestTrialChatTextApi: with pytest.raises(module.AudioTooLargeError): method(api, trial_app_chat) - def test_no_audio_uploaded(self, app, trial_app_chat, account): + def test_no_audio_uploaded(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -881,7 +881,7 @@ class TestTrialChatTextApi: with pytest.raises(module.NoAudioUploadedError): method(api, trial_app_chat) - def test_provider_not_init(self, app, trial_app_chat, account): + def test_provider_not_init(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -893,7 +893,7 @@ class TestTrialChatTextApi: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_chat) - def test_quota_exceeded(self, app, trial_app_chat, account): + def test_quota_exceeded(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -905,7 +905,7 @@ class TestTrialChatTextApi: with pytest.raises(ProviderQuotaExceededError): method(api, trial_app_chat) - def test_model_not_support(self, app, trial_app_chat, account): + def test_model_not_support(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -917,7 +917,7 @@ class TestTrialChatTextApi: with pytest.raises(ProviderModelCurrentlyNotSupportError): method(api, trial_app_chat) - def test_invoke_error(self, app, trial_app_chat, account): + def test_invoke_error(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -931,7 +931,7 @@ class TestTrialChatTextApi: class TestTrialAppWorkflowTaskStopApi: - def test_not_workflow_app(self, app, trial_app_chat): + def test_not_workflow_app(self, app: Flask, trial_app_chat): api = module.TrialAppWorkflowTaskStopApi() method = unwrap(api.post) @@ -939,7 +939,7 @@ class TestTrialAppWorkflowTaskStopApi: with pytest.raises(NotWorkflowAppError): method(api, trial_app_chat, str(uuid4())) - def test_success(self, app, trial_app_workflow, account): + def test_success(self, app: Flask, trial_app_workflow, account): api = module.TrialAppWorkflowTaskStopApi() method = unwrap(api.post) @@ -1009,7 +1009,7 @@ class TestTrialSitApi: class TestTrialChatAudioApiExceptionHandlers: - def test_provider_not_init(self, app, trial_app_chat, account): + def test_provider_not_init(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -1030,7 +1030,7 @@ class TestTrialChatAudioApiExceptionHandlers: with pytest.raises(ProviderNotInitializeError): method(api, trial_app_chat) - def test_quota_exceeded(self, app, trial_app_chat, account): + def test_quota_exceeded(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -1051,7 +1051,7 @@ class TestTrialChatAudioApiExceptionHandlers: with pytest.raises(ProviderQuotaExceededError): method(api, trial_app_chat) - def test_invoke_error(self, app, trial_app_chat, account): + def test_invoke_error(self, app: Flask, trial_app_chat, account): api = module.TrialChatAudioApi() method = unwrap(api.post) @@ -1074,7 +1074,7 @@ class TestTrialChatAudioApiExceptionHandlers: class TestTrialChatTextApiExceptionHandlers: - def test_app_config_broken(self, app, trial_app_chat, account): + def test_app_config_broken(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) @@ -1090,7 +1090,7 @@ class TestTrialChatTextApiExceptionHandlers: with pytest.raises(module.AppUnavailableError): method(api, trial_app_chat) - def test_unsupported_audio_type(self, app, trial_app_chat, account): + def test_unsupported_audio_type(self, app: Flask, trial_app_chat, account): api = module.TrialChatTextApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/explore/test_workflow.py b/api/tests/unit_tests/controllers/console/explore/test_workflow.py index 445f887fd3..3a01925204 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_workflow.py +++ b/api/tests/unit_tests/controllers/console/explore/test_workflow.py @@ -57,7 +57,7 @@ def payload(): class TestInstalledAppWorkflowRunApi: - def test_not_workflow_app(self, app, non_workflow_installed_app): + def test_not_workflow_app(self, app: Flask, non_workflow_installed_app): api = InstalledAppWorkflowRunApi() method = unwrap(api.post) @@ -71,7 +71,7 @@ class TestInstalledAppWorkflowRunApi: with pytest.raises(NotWorkflowAppError): method(non_workflow_installed_app) - def test_success(self, app, installed_workflow_app, user, payload): + def test_success(self, app: Flask, installed_workflow_app, user, payload): api = InstalledAppWorkflowRunApi() method = unwrap(api.post) @@ -91,7 +91,7 @@ class TestInstalledAppWorkflowRunApi: generate_mock.assert_called_once() assert result is not None - def test_rate_limit_error(self, app, installed_workflow_app, user, payload): + def test_rate_limit_error(self, app: Flask, installed_workflow_app, user, payload): api = InstalledAppWorkflowRunApi() method = unwrap(api.post) @@ -109,7 +109,7 @@ class TestInstalledAppWorkflowRunApi: with pytest.raises(InvokeRateLimitHttpError): method(installed_workflow_app) - def test_unexpected_exception(self, app, installed_workflow_app, user, payload): + def test_unexpected_exception(self, app: Flask, installed_workflow_app, user, payload): api = InstalledAppWorkflowRunApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/tag/test_tags.py b/api/tests/unit_tests/controllers/console/tag/test_tags.py index b44706c566..f4916f013c 100644 --- a/api/tests/unit_tests/controllers/console/tag/test_tags.py +++ b/api/tests/unit_tests/controllers/console/tag/test_tags.py @@ -101,7 +101,7 @@ class TestTagListApi: assert status == 200 assert result == [{"id": "1", "name": "tag", "type": "knowledge", "binding_count": "1"}] - def test_post_success(self, app, admin_user, tag, payload_patch): + def test_post_success(self, app: Flask, admin_user, tag, payload_patch): api = TagListApi() method = unwrap(api.post) @@ -144,7 +144,7 @@ class TestTagListApi: class TestTagUpdateDeleteApi: - def test_patch_success(self, app, admin_user, tag, payload_patch): + def test_patch_success(self, app: Flask, admin_user, tag, payload_patch): api = TagUpdateDeleteApi() method = unwrap(api.patch) @@ -191,7 +191,7 @@ class TestTagUpdateDeleteApi: with pytest.raises(Forbidden): method(api, "tag-1") - def test_delete_success(self, app, admin_user): + def test_delete_success(self, app: Flask, admin_user): api = TagUpdateDeleteApi() method = unwrap(api.delete) @@ -210,7 +210,7 @@ class TestTagUpdateDeleteApi: class TestTagBindingCollectionApi: - def test_create_success(self, app, admin_user, payload_patch): + def test_create_success(self, app: Flask, admin_user, payload_patch): api = TagBindingCollectionApi() method = unwrap(api.post) @@ -252,7 +252,7 @@ class TestTagBindingCollectionApi: class TestTagBindingRemoveApi: - def test_remove_success(self, app, admin_user, payload_patch): + def test_remove_success(self, app: Flask, admin_user, payload_patch): api = TagBindingRemoveApi() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/test_files.py b/api/tests/unit_tests/controllers/console/test_files.py index acae081b98..9274f6cf61 100644 --- a/api/tests/unit_tests/controllers/console/test_files.py +++ b/api/tests/unit_tests/controllers/console/test_files.py @@ -95,7 +95,7 @@ class TestFileApiGet: class TestFileApiPost: - def test_no_file_uploaded(self, app, mock_account_context): + def test_no_file_uploaded(self, app: Flask, mock_account_context): api = FileApi() post_method = unwrap(api.post) @@ -103,7 +103,7 @@ class TestFileApiPost: with pytest.raises(NoFileUploadedError): post_method(api) - def test_too_many_files(self, app, mock_account_context): + def test_too_many_files(self, app: Flask, mock_account_context): api = FileApi() post_method = unwrap(api.post) @@ -120,7 +120,7 @@ class TestFileApiPost: with pytest.raises(TooManyFilesError): post_method(api) - def test_filename_missing(self, app, mock_account_context): + def test_filename_missing(self, app: Flask, mock_account_context): api = FileApi() post_method = unwrap(api.post) @@ -132,7 +132,7 @@ class TestFileApiPost: with pytest.raises(FilenameNotExistsError): post_method(api) - def test_dataset_upload_without_permission(self, app, mock_current_user): + def test_dataset_upload_without_permission(self, app: Flask, mock_current_user): mock_current_user.is_dataset_editor = False with patch( @@ -151,7 +151,7 @@ class TestFileApiPost: with pytest.raises(Forbidden): post_method(api) - def test_successful_upload(self, app, mock_account_context, mock_file_service): + def test_successful_upload(self, app: Flask, mock_account_context, mock_file_service): api = FileApi() post_method = unwrap(api.post) @@ -185,7 +185,7 @@ class TestFileApiPost: assert response["id"] == "file-id-123" assert response["name"] == "test.txt" - def test_upload_with_invalid_source(self, app, mock_account_context, mock_file_service): + def test_upload_with_invalid_source(self, app: Flask, mock_account_context, mock_file_service): """Test that invalid source parameter gets normalized to None""" api = FileApi() post_method = unwrap(api.post) @@ -225,7 +225,7 @@ class TestFileApiPost: call_kwargs = mock_file_service.upload_file.call_args[1] assert call_kwargs["source"] is None - def test_file_too_large_error(self, app, mock_account_context, mock_file_service): + def test_file_too_large_error(self, app: Flask, mock_account_context, mock_file_service): api = FileApi() post_method = unwrap(api.post) @@ -242,7 +242,7 @@ class TestFileApiPost: with pytest.raises(FileTooLargeError): post_method(api) - def test_unsupported_file_type(self, app, mock_account_context, mock_file_service): + def test_unsupported_file_type(self, app: Flask, mock_account_context, mock_file_service): api = FileApi() post_method = unwrap(api.post) @@ -259,7 +259,7 @@ class TestFileApiPost: with pytest.raises(UnsupportedFileTypeError): post_method(api) - def test_blocked_extension(self, app, mock_account_context, mock_file_service): + def test_blocked_extension(self, app: Flask, mock_account_context, mock_file_service): api = FileApi() post_method = unwrap(api.post) @@ -278,7 +278,7 @@ class TestFileApiPost: class TestFilePreviewApi: - def test_get_preview(self, app, mock_account_context, mock_file_service): + def test_get_preview(self, app: Flask, mock_account_context, mock_file_service): api = FilePreviewApi() get_method = unwrap(api.get) mock_file_service.get_file_preview.return_value = "preview text" diff --git a/api/tests/unit_tests/controllers/console/workspace/test_accounts.py b/api/tests/unit_tests/controllers/console/workspace/test_accounts.py index 064726da05..df0d2bda49 100644 --- a/api/tests/unit_tests/controllers/console/workspace/test_accounts.py +++ b/api/tests/unit_tests/controllers/console/workspace/test_accounts.py @@ -114,7 +114,7 @@ class TestAccountUpdateApis: (AccountTimezoneApi, {"timezone": "UTC"}), ], ) - def test_update_success(self, app, api_cls, payload): + def test_update_success(self, app: Flask, api_cls, payload): api = api_cls() method = unwrap(api.post) diff --git a/api/tests/unit_tests/controllers/console/workspace/test_plugin.py b/api/tests/unit_tests/controllers/console/workspace/test_plugin.py index d01bf7d668..83915a0b74 100644 --- a/api/tests/unit_tests/controllers/console/workspace/test_plugin.py +++ b/api/tests/unit_tests/controllers/console/workspace/test_plugin.py @@ -302,7 +302,7 @@ class TestPluginFetchPermissionApi: class TestPluginFetchDynamicSelectOptionsApi: - def test_fetch_dynamic_options(self, app, user): + def test_fetch_dynamic_options(self, app: Flask, user): api = PluginFetchDynamicSelectOptionsApi() method = unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/service_api/app/test_annotation.py b/api/tests/unit_tests/controllers/service_api/app/test_annotation.py index b16ad38c7c..2ab5547cd4 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_annotation.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_annotation.py @@ -17,6 +17,7 @@ from types import SimpleNamespace from unittest.mock import Mock import pytest +from flask import Flask from flask_restx.api import HTTPStatus from controllers.service_api.app.annotation import ( @@ -163,7 +164,7 @@ class TestAnnotationErrorPatterns: class TestAnnotationReplyActionApi: - def test_enable(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_enable(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: enable_mock = Mock() monkeypatch.setattr(AppAnnotationService, "enable_app_annotation", enable_mock) @@ -181,7 +182,7 @@ class TestAnnotationReplyActionApi: assert status == 200 enable_mock.assert_called_once() - def test_disable(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_disable(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: disable_mock = Mock() monkeypatch.setattr(AppAnnotationService, "disable_app_annotation", disable_mock) @@ -231,7 +232,7 @@ class TestAnnotationReplyActionStatusApi: class TestAnnotationListApi: - def test_get(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_get(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: annotation = SimpleNamespace(id="a1", question="q", content="a", created_at=0) monkeypatch.setattr( AppAnnotationService, @@ -248,7 +249,7 @@ class TestAnnotationListApi: assert response["total"] == 1 - def test_create(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_create(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: annotation = SimpleNamespace(id="a1", question="q", content="a", created_at=0) monkeypatch.setattr( AppAnnotationService, @@ -268,7 +269,7 @@ class TestAnnotationListApi: class TestAnnotationUpdateDeleteApi: - def test_update_delete(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_update_delete(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: annotation = SimpleNamespace(id="a1", question="q", content="a", created_at=0) monkeypatch.setattr( AppAnnotationService, diff --git a/api/tests/unit_tests/controllers/service_api/app/test_completion.py b/api/tests/unit_tests/controllers/service_api/app/test_completion.py index 259741937f..a60b3b18bd 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_completion.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_completion.py @@ -415,7 +415,7 @@ class TestChatRequestPayloadController: class TestCompletionApiController: - def test_wrong_mode(self, app) -> None: + def test_wrong_mode(self, app: Flask) -> None: api = CompletionApi() handler = _unwrap(api.post) app_model = SimpleNamespace(mode=AppMode.CHAT.value) @@ -425,7 +425,7 @@ class TestCompletionApiController: with pytest.raises(AppUnavailableError): handler(api, app_model=app_model, end_user=end_user) - def test_conversation_not_found(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_conversation_not_found(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr( AppGenerateService, "generate", @@ -443,7 +443,7 @@ class TestCompletionApiController: class TestCompletionStopApiController: - def test_wrong_mode(self, app) -> None: + def test_wrong_mode(self, app: Flask) -> None: api = CompletionStopApi() handler = _unwrap(api.post) app_model = SimpleNamespace(mode=AppMode.CHAT.value) @@ -453,7 +453,7 @@ class TestCompletionStopApiController: with pytest.raises(AppUnavailableError): handler(api, app_model=app_model, end_user=end_user, task_id="t1") - def test_success(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_success(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: stop_mock = Mock() monkeypatch.setattr(AppTaskService, "stop_task", stop_mock) @@ -470,7 +470,7 @@ class TestCompletionStopApiController: class TestChatApiController: - def test_wrong_mode(self, app) -> None: + def test_wrong_mode(self, app: Flask) -> None: api = ChatApi() handler = _unwrap(api.post) app_model = SimpleNamespace(mode=AppMode.COMPLETION.value) @@ -480,7 +480,7 @@ class TestChatApiController: with pytest.raises(NotChatAppError): handler(api, app_model=app_model, end_user=end_user) - def test_workflow_not_found(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_workflow_not_found(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr( AppGenerateService, "generate", @@ -496,7 +496,7 @@ class TestChatApiController: with pytest.raises(NotFound): handler(api, app_model=app_model, end_user=end_user) - def test_draft_workflow(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_draft_workflow(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr( AppGenerateService, "generate", @@ -514,10 +514,10 @@ class TestChatApiController: class TestChatStopApiController: - def test_wrong_mode(self, app) -> None: + def test_wrong_mode(self, app: Flask) -> None: api = ChatStopApi() handler = _unwrap(api.post) - app_model = SimpleNamespace(mode=AppMode.COMPLETION.value) + app_model = SimpleNamespace(mode=AppMode.COMPLETION) end_user = SimpleNamespace(id="u1") with app.test_request_context("/chat-messages/1/stop", method="POST"): diff --git a/api/tests/unit_tests/controllers/service_api/app/test_conversation.py b/api/tests/unit_tests/controllers/service_api/app/test_conversation.py index 74c13d50f6..52a7aa2189 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_conversation.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_conversation.py @@ -495,7 +495,7 @@ class TestConversationPayloadsController: class TestConversationApiController: - def test_list_not_chat(self, app) -> None: + def test_list_not_chat(self, app: Flask) -> None: api = ConversationApi() handler = _unwrap(api.get) app_model = SimpleNamespace(mode=AppMode.COMPLETION) @@ -543,7 +543,7 @@ class TestConversationApiController: class TestConversationDetailApiController: - def test_delete_not_chat(self, app) -> None: + def test_delete_not_chat(self, app: Flask) -> None: api = ConversationDetailApi() handler = _unwrap(api.delete) app_model = SimpleNamespace(mode=AppMode.COMPLETION) @@ -593,7 +593,7 @@ class TestConversationRenameApiController: class TestConversationVariablesApiController: - def test_not_chat(self, app) -> None: + def test_not_chat(self, app: Flask) -> None: api = ConversationVariablesApi() handler = _unwrap(api.get) app_model = SimpleNamespace(mode=AppMode.COMPLETION) diff --git a/api/tests/unit_tests/controllers/service_api/app/test_file.py b/api/tests/unit_tests/controllers/service_api/app/test_file.py index 2615c3edac..88ebe955a8 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_file.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_file.py @@ -238,7 +238,7 @@ class TestFileApiPost: self, mock_db, mock_file_svc_cls, - app, + app: Flask, mock_app_model, mock_end_user, ): @@ -342,7 +342,7 @@ class TestFileApiPost: self, mock_db, mock_file_svc_cls, - app, + app: Flask, mock_app_model, mock_end_user, ): @@ -374,7 +374,7 @@ class TestFileApiPost: self, mock_db, mock_file_svc_cls, - app, + app: Flask, mock_app_model, mock_end_user, ): diff --git a/api/tests/unit_tests/controllers/service_api/app/test_file_preview.py b/api/tests/unit_tests/controllers/service_api/app/test_file_preview.py index d83c22f2cf..f5e8453c5c 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_file_preview.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_file_preview.py @@ -66,7 +66,7 @@ class TestFilePreviewApi: return message def test_validate_file_ownership_success( - self, file_preview_api, mock_app, mock_upload_file, mock_message_file, mock_message + self, file_preview_api: FilePreviewApi, mock_app, mock_upload_file, mock_message_file, mock_message ): """Test successful file ownership validation""" file_id = str(uuid.uuid4()) @@ -97,7 +97,7 @@ class TestFilePreviewApi: assert result_message_file == mock_message_file assert result_upload_file == mock_upload_file - def test_validate_file_ownership_file_not_found(self, file_preview_api): + def test_validate_file_ownership_file_not_found(self, file_preview_api: FilePreviewApi): """Test file ownership validation when MessageFile not found""" file_id = str(uuid.uuid4()) app_id = str(uuid.uuid4()) @@ -112,7 +112,7 @@ class TestFilePreviewApi: assert "File not found in message context" in str(exc_info.value) - def test_validate_file_ownership_access_denied(self, file_preview_api, mock_message_file): + def test_validate_file_ownership_access_denied(self, file_preview_api: FilePreviewApi, mock_message_file): """Test file ownership validation when Message not owned by app""" file_id = str(uuid.uuid4()) app_id = str(uuid.uuid4()) @@ -130,7 +130,9 @@ class TestFilePreviewApi: assert "not owned by requesting app" in str(exc_info.value) - def test_validate_file_ownership_upload_file_not_found(self, file_preview_api, mock_message_file, mock_message): + def test_validate_file_ownership_upload_file_not_found( + self, file_preview_api: FilePreviewApi, mock_message_file, mock_message + ): """Test file ownership validation when UploadFile not found""" file_id = str(uuid.uuid4()) app_id = str(uuid.uuid4()) @@ -151,7 +153,7 @@ class TestFilePreviewApi: assert "Upload file record not found" in str(exc_info.value) def test_validate_file_ownership_tenant_mismatch( - self, file_preview_api, mock_app, mock_upload_file, mock_message_file, mock_message + self, file_preview_api: FilePreviewApi, mock_app, mock_upload_file, mock_message_file, mock_message ): """Test file ownership validation with tenant mismatch""" file_id = str(uuid.uuid4()) @@ -182,7 +184,7 @@ class TestFilePreviewApi: assert "tenant mismatch" in str(exc_info.value) - def test_validate_file_ownership_invalid_input(self, file_preview_api): + def test_validate_file_ownership_invalid_input(self, file_preview_api: FilePreviewApi): """Test file ownership validation with invalid input""" # Test with empty file_id @@ -195,7 +197,7 @@ class TestFilePreviewApi: file_preview_api._validate_file_ownership("file_id", "") assert "Invalid file or app identifier" in str(exc_info.value) - def test_build_file_response_basic(self, file_preview_api, mock_upload_file): + def test_build_file_response_basic(self, file_preview_api: FilePreviewApi, mock_upload_file): """Test basic file response building""" mock_generator = Mock() @@ -207,7 +209,7 @@ class TestFilePreviewApi: assert response.headers["Content-Length"] == str(mock_upload_file.size) assert "Cache-Control" in response.headers - def test_build_file_response_as_attachment(self, file_preview_api, mock_upload_file): + def test_build_file_response_as_attachment(self, file_preview_api: FilePreviewApi, mock_upload_file): """Test file response building with attachment flag""" mock_generator = Mock() @@ -218,7 +220,7 @@ class TestFilePreviewApi: assert mock_upload_file.name in response.headers["Content-Disposition"] assert response.headers["Content-Type"] == "application/octet-stream" - def test_build_file_response_html_forces_attachment(self, file_preview_api, mock_upload_file): + def test_build_file_response_html_forces_attachment(self, file_preview_api: FilePreviewApi, mock_upload_file): """Test HTML files are forced to download""" mock_generator = Mock() mock_upload_file.mime_type = "text/html" @@ -231,7 +233,7 @@ class TestFilePreviewApi: assert response.headers["Content-Type"] == "application/octet-stream" assert response.headers["X-Content-Type-Options"] == "nosniff" - def test_build_file_response_audio_video(self, file_preview_api, mock_upload_file): + def test_build_file_response_audio_video(self, file_preview_api: FilePreviewApi, mock_upload_file): """Test file response building for audio/video files""" mock_generator = Mock() mock_upload_file.mime_type = "video/mp4" @@ -241,7 +243,7 @@ class TestFilePreviewApi: # Check Range support for media files assert response.headers["Accept-Ranges"] == "bytes" - def test_build_file_response_no_size(self, file_preview_api, mock_upload_file): + def test_build_file_response_no_size(self, file_preview_api: FilePreviewApi, mock_upload_file): """Test file response building when size is unknown""" mock_generator = Mock() mock_upload_file.size = 0 # Unknown size @@ -253,7 +255,14 @@ class TestFilePreviewApi: @patch("controllers.service_api.app.file_preview.storage") def test_get_method_integration( - self, mock_storage, file_preview_api, mock_app, mock_end_user, mock_upload_file, mock_message_file, mock_message + self, + mock_storage, + file_preview_api: FilePreviewApi, + mock_app, + mock_end_user, + mock_upload_file, + mock_message_file, + mock_message, ): """Test the full GET method integration (without decorator)""" file_id = str(uuid.uuid4()) @@ -295,7 +304,13 @@ class TestFilePreviewApi: @patch("controllers.service_api.app.file_preview.storage") def test_storage_error_handling( - self, mock_storage, file_preview_api, mock_app, mock_upload_file, mock_message_file, mock_message + self, + mock_storage, + file_preview_api: FilePreviewApi, + mock_app, + mock_upload_file, + mock_message_file, + mock_message, ): """Test storage error handling in the core logic""" file_id = str(uuid.uuid4()) @@ -334,7 +349,7 @@ class TestFilePreviewApi: assert "Storage error" in str(exc_info.value) @patch("controllers.service_api.app.file_preview.logger") - def test_validate_file_ownership_unexpected_error_logging(self, mock_logger, file_preview_api): + def test_validate_file_ownership_unexpected_error_logging(self, mock_logger, file_preview_api: FilePreviewApi): """Test that unexpected errors are logged properly""" file_id = str(uuid.uuid4()) app_id = str(uuid.uuid4()) diff --git a/api/tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py b/api/tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py index 38c403a9c4..ff668ac60a 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py @@ -249,7 +249,9 @@ def _build_resumption_context(task_id: str) -> WorkflowResumptionContext: class TestHitlServiceApi: # Service API event-stream continuation - def test_workflow_events_continue_on_pause_keeps_stream_open(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_workflow_events_continue_on_pause_keeps_stream_open( + self, app: Flask, monkeypatch: pytest.MonkeyPatch + ) -> None: workflow_run = SimpleNamespace( id="run-1", app_id="app-1", diff --git a/api/tests/unit_tests/controllers/service_api/app/test_human_input_form.py b/api/tests/unit_tests/controllers/service_api/app/test_human_input_form.py index 531f722ceb..5d1c4b4e26 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_human_input_form.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_human_input_form.py @@ -9,6 +9,7 @@ from types import SimpleNamespace from unittest.mock import Mock import pytest +from flask import Flask from werkzeug.exceptions import NotFound from controllers.service_api.app.human_input_form import WorkflowHumanInputFormApi @@ -17,7 +18,7 @@ from tests.unit_tests.controllers.service_api.conftest import _unwrap class TestWorkflowHumanInputFormApi: - def test_get_success(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_get_success(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: definition = SimpleNamespace( model_dump=lambda: { "rendered_content": "Rendered form content", @@ -57,7 +58,7 @@ class TestWorkflowHumanInputFormApi: service_mock.get_form_by_token.assert_called_once_with("token-1") service_mock.ensure_form_active.assert_called_once_with(form) - def test_get_form_not_in_app(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_get_form_not_in_app(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: form = SimpleNamespace( app_id="another-app", tenant_id="tenant-1", @@ -87,7 +88,7 @@ class TestWorkflowHumanInputFormApi: ], ) def test_get_rejects_non_service_api_recipient_types( - self, app, monkeypatch: pytest.MonkeyPatch, recipient_type: RecipientType + self, app: Flask, monkeypatch: pytest.MonkeyPatch, recipient_type: RecipientType ) -> None: form = SimpleNamespace( app_id="app-1", @@ -111,7 +112,7 @@ class TestWorkflowHumanInputFormApi: service_mock.ensure_form_active.assert_not_called() - def test_post_success(self, app, monkeypatch: pytest.MonkeyPatch) -> None: + def test_post_success(self, app: Flask, monkeypatch: pytest.MonkeyPatch) -> None: form = SimpleNamespace( app_id="app-1", tenant_id="tenant-1", @@ -155,7 +156,7 @@ class TestWorkflowHumanInputFormApi: ], ) def test_post_rejects_non_service_api_recipient_types( - self, app, monkeypatch: pytest.MonkeyPatch, recipient_type: RecipientType + self, app: Flask, monkeypatch: pytest.MonkeyPatch, recipient_type: RecipientType ) -> None: form = SimpleNamespace( app_id="app-1", diff --git a/api/tests/unit_tests/controllers/service_api/app/test_message.py b/api/tests/unit_tests/controllers/service_api/app/test_message.py index 2bc9771862..d44e92ce66 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_message.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_message.py @@ -381,7 +381,7 @@ class TestMessageService: class TestMessageListApi: - def test_not_chat_app(self, app) -> None: + def test_not_chat_app(self, app: Flask) -> None: api = MessageListApi() handler = _unwrap(api.get) app_model = SimpleNamespace(mode=AppMode.COMPLETION.value) @@ -467,7 +467,7 @@ class TestAppGetFeedbacksApi: class TestMessageSuggestedApi: - def test_not_chat(self, app) -> None: + def test_not_chat(self, app: Flask) -> None: api = MessageSuggestedApi() handler = _unwrap(api.get) app_model = SimpleNamespace(mode=AppMode.COMPLETION.value) diff --git a/api/tests/unit_tests/controllers/service_api/app/test_workflow_events.py b/api/tests/unit_tests/controllers/service_api/app/test_workflow_events.py index b3edc2ecd8..a1aca06570 100644 --- a/api/tests/unit_tests/controllers/service_api/app/test_workflow_events.py +++ b/api/tests/unit_tests/controllers/service_api/app/test_workflow_events.py @@ -32,7 +32,7 @@ def _mock_repo_for_run(monkeypatch: pytest.MonkeyPatch, workflow_run): class TestWorkflowEventsApi: - def test_wrong_app_mode(self, app) -> None: + def test_wrong_app_mode(self, app: Flask) -> None: api = WorkflowEventsApi() handler = _unwrap(api.get) app_model = SimpleNamespace(mode=AppMode.CHAT.value) diff --git a/api/tests/unit_tests/controllers/service_api/dataset/test_document.py b/api/tests/unit_tests/controllers/service_api/dataset/test_document.py index 738238d10a..61ec397193 100644 --- a/api/tests/unit_tests/controllers/service_api/dataset/test_document.py +++ b/api/tests/unit_tests/controllers/service_api/dataset/test_document.py @@ -19,6 +19,7 @@ import uuid from unittest.mock import Mock, patch import pytest +from flask import Flask from werkzeug.exceptions import Forbidden, NotFound from controllers.service_api.dataset.document import ( @@ -550,7 +551,7 @@ class TestDocumentApiGet: @patch("controllers.service_api.dataset.document.DatasetService") @patch("controllers.service_api.dataset.document.DocumentService") def test_get_document_success_with_all_metadata( - self, mock_doc_svc, mock_dataset_svc, app, mock_tenant, mock_doc_detail + self, mock_doc_svc, mock_dataset_svc, app: Flask, mock_tenant, mock_doc_detail ): """Test successful document retrieval with metadata='all'.""" # Arrange @@ -579,7 +580,7 @@ class TestDocumentApiGet: assert "doc_metadata" in response @patch("controllers.service_api.dataset.document.DocumentService") - def test_get_document_not_found(self, mock_doc_svc, app, mock_tenant): + def test_get_document_not_found(self, mock_doc_svc, app: Flask, mock_tenant): """Test 404 when document is not found.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -599,7 +600,7 @@ class TestDocumentApiGet: api.get(tenant_id=mock_tenant.id, dataset_id=dataset_id, document_id="nonexistent") @patch("controllers.service_api.dataset.document.DocumentService") - def test_get_document_forbidden_wrong_tenant(self, mock_doc_svc, app, mock_tenant, mock_doc_detail): + def test_get_document_forbidden_wrong_tenant(self, mock_doc_svc, app: Flask, mock_tenant, mock_doc_detail): """Test 403 when document tenant doesn't match request tenant.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -620,7 +621,7 @@ class TestDocumentApiGet: api.get(tenant_id=mock_tenant.id, dataset_id=dataset_id, document_id=mock_doc_detail.id) @patch("controllers.service_api.dataset.document.DocumentService") - def test_get_document_metadata_only(self, mock_doc_svc, app, mock_tenant, mock_doc_detail): + def test_get_document_metadata_only(self, mock_doc_svc, app: Flask, mock_tenant, mock_doc_detail): """Test document retrieval with metadata='only'.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -647,7 +648,9 @@ class TestDocumentApiGet: @patch("controllers.service_api.dataset.document.DatasetService") @patch("controllers.service_api.dataset.document.DocumentService") - def test_get_document_metadata_without(self, mock_doc_svc, mock_dataset_svc, app, mock_tenant, mock_doc_detail): + def test_get_document_metadata_without( + self, mock_doc_svc, mock_dataset_svc, app: Flask, mock_tenant, mock_doc_detail + ): """Test document retrieval with metadata='without'.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -674,7 +677,7 @@ class TestDocumentApiGet: assert "name" in response @patch("controllers.service_api.dataset.document.DocumentService") - def test_get_document_invalid_metadata_value(self, mock_doc_svc, app, mock_tenant, mock_doc_detail): + def test_get_document_invalid_metadata_value(self, mock_doc_svc, app: Flask, mock_tenant, mock_doc_detail): """Test error when metadata parameter has invalid value.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -713,7 +716,7 @@ class TestDocumentApiDelete: @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_delete_document_success(self, mock_db, mock_doc_svc, app, mock_tenant, mock_document): + def test_delete_document_success(self, mock_db, mock_doc_svc, app: Flask, mock_tenant, mock_document): """Test successful document deletion.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -741,7 +744,7 @@ class TestDocumentApiDelete: @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_delete_document_not_found(self, mock_db, mock_doc_svc, app, mock_tenant): + def test_delete_document_not_found(self, mock_db, mock_doc_svc, app: Flask, mock_tenant): """Test 404 when document not found.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -763,7 +766,7 @@ class TestDocumentApiDelete: @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_delete_document_archived_forbidden(self, mock_db, mock_doc_svc, app, mock_tenant, mock_document): + def test_delete_document_archived_forbidden(self, mock_db, mock_doc_svc, app: Flask, mock_tenant, mock_document): """Test ArchivedDocumentImmutableError when deleting archived document.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -785,7 +788,7 @@ class TestDocumentApiDelete: @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_delete_document_dataset_not_found(self, mock_db, mock_doc_svc, app, mock_tenant): + def test_delete_document_dataset_not_found(self, mock_db, mock_doc_svc, app: Flask, mock_tenant): """Test ValueError when dataset not found.""" # Arrange dataset_id = str(uuid.uuid4()) @@ -808,7 +811,7 @@ class TestDocumentListApi: @patch("controllers.service_api.dataset.document.marshal") @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_list_documents_success(self, mock_db, mock_doc_svc, mock_marshal, app, mock_tenant, mock_dataset): + def test_list_documents_success(self, mock_db, mock_doc_svc, mock_marshal, app: Flask, mock_tenant, mock_dataset): """Test successful document list retrieval.""" # Arrange mock_db.session.scalar.return_value = mock_dataset @@ -837,7 +840,7 @@ class TestDocumentListApi: assert response["total"] == 2 @patch("controllers.service_api.dataset.document.db") - def test_list_documents_dataset_not_found(self, mock_db, app, mock_tenant, mock_dataset): + def test_list_documents_dataset_not_found(self, mock_db, app: Flask, mock_tenant, mock_dataset): """Test 404 when dataset not found.""" # Arrange mock_db.session.scalar.return_value = None @@ -858,7 +861,9 @@ class TestDocumentIndexingStatusApi: @patch("controllers.service_api.dataset.document.marshal") @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_get_indexing_status_success(self, mock_db, mock_doc_svc, mock_marshal, app, mock_tenant, mock_dataset): + def test_get_indexing_status_success( + self, mock_db, mock_doc_svc, mock_marshal, app: Flask, mock_tenant, mock_dataset + ): """Test successful indexing status retrieval.""" # Arrange batch_id = "batch_123" @@ -894,7 +899,7 @@ class TestDocumentIndexingStatusApi: assert len(response["data"]) == 1 @patch("controllers.service_api.dataset.document.db") - def test_get_indexing_status_dataset_not_found(self, mock_db, app, mock_tenant, mock_dataset): + def test_get_indexing_status_dataset_not_found(self, mock_db, app: Flask, mock_tenant, mock_dataset): """Test 404 when dataset not found.""" # Arrange batch_id = "batch_123" @@ -911,7 +916,9 @@ class TestDocumentIndexingStatusApi: @patch("controllers.service_api.dataset.document.DocumentService") @patch("controllers.service_api.dataset.document.db") - def test_get_indexing_status_documents_not_found(self, mock_db, mock_doc_svc, app, mock_tenant, mock_dataset): + def test_get_indexing_status_documents_not_found( + self, mock_db, mock_doc_svc, app: Flask, mock_tenant, mock_dataset + ): """Test 404 when no documents found for batch.""" # Arrange batch_id = "batch_empty" @@ -978,7 +985,7 @@ class TestDocumentAddByTextApi: mock_knowledge_config, mock_doc_svc, mock_marshal, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1029,7 +1036,7 @@ class TestDocumentAddByTextApi: @patch("controllers.service_api.wraps.validate_and_get_api_token") @patch("controllers.service_api.dataset.document.db") def test_create_document_dataset_not_found( - self, mock_db, mock_validate_token, mock_feature_svc, app, mock_tenant, mock_dataset + self, mock_db, mock_validate_token, mock_feature_svc, app: Flask, mock_tenant, mock_dataset ): """Test ValueError when dataset not found.""" # Arrange — neutralise billing decorators @@ -1052,7 +1059,7 @@ class TestDocumentAddByTextApi: @patch("controllers.service_api.wraps.validate_and_get_api_token") @patch("controllers.service_api.dataset.document.db") def test_create_document_missing_indexing_technique( - self, mock_db, mock_validate_token, mock_feature_svc, app, mock_tenant, mock_dataset + self, mock_db, mock_validate_token, mock_feature_svc, app: Flask, mock_tenant, mock_dataset ): """Test error when both dataset and payload lack indexing_technique. @@ -1161,7 +1168,7 @@ class TestDocumentUpdateByTextApiPost: mock_file_svc_cls, mock_doc_svc, mock_marshal, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1206,7 +1213,7 @@ class TestDocumentUpdateByTextApiPost: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1245,7 +1252,7 @@ class TestDocumentAddByFileApiPost: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1275,7 +1282,7 @@ class TestDocumentAddByFileApiPost: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1306,7 +1313,7 @@ class TestDocumentAddByFileApiPost: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1338,7 +1345,7 @@ class TestDocumentAddByFileApiPost: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1381,7 +1388,7 @@ class TestDocumentUpdateByFileApiPatch: mock_feature_svc, mock_update_document_by_file, route_name, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1418,7 +1425,7 @@ class TestDocumentUpdateByFileApiPatch: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1453,7 +1460,7 @@ class TestDocumentUpdateByFileApiPatch: mock_validate_token, mock_feature_svc, mock_db, - app, + app: Flask, mock_tenant, mock_dataset, ): @@ -1497,7 +1504,7 @@ class TestDocumentUpdateByFileApiPatch: mock_file_svc_cls, mock_doc_svc, mock_marshal, - app, + app: Flask, mock_tenant, mock_dataset, ): diff --git a/api/tests/unit_tests/controllers/service_api/dataset/test_hit_testing.py b/api/tests/unit_tests/controllers/service_api/dataset/test_hit_testing.py index c02416e5fe..38fcb55fc0 100644 --- a/api/tests/unit_tests/controllers/service_api/dataset/test_hit_testing.py +++ b/api/tests/unit_tests/controllers/service_api/dataset/test_hit_testing.py @@ -18,6 +18,7 @@ import uuid from unittest.mock import Mock, patch import pytest +from flask import Flask from werkzeug.exceptions import Forbidden, NotFound import services @@ -91,7 +92,7 @@ class TestHitTestingApiPost: mock_hit_svc, mock_marshal, mock_ns, - app, + app: Flask, ): """Test successful hit testing request.""" dataset_id = str(uuid.uuid4()) @@ -129,7 +130,7 @@ class TestHitTestingApiPost: mock_hit_svc, mock_marshal, mock_ns, - app, + app: Flask, ): """Test hit testing with custom retrieval model.""" dataset_id = str(uuid.uuid4()) @@ -183,7 +184,7 @@ class TestHitTestingApiPost: mock_hit_svc, mock_marshal, mock_ns, - app, + app: Flask, ): """Service API retrieval payload should not drop metadata filters.""" dataset_id = str(uuid.uuid4()) @@ -239,7 +240,7 @@ class TestHitTestingApiPost: mock_hit_svc, mock_marshal, mock_ns, - app, + app: Flask, ): """Test service API prepares nullable list fields from marshalled records.""" dataset_id = str(uuid.uuid4()) @@ -286,7 +287,7 @@ class TestHitTestingApiPost: mock_current_user, mock_dataset_svc, mock_ns, - app, + app: Flask, ): """Test hit testing with non-existent dataset.""" dataset_id = str(uuid.uuid4()) @@ -308,7 +309,7 @@ class TestHitTestingApiPost: mock_current_user, mock_dataset_svc, mock_ns, - app, + app: Flask, ): """Test hit testing when user lacks dataset permission.""" dataset_id = str(uuid.uuid4()) diff --git a/api/tests/unit_tests/controllers/service_api/test_index.py b/api/tests/unit_tests/controllers/service_api/test_index.py index 8441118181..c4074c14dd 100644 --- a/api/tests/unit_tests/controllers/service_api/test_index.py +++ b/api/tests/unit_tests/controllers/service_api/test_index.py @@ -54,7 +54,7 @@ class TestIndexApi: assert isinstance(response["server_version"], str) @pytest.mark.parametrize("version", ["0.0.1", "1.0.0", "2.0.0-beta", "1.11.4"]) - def test_get_returns_correct_version(self, app, version): + def test_get_returns_correct_version(self, app: Flask, version): """Test that server_version matches config version.""" # Arrange mock_config = MagicMock() diff --git a/api/tests/unit_tests/controllers/web/test_web_login.py b/api/tests/unit_tests/controllers/web/test_web_login.py index 13b953c04d..839939367c 100644 --- a/api/tests/unit_tests/controllers/web/test_web_login.py +++ b/api/tests/unit_tests/controllers/web/test_web_login.py @@ -44,7 +44,7 @@ class TestEmailCodeLoginSendEmailApi: self, mock_get_user, mock_send_email, - app, + app: Flask, ): mock_account = MagicMock() mock_get_user.return_value = mock_account @@ -75,7 +75,7 @@ class TestEmailCodeLoginApi: mock_get_user, mock_login, mock_reset_login_rate, - app, + app: Flask, ): mock_get_token_data.return_value = {"email": "User@Example.com", "code": "123456"} mock_get_user.return_value = MagicMock() diff --git a/api/tests/unit_tests/core/app/test_llm_quota.py b/api/tests/unit_tests/core/app/test_llm_quota.py index baf54851e9..13bdf76535 100644 --- a/api/tests/unit_tests/core/app/test_llm_quota.py +++ b/api/tests/unit_tests/core/app/test_llm_quota.py @@ -1,4 +1,4 @@ -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from types import SimpleNamespace from unittest.mock import MagicMock, patch @@ -26,7 +26,7 @@ from models.provider import Provider, ProviderType @contextmanager -def _patched_credit_pool_session_factory(engine: Engine) -> Iterator[None]: +def _patched_credit_pool_session_factory(engine: Engine) -> Generator[None, None, None]: session_maker = sessionmaker(bind=engine, expire_on_commit=False) with patch("services.credit_pool_service.session_factory.get_session_maker", return_value=session_maker): yield diff --git a/api/tests/unit_tests/events/test_update_provider_when_message_created.py b/api/tests/unit_tests/events/test_update_provider_when_message_created.py index ca21b0d205..4b2a6438f4 100644 --- a/api/tests/unit_tests/events/test_update_provider_when_message_created.py +++ b/api/tests/unit_tests/events/test_update_provider_when_message_created.py @@ -1,4 +1,4 @@ -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from types import SimpleNamespace from unittest.mock import patch @@ -16,7 +16,7 @@ from models.provider import ProviderType @contextmanager -def _patched_credit_pool_session_factory(engine: Engine) -> Iterator[None]: +def _patched_credit_pool_session_factory(engine: Engine) -> Generator[None, None, None]: session_maker = sessionmaker(bind=engine, expire_on_commit=False) with patch("services.credit_pool_service.session_factory.get_session_maker", return_value=session_maker): yield diff --git a/api/tests/unit_tests/services/plugin/test_plugin_migration.py b/api/tests/unit_tests/services/plugin/test_plugin_migration.py new file mode 100644 index 0000000000..12b6ea23a1 --- /dev/null +++ b/api/tests/unit_tests/services/plugin/test_plugin_migration.py @@ -0,0 +1,76 @@ +from unittest.mock import MagicMock, patch + +import pytest +from pytest_mock import MockerFixture + +from services.plugin.plugin_migration import PluginMigration + +MIGRATION_MODULE = "services.plugin.plugin_migration" + + +def test_fetch_plugin_unique_identifier_returns_none_when_disabled(mocker: MockerFixture) -> None: + mocker.patch("services.plugin.plugin_migration.dify_config.MARKETPLACE_ENABLED", False) + batch_fetch = mocker.patch("services.plugin.plugin_migration.marketplace.batch_fetch_plugin_manifests") + + result = PluginMigration._fetch_plugin_unique_identifier("langgenius/openai") + + assert result is None + batch_fetch.assert_not_called() + + +def test_fetch_plugin_unique_identifier_calls_marketplace_when_enabled(mocker: MockerFixture) -> None: + mocker.patch("services.plugin.plugin_migration.dify_config.MARKETPLACE_ENABLED", True) + manifest = mocker.MagicMock() + manifest.latest_package_identifier = "langgenius/openai:1.0.0@abc" + mocker.patch( + "services.plugin.plugin_migration.marketplace.batch_fetch_plugin_manifests", + return_value=[manifest], + ) + + result = PluginMigration._fetch_plugin_unique_identifier("langgenius/openai") + + assert result == "langgenius/openai:1.0.0@abc" + + +class TestHandlePluginInstanceInstall: + def test_raises_when_disabled_and_map_nonempty(self) -> None: + with patch(f"{MIGRATION_MODULE}.dify_config") as mock_cfg: + mock_cfg.MARKETPLACE_ENABLED = False + + with pytest.raises(ValueError, match="Marketplace disabled"): + PluginMigration.handle_plugin_instance_install( + "tenant1", {"langgenius/openai": "langgenius/openai:1.0.0@abc"} + ) + + def test_no_raise_when_disabled_and_map_empty(self) -> None: + with ( + patch(f"{MIGRATION_MODULE}.dify_config") as mock_cfg, + patch(f"{MIGRATION_MODULE}.PluginInstaller") as mock_installer_cls, + ): + mock_cfg.MARKETPLACE_ENABLED = False + mock_installer = MagicMock() + mock_installer_cls.return_value = mock_installer + mock_installer.install_from_identifiers.return_value = MagicMock(all_installed=True) + + result = PluginMigration.handle_plugin_instance_install("tenant1", {}) + + assert isinstance(result, dict) + + def test_proceeds_when_enabled(self) -> None: + with ( + patch(f"{MIGRATION_MODULE}.dify_config") as mock_cfg, + patch(f"{MIGRATION_MODULE}.marketplace") as mock_marketplace, + patch(f"{MIGRATION_MODULE}.PluginInstaller") as mock_installer_cls, + ): + mock_cfg.MARKETPLACE_ENABLED = True + mock_marketplace.download_plugin_pkg.return_value = b"pkg_data" + mock_installer = MagicMock() + mock_installer_cls.return_value = mock_installer + mock_installer.install_from_identifiers.return_value = MagicMock(all_installed=True) + + result = PluginMigration.handle_plugin_instance_install( + "tenant1", {"langgenius/openai": "langgenius/openai:1.0.0@abc"} + ) + + mock_marketplace.download_plugin_pkg.assert_called_once() + assert "success" in result or "failed" in result diff --git a/api/tests/unit_tests/services/plugin/test_plugin_service.py b/api/tests/unit_tests/services/plugin/test_plugin_service.py new file mode 100644 index 0000000000..05bb3b65c0 --- /dev/null +++ b/api/tests/unit_tests/services/plugin/test_plugin_service.py @@ -0,0 +1,50 @@ +from unittest.mock import MagicMock, patch + +MODULE = "services.plugin.plugin_service" + + +class TestFetchLatestPluginVersion: + def test_skips_marketplace_fetch_when_disabled(self) -> None: + """Cache misses stay None; marketplace is never called when disabled.""" + with ( + patch(f"{MODULE}.dify_config") as mock_cfg, + patch(f"{MODULE}.redis_client") as mock_redis, + patch(f"{MODULE}.marketplace") as mock_marketplace, + ): + mock_cfg.MARKETPLACE_ENABLED = False + mock_redis.get.return_value = None # all cache misses + + from services.plugin.plugin_service import PluginService + + result = PluginService.fetch_latest_plugin_version(["langgenius/openai", "langgenius/anthropic"]) + + mock_marketplace.batch_fetch_plugin_manifests.assert_not_called() + assert result == {"langgenius/openai": None, "langgenius/anthropic": None} + + def test_calls_marketplace_fetch_when_enabled(self) -> None: + """Cache misses trigger marketplace fetch when enabled.""" + manifest = MagicMock() + manifest.plugin_id = "langgenius/openai" + manifest.latest_version = "1.0.0" + manifest.latest_package_identifier = "langgenius/openai:1.0.0@abc" + manifest.status = "active" + manifest.deprecated_reason = "" + manifest.alternative_plugin_id = "" + + with ( + patch(f"{MODULE}.dify_config") as mock_cfg, + patch(f"{MODULE}.redis_client") as mock_redis, + patch(f"{MODULE}.marketplace") as mock_marketplace, + ): + mock_cfg.MARKETPLACE_ENABLED = True + mock_redis.get.return_value = None + mock_marketplace.batch_fetch_plugin_manifests.return_value = [manifest] + + from services.plugin.plugin_service import PluginService + + result = PluginService.fetch_latest_plugin_version(["langgenius/openai"]) + + # The list arg is mutated by remove() after the call, so check call count + result. + mock_marketplace.batch_fetch_plugin_manifests.assert_called_once() + assert result["langgenius/openai"] is not None + assert result["langgenius/openai"].version == "1.0.0" diff --git a/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py b/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py new file mode 100644 index 0000000000..2ddb1ea448 --- /dev/null +++ b/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py @@ -0,0 +1,36 @@ +from pytest_mock import MockerFixture + +from services.rag_pipeline.rag_pipeline import RagPipelineService + + +def _make_service() -> RagPipelineService: + return RagPipelineService.__new__(RagPipelineService) + + +def test_fetch_recommended_plugin_manifests_returns_empty_when_disabled( + mocker: MockerFixture, +) -> None: + mocker.patch("services.rag_pipeline.rag_pipeline.dify_config.MARKETPLACE_ENABLED", False) + batch_fetch = mocker.patch("services.rag_pipeline.rag_pipeline.marketplace.batch_fetch_plugin_by_ids") + + service = _make_service() + result = service._fetch_recommended_plugin_manifests(["langgenius/openai"]) + + assert result == [] + batch_fetch.assert_not_called() + + +def test_fetch_recommended_plugin_manifests_returns_data_when_enabled( + mocker: MockerFixture, +) -> None: + mocker.patch("services.rag_pipeline.rag_pipeline.dify_config.MARKETPLACE_ENABLED", True) + expected = [{"plugin_id": "langgenius/openai", "name": "OpenAI"}] + mocker.patch( + "services.rag_pipeline.rag_pipeline.marketplace.batch_fetch_plugin_by_ids", + return_value=expected, + ) + + service = _make_service() + result = service._fetch_recommended_plugin_manifests(["langgenius/openai"]) + + assert result == expected diff --git a/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline_transform_service.py b/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline_transform_service.py index 82e5e973c1..3f511a109a 100644 --- a/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline_transform_service.py +++ b/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline_transform_service.py @@ -1,8 +1,10 @@ +import logging from datetime import UTC, datetime from types import SimpleNamespace from typing import cast import pytest +from pytest_mock import MockerFixture from models.dataset import Dataset from services.entities.knowledge_entities.rag_pipeline_entities import KnowledgeConfiguration @@ -514,3 +516,64 @@ def test_deal_document_data_upload_file_with_existing_file(mocker) -> None: assert document.data_source_type == "local_file" assert "real_file_id" in document.data_source_info assert add_mock.call_count >= 2 + + +def _make_service(): + return RagPipelineTransformService.__new__(RagPipelineTransformService) + + +def test_deal_dependencies_skips_marketplace_when_disabled(mocker: MockerFixture, caplog) -> None: + mocker.patch( + "services.rag_pipeline.rag_pipeline_transform_service.dify_config.MARKETPLACE_ENABLED", + False, + ) + installer = mocker.patch("services.rag_pipeline.rag_pipeline_transform_service.PluginInstaller").return_value + installer.list_plugins.return_value = [] + mocker.patch("services.rag_pipeline.rag_pipeline_transform_service.PluginMigration") + install_call = mocker.patch( + "services.rag_pipeline.rag_pipeline_transform_service.PluginService.install_from_marketplace_pkg" + ) + + pipeline_yaml = { + "dependencies": [ + { + "type": "marketplace", + "value": {"plugin_unique_identifier": "langgenius/openai:1.0.0@abc"}, + } + ] + } + + service = _make_service() + with caplog.at_level(logging.WARNING): + service._deal_dependencies(pipeline_yaml, "tenant-1") + + install_call.assert_not_called() + assert any("Marketplace disabled" in rec.message for rec in caplog.records) + + +def test_deal_dependencies_installs_when_enabled(mocker: MockerFixture) -> None: + mocker.patch( + "services.rag_pipeline.rag_pipeline_transform_service.dify_config.MARKETPLACE_ENABLED", + True, + ) + installer = mocker.patch("services.rag_pipeline.rag_pipeline_transform_service.PluginInstaller").return_value + installer.list_plugins.return_value = [] + migration = mocker.patch("services.rag_pipeline.rag_pipeline_transform_service.PluginMigration").return_value + migration._fetch_plugin_unique_identifier.return_value = "langgenius/openai:1.0.0@abc" + install_call = mocker.patch( + "services.rag_pipeline.rag_pipeline_transform_service.PluginService.install_from_marketplace_pkg" + ) + + pipeline_yaml = { + "dependencies": [ + { + "type": "marketplace", + "value": {"plugin_unique_identifier": "langgenius/openai:1.0.0@abc"}, + } + ] + } + + service = _make_service() + service._deal_dependencies(pipeline_yaml, "tenant-1") + + install_call.assert_called_once_with("tenant-1", ["langgenius/openai:1.0.0@abc"]) diff --git a/api/tests/unit_tests/services/test_credit_pool_service.py b/api/tests/unit_tests/services/test_credit_pool_service.py index 62e492c67d..6956dbbd6e 100644 --- a/api/tests/unit_tests/services/test_credit_pool_service.py +++ b/api/tests/unit_tests/services/test_credit_pool_service.py @@ -1,4 +1,4 @@ -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from unittest.mock import patch from uuid import uuid4 @@ -34,7 +34,7 @@ def _create_engine_with_pool(*, quota_limit: int, quota_used: int) -> tuple[Engi @contextmanager -def _patched_session_factory(engine: Engine) -> Iterator[None]: +def _patched_session_factory(engine: Engine) -> Generator[None, None, None]: session_maker = sessionmaker(bind=engine, expire_on_commit=False) with patch("services.credit_pool_service.session_factory.get_session_maker", return_value=session_maker): yield diff --git a/dev/pyrefly-check-local b/dev/pyrefly-check-local index e29dfe49e0..be78230662 100755 --- a/dev/pyrefly-check-local +++ b/dev/pyrefly-check-local @@ -34,8 +34,16 @@ if [[ -f "$EXCLUDES_FILE" ]]; then fi tmp_output="$(mktemp)" +pyrefly_command=( + uv run --directory api --dev pyrefly check + "${pyrefly_args[@]}" +) +if (( ${#target_paths[@]} > 0 )); then + pyrefly_command+=("${target_paths[@]}") +fi + set +e -uv run --directory api --dev pyrefly check "${pyrefly_args[@]}" "${target_paths[@]}" >"$tmp_output" 2>&1 +"${pyrefly_command[@]}" >"$tmp_output" 2>&1 pyrefly_status=$? set -e diff --git a/docker/README.md b/docker/README.md index 26b1dac9ac..2e21a2ce8f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -5,7 +5,7 @@ Welcome to the new `docker` directory for deploying Dify using Docker Compose. T ### What's Updated - **Certbot Container**: `docker-compose.yaml` now contains `certbot` for managing SSL certificates. This container automatically renews certificates and ensures secure HTTPS connections.\ - For more information, refer `docker/certbot/README.md`. + For more information, refer to `docker/certbot/README.md`. - **Persistent Environment Variables**: Essential startup defaults are provided in `.env.example`, while local values are stored in `.env`, ensuring that your configurations persist across deployments. @@ -17,26 +17,26 @@ Welcome to the new `docker` directory for deploying Dify using Docker Compose. T ### How to Deploy Dify with `docker-compose.yaml` 1. **Prerequisites**: Ensure Docker and Docker Compose are installed on your system. -1. **Environment Setup**: +2. **Environment Setup**: - Navigate to the `docker` directory. - Copy `.env.example` to `.env`. - Customize `.env` when you need to change essential startup defaults. Copy optional files from `envs/` without the `.example` suffix when you need advanced settings. - **Optional (for advanced deployments)**: If you maintain a full `.env` file copied from `.env.example`, you may use the environment synchronization tool to keep it aligned with the latest `.env.example` updates while preserving your custom settings. See the [Environment Variables Synchronization](#environment-variables-synchronization) section below. -1. **Running the Services**: +3. **Running the Services**: - Execute `docker compose up -d` from the `docker` directory to start the services. - - To specify a vector database, set the `VECTOR_STORE` variable in your `.env` file to your desired vector database service, such as `milvus`, `weaviate`, or `opensearch`. + - To specify a vector database, set the `VECTOR_STORE` variable in your `.env` file to your desired vector database service, such as `milvus`, `weaviate`, or `opensearch`. See `envs/vectorstores/` for the full list of supported options. ```bash cp .env.example .env docker compose up -d ``` -1. **SSL Certificate Setup**: - - Refer `docker/certbot/README.md` to set up SSL certificates using Certbot. -1. **OpenTelemetry Collector Setup**: - - Change `ENABLE_OTEL` to `true` in `.env`. - - Configure `OTLP_BASE_ENDPOINT` properly. +4. **SSL Certificate Setup**: + - Refer to `docker/certbot/README.md` to set up SSL certificates using Certbot. +5. **OpenTelemetry Collector Setup**: + - Copy `envs/core-services/shared.env.example` to `envs/core-services/shared.env`. + - Set `ENABLE_OTEL=true` and configure `OTLP_BASE_ENDPOINT`. Tune the other `OTEL_*` knobs in the same file if needed. ### How to Deploy Middleware for Developing Dify @@ -44,7 +44,7 @@ Welcome to the new `docker` directory for deploying Dify using Docker Compose. T - Use the `docker-compose.middleware.yaml` for setting up essential middleware services like databases and caches. - Navigate to the `docker` directory. - Ensure the `middleware.env` file is created by running `cp envs/middleware.env.example middleware.env` (refer to the `envs/middleware.env.example` file). -1. **Running Middleware Services**: +2. **Running Middleware Services**: - Navigate to the `docker` directory. - Execute `docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d` to start PostgreSQL/MySQL (per `DB_TYPE`) plus the bundled Weaviate instance. @@ -55,9 +55,9 @@ Welcome to the new `docker` directory for deploying Dify using Docker Compose. T For users migrating from the `docker-legacy` setup: 1. **Review Changes**: Familiarize yourself with the new `.env` configuration and Docker Compose setup. -1. **Transfer Customizations**: +2. **Transfer Customizations**: - If you have customized configurations such as `docker-compose.yaml`, `ssrf_proxy/squid.conf`, or `nginx/conf.d/default.conf`, you will need to reflect these changes in the `.env` file you create. -1. **Data Migration**: +3. **Data Migration**: - Ensure that data from services like databases and caches is backed up and migrated appropriately to the new structure if necessary. ### Overview of `.env`, `.env.example`, and `envs/` @@ -80,49 +80,51 @@ The root `.env.example` file contains the essential startup settings. Optional a 1. **Common Variables**: - - `CONSOLE_API_URL`, `SERVICE_API_URL`: URLs for different API services. - - `APP_WEB_URL`: Frontend application URL. - - `FILES_URL`: Base URL for file downloads and previews. + - `CONSOLE_API_URL`, `CONSOLE_WEB_URL`, `SERVICE_API_URL`, `APP_API_URL`, `APP_WEB_URL`: URLs for the API and frontend services. + - `FILES_URL`, `INTERNAL_FILES_URL`: Public and internal base URLs for file downloads and previews. + - `ENDPOINT_URL_TEMPLATE`, `NEXT_PUBLIC_SOCKET_URL`, `TRIGGER_URL`: Additional service URLs. + + See `.env.example` for the full list. -1. **Server Configuration**: +2. **Server Configuration**: - `LOG_LEVEL`, `DEBUG`, `FLASK_DEBUG`: Logging and debug settings. - `SECRET_KEY`: A key for signing sessions, JWTs, and file URLs. Leave it empty to let Dify generate a persistent key in the storage directory, or set a unique value yourself. -1. **Database Configuration**: +3. **Database Configuration**: - `DB_USERNAME`, `DB_PASSWORD`, `DB_HOST`, `DB_PORT`, `DB_DATABASE`: PostgreSQL database credentials and connection details. -1. **Redis Configuration**: +4. **Redis Configuration**: - `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`: Redis server connection settings. - `REDIS_KEY_PREFIX`: Optional global namespace prefix for Redis keys, topics, streams, and Celery Redis transport artifacts. -1. **Celery Configuration**: +5. **Celery Configuration**: - `CELERY_BROKER_URL`: Configuration for Celery message broker. -1. **Storage Configuration**: +6. **Storage Configuration**: - `STORAGE_TYPE`, `OPENDAL_SCHEME`, `OPENDAL_FS_ROOT`: Default local file storage settings. Optional storage backends are configured from the files under `envs/`. -1. **Vector Database Configuration**: +7. **Vector Database Configuration**: - - `VECTOR_STORE`: Type of vector database (e.g., `weaviate`, `milvus`). + - `VECTOR_STORE`: Type of vector database (e.g., `weaviate`, `milvus`). See `envs/vectorstores/` for the full list of supported options. - Specific settings for each vector store like `WEAVIATE_ENDPOINT`, `MILVUS_URI`. -1. **CORS Configuration**: +8. **CORS Configuration**: - `WEB_API_CORS_ALLOW_ORIGINS`, `CONSOLE_CORS_ALLOW_ORIGINS`: Settings for cross-origin resource sharing. -1. **OpenTelemetry Configuration**: +9. **OpenTelemetry Configuration**: - `ENABLE_OTEL`: Enable OpenTelemetry collector in api. - `OTLP_BASE_ENDPOINT`: Endpoint for your OTLP exporter. -1. **Other Service-Specific Environment Variables**: +10. **Other Service-Specific Environment Variables**: - - Each service like `nginx`, `redis`, `db`, and vector databases have specific environment variables that are directly referenced in the `docker-compose.yaml`. + - Each service like `nginx`, `redis`, `db`, and vector databases have specific environment variables that are directly referenced in the `docker-compose.yaml`. ### Environment Variables Synchronization diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yaml index d9e2fc5bc9..9d5018f6e7 100644 --- a/docker/docker-compose-template.yaml +++ b/docker/docker-compose-template.yaml @@ -518,7 +518,7 @@ services: # plugin daemon plugin_daemon: - image: langgenius/dify-plugin-daemon:0.6.0-local + image: langgenius/dify-plugin-daemon:0.6.1-local restart: always env_file: - path: ./envs/core-services/shared.env diff --git a/docker/docker-compose.middleware.yaml b/docker/docker-compose.middleware.yaml index 0ad406a63b..170e171856 100644 --- a/docker/docker-compose.middleware.yaml +++ b/docker/docker-compose.middleware.yaml @@ -129,7 +129,7 @@ services: # plugin daemon plugin_daemon: - image: langgenius/dify-plugin-daemon:0.6.0-local + image: langgenius/dify-plugin-daemon:0.6.1-local restart: always env_file: - ./middleware.env diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 004140abfb..63df56ddd5 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -524,7 +524,7 @@ services: # plugin daemon plugin_daemon: - image: langgenius/dify-plugin-daemon:0.6.0-local + image: langgenius/dify-plugin-daemon:0.6.1-local restart: always env_file: - path: ./envs/core-services/shared.env diff --git a/eslint-suppressions.json b/eslint-suppressions.json index f8938c2bcb..bfa873933a 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -828,14 +828,6 @@ "count": 10 } }, - "web/app/components/base/checkbox/index.stories.tsx": { - "no-console": { - "count": 1 - }, - "ts/no-explicit-any": { - "count": 1 - } - }, "web/app/components/base/chip/index.tsx": { "ts/no-explicit-any": { "count": 3 @@ -2546,7 +2538,7 @@ "count": 1 }, "ts/no-explicit-any": { - "count": 3 + "count": 2 } }, "web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx": { diff --git a/packages/contracts/README.md b/packages/contracts/README.md new file mode 100644 index 0000000000..e9320c921d --- /dev/null +++ b/packages/contracts/README.md @@ -0,0 +1,40 @@ +# Contracts + +## API OpenAPI Readiness + + + + + +Snapshot generated from `packages/contracts/generated/api/readiness.json` after running `pnpm -C packages/contracts gen-api-contract-from-openapi`. + +Are we OpenAPI ready? **No.** Current generated API contracts are **16.7% ready**. + +| Surface | Ready | Not ready | Total | Ready % | +| --------- | ------: | --------: | ------: | --------: | +| console | 96 | 474 | 570 | 16.8% | +| service | 16 | 72 | 88 | 18.2% | +| web | 5 | 36 | 41 | 12.2% | +| **total** | **117** | **582** | **699** | **16.7%** | + +Readiness here means the generated contract operation is not marked with: + +> Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + +Operations marked with that warning should not be migrated to blindly. Prefer fixing backend OpenAPI annotations first so the generated contract has accurate request and response types, then migrate callers endpoint by endpoint. + +The current heuristic marks an operation as not ready when a request body or success response that should have a body contains a loose object type, or when an operation has no documented 2xx response. 204, 205, and 304 responses are treated as bodyless when the request type is otherwise accurate. + + + +## How to Improve Readiness + +Improve the ready percentage by fixing the backend annotations that produce loose generated types, then regenerating the contracts. + +- Add accurate request body schemas for endpoints that currently generate loose object types. +- Add accurate 2xx response schemas for endpoints that return JSON payloads. +- Use 204 responses for endpoints that intentionally return no body. +- Avoid untyped dictionaries, raw objects, or `additionalProperties: true` responses unless the API really returns an arbitrary object. +- Regenerate with `pnpm -C packages/contracts gen-api-contract` and use this README to verify the updated percentage. + +Do not remove the generated warning just to increase the number. The warning should disappear because the backend OpenAPI output became accurate enough for callers to migrate safely. diff --git a/packages/contracts/generated/api/console/account/orpc.gen.ts b/packages/contracts/generated/api/console/account/orpc.gen.ts index a926103667..7308733a12 100644 --- a/packages/contracts/generated/api/console/account/orpc.gen.ts +++ b/packages/contracts/generated/api/console/account/orpc.gen.ts @@ -45,10 +45,16 @@ import { /** * Get account avatar url + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get account avatar url', + deprecated: true, + description: + 'Get account avatar url\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAccountAvatar', @@ -74,8 +80,16 @@ export const avatar = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountChangeEmailCheckEmailUnique', @@ -104,8 +118,16 @@ export const reset = { post: post3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountChangeEmailValidity', @@ -119,8 +141,16 @@ export const validity = { post: post4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountChangeEmail', @@ -137,8 +167,16 @@ export const changeEmail = { validity, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountDeleteFeedback', @@ -152,8 +190,16 @@ export const feedback = { post: post6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAccountDeleteVerify', @@ -166,8 +212,16 @@ export const verify = { get: get2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountDelete', @@ -222,8 +276,16 @@ export const get5 = oc }) .output(zGetAccountEducationResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountEducation', @@ -240,8 +302,16 @@ export const education = { verify: verify2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAccountInit', diff --git a/packages/contracts/generated/api/console/activate/orpc.gen.ts b/packages/contracts/generated/api/console/activate/orpc.gen.ts index 870f45bd2e..3e74dd841b 100644 --- a/packages/contracts/generated/api/console/activate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/activate/orpc.gen.ts @@ -12,10 +12,16 @@ import { /** * Check if activation token is valid + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Check if activation token is valid', + deprecated: true, + description: + 'Check if activation token is valid\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getActivateCheck', diff --git a/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts b/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts index 91ccdbc408..52ee85667e 100644 --- a/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts +++ b/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts @@ -5,8 +5,16 @@ import * as z from 'zod' import { zGetAllWorkspacesQuery, zGetAllWorkspacesResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAllWorkspaces', diff --git a/packages/contracts/generated/api/console/api-based-extension/types.gen.ts b/packages/contracts/generated/api/console/api-based-extension/types.gen.ts index f7b12f5b3f..1b460d2166 100644 --- a/packages/contracts/generated/api/console/api-based-extension/types.gen.ts +++ b/packages/contracts/generated/api/console/api-based-extension/types.gen.ts @@ -59,7 +59,7 @@ export type DeleteApiBasedExtensionByIdData = { export type DeleteApiBasedExtensionByIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } diff --git a/packages/contracts/generated/api/console/api-based-extension/zod.gen.ts b/packages/contracts/generated/api/console/api-based-extension/zod.gen.ts index 43f38a5214..dd7fa0c51d 100644 --- a/packages/contracts/generated/api/console/api-based-extension/zod.gen.ts +++ b/packages/contracts/generated/api/console/api-based-extension/zod.gen.ts @@ -43,7 +43,7 @@ export const zDeleteApiBasedExtensionByIdPath = z.object({ /** * Extension deleted successfully */ -export const zDeleteApiBasedExtensionByIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteApiBasedExtensionByIdResponse = z.record(z.string(), z.never()) export const zGetApiBasedExtensionByIdPath = z.object({ id: z.string(), diff --git a/packages/contracts/generated/api/console/api-key-auth/orpc.gen.ts b/packages/contracts/generated/api/console/api-key-auth/orpc.gen.ts index a113e39c15..48f5f69624 100644 --- a/packages/contracts/generated/api/console/api-key-auth/orpc.gen.ts +++ b/packages/contracts/generated/api/console/api-key-auth/orpc.gen.ts @@ -11,8 +11,16 @@ import { zPostApiKeyAuthDataSourceBindingResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postApiKeyAuthDataSourceBinding', @@ -26,8 +34,16 @@ export const binding = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteApiKeyAuthDataSourceByBindingId', @@ -41,8 +57,16 @@ export const byBindingId = { delete: delete_, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getApiKeyAuthDataSource', diff --git a/packages/contracts/generated/api/console/app/orpc.gen.ts b/packages/contracts/generated/api/console/app/orpc.gen.ts index 7ccb933866..1a2a10f23c 100644 --- a/packages/contracts/generated/api/console/app/orpc.gen.ts +++ b/packages/contracts/generated/api/console/app/orpc.gen.ts @@ -7,10 +7,16 @@ import { zGetAppPromptTemplatesQuery, zGetAppPromptTemplatesResponse } from './z /** * Get advanced prompt templates based on app mode and model configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get advanced prompt templates based on app mode and model configuration', + deprecated: true, + description: + 'Get advanced prompt templates based on app mode and model configuration\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppPromptTemplates', diff --git a/packages/contracts/generated/api/console/apps/orpc.gen.ts b/packages/contracts/generated/api/console/apps/orpc.gen.ts index e3ebc473a9..a1a0faaefd 100644 --- a/packages/contracts/generated/api/console/apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/apps/orpc.gen.ts @@ -506,10 +506,16 @@ export const workflowRuns = { * Preview human input form content and placeholders * * Get human input form preview for advanced chat workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post4 = oc .route({ - description: 'Get human input form preview for advanced chat workflow', + deprecated: true, + description: + 'Get human input form preview for advanced chat workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreview', @@ -533,10 +539,16 @@ export const preview = { * Submit human input form preview * * Submit human input form preview for advanced chat workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post5 = oc .route({ - description: 'Submit human input form preview for advanced chat workflow', + deprecated: true, + description: + 'Submit human input form preview for advanced chat workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRun', @@ -577,10 +589,16 @@ export const humanInput = { * Run draft workflow iteration node * * Run draft workflow iteration node for advanced chat + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post6 = oc .route({ - description: 'Run draft workflow iteration node for advanced chat', + deprecated: true, + description: + 'Run draft workflow iteration node for advanced chat\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRun', @@ -616,10 +634,16 @@ export const iteration = { * Run draft workflow loop node * * Run draft workflow loop node for advanced chat + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post7 = oc .route({ - description: 'Run draft workflow loop node for advanced chat', + deprecated: true, + description: + 'Run draft workflow loop node for advanced chat\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRun', @@ -655,10 +679,16 @@ export const loop = { * Run draft workflow * * Run draft workflow for advanced chat application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post8 = oc .route({ - description: 'Run draft workflow for advanced chat application', + deprecated: true, + description: + 'Run draft workflow for advanced chat application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftRun', @@ -698,10 +728,16 @@ export const advancedChat = { * Get agent logs * * Get agent execution logs for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get4 = oc .route({ - description: 'Get agent execution logs for an application', + deprecated: true, + description: + 'Get agent execution logs for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAgentLogs', @@ -722,10 +758,16 @@ export const agent = { /** * Get status of annotation reply action job + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ - description: 'Get status of annotation reply action job', + deprecated: true, + description: + 'Get status of annotation reply action job\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationReplyByActionStatusByJobId', @@ -745,10 +787,16 @@ export const status = { /** * Enable or disable annotation reply for an app + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post9 = oc .route({ - description: 'Enable or disable annotation reply for an app', + deprecated: true, + description: + 'Enable or disable annotation reply for an app\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationReplyByAction', @@ -774,10 +822,16 @@ export const annotationReply = { /** * Get annotation settings for an app + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ - description: 'Get annotation settings for an app', + deprecated: true, + description: + 'Get annotation settings for an app\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationSetting', @@ -793,10 +847,16 @@ export const annotationSetting = { /** * Update annotation settings for an app + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post10 = oc .route({ - description: 'Update annotation settings for an app', + deprecated: true, + description: + 'Update annotation settings for an app\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationSettingsByAnnotationSettingId', @@ -821,10 +881,16 @@ export const annotationSettings = { /** * Batch import annotations from CSV file with rate limiting and security checks + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post11 = oc .route({ - description: 'Batch import annotations from CSV file with rate limiting and security checks', + deprecated: true, + description: + 'Batch import annotations from CSV file with rate limiting and security checks\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationsBatchImport', @@ -840,10 +906,16 @@ export const batchImport = { /** * Get status of batch import job + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get7 = oc .route({ - description: 'Get status of batch import job', + deprecated: true, + description: + 'Get status of batch import job\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationsBatchImportStatusByJobId', @@ -923,8 +995,16 @@ export const hitHistories = { get: get10, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAppsByAppIdAnnotationsByAnnotationId', @@ -936,10 +1016,16 @@ export const delete_ = oc /** * Update or delete an annotation + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post12 = oc .route({ - description: 'Update or delete an annotation', + deprecated: true, + description: + 'Update or delete an annotation\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationsByAnnotationId', @@ -960,8 +1046,16 @@ export const byAnnotationId = { hitHistories, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAppsByAppIdAnnotations', @@ -973,10 +1067,16 @@ export const delete2 = oc /** * Get annotations for an app with pagination + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ - description: 'Get annotations for an app with pagination', + deprecated: true, + description: + 'Get annotations for an app with pagination\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotations', @@ -993,10 +1093,16 @@ export const get11 = oc /** * Create a new annotation for an app + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post13 = oc .route({ - description: 'Create a new annotation for an app', + deprecated: true, + description: + 'Create a new annotation for an app\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotations', @@ -1022,10 +1128,16 @@ export const annotations = { /** * Enable or disable app API + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post14 = oc .route({ - description: 'Enable or disable app API', + deprecated: true, + description: + 'Enable or disable app API\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdApiEnable', @@ -1076,10 +1188,16 @@ export const delete3 = oc /** * Get chat conversation details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get12 = oc .route({ - description: 'Get chat conversation details', + deprecated: true, + description: + 'Get chat conversation details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdChatConversationsByConversationId', @@ -1144,10 +1262,16 @@ export const byMessageId = { /** * Stop a running chat message generation + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post16 = oc .route({ - description: 'Stop a running chat message generation', + deprecated: true, + description: + 'Stop a running chat message generation\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdChatMessagesByTaskIdStop', @@ -1167,10 +1291,16 @@ export const byTaskId = { /** * Get chat messages for a conversation with pagination + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ - description: 'Get chat messages for a conversation with pagination', + deprecated: true, + description: + 'Get chat messages for a conversation with pagination\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdChatMessages', @@ -1206,10 +1336,16 @@ export const delete4 = oc /** * Get completion conversation details with messages + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get16 = oc .route({ - description: 'Get completion conversation details with messages', + deprecated: true, + description: + 'Get completion conversation details with messages\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdCompletionConversationsByConversationId', @@ -1251,10 +1387,16 @@ export const completionConversations = { /** * Stop a running completion message generation + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post17 = oc .route({ - description: 'Stop a running completion message generation', + deprecated: true, + description: + 'Stop a running completion message generation\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdCompletionMessagesByTaskIdStop', @@ -1274,10 +1416,16 @@ export const byTaskId2 = { /** * Generate completion message for debugging + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post18 = oc .route({ - description: 'Generate completion message for debugging', + deprecated: true, + description: + 'Generate completion message for debugging\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdCompletionMessages', @@ -1327,11 +1475,16 @@ export const conversationVariables = { * Convert application to workflow mode * Convert expert mode of chatbot app to workflow mode * Convert Completion App to Workflow App + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post19 = oc .route({ + deprecated: true, description: - 'Convert application to workflow mode\nConvert expert mode of chatbot app to workflow mode\nConvert Completion App to Workflow App', + 'Convert application to workflow mode\nConvert expert mode of chatbot app to workflow mode\nConvert Completion App to Workflow App\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdConvertToWorkflow', @@ -1355,10 +1508,16 @@ export const convertToWorkflow = { * Copy app * * Create a copy of an existing application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post20 = oc .route({ - description: 'Create a copy of an existing application', + deprecated: true, + description: + 'Create a copy of an existing application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdCopy', @@ -1400,10 +1559,16 @@ export const export2 = { /** * Export user feedback data for Google Sheets + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get20 = oc .route({ - description: 'Export user feedback data for Google Sheets', + deprecated: true, + description: + 'Export user feedback data for Google Sheets\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdFeedbacksExport', @@ -1424,10 +1589,16 @@ export const export3 = { /** * Create or update message feedback (like/dislike) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post21 = oc .route({ - description: 'Create or update message feedback (like/dislike)', + deprecated: true, + description: + 'Create or update message feedback (like/dislike)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdFeedbacks', @@ -1444,10 +1615,16 @@ export const feedbacks = { /** * Update application icon + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post22 = oc .route({ - description: 'Update application icon', + deprecated: true, + description: + 'Update application icon\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdIcon', @@ -1463,10 +1640,16 @@ export const icon = { /** * Get message details by ID + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get21 = oc .route({ - description: 'Get message details by ID', + deprecated: true, + description: + 'Get message details by ID\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdMessagesByMessageId', @@ -1488,10 +1671,16 @@ export const messages = { * Modify app model config * * Update application model configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post23 = oc .route({ - description: 'Update application model configuration', + deprecated: true, + description: + 'Update application model configuration\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdModelConfig', @@ -1510,10 +1699,16 @@ export const modelConfig = { /** * Check if app name is available + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post24 = oc .route({ - description: 'Check if app name is available', + deprecated: true, + description: + 'Check if app name is available\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdName', @@ -1529,9 +1724,16 @@ export const name = { /** * Publish app to Creators Platform + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post25 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdPublishToCreatorsPlatform', @@ -1548,10 +1750,16 @@ export const publishToCreatorsPlatform = { /** * Get MCP server configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get22 = oc .route({ - description: 'Get MCP server configuration for an application', + deprecated: true, + description: + 'Get MCP server configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdServer', @@ -1563,10 +1771,16 @@ export const get22 = oc /** * Create MCP server configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post26 = oc .route({ - description: 'Create MCP server configuration for an application', + deprecated: true, + description: + 'Create MCP server configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdServer', @@ -1579,10 +1793,16 @@ export const post26 = oc /** * Update MCP server configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const put = oc .route({ - description: 'Update MCP server configuration for an application', + deprecated: true, + description: + 'Update MCP server configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsByAppIdServer', @@ -1639,10 +1859,16 @@ export const site = { /** * Enable or disable app site + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post29 = oc .route({ - description: 'Enable or disable app site', + deprecated: true, + description: + 'Enable or disable app site\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdSiteEnable', @@ -1658,10 +1884,16 @@ export const siteEnable = { /** * Get average response time statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get23 = oc .route({ - description: 'Get average response time statistics for an application', + deprecated: true, + description: + 'Get average response time statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsAverageResponseTime', @@ -1682,10 +1914,16 @@ export const averageResponseTime = { /** * Get average session interaction statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get24 = oc .route({ - description: 'Get average session interaction statistics for an application', + deprecated: true, + description: + 'Get average session interaction statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsAverageSessionInteractions', @@ -1706,10 +1944,16 @@ export const averageSessionInteractions = { /** * Get daily conversation statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get25 = oc .route({ - description: 'Get daily conversation statistics for an application', + deprecated: true, + description: + 'Get daily conversation statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyConversations', @@ -1730,10 +1974,16 @@ export const dailyConversations = { /** * Get daily terminal/end-user statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get26 = oc .route({ - description: 'Get daily terminal/end-user statistics for an application', + deprecated: true, + description: + 'Get daily terminal/end-user statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyEndUsers', @@ -1754,10 +2004,16 @@ export const dailyEndUsers = { /** * Get daily message statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get27 = oc .route({ - description: 'Get daily message statistics for an application', + deprecated: true, + description: + 'Get daily message statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyMessages', @@ -1778,10 +2034,16 @@ export const dailyMessages = { /** * Get daily token cost statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get28 = oc .route({ - description: 'Get daily token cost statistics for an application', + deprecated: true, + description: + 'Get daily token cost statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsTokenCosts', @@ -1802,10 +2064,16 @@ export const tokenCosts = { /** * Get tokens per second statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get29 = oc .route({ - description: 'Get tokens per second statistics for an application', + deprecated: true, + description: + 'Get tokens per second statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsTokensPerSecond', @@ -1826,10 +2094,16 @@ export const tokensPerSecond = { /** * Get user satisfaction rate statistics for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get30 = oc .route({ - description: 'Get user satisfaction rate statistics for an application', + deprecated: true, + description: + 'Get user satisfaction rate statistics for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsUserSatisfactionRate', @@ -1861,10 +2135,16 @@ export const statistics = { /** * Get available TTS voices for a specific language + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get31 = oc .route({ - description: 'Get available TTS voices for a specific language', + deprecated: true, + description: + 'Get available TTS voices for a specific language\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTextToAudioVoices', @@ -1885,10 +2165,16 @@ export const voices = { /** * Convert text to speech for chat messages + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post30 = oc .route({ - description: 'Convert text to speech for chat messages', + deprecated: true, + description: + 'Convert text to speech for chat messages\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdTextToAudio', @@ -1909,10 +2195,16 @@ export const textToAudio = { * Get app trace * * Get app tracing configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get32 = oc .route({ - description: 'Get app tracing configuration', + deprecated: true, + description: + 'Get app tracing configuration\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTrace', @@ -1925,10 +2217,16 @@ export const get32 = oc /** * Update app tracing configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post31 = oc .route({ - description: 'Update app tracing configuration', + deprecated: true, + description: + 'Update app tracing configuration\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdTrace', @@ -1969,10 +2267,16 @@ export const delete5 = oc /** * Get tracing configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get33 = oc .route({ - description: 'Get tracing configuration for an application', + deprecated: true, + description: + 'Get tracing configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTraceConfig', @@ -1988,10 +2292,16 @@ export const get33 = oc * Update an existing trace app configuration * * Update an existing tracing configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch = oc .route({ - description: 'Update an existing tracing configuration for an application', + deprecated: true, + description: + 'Update an existing tracing configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdTraceConfig', @@ -2008,10 +2318,16 @@ export const patch = oc * Create a new trace app configuration * * Create a new tracing configuration for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post32 = oc .route({ - description: 'Create a new tracing configuration for an application', + deprecated: true, + description: + 'Create a new tracing configuration for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdTraceConfig', @@ -2160,10 +2476,16 @@ export const count3 = { * Stop workflow task * * Stop running workflow task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post34 = oc .route({ - description: 'Stop running workflow task', + deprecated: true, + description: + 'Stop running workflow task\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowRunsTasksByTaskIdStop', @@ -2520,10 +2842,16 @@ export const comments = { /** * Get workflow average app interaction statistics + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get45 = oc .route({ - description: 'Get workflow average app interaction statistics', + deprecated: true, + description: + 'Get workflow average app interaction statistics\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsAverageAppInteractions', @@ -2544,10 +2872,16 @@ export const averageAppInteractions = { /** * Get workflow daily runs statistics + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get46 = oc .route({ - description: 'Get workflow daily runs statistics', + deprecated: true, + description: + 'Get workflow daily runs statistics\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsDailyConversations', @@ -2568,10 +2902,16 @@ export const dailyConversations2 = { /** * Get workflow daily terminals statistics + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get47 = oc .route({ - description: 'Get workflow daily terminals statistics', + deprecated: true, + description: + 'Get workflow daily terminals statistics\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsDailyTerminals', @@ -2592,10 +2932,16 @@ export const dailyTerminals = { /** * Get workflow daily token cost statistics + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get48 = oc .route({ - description: 'Get workflow daily token cost statistics', + deprecated: true, + description: + 'Get workflow daily token cost statistics\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsTokenCosts', @@ -2630,10 +2976,16 @@ export const workflow = { * Get default block config * * Get default block configuration by type + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get49 = oc .route({ - description: 'Get default block configuration by type', + deprecated: true, + description: + 'Get default block configuration by type\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockType', @@ -2657,10 +3009,16 @@ export const byBlockType = { * Get default block config * * Get default block configurations for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get50 = oc .route({ - description: 'Get default block configurations for workflow', + deprecated: true, + description: + 'Get default block configurations for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigs', @@ -2678,10 +3036,16 @@ export const defaultWorkflowBlockConfigs = { /** * Get conversation variables for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get51 = oc .route({ - description: 'Get conversation variables for workflow', + deprecated: true, + description: + 'Get conversation variables for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftConversationVariables', @@ -2693,10 +3057,16 @@ export const get51 = oc /** * Update conversation variables for workflow draft + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post38 = oc .route({ - description: 'Update conversation variables for workflow draft', + deprecated: true, + description: + 'Update conversation variables for workflow draft\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftConversationVariables', @@ -2720,10 +3090,16 @@ export const conversationVariables2 = { * Get draft workflow * * Get environment variables for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get52 = oc .route({ - description: 'Get environment variables for workflow', + deprecated: true, + description: + 'Get environment variables for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftEnvironmentVariables', @@ -2736,10 +3112,16 @@ export const get52 = oc /** * Update environment variables for workflow draft + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post39 = oc .route({ - description: 'Update environment variables for workflow draft', + deprecated: true, + description: + 'Update environment variables for workflow draft\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftEnvironmentVariables', @@ -2761,10 +3143,16 @@ export const environmentVariables = { /** * Update draft workflow features + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post40 = oc .route({ - description: 'Update draft workflow features', + deprecated: true, + description: + 'Update draft workflow features\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftFeatures', @@ -2787,10 +3175,16 @@ export const features = { * Test human input delivery * * Test human input delivery for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post41 = oc .route({ - description: 'Test human input delivery for workflow', + deprecated: true, + description: + 'Test human input delivery for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTest', @@ -2814,10 +3208,16 @@ export const deliveryTest = { * Preview human input form content and placeholders * * Get human input form preview for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post42 = oc .route({ - description: 'Get human input form preview for workflow', + deprecated: true, + description: + 'Get human input form preview for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreview', @@ -2841,10 +3241,16 @@ export const preview2 = { * Submit human input form preview * * Submit human input form preview for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post43 = oc .route({ - description: 'Submit human input form preview for workflow', + deprecated: true, + description: + 'Submit human input form preview for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRun', @@ -2886,10 +3292,16 @@ export const humanInput2 = { * Run draft workflow iteration node * * Run draft workflow iteration node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post44 = oc .route({ - description: 'Run draft workflow iteration node', + deprecated: true, + description: + 'Run draft workflow iteration node\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRun', @@ -2925,10 +3337,16 @@ export const iteration2 = { * Run draft workflow loop node * * Run draft workflow loop node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post45 = oc .route({ - description: 'Run draft workflow loop node', + deprecated: true, + description: + 'Run draft workflow loop node\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRun', @@ -2983,10 +3401,16 @@ export const lastRun = { * Run draft workflow node * * Run draft workflow node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post46 = oc .route({ - description: 'Run draft workflow node', + deprecated: true, + description: + 'Run draft workflow node\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdRun', @@ -3010,10 +3434,16 @@ export const run8 = { * Poll for trigger events and execute single node when event arrives * * Poll for trigger events and execute single node when event arrives + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post47 = oc .route({ - description: 'Poll for trigger events and execute single node when event arrives', + deprecated: true, + description: + 'Poll for trigger events and execute single node when event arrives\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRun', @@ -3050,10 +3480,16 @@ export const delete8 = oc /** * Get variables for a specific node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get54 = oc .route({ - description: 'Get variables for a specific node', + deprecated: true, + description: + 'Get variables for a specific node\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdVariables', @@ -3083,10 +3519,16 @@ export const nodes7 = { * Run draft workflow * * Run draft workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post48 = oc .route({ - description: 'Run draft workflow', + deprecated: true, + description: + 'Run draft workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftRun', @@ -3108,10 +3550,16 @@ export const run10 = { /** * Get system variables for workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get55 = oc .route({ - description: 'Get system variables for workflow', + deprecated: true, + description: + 'Get system variables for workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftSystemVariables', @@ -3129,10 +3577,16 @@ export const systemVariables = { * Poll for trigger events and execute full workflow when event arrives * * Poll for trigger events and execute full workflow when event arrives + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post49 = oc .route({ - description: 'Poll for trigger events and execute full workflow when event arrives', + deprecated: true, + description: + 'Poll for trigger events and execute full workflow when event arrives\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftTriggerRun', @@ -3156,10 +3610,16 @@ export const run11 = { * Full workflow debug when the start node is a trigger * * Full workflow debug when the start node is a trigger + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post50 = oc .route({ - description: 'Full workflow debug when the start node is a trigger', + deprecated: true, + description: + 'Full workflow debug when the start node is a trigger\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftTriggerRunAll', @@ -3186,10 +3646,16 @@ export const trigger2 = { /** * Reset a workflow variable to its default value + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const put4 = oc .route({ - description: 'Reset a workflow variable to its default value', + deprecated: true, + description: + 'Reset a workflow variable to its default value\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsByAppIdWorkflowsDraftVariablesByVariableIdReset', @@ -3221,10 +3687,16 @@ export const delete9 = oc /** * Get a specific workflow variable + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get56 = oc .route({ - description: 'Get a specific workflow variable', + deprecated: true, + description: + 'Get a specific workflow variable\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftVariablesByVariableId', @@ -3236,10 +3708,16 @@ export const get56 = oc /** * Update a workflow variable + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch2 = oc .route({ - description: 'Update a workflow variable', + deprecated: true, + description: + 'Update a workflow variable\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdWorkflowsDraftVariablesByVariableId', @@ -3281,10 +3759,16 @@ export const delete10 = oc * Get draft workflow * * Get draft workflow variables + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get57 = oc .route({ - description: 'Get draft workflow variables', + deprecated: true, + description: + 'Get draft workflow variables\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftVariables', @@ -3310,10 +3794,16 @@ export const variables2 = { * Get draft workflow * * Get draft workflow for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get58 = oc .route({ - description: 'Get draft workflow for an application', + deprecated: true, + description: + 'Get draft workflow for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraft', @@ -3328,10 +3818,16 @@ export const get58 = oc * Sync draft workflow * * Sync draft workflow configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post51 = oc .route({ - description: 'Sync draft workflow configuration', + deprecated: true, + description: + 'Sync draft workflow configuration\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraft', @@ -3367,10 +3863,16 @@ export const draft2 = { * Get published workflow * * Get published workflow for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get59 = oc .route({ - description: 'Get published workflow for an application', + deprecated: true, + description: + 'Get published workflow for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsPublish', @@ -3383,9 +3885,16 @@ export const get59 = oc /** * Publish workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post52 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsPublish', @@ -3408,9 +3917,16 @@ export const publish = { /** * Get webhook trigger for a node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get60 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsTriggersWebhook', @@ -3436,10 +3952,16 @@ export const triggers2 = { /** * Restore a published workflow version into the draft workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post53 = oc .route({ - description: 'Restore a published workflow version into the draft workflow', + deprecated: true, + description: + 'Restore a published workflow version into the draft workflow\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsByWorkflowIdRestore', @@ -3455,9 +3977,16 @@ export const restore = { /** * Delete workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const delete11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAppsByAppIdWorkflowsByWorkflowId', @@ -3472,10 +4001,16 @@ export const delete11 = oc * Update workflow attributes * * Update workflow by ID + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch3 = oc .route({ - description: 'Update workflow by ID', + deprecated: true, + description: + 'Update workflow by ID\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdWorkflowsByWorkflowId', @@ -3501,10 +4036,16 @@ export const byWorkflowId = { * Get published workflows * * Get all published workflows for an application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get61 = oc .route({ - description: 'Get all published workflows for an application', + deprecated: true, + description: + 'Get all published workflows for an application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflows', @@ -3552,10 +4093,16 @@ export const delete12 = oc * Get app detail * * Get application details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get62 = oc .route({ - description: 'Get application details', + deprecated: true, + description: + 'Get application details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppId', @@ -3570,10 +4117,16 @@ export const get62 = oc * Update app * * Update application details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const put5 = oc .route({ - description: 'Update application details', + deprecated: true, + description: + 'Update application details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsByAppId', @@ -3698,10 +4251,16 @@ export const byResourceId = { /** * Refresh MCP server configuration and regenerate server code + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get64 = oc .route({ - description: 'Refresh MCP server configuration and regenerate server code', + deprecated: true, + description: + 'Refresh MCP server configuration and regenerate server code\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByServerIdServerRefresh', @@ -3745,10 +4304,16 @@ export const get65 = oc * Create app * * Create a new application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post55 = oc .route({ - description: 'Create a new application', + deprecated: true, + description: + 'Create a new application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postApps', diff --git a/packages/contracts/generated/api/console/apps/types.gen.ts b/packages/contracts/generated/api/console/apps/types.gen.ts index 2402abb2da..a4e3c97a0a 100644 --- a/packages/contracts/generated/api/console/apps/types.gen.ts +++ b/packages/contracts/generated/api/console/apps/types.gen.ts @@ -72,6 +72,10 @@ export type WorkflowOnlineUsersPayload = { app_ids?: Array } +export type WorkflowOnlineUsersResponse = { + data: Array +} + export type AppDetailWithSite = { access_mode?: string | null api_base_url?: string | null @@ -627,39 +631,33 @@ export type WorkflowCommentResolve = { resolved_by?: string | null } -export type WorkflowPagination = { - has_more?: boolean - items?: Array - limit?: number - page?: number +export type WorkflowPaginationResponse = { + has_more: boolean + items: Array + limit: number + page: number } -export type Workflow = { - conversation_variables?: Array - created_at?: { - [key: string]: unknown - } +export type WorkflowResponse = { + conversation_variables: Array + created_at: number created_by?: SimpleAccount - environment_variables?: Array<{ - [key: string]: unknown - }> - features?: { + environment_variables: Array + features: { [key: string]: unknown } - graph?: { - [key: string]: unknown - } - hash?: string - id?: string - marked_comment?: string - marked_name?: string - rag_pipeline_variables?: Array - tool_published?: boolean - updated_at?: { + graph: { [key: string]: unknown } + hash: string + id: string + marked_comment: string + marked_name: string + rag_pipeline_variables: Array + tool_published: boolean + updated_at: number updated_by?: SimpleAccount - version?: string + version: string } export type SyncDraftWorkflowPayload = { @@ -886,6 +884,11 @@ export type PluginDependency = { value: unknown } +export type WorkflowOnlineUsersByApp = { + app_id: string + users: Array +} + export type DeletedTool = { provider_id: string tool_name: string @@ -1182,33 +1185,43 @@ export type WorkflowCommentReply = { id: string } -export type ConversationVariable = { - description?: string - id?: string - name?: string - value?: { +export type WorkflowConversationVariableResponse = { + description: string + id: string + name: string + value: { [key: string]: unknown } - value_type?: string + value_type: string } -export type PipelineVariable = { - allow_file_extension?: Array - allow_file_upload_methods?: Array - allowed_file_types?: Array - belong_to_node_id?: string +export type WorkflowEnvironmentVariableResponse = { + description: string + id: string + name: string + value: { + [key: string]: unknown + } + value_type: string +} + +export type PipelineVariableResponse = { + allowed_file_extensions?: Array | null + allowed_file_types?: Array | null + allowed_file_upload_methods?: Array | null + belong_to_node_id: string default_value?: { [key: string]: unknown } - label?: string - max_length?: number - options?: Array - placeholder?: string - required?: boolean - tooltips?: string - type?: string - unit?: string - variable?: string + label: string + max_length?: number | null + options?: Array | null + placeholder?: string | null + required: boolean + tooltips?: string | null + type: string + unit?: string | null + variable: string } export type WorkflowDraftVariableWithoutValue = { @@ -1253,6 +1266,12 @@ export type Package = { version?: string | null } +export type WorkflowOnlineUser = { + avatar?: string | null + user_id: string + username: string +} + export type SimpleModelConfig = { model_dict?: JsonValue pre_prompt?: string | null @@ -1548,9 +1567,7 @@ export type PostAppsWorkflowsOnlineUsersData = { } export type PostAppsWorkflowsOnlineUsersResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowOnlineUsersResponse } export type PostAppsWorkflowsOnlineUsersResponse @@ -1575,7 +1592,7 @@ export type DeleteAppsByAppIdError = DeleteAppsByAppIdErrors[keyof DeleteAppsByA export type DeleteAppsByAppIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -2155,7 +2172,7 @@ export type PostAppsByAppIdAnnotationsByAnnotationIdError export type PostAppsByAppIdAnnotationsByAnnotationIdResponses = { 200: Annotation 204: { - [key: string]: unknown + [key: string]: never } } @@ -2301,7 +2318,7 @@ export type DeleteAppsByAppIdChatConversationsByConversationIdError export type DeleteAppsByAppIdChatConversationsByConversationIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -2467,7 +2484,7 @@ export type DeleteAppsByAppIdCompletionConversationsByConversationIdError export type DeleteAppsByAppIdCompletionConversationsByConversationIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -3270,7 +3287,7 @@ export type DeleteAppsByAppIdTraceConfigError export type DeleteAppsByAppIdTraceConfigResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -3645,7 +3662,7 @@ export type DeleteAppsByAppIdWorkflowCommentsByCommentIdData = { export type DeleteAppsByAppIdWorkflowCommentsByCommentIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -3716,7 +3733,7 @@ export type DeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdData = { export type DeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -3857,7 +3874,7 @@ export type GetAppsByAppIdWorkflowsData = { } export type GetAppsByAppIdWorkflowsResponses = { - 200: WorkflowPagination + 200: WorkflowPaginationResponse } export type GetAppsByAppIdWorkflowsResponse @@ -3930,7 +3947,7 @@ export type GetAppsByAppIdWorkflowsDraftError = GetAppsByAppIdWorkflowsDraftErrors[keyof GetAppsByAppIdWorkflowsDraftErrors] export type GetAppsByAppIdWorkflowsDraftResponses = { - 200: Workflow + 200: WorkflowResponse } export type GetAppsByAppIdWorkflowsDraftResponse @@ -4290,7 +4307,7 @@ export type DeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesData = { export type DeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -4428,7 +4445,7 @@ export type DeleteAppsByAppIdWorkflowsDraftVariablesData = { export type DeleteAppsByAppIdWorkflowsDraftVariablesResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -4475,7 +4492,7 @@ export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdError export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -4556,7 +4573,7 @@ export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetError export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetResponses = { 200: WorkflowDraftVariable 204: { - [key: string]: unknown + [key: string]: never } } @@ -4572,17 +4589,8 @@ export type GetAppsByAppIdWorkflowsPublishData = { url: '/apps/{app_id}/workflows/publish' } -export type GetAppsByAppIdWorkflowsPublishErrors = { - 404: { - [key: string]: unknown - } -} - -export type GetAppsByAppIdWorkflowsPublishError - = GetAppsByAppIdWorkflowsPublishErrors[keyof GetAppsByAppIdWorkflowsPublishErrors] - export type GetAppsByAppIdWorkflowsPublishResponses = { - 200: Workflow + 200: WorkflowResponse } export type GetAppsByAppIdWorkflowsPublishResponse @@ -4668,7 +4676,7 @@ export type PatchAppsByAppIdWorkflowsByWorkflowIdError = PatchAppsByAppIdWorkflowsByWorkflowIdErrors[keyof PatchAppsByAppIdWorkflowsByWorkflowIdErrors] export type PatchAppsByAppIdWorkflowsByWorkflowIdResponses = { - 200: Workflow + 200: WorkflowResponse } export type PatchAppsByAppIdWorkflowsByWorkflowIdResponse @@ -4758,7 +4766,7 @@ export type DeleteAppsByResourceIdApiKeysByApiKeyIdData = { export type DeleteAppsByResourceIdApiKeysByApiKeyIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } diff --git a/packages/contracts/generated/api/console/apps/zod.gen.ts b/packages/contracts/generated/api/console/apps/zod.gen.ts index f02b146106..1f8ea393c7 100644 --- a/packages/contracts/generated/api/console/apps/zod.gen.ts +++ b/packages/contracts/generated/api/console/apps/zod.gen.ts @@ -1108,54 +1108,77 @@ export const zWorkflowCommentDetail = z.object({ updated_at: z.int().nullish(), }) -export const zConversationVariable = z.object({ - description: z.string().optional(), - id: z.string().optional(), - name: z.string().optional(), - value: z.record(z.string(), z.unknown()).optional(), - value_type: z.string().optional(), +/** + * WorkflowConversationVariableResponse + */ +export const zWorkflowConversationVariableResponse = z.object({ + description: z.string(), + id: z.string(), + name: z.string(), + value: z.record(z.string(), z.unknown()), + value_type: z.string(), }) -export const zPipelineVariable = z.object({ - allow_file_extension: z.array(z.string()).optional(), - allow_file_upload_methods: z.array(z.string()).optional(), - allowed_file_types: z.array(z.string()).optional(), - belong_to_node_id: z.string().optional(), +/** + * WorkflowEnvironmentVariableResponse + */ +export const zWorkflowEnvironmentVariableResponse = z.object({ + description: z.string(), + id: z.string(), + name: z.string(), + value: z.record(z.string(), z.unknown()), + value_type: z.string(), +}) + +/** + * PipelineVariableResponse + */ +export const zPipelineVariableResponse = z.object({ + allowed_file_extensions: z.array(z.string()).nullish(), + allowed_file_types: z.array(z.string()).nullish(), + allowed_file_upload_methods: z.array(z.string()).nullish(), + belong_to_node_id: z.string(), default_value: z.record(z.string(), z.unknown()).optional(), - label: z.string().optional(), - max_length: z.int().optional(), - options: z.array(z.string()).optional(), - placeholder: z.string().optional(), - required: z.boolean().optional(), - tooltips: z.string().optional(), - type: z.string().optional(), - unit: z.string().optional(), - variable: z.string().optional(), + label: z.string(), + max_length: z.int().nullish(), + options: z.array(z.string()).nullish(), + placeholder: z.string().nullish(), + required: z.boolean(), + tooltips: z.string().nullish(), + type: z.string(), + unit: z.string().nullish(), + variable: z.string(), }) -export const zWorkflow = z.object({ - conversation_variables: z.array(zConversationVariable).optional(), - created_at: z.record(z.string(), z.unknown()).optional(), +/** + * WorkflowResponse + */ +export const zWorkflowResponse = z.object({ + conversation_variables: z.array(zWorkflowConversationVariableResponse), + created_at: z.int(), created_by: zSimpleAccount.optional(), - environment_variables: z.array(z.record(z.string(), z.unknown())).optional(), - features: z.record(z.string(), z.unknown()).optional(), - graph: z.record(z.string(), z.unknown()).optional(), - hash: z.string().optional(), - id: z.string().optional(), - marked_comment: z.string().optional(), - marked_name: z.string().optional(), - rag_pipeline_variables: z.array(zPipelineVariable).optional(), - tool_published: z.boolean().optional(), - updated_at: z.record(z.string(), z.unknown()).optional(), + environment_variables: z.array(zWorkflowEnvironmentVariableResponse), + features: z.record(z.string(), z.unknown()), + graph: z.record(z.string(), z.unknown()), + hash: z.string(), + id: z.string(), + marked_comment: z.string(), + marked_name: z.string(), + rag_pipeline_variables: z.array(zPipelineVariableResponse), + tool_published: z.boolean(), + updated_at: z.int(), updated_by: zSimpleAccount.optional(), - version: z.string().optional(), + version: z.string(), }) -export const zWorkflowPagination = z.object({ - has_more: z.boolean().optional(), - items: z.array(zWorkflow).optional(), - limit: z.int().optional(), - page: z.int().optional(), +/** + * WorkflowPaginationResponse + */ +export const zWorkflowPaginationResponse = z.object({ + has_more: z.boolean(), + items: z.array(zWorkflowResponse), + limit: z.int(), + page: z.int(), }) export const zWorkflowDraftVariableWithoutValue = z.object({ @@ -1374,6 +1397,30 @@ export const zPackage = z.object({ version: z.string().nullish(), }) +/** + * WorkflowOnlineUser + */ +export const zWorkflowOnlineUser = z.object({ + avatar: z.string().nullish(), + user_id: z.string(), + username: z.string(), +}) + +/** + * WorkflowOnlineUsersByApp + */ +export const zWorkflowOnlineUsersByApp = z.object({ + app_id: z.string(), + users: z.array(zWorkflowOnlineUser), +}) + +/** + * WorkflowOnlineUsersResponse + */ +export const zWorkflowOnlineUsersResponse = z.object({ + data: z.array(zWorkflowOnlineUsersByApp), +}) + /** * SimpleModelConfig */ @@ -1862,9 +1909,9 @@ export const zPostAppsImportsByImportIdConfirmResponse = zImport export const zPostAppsWorkflowsOnlineUsersBody = zWorkflowOnlineUsersPayload /** - * Success + * Workflow online users retrieved successfully */ -export const zPostAppsWorkflowsOnlineUsersResponse = z.record(z.string(), z.unknown()) +export const zPostAppsWorkflowsOnlineUsersResponse = zWorkflowOnlineUsersResponse export const zDeleteAppsByAppIdPath = z.object({ app_id: z.string(), @@ -1873,7 +1920,7 @@ export const zDeleteAppsByAppIdPath = z.object({ /** * App deleted successfully */ -export const zDeleteAppsByAppIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdResponse = z.record(z.string(), z.never()) export const zGetAppsByAppIdPath = z.object({ app_id: z.string(), @@ -2162,7 +2209,7 @@ export const zPostAppsByAppIdAnnotationsByAnnotationIdPath = z.object({ export const zPostAppsByAppIdAnnotationsByAnnotationIdResponse = z.union([ zAnnotation, - z.record(z.string(), z.unknown()), + z.record(z.string(), z.never()), ]) export const zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesPath = z.object({ @@ -2233,7 +2280,7 @@ export const zDeleteAppsByAppIdChatConversationsByConversationIdPath = z.object( */ export const zDeleteAppsByAppIdChatConversationsByConversationIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetAppsByAppIdChatConversationsByConversationIdPath = z.object({ @@ -2310,7 +2357,7 @@ export const zDeleteAppsByAppIdCompletionConversationsByConversationIdPath = z.o */ export const zDeleteAppsByAppIdCompletionConversationsByConversationIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetAppsByAppIdCompletionConversationsByConversationIdPath = z.object({ @@ -2721,7 +2768,7 @@ export const zDeleteAppsByAppIdTraceConfigPath = z.object({ /** * Tracing configuration deleted successfully */ -export const zDeleteAppsByAppIdTraceConfigResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdTraceConfigResponse = z.record(z.string(), z.never()) export const zGetAppsByAppIdTraceConfigPath = z.object({ app_id: z.string(), @@ -2933,10 +2980,7 @@ export const zDeleteAppsByAppIdWorkflowCommentsByCommentIdPath = z.object({ /** * Comment deleted successfully */ -export const zDeleteAppsByAppIdWorkflowCommentsByCommentIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteAppsByAppIdWorkflowCommentsByCommentIdResponse = z.record(z.string(), z.never()) export const zGetAppsByAppIdWorkflowCommentsByCommentIdPath = z.object({ app_id: z.string(), @@ -2984,7 +3028,7 @@ export const zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath = */ export const zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdBody @@ -3091,7 +3135,7 @@ export const zGetAppsByAppIdWorkflowsQuery = z.object({ /** * Published workflows retrieved successfully */ -export const zGetAppsByAppIdWorkflowsResponse = zWorkflowPagination +export const zGetAppsByAppIdWorkflowsResponse = zWorkflowPaginationResponse export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsPath = z.object({ app_id: z.string(), @@ -3129,7 +3173,7 @@ export const zGetAppsByAppIdWorkflowsDraftPath = z.object({ /** * Draft workflow retrieved successfully */ -export const zGetAppsByAppIdWorkflowsDraftResponse = zWorkflow +export const zGetAppsByAppIdWorkflowsDraftResponse = zWorkflowResponse export const zPostAppsByAppIdWorkflowsDraftBody = zSyncDraftWorkflowPayload @@ -3329,7 +3373,7 @@ export const zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath = z.obje */ export const zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath = z.object({ @@ -3392,7 +3436,7 @@ export const zDeleteAppsByAppIdWorkflowsDraftVariablesPath = z.object({ /** * Workflow variables deleted successfully */ -export const zDeleteAppsByAppIdWorkflowsDraftVariablesResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdWorkflowsDraftVariablesResponse = z.record(z.string(), z.never()) export const zGetAppsByAppIdWorkflowsDraftVariablesPath = z.object({ app_id: z.string(), @@ -3418,7 +3462,7 @@ export const zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdPath = z.objec */ export const zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetAppsByAppIdWorkflowsDraftVariablesByVariableIdPath = z.object({ @@ -3451,7 +3495,7 @@ export const zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetPath = z.obj export const zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetResponse = z.union([ zWorkflowDraftVariable, - z.record(z.string(), z.unknown()), + z.record(z.string(), z.never()), ]) export const zGetAppsByAppIdWorkflowsPublishPath = z.object({ @@ -3459,9 +3503,9 @@ export const zGetAppsByAppIdWorkflowsPublishPath = z.object({ }) /** - * Published workflow retrieved successfully + * Published workflow retrieved successfully, or null if not found */ -export const zGetAppsByAppIdWorkflowsPublishResponse = zWorkflow +export const zGetAppsByAppIdWorkflowsPublishResponse = zWorkflowResponse export const zPostAppsByAppIdWorkflowsPublishBody = zPublishWorkflowPayload @@ -3509,7 +3553,7 @@ export const zPatchAppsByAppIdWorkflowsByWorkflowIdPath = z.object({ /** * Workflow updated successfully */ -export const zPatchAppsByAppIdWorkflowsByWorkflowIdResponse = zWorkflow +export const zPatchAppsByAppIdWorkflowsByWorkflowIdResponse = zWorkflowResponse export const zPostAppsByAppIdWorkflowsByWorkflowIdRestorePath = z.object({ app_id: z.string(), @@ -3550,7 +3594,7 @@ export const zDeleteAppsByResourceIdApiKeysByApiKeyIdPath = z.object({ /** * API key deleted successfully */ -export const zDeleteAppsByResourceIdApiKeysByApiKeyIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByResourceIdApiKeysByApiKeyIdResponse = z.record(z.string(), z.never()) export const zGetAppsByServerIdServerRefreshPath = z.object({ server_id: z.string(), diff --git a/packages/contracts/generated/api/console/auth/orpc.gen.ts b/packages/contracts/generated/api/console/auth/orpc.gen.ts index 7a95a96f10..a17a733d82 100644 --- a/packages/contracts/generated/api/console/auth/orpc.gen.ts +++ b/packages/contracts/generated/api/console/auth/orpc.gen.ts @@ -30,8 +30,16 @@ import { zPostAuthPluginDatasourceByProviderIdUpdateResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAuthPluginDatasourceDefaultList', @@ -44,8 +52,16 @@ export const defaultList = { get, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAuthPluginDatasourceList', @@ -58,8 +74,16 @@ export const list = { get: get2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAuthPluginDatasourceByProviderIdCustomClient', @@ -69,8 +93,16 @@ export const delete_ = oc .input(z.object({ params: zDeleteAuthPluginDatasourceByProviderIdCustomClientPath })) .output(zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderIdCustomClient', @@ -90,8 +122,16 @@ export const customClient = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderIdDefault', @@ -110,8 +150,16 @@ export const default_ = { post: post2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderIdDelete', @@ -130,8 +178,16 @@ export const delete2 = { post: post3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderIdUpdate', @@ -150,8 +206,16 @@ export const update = { post: post4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderIdUpdateName', @@ -170,8 +234,16 @@ export const updateName = { post: post5, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAuthPluginDatasourceByProviderId', @@ -181,8 +253,16 @@ export const get3 = oc .input(z.object({ params: zGetAuthPluginDatasourceByProviderIdPath })) .output(zGetAuthPluginDatasourceByProviderIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAuthPluginDatasourceByProviderId', diff --git a/packages/contracts/generated/api/console/billing/orpc.gen.ts b/packages/contracts/generated/api/console/billing/orpc.gen.ts index 09d25c072e..501f8a4e46 100644 --- a/packages/contracts/generated/api/console/billing/orpc.gen.ts +++ b/packages/contracts/generated/api/console/billing/orpc.gen.ts @@ -11,8 +11,16 @@ import { zPutBillingPartnersByPartnerKeyTenantsResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getBillingInvoices', @@ -27,10 +35,16 @@ export const invoices = { /** * Sync partner tenants bindings + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const put = oc .route({ - description: 'Sync partner tenants bindings', + deprecated: true, + description: + 'Sync partner tenants bindings\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putBillingPartnersByPartnerKeyTenants', @@ -57,8 +71,16 @@ export const partners = { byPartnerKey, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getBillingSubscription', diff --git a/packages/contracts/generated/api/console/compliance/orpc.gen.ts b/packages/contracts/generated/api/console/compliance/orpc.gen.ts index e68c87e7eb..ec7a9be60f 100644 --- a/packages/contracts/generated/api/console/compliance/orpc.gen.ts +++ b/packages/contracts/generated/api/console/compliance/orpc.gen.ts @@ -7,10 +7,16 @@ import { zGetComplianceDownloadQuery, zGetComplianceDownloadResponse } from './z /** * Get compliance document download link + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get compliance document download link', + deprecated: true, + description: + 'Get compliance document download link\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getComplianceDownload', diff --git a/packages/contracts/generated/api/console/data-source/orpc.gen.ts b/packages/contracts/generated/api/console/data-source/orpc.gen.ts index 209447236a..dceb32433d 100644 --- a/packages/contracts/generated/api/console/data-source/orpc.gen.ts +++ b/packages/contracts/generated/api/console/data-source/orpc.gen.ts @@ -12,8 +12,16 @@ import { zPatchDataSourceIntegratesResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDataSourceIntegratesByBindingIdByAction', @@ -23,8 +31,16 @@ export const get = oc .input(z.object({ params: zGetDataSourceIntegratesByBindingIdByActionPath })) .output(zGetDataSourceIntegratesByBindingIdByActionResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDataSourceIntegratesByBindingIdByAction', @@ -43,8 +59,16 @@ export const byBindingId = { byAction, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDataSourceIntegrates', @@ -53,8 +77,16 @@ export const get2 = oc }) .output(zGetDataSourceIntegratesResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDataSourceIntegrates', diff --git a/packages/contracts/generated/api/console/datasets/orpc.gen.ts b/packages/contracts/generated/api/console/datasets/orpc.gen.ts index 37a0b7cb8c..6a2bcb7720 100644 --- a/packages/contracts/generated/api/console/datasets/orpc.gen.ts +++ b/packages/contracts/generated/api/console/datasets/orpc.gen.ts @@ -187,10 +187,16 @@ import { /** * Get dataset API base information + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get dataset API base information', + deprecated: true, + description: + 'Get dataset API base information\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsApiBaseInfo', @@ -253,8 +259,16 @@ export const apiKeys = { byApiKeyId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsBatchImportStatusByJobId', @@ -264,8 +278,16 @@ export const get3 = oc .input(z.object({ params: zGetDatasetsBatchImportStatusByJobIdPath })) .output(zGetDatasetsBatchImportStatusByJobIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsBatchImportStatusByJobId', @@ -291,10 +313,16 @@ export const batchImportStatus = { /** * Create external knowledge dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post3 = oc .route({ - description: 'Create external knowledge dataset', + deprecated: true, + description: + 'Create external knowledge dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsExternal', @@ -311,10 +339,16 @@ export const external = { /** * Check if external knowledge API is being used + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get4 = oc .route({ - description: 'Check if external knowledge API is being used', + deprecated: true, + description: + 'Check if external knowledge API is being used\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdUseCheck', @@ -328,8 +362,16 @@ export const useCheck = { get: get4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsExternalKnowledgeApiByExternalKnowledgeApiId', @@ -341,10 +383,16 @@ export const delete2 = oc /** * Get external knowledge API template details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ - description: 'Get external knowledge API template details', + deprecated: true, + description: + 'Get external knowledge API template details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsExternalKnowledgeApiByExternalKnowledgeApiId', @@ -354,8 +402,16 @@ export const get5 = oc .input(z.object({ params: zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath })) .output(zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsExternalKnowledgeApiByExternalKnowledgeApiId', @@ -379,10 +435,16 @@ export const byExternalKnowledgeApiId = { /** * Get external knowledge API templates + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ - description: 'Get external knowledge API templates', + deprecated: true, + description: + 'Get external knowledge API templates\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsExternalKnowledgeApi', @@ -392,8 +454,16 @@ export const get6 = oc .input(z.object({ query: zGetDatasetsExternalKnowledgeApiQuery.optional() })) .output(zGetDatasetsExternalKnowledgeApiResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsExternalKnowledgeApi', @@ -411,10 +481,16 @@ export const externalKnowledgeApi = { /** * Estimate dataset indexing cost + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post5 = oc .route({ - description: 'Estimate dataset indexing cost', + deprecated: true, + description: + 'Estimate dataset indexing cost\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsIndexingEstimate', @@ -430,10 +506,16 @@ export const indexingEstimate = { /** * Initialize dataset with documents + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post6 = oc .route({ - description: 'Initialize dataset with documents', + deprecated: true, + description: + 'Initialize dataset with documents\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsInit', @@ -448,8 +530,16 @@ export const init = { post: post6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsMetadataBuiltIn', @@ -466,8 +556,16 @@ export const metadata = { builtIn, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsNotionIndexingEstimate', @@ -476,8 +574,16 @@ export const get8 = oc }) .output(zGetDatasetsNotionIndexingEstimateResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsNotionIndexingEstimate', @@ -494,10 +600,16 @@ export const notionIndexingEstimate = { /** * Get dataset document processing rules + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get9 = oc .route({ - description: 'Get dataset document processing rules', + deprecated: true, + description: + 'Get dataset document processing rules\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsProcessRule', @@ -513,10 +625,16 @@ export const processRule = { /** * Get mock dataset retrieval settings by vector type + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get10 = oc .route({ - description: 'Get mock dataset retrieval settings by vector type', + deprecated: true, + description: + 'Get mock dataset retrieval settings by vector type\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsRetrievalSettingByVectorType', @@ -532,10 +650,16 @@ export const byVectorType = { /** * Get dataset retrieval settings + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ - description: 'Get dataset retrieval settings', + deprecated: true, + description: + 'Get dataset retrieval settings\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsRetrievalSetting', @@ -549,8 +673,16 @@ export const retrievalSetting = { byVectorType, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdApiKeysByStatus', @@ -570,10 +702,16 @@ export const apiKeys2 = { /** * Get dataset auto disable logs + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get12 = oc .route({ - description: 'Get dataset auto disable logs', + deprecated: true, + description: + 'Get dataset auto disable logs\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdAutoDisableLogs', @@ -587,8 +725,16 @@ export const autoDisableLogs = { get: get12, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdBatchByBatchIndexingEstimate', @@ -602,8 +748,16 @@ export const indexingEstimate2 = { get: get13, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdBatchByBatchIndexingStatus', @@ -630,10 +784,16 @@ export const batch = { * Stream a ZIP archive containing the requested uploaded documents * * Download selected dataset documents as a single ZIP archive (upload-file only) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post9 = oc .route({ - description: 'Download selected dataset documents as a single ZIP archive (upload-file only)', + deprecated: true, + description: + 'Download selected dataset documents as a single ZIP archive (upload-file only)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip', @@ -660,11 +820,16 @@ export const downloadZip = { * This endpoint checks if the dataset configuration supports summary generation * (indexing_technique must be 'high_quality' and summary_index_setting.enable must be true), * then asynchronously generates summary indexes for the provided documents. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post10 = oc .route({ + deprecated: true, description: - 'Generate summary index for documents\nThis endpoint checks if the dataset configuration supports summary generation\n(indexing_technique must be \'high_quality\' and summary_index_setting.enable must be true),\nthen asynchronously generates summary indexes for the provided documents.', + 'Generate summary index for documents\nThis endpoint checks if the dataset configuration supports summary generation\n(indexing_technique must be \'high_quality\' and summary_index_setting.enable must be true),\nthen asynchronously generates summary indexes for the provided documents.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsGenerateSummary', @@ -684,8 +849,16 @@ export const generateSummary = { post: post10, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsMetadata', @@ -704,8 +877,16 @@ export const metadata2 = { post: post11, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsStatusByActionBatch', @@ -729,10 +910,16 @@ export const status = { /** * Get a signed download URL for a dataset document's original uploaded file + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ - description: 'Get a signed download URL for a dataset document\'s original uploaded file', + deprecated: true, + description: + 'Get a signed download URL for a dataset document\'s original uploaded file\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdDownload', @@ -748,10 +935,16 @@ export const download = { /** * Estimate document indexing cost + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get16 = oc .route({ - description: 'Estimate document indexing cost', + deprecated: true, + description: + 'Estimate document indexing cost\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimate', @@ -767,10 +960,16 @@ export const indexingEstimate3 = { /** * Get document indexing status + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get17 = oc .route({ - description: 'Get document indexing status', + deprecated: true, + description: + 'Get document indexing status\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatus', @@ -786,10 +985,16 @@ export const indexingStatus2 = { /** * Update document metadata + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const put = oc .route({ - description: 'Update document metadata', + deprecated: true, + description: + 'Update document metadata\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putDatasetsByDatasetIdDocumentsByDocumentIdMetadata', @@ -808,8 +1013,16 @@ export const metadata3 = { put, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get18 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdNotionSync', @@ -827,8 +1040,16 @@ export const notion = { sync, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLog', @@ -844,9 +1065,16 @@ export const pipelineExecutionLog = { /** * pause document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdProcessingPause', @@ -863,9 +1091,16 @@ export const pause = { /** * recover document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdProcessingResume', @@ -882,10 +1117,16 @@ export const resume = { /** * Update document processing status (pause/resume) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch5 = oc .route({ - description: 'Update document processing status (pause/resume)', + deprecated: true, + description: + 'Update document processing status (pause/resume)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByAction', @@ -925,8 +1166,16 @@ export const rename = { post: post12, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdSegmentByAction', @@ -940,8 +1189,16 @@ export const byAction3 = { patch: patch6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegment', @@ -961,8 +1218,16 @@ export const segment = { byAction: byAction3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImport', @@ -972,8 +1237,16 @@ export const get20 = oc .input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportPath })) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImport', @@ -993,8 +1266,16 @@ export const batchImport = { post: post14, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: @@ -1012,8 +1293,16 @@ export const delete3 = oc zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, ) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: @@ -1037,8 +1326,16 @@ export const byChildChunkId = { patch: patch7, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get21 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', @@ -1052,8 +1349,16 @@ export const get21 = oc ) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', @@ -1067,8 +1372,16 @@ export const patch8 = oc ) .output(zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post15 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', @@ -1090,8 +1403,16 @@ export const childChunks = { byChildChunkId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', @@ -1103,8 +1424,16 @@ export const delete4 = oc ) .output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', @@ -1125,8 +1454,16 @@ export const bySegmentId = { childChunks, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegments', @@ -1136,8 +1473,16 @@ export const delete5 = oc .input(z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath })) .output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get22 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegments', @@ -1166,11 +1511,16 @@ export const segments = { * - error: Number of summaries with errors * - not_started: Number of segments without summary records * - summaries: List of summary records with status and content preview + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get23 = oc .route({ + deprecated: true, description: - 'Get summary index generation status for a document\nReturns:\n- total_segments: Total number of segments in the document\n- summary_status: Dictionary with status counts\n - completed: Number of summaries completed\n - generating: Number of summaries being generated\n - error: Number of summaries with errors\n - not_started: Number of segments without summary records\n- summaries: List of summary records with status and content preview', + 'Get summary index generation status for a document\nReturns:\n- total_segments: Total number of segments in the document\n- summary_status: Dictionary with status counts\n - completed: Number of summaries completed\n - generating: Number of summaries being generated\n - error: Number of summaries with errors\n - not_started: Number of segments without summary records\n- summaries: List of summary records with status and content preview\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatus', @@ -1187,9 +1537,16 @@ export const summaryStatus = { /** * sync website document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get24 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdWebsiteSync', @@ -1204,8 +1561,16 @@ export const websiteSync = { get: get24, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentId', @@ -1217,10 +1582,16 @@ export const delete6 = oc /** * Get document details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get25 = oc .route({ - description: 'Get document details', + deprecated: true, + description: + 'Get document details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId', @@ -1252,8 +1623,16 @@ export const byDocumentId = { websiteSync, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocuments', @@ -1265,10 +1644,16 @@ export const delete7 = oc /** * Get documents in a dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get26 = oc .route({ - description: 'Get documents in a dataset', + deprecated: true, + description: + 'Get documents in a dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocuments', @@ -1283,8 +1668,16 @@ export const get26 = oc ) .output(zGetDatasetsByDatasetIdDocumentsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post16 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocuments', @@ -1312,10 +1705,16 @@ export const documents = { /** * Get dataset error documents + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get27 = oc .route({ - description: 'Get dataset error documents', + deprecated: true, + description: + 'Get dataset error documents\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdErrorDocs', @@ -1331,10 +1730,16 @@ export const errorDocs = { /** * Test external knowledge retrieval for dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post17 = oc .route({ - description: 'Test external knowledge retrieval for dataset', + deprecated: true, + description: + 'Test external knowledge retrieval for dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdExternalHitTesting', @@ -1355,10 +1760,16 @@ export const externalHitTesting = { /** * Test dataset knowledge retrieval + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post18 = oc .route({ - description: 'Test dataset knowledge retrieval', + deprecated: true, + description: + 'Test dataset knowledge retrieval\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdHitTesting', @@ -1379,10 +1790,16 @@ export const hitTesting = { /** * Get dataset indexing status + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get28 = oc .route({ - description: 'Get dataset indexing status', + deprecated: true, + description: + 'Get dataset indexing status\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdIndexingStatus', @@ -1396,8 +1813,16 @@ export const indexingStatus3 = { get: get28, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadataBuiltInByAction', @@ -1415,8 +1840,16 @@ export const builtIn2 = { byAction: byAction4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdMetadataByMetadataId', @@ -1426,8 +1859,16 @@ export const delete8 = oc .input(z.object({ params: zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath })) .output(zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdMetadataByMetadataId', @@ -1447,8 +1888,16 @@ export const byMetadataId = { patch: patch10, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get29 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdMetadata', @@ -1458,8 +1907,16 @@ export const get29 = oc .input(z.object({ params: zGetDatasetsByDatasetIdMetadataPath })) .output(zGetDatasetsByDatasetIdMetadataResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadata', @@ -1481,8 +1938,16 @@ export const metadata4 = { byMetadataId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get30 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdNotionSync', @@ -1502,10 +1967,16 @@ export const notion2 = { /** * Get dataset permission user list + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get31 = oc .route({ - description: 'Get dataset permission user list', + deprecated: true, + description: + 'Get dataset permission user list\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdPermissionPartUsers', @@ -1521,10 +1992,16 @@ export const permissionPartUsers = { /** * Get dataset query history + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get32 = oc .route({ - description: 'Get dataset query history', + deprecated: true, + description: + 'Get dataset query history\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdQueries', @@ -1540,10 +2017,16 @@ export const queries = { /** * Get applications related to dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get33 = oc .route({ - description: 'Get applications related to dataset', + deprecated: true, + description: + 'Get applications related to dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdRelatedApps', @@ -1559,9 +2042,16 @@ export const relatedApps = { /** * retry document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post21 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdRetry', @@ -1583,10 +2073,16 @@ export const retry = { /** * Check if dataset is in use + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get34 = oc .route({ - description: 'Check if dataset is in use', + deprecated: true, + description: + 'Check if dataset is in use\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdUseCheck', @@ -1600,8 +2096,16 @@ export const useCheck2 = { get: get34, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetId', @@ -1613,10 +2117,16 @@ export const delete9 = oc /** * Get dataset details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get35 = oc .route({ - description: 'Get dataset details', + deprecated: true, + description: + 'Get dataset details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetId', @@ -1628,10 +2138,16 @@ export const get35 = oc /** * Update dataset details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch11 = oc .route({ - description: 'Update dataset details', + deprecated: true, + description: + 'Update dataset details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetId', @@ -1734,10 +2250,16 @@ export const byResourceId = { /** * Get list of datasets + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get37 = oc .route({ - description: 'Get list of datasets', + deprecated: true, + description: + 'Get list of datasets\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasets', @@ -1749,10 +2271,16 @@ export const get37 = oc /** * Create a new dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post23 = oc .route({ - description: 'Create a new dataset', + deprecated: true, + description: + 'Create a new dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasets', diff --git a/packages/contracts/generated/api/console/datasets/types.gen.ts b/packages/contracts/generated/api/console/datasets/types.gen.ts index ed22457ba6..4b1ff07660 100644 --- a/packages/contracts/generated/api/console/datasets/types.gen.ts +++ b/packages/contracts/generated/api/console/datasets/types.gen.ts @@ -720,7 +720,7 @@ export type DeleteDatasetsApiKeysByApiKeyIdData = { export type DeleteDatasetsApiKeysByApiKeyIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -2303,7 +2303,7 @@ export type DeleteDatasetsByResourceIdApiKeysByApiKeyIdData = { export type DeleteDatasetsByResourceIdApiKeysByApiKeyIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } diff --git a/packages/contracts/generated/api/console/datasets/zod.gen.ts b/packages/contracts/generated/api/console/datasets/zod.gen.ts index 2768eb534b..e26f412da9 100644 --- a/packages/contracts/generated/api/console/datasets/zod.gen.ts +++ b/packages/contracts/generated/api/console/datasets/zod.gen.ts @@ -796,7 +796,7 @@ export const zDeleteDatasetsApiKeysByApiKeyIdPath = z.object({ /** * API key deleted successfully */ -export const zDeleteDatasetsApiKeysByApiKeyIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteDatasetsApiKeysByApiKeyIdResponse = z.record(z.string(), z.never()) export const zGetDatasetsBatchImportStatusByJobIdPath = z.object({ job_id: z.string(), @@ -1672,7 +1672,4 @@ export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdPath = z.object({ /** * API key deleted successfully */ -export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdResponse = z.record(z.string(), z.never()) diff --git a/packages/contracts/generated/api/console/email-code-login/orpc.gen.ts b/packages/contracts/generated/api/console/email-code-login/orpc.gen.ts index 54edabc29f..e1d0c2c319 100644 --- a/packages/contracts/generated/api/console/email-code-login/orpc.gen.ts +++ b/packages/contracts/generated/api/console/email-code-login/orpc.gen.ts @@ -10,8 +10,16 @@ import { zPostEmailCodeLoginValidityResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailCodeLoginValidity', @@ -25,8 +33,16 @@ export const validity = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailCodeLogin', diff --git a/packages/contracts/generated/api/console/email-register/orpc.gen.ts b/packages/contracts/generated/api/console/email-register/orpc.gen.ts index 0bd724aba9..b00fdb1c63 100644 --- a/packages/contracts/generated/api/console/email-register/orpc.gen.ts +++ b/packages/contracts/generated/api/console/email-register/orpc.gen.ts @@ -8,8 +8,16 @@ import { zPostEmailRegisterValidityResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailRegisterSendEmail', @@ -22,8 +30,16 @@ export const sendEmail = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailRegisterValidity', @@ -36,8 +52,16 @@ export const validity = { post: post2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailRegister', diff --git a/packages/contracts/generated/api/console/explore/orpc.gen.ts b/packages/contracts/generated/api/console/explore/orpc.gen.ts index 4b37a0a4fd..4933c1ec12 100644 --- a/packages/contracts/generated/api/console/explore/orpc.gen.ts +++ b/packages/contracts/generated/api/console/explore/orpc.gen.ts @@ -11,8 +11,16 @@ import { zGetExploreBannersResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getExploreAppsByAppId', @@ -44,9 +52,16 @@ export const apps = { /** * Get banner list + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getExploreBanners', diff --git a/packages/contracts/generated/api/console/features/orpc.gen.ts b/packages/contracts/generated/api/console/features/orpc.gen.ts index e24ec3d964..e859a3c684 100644 --- a/packages/contracts/generated/api/console/features/orpc.gen.ts +++ b/packages/contracts/generated/api/console/features/orpc.gen.ts @@ -8,10 +8,16 @@ import { zGetFeaturesResponse } from './zod.gen' * Get feature configuration for current tenant * * Get feature configuration for current tenant + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get feature configuration for current tenant', + deprecated: true, + description: + 'Get feature configuration for current tenant\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFeatures', diff --git a/packages/contracts/generated/api/console/files/orpc.gen.ts b/packages/contracts/generated/api/console/files/orpc.gen.ts index 2ee949edc2..a46dcca46e 100644 --- a/packages/contracts/generated/api/console/files/orpc.gen.ts +++ b/packages/contracts/generated/api/console/files/orpc.gen.ts @@ -11,8 +11,16 @@ import { zPostFilesUploadResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFilesSupportType', @@ -51,8 +59,16 @@ export const upload = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFilesByFileIdPreview', diff --git a/packages/contracts/generated/api/console/form/orpc.gen.ts b/packages/contracts/generated/api/console/form/orpc.gen.ts index f6d76b28c0..0d30da9d00 100644 --- a/packages/contracts/generated/api/console/form/orpc.gen.ts +++ b/packages/contracts/generated/api/console/form/orpc.gen.ts @@ -14,10 +14,16 @@ import { * Get human input form definition by form token * * GET /console/api/form/human_input/ + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'GET /console/api/form/human_input/', + deprecated: true, + description: + 'GET /console/api/form/human_input/\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -40,11 +46,16 @@ export const get = oc * }, * "action": "Approve" * } + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ + deprecated: true, description: - 'POST /console/api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}', + 'POST /console/api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', diff --git a/packages/contracts/generated/api/console/info/orpc.gen.ts b/packages/contracts/generated/api/console/info/orpc.gen.ts index 4eb342e9cf..0ef5bd4856 100644 --- a/packages/contracts/generated/api/console/info/orpc.gen.ts +++ b/packages/contracts/generated/api/console/info/orpc.gen.ts @@ -4,8 +4,16 @@ import { oc } from '@orpc/contract' import { zPostInfoResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInfo', diff --git a/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts b/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts index c2b0b2eb37..f0efa7abbc 100644 --- a/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts @@ -67,8 +67,16 @@ import { zPostInstalledAppsResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdAudioToText', @@ -82,8 +90,16 @@ export const audioToText = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdChatMessagesByTaskIdStop', @@ -101,8 +117,16 @@ export const byTaskId = { stop, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdChatMessages', @@ -122,8 +146,16 @@ export const chatMessages = { byTaskId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStop', @@ -141,8 +173,16 @@ export const byTaskId2 = { stop: stop2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdCompletionMessages', @@ -162,8 +202,16 @@ export const completionMessages = { byTaskId: byTaskId2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdConversationsByCIdName', @@ -182,8 +230,16 @@ export const name = { post: post6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdPin', @@ -197,8 +253,16 @@ export const pin = { patch, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdUnpin', @@ -212,8 +276,16 @@ export const unpin = { patch: patch2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteInstalledAppsByInstalledAppIdConversationsByCId', @@ -230,8 +302,16 @@ export const byCId = { unpin, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdConversations', @@ -251,8 +331,16 @@ export const conversations = { byCId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacks', @@ -271,8 +359,16 @@ export const feedbacks = { post: post7, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThis', @@ -291,8 +387,16 @@ export const moreLikeThis = { get: get2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestions', @@ -316,8 +420,16 @@ export const byMessageId = { suggestedQuestions, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdMessages', @@ -339,9 +451,16 @@ export const messages = { /** * Get app meta + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdMeta', @@ -358,9 +477,16 @@ export const meta = { /** * Retrieve app parameters + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdParameters', @@ -375,8 +501,16 @@ export const parameters = { get: get6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteInstalledAppsByInstalledAppIdSavedMessagesByMessageId', @@ -390,8 +524,16 @@ export const byMessageId2 = { delete: delete2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInstalledAppsByInstalledAppIdSavedMessages', @@ -406,8 +548,16 @@ export const get7 = oc ) .output(zGetInstalledAppsByInstalledAppIdSavedMessagesResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdSavedMessages', @@ -428,8 +578,16 @@ export const savedMessages = { byMessageId: byMessageId2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdTextToAudio', @@ -450,9 +608,16 @@ export const textToAudio = { /** * Run workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdWorkflowsRun', @@ -474,9 +639,16 @@ export const run = { /** * Stop workflow task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStop', @@ -504,8 +676,16 @@ export const workflows = { tasks, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteInstalledAppsByInstalledAppId', @@ -515,8 +695,16 @@ export const delete3 = oc .input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdPath })) .output(zDeleteInstalledAppsByInstalledAppIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchInstalledAppsByInstalledAppId', @@ -551,8 +739,16 @@ export const get8 = oc }) .output(zGetInstalledAppsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post12 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstalledApps', diff --git a/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts b/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts index 3aff6a9a3b..f91220f369 100644 --- a/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts @@ -12,10 +12,16 @@ import { /** * Get instruction generation template + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Get instruction generation template', + deprecated: true, + description: + 'Get instruction generation template\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstructionGenerateTemplate', @@ -31,10 +37,16 @@ export const template = { /** * Generate instruction for workflow nodes or general use + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post2 = oc .route({ - description: 'Generate instruction for workflow nodes or general use', + deprecated: true, + description: + 'Generate instruction for workflow nodes or general use\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postInstructionGenerate', diff --git a/packages/contracts/generated/api/console/login/orpc.gen.ts b/packages/contracts/generated/api/console/login/orpc.gen.ts index b8e647a11d..0fb7cbf4bb 100644 --- a/packages/contracts/generated/api/console/login/orpc.gen.ts +++ b/packages/contracts/generated/api/console/login/orpc.gen.ts @@ -7,9 +7,16 @@ import { zPostLoginBody, zPostLoginResponse } from './zod.gen' /** * Authenticate user and login + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postLogin', diff --git a/packages/contracts/generated/api/console/logout/orpc.gen.ts b/packages/contracts/generated/api/console/logout/orpc.gen.ts index 02ecd2c82d..0fe1f3b909 100644 --- a/packages/contracts/generated/api/console/logout/orpc.gen.ts +++ b/packages/contracts/generated/api/console/logout/orpc.gen.ts @@ -4,8 +4,16 @@ import { oc } from '@orpc/contract' import { zPostLogoutResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postLogout', diff --git a/packages/contracts/generated/api/console/mcp/orpc.gen.ts b/packages/contracts/generated/api/console/mcp/orpc.gen.ts index 211e8cb2f2..6508e34a42 100644 --- a/packages/contracts/generated/api/console/mcp/orpc.gen.ts +++ b/packages/contracts/generated/api/console/mcp/orpc.gen.ts @@ -4,8 +4,16 @@ import { oc } from '@orpc/contract' import { zGetMcpOauthCallbackResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMcpOauthCallback', diff --git a/packages/contracts/generated/api/console/notification/orpc.gen.ts b/packages/contracts/generated/api/console/notification/orpc.gen.ts index f7125346cf..c7d55612af 100644 --- a/packages/contracts/generated/api/console/notification/orpc.gen.ts +++ b/packages/contracts/generated/api/console/notification/orpc.gen.ts @@ -6,10 +6,16 @@ import { zGetNotificationResponse, zPostNotificationDismissResponse } from './zo /** * Mark a notification as dismissed for the current user. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Mark a notification as dismissed for the current user.', + deprecated: true, + description: + 'Mark a notification as dismissed for the current user.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postNotificationDismiss', @@ -24,11 +30,16 @@ export const dismiss = { /** * Return the active in-product notification for the current user in their interface language (falls back to English if unavailable). The notification is NOT marked as seen here; call POST /notification/dismiss when the user explicitly closes the modal. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ + deprecated: true, description: - 'Return the active in-product notification for the current user in their interface language (falls back to English if unavailable). The notification is NOT marked as seen here; call POST /notification/dismiss when the user explicitly closes the modal.', + 'Return the active in-product notification for the current user in their interface language (falls back to English if unavailable). The notification is NOT marked as seen here; call POST /notification/dismiss when the user explicitly closes the modal.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getNotification', diff --git a/packages/contracts/generated/api/console/notion/orpc.gen.ts b/packages/contracts/generated/api/console/notion/orpc.gen.ts index b8de9e89f2..8c5dc03c9e 100644 --- a/packages/contracts/generated/api/console/notion/orpc.gen.ts +++ b/packages/contracts/generated/api/console/notion/orpc.gen.ts @@ -12,8 +12,16 @@ import { zPostNotionPagesByPageIdByPageTypePreviewResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getNotionPagesByPageIdByPageTypePreview', @@ -23,8 +31,16 @@ export const get = oc .input(z.object({ params: zGetNotionPagesByPageIdByPageTypePreviewPath })) .output(zGetNotionPagesByPageIdByPageTypePreviewResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postNotionPagesByPageIdByPageTypePreview', @@ -56,8 +72,16 @@ export const pages = { byPageId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getNotionPreImportPages', diff --git a/packages/contracts/generated/api/console/oauth/orpc.gen.ts b/packages/contracts/generated/api/console/oauth/orpc.gen.ts index b9a57e3e88..5ef03ccb96 100644 --- a/packages/contracts/generated/api/console/oauth/orpc.gen.ts +++ b/packages/contracts/generated/api/console/oauth/orpc.gen.ts @@ -38,10 +38,16 @@ import { /** * Handle OAuth callback and complete login process + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Handle OAuth callback and complete login process', + deprecated: true, + description: + 'Handle OAuth callback and complete login process\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthAuthorizeByProvider', @@ -94,10 +100,16 @@ export const binding = { /** * Handle OAuth callback from data source provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get3 = oc .route({ - description: 'Handle OAuth callback from data source provider', + deprecated: true, + description: + 'Handle OAuth callback from data source provider\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthDataSourceCallbackByProvider', @@ -171,10 +183,16 @@ export const dataSource = { /** * Initiate OAuth login process + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ - description: 'Initiate OAuth login process', + deprecated: true, + description: + 'Initiate OAuth login process\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthLoginByProvider', @@ -197,8 +215,16 @@ export const login = { byProvider: byProvider5, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthPluginByProviderIdDatasourceCallback', @@ -212,8 +238,16 @@ export const callback2 = { get: get7, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthPluginByProviderIdDatasourceGetAuthorizationUrl', @@ -236,8 +270,16 @@ export const byProviderId = { datasource, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthPluginByProviderToolAuthorizationUrl', @@ -251,8 +293,16 @@ export const authorizationUrl = { get: get9, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthPluginByProviderToolCallback', @@ -273,9 +323,16 @@ export const tool = { /** * Handle OAuth callback for trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getOauthPluginByProviderTriggerCallback', @@ -304,8 +361,16 @@ export const plugin = { byProvider: byProvider6, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postOauthProviderAccount', @@ -318,8 +383,16 @@ export const account = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postOauthProviderAuthorize', @@ -332,8 +405,16 @@ export const authorize2 = { post: post2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postOauthProviderToken', @@ -346,8 +427,16 @@ export const token = { post: post3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postOauthProvider', diff --git a/packages/contracts/generated/api/console/orpc.gen.ts b/packages/contracts/generated/api/console/orpc.gen.ts new file mode 100644 index 0000000000..06a4d79563 --- /dev/null +++ b/packages/contracts/generated/api/console/orpc.gen.ts @@ -0,0 +1,95 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { account } from './account/orpc.gen' +import { activate } from './activate/orpc.gen' +import { allWorkspaces } from './all-workspaces/orpc.gen' +import { apiBasedExtension } from './api-based-extension/orpc.gen' +import { apiKeyAuth } from './api-key-auth/orpc.gen' +import { app } from './app/orpc.gen' +import { apps } from './apps/orpc.gen' +import { auth } from './auth/orpc.gen' +import { billing } from './billing/orpc.gen' +import { codeBasedExtension } from './code-based-extension/orpc.gen' +import { compliance } from './compliance/orpc.gen' +import { dataSource } from './data-source/orpc.gen' +import { datasets } from './datasets/orpc.gen' +import { emailCodeLogin } from './email-code-login/orpc.gen' +import { emailRegister } from './email-register/orpc.gen' +import { explore } from './explore/orpc.gen' +import { features } from './features/orpc.gen' +import { files } from './files/orpc.gen' +import { forgotPassword } from './forgot-password/orpc.gen' +import { form } from './form/orpc.gen' +import { info } from './info/orpc.gen' +import { installedApps } from './installed-apps/orpc.gen' +import { instructionGenerate } from './instruction-generate/orpc.gen' +import { login } from './login/orpc.gen' +import { logout } from './logout/orpc.gen' +import { mcp } from './mcp/orpc.gen' +import { notification } from './notification/orpc.gen' +import { notion } from './notion/orpc.gen' +import { oauth } from './oauth/orpc.gen' +import { rag } from './rag/orpc.gen' +import { refreshToken } from './refresh-token/orpc.gen' +import { remoteFiles } from './remote-files/orpc.gen' +import { resetPassword } from './reset-password/orpc.gen' +import { ruleCodeGenerate } from './rule-code-generate/orpc.gen' +import { ruleGenerate } from './rule-generate/orpc.gen' +import { ruleStructuredOutputGenerate } from './rule-structured-output-generate/orpc.gen' +import { spec } from './spec/orpc.gen' +import { systemFeatures } from './system-features/orpc.gen' +import { tagBindings } from './tag-bindings/orpc.gen' +import { tags } from './tags/orpc.gen' +import { test } from './test/orpc.gen' +import { trialApps } from './trial-apps/orpc.gen' +import { website } from './website/orpc.gen' +import { workflow } from './workflow/orpc.gen' +import { workspaces } from './workspaces/orpc.gen' + +export const contract = { + account, + activate, + allWorkspaces, + apiBasedExtension, + apiKeyAuth, + app, + apps, + auth, + billing, + codeBasedExtension, + compliance, + dataSource, + datasets, + emailCodeLogin, + emailRegister, + explore, + features, + files, + forgotPassword, + form, + info, + installedApps, + instructionGenerate, + login, + logout, + mcp, + notification, + notion, + oauth, + rag, + refreshToken, + remoteFiles, + resetPassword, + ruleCodeGenerate, + ruleGenerate, + ruleStructuredOutputGenerate, + spec, + systemFeatures, + tagBindings, + tags, + test, + trialApps, + website, + workflow, + workspaces, +} diff --git a/packages/contracts/generated/api/console/rag/orpc.gen.ts b/packages/contracts/generated/api/console/rag/orpc.gen.ts index a642a91ba1..c522f1d060 100644 --- a/packages/contracts/generated/api/console/rag/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rag/orpc.gen.ts @@ -118,8 +118,16 @@ import { zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteRagPipelineCustomizedTemplatesByTemplateId', @@ -129,8 +137,16 @@ export const delete_ = oc .input(z.object({ params: zDeleteRagPipelineCustomizedTemplatesByTemplateIdPath })) .output(zDeleteRagPipelineCustomizedTemplatesByTemplateIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchRagPipelineCustomizedTemplatesByTemplateId', @@ -140,8 +156,16 @@ export const patch = oc .input(z.object({ params: zPatchRagPipelineCustomizedTemplatesByTemplateIdPath })) .output(zPatchRagPipelineCustomizedTemplatesByTemplateIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelineCustomizedTemplatesByTemplateId', @@ -165,8 +189,16 @@ export const customized = { templates, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelineDataset', @@ -180,8 +212,16 @@ export const dataset = { post: post2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelineEmptyDataset', @@ -194,8 +234,16 @@ export const emptyDataset = { post: post3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelineTemplatesByTemplateId', @@ -209,8 +257,16 @@ export const byTemplateId2 = { get, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelineTemplates', @@ -231,8 +287,16 @@ export const pipeline = { templates: templates2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesDatasourcePlugins', @@ -245,8 +309,16 @@ export const datasourcePlugins = { get: get3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesImportsByImportIdConfirm', @@ -264,8 +336,16 @@ export const byImportId = { confirm, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesImportsByPipelineIdCheckDependencies', @@ -283,8 +363,16 @@ export const byPipelineId = { checkDependencies, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesImports', @@ -300,8 +388,16 @@ export const imports = { byPipelineId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesRecommendedPlugins', @@ -314,8 +410,16 @@ export const recommendedPlugins = { get: get5, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesTransformDatasetsByDatasetId', @@ -337,8 +441,16 @@ export const transform = { datasets, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post7 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdCustomizedPublish', @@ -361,8 +473,16 @@ export const customized2 = { publish, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdExports', @@ -378,9 +498,16 @@ export const exports_ = { /** * Stop workflow task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStop', @@ -465,9 +592,16 @@ export const workflowRuns = { /** * Get default block config + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockType', @@ -488,9 +622,16 @@ export const byBlockType = { /** * Get default block config + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigs', @@ -508,9 +649,16 @@ export const defaultWorkflowBlockConfigs = { /** * Run rag pipeline datasource + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRun', @@ -540,9 +688,16 @@ export const nodes = { /** * Set datasource variables + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspect', @@ -567,8 +722,16 @@ export const datasource = { variablesInspect, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get12 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariables', @@ -584,9 +747,16 @@ export const environmentVariables = { /** * Run draft workflow iteration node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRun', @@ -620,9 +790,16 @@ export const iteration = { /** * Run draft workflow loop node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post12 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRun', @@ -671,9 +848,16 @@ export const lastRun = { /** * Run draft workflow node + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRun', @@ -693,8 +877,16 @@ export const run4 = { post: post13, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables', @@ -706,8 +898,16 @@ export const delete2 = oc ) .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables', @@ -734,9 +934,16 @@ export const nodes4 = { /** * Get first step parameters of rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParameters', @@ -759,9 +966,16 @@ export const preProcessing = { /** * Get second step parameters of rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get16 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftProcessingParameters', @@ -782,9 +996,16 @@ export const processing = { /** * Run draft workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraftRun', @@ -804,8 +1025,16 @@ export const run5 = { post: post14, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get17 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftSystemVariables', @@ -819,8 +1048,16 @@ export const systemVariables = { get: get17, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const put = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdReset', @@ -836,8 +1073,16 @@ export const reset = { put, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId', @@ -849,8 +1094,16 @@ export const delete3 = oc ) .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get18 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId', @@ -860,8 +1113,16 @@ export const get18 = oc .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath })) .output(zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId', @@ -880,8 +1141,16 @@ export const byVariableId = { reset, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftVariables', @@ -891,8 +1160,16 @@ export const delete4 = oc .input(z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesPath })) .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftVariables', @@ -910,9 +1187,16 @@ export const variables2 = { /** * Get draft rag pipeline's workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsDraft', @@ -925,9 +1209,16 @@ export const get20 = oc /** * Sync draft workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post15 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsDraft', @@ -955,9 +1246,16 @@ export const draft = { /** * Get published pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get21 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsPublish', @@ -970,9 +1268,16 @@ export const get21 = oc /** * Publish workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post16 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsPublish', @@ -990,9 +1295,16 @@ export const publish2 = { /** * Run datasource content preview + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post17 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreview', @@ -1014,9 +1326,16 @@ export const preview = { /** * Run rag pipeline datasource + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post18 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRun', @@ -1051,9 +1370,16 @@ export const datasource2 = { /** * Get first step parameters of rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get22 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParameters', @@ -1076,9 +1402,16 @@ export const preProcessing2 = { /** * Get second step parameters of rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get23 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflowsPublishedProcessingParameters', @@ -1101,9 +1434,16 @@ export const processing2 = { /** * Run published workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsPublishedRun', @@ -1130,8 +1470,16 @@ export const published = { run: run7, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestore', @@ -1147,9 +1495,16 @@ export const restore = { /** * Delete a published workflow version that is not currently active on the pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const delete5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteRagPipelinesByPipelineIdWorkflowsByWorkflowId', @@ -1162,9 +1517,16 @@ export const delete5 = oc /** * Update workflow attributes + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchRagPipelinesByPipelineIdWorkflowsByWorkflowId', @@ -1183,9 +1545,16 @@ export const byWorkflowId = { /** * Get published workflows + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get24 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRagPipelinesByPipelineIdWorkflows', diff --git a/packages/contracts/generated/api/console/rag/types.gen.ts b/packages/contracts/generated/api/console/rag/types.gen.ts index 9de86c6cd2..b25272ed7a 100644 --- a/packages/contracts/generated/api/console/rag/types.gen.ts +++ b/packages/contracts/generated/api/console/rag/types.gen.ts @@ -57,6 +57,35 @@ export type WorkflowRunNodeExecutionListResponse = { data: Array } +export type WorkflowPaginationResponse = { + has_more: boolean + items: Array + limit: number + page: number +} + +export type WorkflowResponse = { + conversation_variables: Array + created_at: number + created_by?: SimpleAccount + environment_variables: Array + features: { + [key: string]: unknown + } + graph: { + [key: string]: unknown + } + hash: string + id: string + marked_comment: string + marked_name: string + rag_pipeline_variables: Array + tool_published: boolean + updated_at: number + updated_by?: SimpleAccount + version: string +} + export type DatasourceNodeRunPayload = { credential_id?: string | null datasource_type: string @@ -171,6 +200,45 @@ export type SimpleEndUser = { type: string } +export type WorkflowConversationVariableResponse = { + description: string + id: string + name: string + value: { + [key: string]: unknown + } + value_type: string +} + +export type WorkflowEnvironmentVariableResponse = { + description: string + id: string + name: string + value: { + [key: string]: unknown + } + value_type: string +} + +export type PipelineVariableResponse = { + allowed_file_extensions?: Array | null + allowed_file_types?: Array | null + allowed_file_upload_methods?: Array | null + belong_to_node_id: string + default_value?: { + [key: string]: unknown + } + label: string + max_length?: number | null + options?: Array | null + placeholder?: string | null + required: boolean + tooltips?: string | null + type: string + unit?: string | null + variable: string +} + export type DeleteRagPipelineCustomizedTemplatesByTemplateIdData = { body?: never path: { @@ -507,12 +575,19 @@ export type GetRagPipelinesByPipelineIdWorkflowsData = { url: '/rag/pipelines/{pipeline_id}/workflows' } -export type GetRagPipelinesByPipelineIdWorkflowsResponses = { - 200: { +export type GetRagPipelinesByPipelineIdWorkflowsErrors = { + 403: { [key: string]: unknown } } +export type GetRagPipelinesByPipelineIdWorkflowsError + = GetRagPipelinesByPipelineIdWorkflowsErrors[keyof GetRagPipelinesByPipelineIdWorkflowsErrors] + +export type GetRagPipelinesByPipelineIdWorkflowsResponses = { + 200: WorkflowPaginationResponse +} + export type GetRagPipelinesByPipelineIdWorkflowsResponse = GetRagPipelinesByPipelineIdWorkflowsResponses[keyof GetRagPipelinesByPipelineIdWorkflowsResponses] @@ -562,12 +637,19 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftData = { url: '/rag/pipelines/{pipeline_id}/workflows/draft' } -export type GetRagPipelinesByPipelineIdWorkflowsDraftResponses = { - 200: { +export type GetRagPipelinesByPipelineIdWorkflowsDraftErrors = { + 404: { [key: string]: unknown } } +export type GetRagPipelinesByPipelineIdWorkflowsDraftError + = GetRagPipelinesByPipelineIdWorkflowsDraftErrors[keyof GetRagPipelinesByPipelineIdWorkflowsDraftErrors] + +export type GetRagPipelinesByPipelineIdWorkflowsDraftResponses = { + 200: WorkflowResponse +} + export type GetRagPipelinesByPipelineIdWorkflowsDraftResponse = GetRagPipelinesByPipelineIdWorkflowsDraftResponses[keyof GetRagPipelinesByPipelineIdWorkflowsDraftResponses] @@ -946,9 +1028,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsPublishData = { } export type GetRagPipelinesByPipelineIdWorkflowsPublishResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowResponse } export type GetRagPipelinesByPipelineIdWorkflowsPublishResponse @@ -1094,10 +1174,23 @@ export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdData = { url: '/rag/pipelines/{pipeline_id}/workflows/{workflow_id}' } -export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponses = { - 200: { +export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors = { + 400: { [key: string]: unknown } + 403: { + [key: string]: unknown + } + 404: { + [key: string]: unknown + } +} + +export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdError + = PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors[keyof PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors] + +export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponses = { + 200: WorkflowResponse } export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse diff --git a/packages/contracts/generated/api/console/rag/zod.gen.ts b/packages/contracts/generated/api/console/rag/zod.gen.ts index 24d9b30139..6832c6eb09 100644 --- a/packages/contracts/generated/api/console/rag/zod.gen.ts +++ b/packages/contracts/generated/api/console/rag/zod.gen.ts @@ -200,6 +200,79 @@ export const zWorkflowRunNodeExecutionListResponse = z.object({ data: z.array(zWorkflowRunNodeExecutionResponse), }) +/** + * WorkflowConversationVariableResponse + */ +export const zWorkflowConversationVariableResponse = z.object({ + description: z.string(), + id: z.string(), + name: z.string(), + value: z.record(z.string(), z.unknown()), + value_type: z.string(), +}) + +/** + * WorkflowEnvironmentVariableResponse + */ +export const zWorkflowEnvironmentVariableResponse = z.object({ + description: z.string(), + id: z.string(), + name: z.string(), + value: z.record(z.string(), z.unknown()), + value_type: z.string(), +}) + +/** + * PipelineVariableResponse + */ +export const zPipelineVariableResponse = z.object({ + allowed_file_extensions: z.array(z.string()).nullish(), + allowed_file_types: z.array(z.string()).nullish(), + allowed_file_upload_methods: z.array(z.string()).nullish(), + belong_to_node_id: z.string(), + default_value: z.record(z.string(), z.unknown()).optional(), + label: z.string(), + max_length: z.int().nullish(), + options: z.array(z.string()).nullish(), + placeholder: z.string().nullish(), + required: z.boolean(), + tooltips: z.string().nullish(), + type: z.string(), + unit: z.string().nullish(), + variable: z.string(), +}) + +/** + * WorkflowResponse + */ +export const zWorkflowResponse = z.object({ + conversation_variables: z.array(zWorkflowConversationVariableResponse), + created_at: z.int(), + created_by: zSimpleAccount.optional(), + environment_variables: z.array(zWorkflowEnvironmentVariableResponse), + features: z.record(z.string(), z.unknown()), + graph: z.record(z.string(), z.unknown()), + hash: z.string(), + id: z.string(), + marked_comment: z.string(), + marked_name: z.string(), + rag_pipeline_variables: z.array(zPipelineVariableResponse), + tool_published: z.boolean(), + updated_at: z.int(), + updated_by: zSimpleAccount.optional(), + version: z.string(), +}) + +/** + * WorkflowPaginationResponse + */ +export const zWorkflowPaginationResponse = z.object({ + has_more: z.boolean(), + items: z.array(zWorkflowResponse), + limit: z.int(), + page: z.int(), +}) + export const zDeleteRagPipelineCustomizedTemplatesByTemplateIdPath = z.object({ template_id: z.string(), }) @@ -383,9 +456,9 @@ export const zGetRagPipelinesByPipelineIdWorkflowsPath = z.object({ }) /** - * Success + * Published workflows retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsResponse = z.record(z.string(), z.unknown()) +export const zGetRagPipelinesByPipelineIdWorkflowsResponse = zWorkflowPaginationResponse export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsPath = z.object({ pipeline_id: z.string(), @@ -416,9 +489,9 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDraftPath = z.object({ }) /** - * Success + * Draft workflow retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftResponse = z.record(z.string(), z.unknown()) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftResponse = zWorkflowResponse export const zPostRagPipelinesByPipelineIdWorkflowsDraftPath = z.object({ pipeline_id: z.string(), @@ -677,12 +750,9 @@ export const zGetRagPipelinesByPipelineIdWorkflowsPublishPath = z.object({ }) /** - * Success + * Published workflow retrieved successfully, or null if not exist */ -export const zGetRagPipelinesByPipelineIdWorkflowsPublishResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsPublishResponse = zWorkflowResponse export const zPostRagPipelinesByPipelineIdWorkflowsPublishPath = z.object({ pipeline_id: z.string(), @@ -781,12 +851,9 @@ export const zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath = z.object( }) /** - * Success + * Workflow updated successfully */ -export const zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse = zWorkflowResponse export const zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestorePath = z.object({ pipeline_id: z.string(), diff --git a/packages/contracts/generated/api/console/refresh-token/orpc.gen.ts b/packages/contracts/generated/api/console/refresh-token/orpc.gen.ts index 4faa4d7d23..90d8aae968 100644 --- a/packages/contracts/generated/api/console/refresh-token/orpc.gen.ts +++ b/packages/contracts/generated/api/console/refresh-token/orpc.gen.ts @@ -4,8 +4,16 @@ import { oc } from '@orpc/contract' import { zPostRefreshTokenResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRefreshToken', diff --git a/packages/contracts/generated/api/console/remote-files/orpc.gen.ts b/packages/contracts/generated/api/console/remote-files/orpc.gen.ts index 977af4a09c..d8e493b759 100644 --- a/packages/contracts/generated/api/console/remote-files/orpc.gen.ts +++ b/packages/contracts/generated/api/console/remote-files/orpc.gen.ts @@ -9,8 +9,16 @@ import { zPostRemoteFilesUploadResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRemoteFilesUpload', @@ -23,8 +31,16 @@ export const upload = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRemoteFilesByUrl', diff --git a/packages/contracts/generated/api/console/reset-password/orpc.gen.ts b/packages/contracts/generated/api/console/reset-password/orpc.gen.ts index 93701280db..2c049efb9d 100644 --- a/packages/contracts/generated/api/console/reset-password/orpc.gen.ts +++ b/packages/contracts/generated/api/console/reset-password/orpc.gen.ts @@ -5,8 +5,16 @@ import * as z from 'zod' import { zPostResetPasswordBody, zPostResetPasswordResponse } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postResetPassword', diff --git a/packages/contracts/generated/api/console/rule-code-generate/orpc.gen.ts b/packages/contracts/generated/api/console/rule-code-generate/orpc.gen.ts index 1c5252525c..fb3909f748 100644 --- a/packages/contracts/generated/api/console/rule-code-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rule-code-generate/orpc.gen.ts @@ -7,10 +7,16 @@ import { zPostRuleCodeGenerateBody, zPostRuleCodeGenerateResponse } from './zod. /** * Generate code rules using LLM + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Generate code rules using LLM', + deprecated: true, + description: + 'Generate code rules using LLM\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleCodeGenerate', diff --git a/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts b/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts index 7bd233de2b..1351b459cc 100644 --- a/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts @@ -7,10 +7,16 @@ import { zPostRuleGenerateBody, zPostRuleGenerateResponse } from './zod.gen' /** * Generate rule configuration using LLM + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Generate rule configuration using LLM', + deprecated: true, + description: + 'Generate rule configuration using LLM\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleGenerate', diff --git a/packages/contracts/generated/api/console/rule-structured-output-generate/orpc.gen.ts b/packages/contracts/generated/api/console/rule-structured-output-generate/orpc.gen.ts index 276442f1c9..3fef5f3c3f 100644 --- a/packages/contracts/generated/api/console/rule-structured-output-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rule-structured-output-generate/orpc.gen.ts @@ -10,10 +10,16 @@ import { /** * Generate structured output rules using LLM + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Generate structured output rules using LLM', + deprecated: true, + description: + 'Generate structured output rules using LLM\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleStructuredOutputGenerate', diff --git a/packages/contracts/generated/api/console/spec/orpc.gen.ts b/packages/contracts/generated/api/console/spec/orpc.gen.ts index bd2e750e6d..9af554b5c5 100644 --- a/packages/contracts/generated/api/console/spec/orpc.gen.ts +++ b/packages/contracts/generated/api/console/spec/orpc.gen.ts @@ -8,10 +8,16 @@ import { zGetSpecSchemaDefinitionsResponse } from './zod.gen' * Get system JSON Schema definitions specification * * Used for frontend component type mapping + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Used for frontend component type mapping', + deprecated: true, + description: + 'Used for frontend component type mapping\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSpecSchemaDefinitions', diff --git a/packages/contracts/generated/api/console/system-features/orpc.gen.ts b/packages/contracts/generated/api/console/system-features/orpc.gen.ts index 5c0a475585..a3667f791f 100644 --- a/packages/contracts/generated/api/console/system-features/orpc.gen.ts +++ b/packages/contracts/generated/api/console/system-features/orpc.gen.ts @@ -14,11 +14,16 @@ import { zGetSystemFeaturesResponse } from './zod.gen' * Authentication would create circular dependency (can't login without dashboard loading). * * Only non-sensitive configuration data should be returned by this endpoint. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ + deprecated: true, description: - 'Get system-wide feature configuration\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for dashboard initialization.\n\nAuthentication would create circular dependency (can\'t login without dashboard loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.', + 'Get system-wide feature configuration\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for dashboard initialization.\n\nAuthentication would create circular dependency (can\'t login without dashboard loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSystemFeatures', diff --git a/packages/contracts/generated/api/console/tag-bindings/orpc.gen.ts b/packages/contracts/generated/api/console/tag-bindings/orpc.gen.ts index a3c7f5ed88..154c75d917 100644 --- a/packages/contracts/generated/api/console/tag-bindings/orpc.gen.ts +++ b/packages/contracts/generated/api/console/tag-bindings/orpc.gen.ts @@ -12,10 +12,16 @@ import { /** * Remove one or more tag bindings from a target. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Remove one or more tag bindings from a target.', + deprecated: true, + description: + 'Remove one or more tag bindings from a target.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTagBindingsRemove', @@ -29,8 +35,16 @@ export const remove = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTagBindings', diff --git a/packages/contracts/generated/api/console/tags/orpc.gen.ts b/packages/contracts/generated/api/console/tags/orpc.gen.ts index 937ccce634..bc2ac4ef5c 100644 --- a/packages/contracts/generated/api/console/tags/orpc.gen.ts +++ b/packages/contracts/generated/api/console/tags/orpc.gen.ts @@ -15,8 +15,16 @@ import { zPostTagsResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete_ = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteTagsByTagId', @@ -26,8 +34,16 @@ export const delete_ = oc .input(z.object({ params: zDeleteTagsByTagIdPath })) .output(zDeleteTagsByTagIdResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchTagsByTagId', @@ -53,8 +69,16 @@ export const get = oc .input(z.object({ query: zGetTagsQuery.optional() })) .output(zGetTagsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTags', diff --git a/packages/contracts/generated/api/console/test/orpc.gen.ts b/packages/contracts/generated/api/console/test/orpc.gen.ts index 1bdf526b70..27b46e3381 100644 --- a/packages/contracts/generated/api/console/test/orpc.gen.ts +++ b/packages/contracts/generated/api/console/test/orpc.gen.ts @@ -7,10 +7,16 @@ import { zPostTestRetrievalBody, zPostTestRetrievalResponse } from './zod.gen' /** * Bedrock retrieval test (internal use only) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Bedrock retrieval test (internal use only)', + deprecated: true, + description: + 'Bedrock retrieval test (internal use only)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTestRetrieval', diff --git a/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts b/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts index eca85c206f..4a10ee7cb8 100644 --- a/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts @@ -34,8 +34,16 @@ import { zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdAudioToText', @@ -49,8 +57,16 @@ export const audioToText = { post, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdChatMessages', @@ -69,8 +85,16 @@ export const chatMessages = { post: post2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdCompletionMessages', @@ -89,8 +113,16 @@ export const completionMessages = { post: post3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdDatasets', @@ -104,8 +136,16 @@ export const datasets = { get, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdMessagesByMessageIdSuggestedQuestions', @@ -129,9 +169,16 @@ export const messages = { /** * Retrieve app parameters + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdParameters', @@ -150,11 +197,16 @@ export const parameters = { * Retrieve app site info * * Returns the site configuration for the application including theme, icons, and text. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get4 = oc .route({ + deprecated: true, description: - 'Returns the site configuration for the application including theme, icons, and text.', + 'Returns the site configuration for the application including theme, icons, and text.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdSite', @@ -169,8 +221,16 @@ export const site = { get: get4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdTextToAudio', @@ -191,9 +251,16 @@ export const textToAudio = { /** * Run workflow + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdWorkflowsRun', @@ -215,9 +282,16 @@ export const run = { /** * Stop workflow task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTrialAppsByAppIdWorkflowsTasksByTaskIdStop', @@ -242,9 +316,16 @@ export const tasks = { /** * Get workflow detail + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdWorkflows', @@ -263,9 +344,16 @@ export const workflows = { /** * Get app detail + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppId', diff --git a/packages/contracts/generated/api/console/website/orpc.gen.ts b/packages/contracts/generated/api/console/website/orpc.gen.ts index 698f656967..5ed1fcd8ab 100644 --- a/packages/contracts/generated/api/console/website/orpc.gen.ts +++ b/packages/contracts/generated/api/console/website/orpc.gen.ts @@ -13,10 +13,16 @@ import { /** * Get website crawl status + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get website crawl status', + deprecated: true, + description: + 'Get website crawl status\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWebsiteCrawlStatusByJobId', @@ -41,10 +47,16 @@ export const status = { /** * Crawl website content + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Crawl website content', + deprecated: true, + description: + 'Crawl website content\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWebsiteCrawl', diff --git a/packages/contracts/generated/api/console/workflow/orpc.gen.ts b/packages/contracts/generated/api/console/workflow/orpc.gen.ts index 66f3e74a48..1470137236 100644 --- a/packages/contracts/generated/api/console/workflow/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workflow/orpc.gen.ts @@ -16,11 +16,16 @@ import { * GET /console/api/workflow//events * * Returns Server-Sent Events stream. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ + deprecated: true, description: - 'GET /console/api/workflow//events\n\nReturns Server-Sent Events stream.', + 'GET /console/api/workflow//events\n\nReturns Server-Sent Events stream.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByWorkflowRunIdEvents', diff --git a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts index 4d16e3120f..f4460bb181 100644 --- a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts @@ -298,10 +298,16 @@ import { /** * Get specific agent provider details + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Get specific agent provider details', + deprecated: true, + description: + 'Get specific agent provider details\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentAgentProviderByProviderName', @@ -321,10 +327,16 @@ export const agentProvider = { /** * Get list of available agent providers + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get2 = oc .route({ - description: 'Get list of available agent providers', + deprecated: true, + description: + 'Get list of available agent providers\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentAgentProviders', @@ -351,8 +363,16 @@ export const datasetOperators = { get: get3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentDefaultModel', @@ -362,8 +382,16 @@ export const get4 = oc .input(z.object({ query: zGetWorkspacesCurrentDefaultModelQuery })) .output(zGetWorkspacesCurrentDefaultModelResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentDefaultModel', @@ -381,13 +409,15 @@ export const defaultModel = { /** * Deprecated legacy alias for creating a plugin endpoint. Use POST /workspaces/current/endpoints instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post2 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for creating a plugin endpoint. Use POST /workspaces/current/endpoints instead.', + 'Deprecated legacy alias for creating a plugin endpoint. Use POST /workspaces/current/endpoints instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpointsCreate', @@ -464,10 +494,16 @@ export const enable = { /** * List endpoints for a specific plugin + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ - description: 'List endpoints for a specific plugin', + deprecated: true, + description: + 'List endpoints for a specific plugin\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentEndpointsListPlugin', @@ -483,10 +519,16 @@ export const plugin = { /** * List plugin endpoints with pagination + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ - description: 'List plugin endpoints with pagination', + deprecated: true, + description: + 'List plugin endpoints with pagination\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentEndpointsList', @@ -504,13 +546,15 @@ export const list = { /** * Deprecated legacy alias for updating a plugin endpoint. Use PATCH /workspaces/current/endpoints/{id} instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post6 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for updating a plugin endpoint. Use PATCH /workspaces/current/endpoints/{id} instead.', + 'Deprecated legacy alias for updating a plugin endpoint. Use PATCH /workspaces/current/endpoints/{id} instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpointsUpdate', @@ -541,10 +585,16 @@ export const delete2 = oc /** * Update a plugin endpoint + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch = oc .route({ - description: 'Update a plugin endpoint', + deprecated: true, + description: + 'Update a plugin endpoint\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchWorkspacesCurrentEndpointsById', @@ -566,10 +616,16 @@ export const byId = { /** * Create a new plugin endpoint + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post7 = oc .route({ - description: 'Create a new plugin endpoint', + deprecated: true, + description: + 'Create a new plugin endpoint\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpoints', @@ -590,8 +646,16 @@ export const endpoints = { byId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentMembersInviteEmail', @@ -605,8 +669,16 @@ export const inviteEmail = { post: post8, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentMembersOwnerTransferCheck', @@ -620,8 +692,16 @@ export const ownerTransferCheck = { post: post9, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentMembersSendOwnerTransferConfirmEmail', @@ -635,8 +715,16 @@ export const sendOwnerTransferConfirmEmail = { post: post10, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentMembersByMemberIdOwnerTransfer', @@ -655,8 +743,16 @@ export const ownerTransfer = { post: post11, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const put = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putWorkspacesCurrentMembersByMemberIdUpdateRole', @@ -675,8 +771,16 @@ export const updateRole = { put, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentMembersByMemberId', @@ -710,8 +814,16 @@ export const members = { byMemberId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get8 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProvidersByProviderCheckoutUrl', @@ -725,8 +837,16 @@ export const checkoutUrl = { get: get8, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post12 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderCredentialsSwitch', @@ -745,8 +865,16 @@ export const switch_ = { post: post12, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderCredentialsValidate', @@ -765,8 +893,16 @@ export const validate = { post: post13, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentModelProvidersByProviderCredentials', @@ -781,8 +917,16 @@ export const delete4 = oc ) .output(zDeleteWorkspacesCurrentModelProvidersByProviderCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get9 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProvidersByProviderCredentials', @@ -797,8 +941,16 @@ export const get9 = oc ) .output(zGetWorkspacesCurrentModelProvidersByProviderCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderCredentials', @@ -813,8 +965,16 @@ export const post14 = oc ) .output(zPostWorkspacesCurrentModelProvidersByProviderCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const put2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putWorkspacesCurrentModelProvidersByProviderCredentials', @@ -838,8 +998,16 @@ export const credentials = { validate, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post15 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderModelsCredentialsSwitch', @@ -858,8 +1026,16 @@ export const switch2 = { post: post15, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post16 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidate', @@ -878,8 +1054,16 @@ export const validate2 = { post: post16, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete5 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentModelProvidersByProviderModelsCredentials', @@ -894,8 +1078,16 @@ export const delete5 = oc ) .output(zDeleteWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProvidersByProviderModelsCredentials', @@ -910,8 +1102,16 @@ export const get10 = oc ) .output(zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post17 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderModelsCredentials', @@ -926,8 +1126,16 @@ export const post17 = oc ) .output(zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const put3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putWorkspacesCurrentModelProvidersByProviderModelsCredentials', @@ -951,8 +1159,16 @@ export const credentials2 = { validate: validate2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch2 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchWorkspacesCurrentModelProvidersByProviderModelsDisable', @@ -971,8 +1187,16 @@ export const disable2 = { patch: patch2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const patch3 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchWorkspacesCurrentModelProvidersByProviderModelsEnable', @@ -991,8 +1215,16 @@ export const enable2 = { patch: patch3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post18 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -1015,8 +1247,16 @@ export const credentialsValidate = { post: post18, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -1048,8 +1288,16 @@ export const loadBalancingConfigs = { byConfigId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProvidersByProviderModelsParameterRules', @@ -1068,8 +1316,16 @@ export const parameterRules = { get: get11, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete6 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentModelProvidersByProviderModels', @@ -1084,8 +1340,16 @@ export const delete6 = oc ) .output(zDeleteWorkspacesCurrentModelProvidersByProviderModelsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get12 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProvidersByProviderModels', @@ -1095,8 +1359,16 @@ export const get12 = oc .input(z.object({ params: zGetWorkspacesCurrentModelProvidersByProviderModelsPath })) .output(zGetWorkspacesCurrentModelProvidersByProviderModelsResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderModels', @@ -1122,8 +1394,16 @@ export const models = { parameterRules, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post21 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentModelProvidersByProviderPreferredProviderType', @@ -1149,8 +1429,16 @@ export const byProvider = { preferredProviderType, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelProviders', @@ -1165,8 +1453,16 @@ export const modelProviders = { byProvider, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get14 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelsModelTypesByModelType', @@ -1192,11 +1488,16 @@ export const models2 = { * Get workspace permission settings * * Returns permission flags that control workspace features like member invitations and owner transfer. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ + deprecated: true, description: - 'Returns permission flags that control workspace features like member invitations and owner transfer.', + 'Returns permission flags that control workspace features like member invitations and owner transfer.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPermission', @@ -1210,8 +1511,16 @@ export const permission = { get: get15, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get16 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginAsset', @@ -1225,8 +1534,16 @@ export const asset = { get: get16, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get17 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginDebuggingKey', @@ -1239,8 +1556,16 @@ export const debuggingKey = { get: get17, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get18 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginFetchManifest', @@ -1254,8 +1579,16 @@ export const fetchManifest = { get: get18, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get19 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginIcon', @@ -1269,8 +1602,16 @@ export const icon = { get: get19, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post22 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginInstallGithub', @@ -1284,8 +1625,16 @@ export const github = { post: post22, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post23 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginInstallMarketplace', @@ -1299,8 +1648,16 @@ export const marketplace = { post: post23, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post24 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginInstallPkg', @@ -1320,8 +1677,16 @@ export const install = { pkg, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post25 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginListInstallationsIds', @@ -1339,8 +1704,16 @@ export const installations = { ids, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post26 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginListLatestVersions', @@ -1354,8 +1727,16 @@ export const latestVersions = { post: post26, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get20 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginList', @@ -1371,8 +1752,16 @@ export const list2 = { latestVersions, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get21 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginMarketplacePkg', @@ -1390,8 +1779,16 @@ export const marketplace2 = { pkg: pkg2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get22 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginParametersDynamicOptions', @@ -1407,9 +1804,16 @@ export const dynamicOptions = { /** * Fetch dynamic options using credentials directly (for edit mode) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post27 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginParametersDynamicOptionsWithCredentials', @@ -1431,8 +1835,16 @@ export const parameters = { dynamicOptionsWithCredentials, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post28 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginPermissionChange', @@ -1446,8 +1858,16 @@ export const change = { post: post28, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get23 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginPermissionFetch', @@ -1465,8 +1885,16 @@ export const permission2 = { fetch: fetch_, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post29 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginPreferencesAutoupgradeExclude', @@ -1484,8 +1912,16 @@ export const autoupgrade = { exclude, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post30 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginPreferencesChange', @@ -1499,8 +1935,16 @@ export const change2 = { post: post30, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get24 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginPreferencesFetch', @@ -1519,8 +1963,16 @@ export const preferences = { fetch: fetch2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get25 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginReadme', @@ -1534,8 +1986,16 @@ export const readme = { get: get25, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post31 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginTasksDeleteAll', @@ -1548,8 +2008,16 @@ export const deleteAll = { post: post31, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post32 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginTasksByTaskIdDeleteByIdentifier', @@ -1563,8 +2031,16 @@ export const byIdentifier = { post: post32, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post33 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginTasksByTaskIdDelete', @@ -1579,8 +2055,16 @@ export const delete7 = { byIdentifier, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get26 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginTasksByTaskId', @@ -1595,8 +2079,16 @@ export const byTaskId = { delete: delete7, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get27 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentPluginTasks', @@ -1612,8 +2104,16 @@ export const tasks = { byTaskId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post34 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUninstall', @@ -1627,8 +2127,16 @@ export const uninstall = { post: post34, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post35 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUpgradeGithub', @@ -1642,8 +2150,16 @@ export const github2 = { post: post35, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post36 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUpgradeMarketplace', @@ -1662,8 +2178,16 @@ export const upgrade = { marketplace: marketplace3, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post37 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUploadBundle', @@ -1676,8 +2200,16 @@ export const bundle = { post: post37, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post38 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUploadGithub', @@ -1691,8 +2223,16 @@ export const github3 = { post: post38, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post39 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentPluginUploadPkg', @@ -1729,8 +2269,16 @@ export const plugin2 = { upload, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get28 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolLabels', @@ -1743,8 +2291,16 @@ export const toolLabels = { get: get28, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post40 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderApiAdd', @@ -1758,8 +2314,16 @@ export const add = { post: post40, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post41 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderApiDelete', @@ -1773,8 +2337,16 @@ export const delete8 = { post: post41, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get29 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderApiGet', @@ -1787,8 +2359,16 @@ export const get30 = { get: get29, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get31 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderApiRemote', @@ -1801,8 +2381,16 @@ export const remote = { get: get31, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post42 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderApiSchema', @@ -1816,8 +2404,16 @@ export const schema = { post: post42, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post43 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderApiTestPre', @@ -1835,8 +2431,16 @@ export const test = { pre, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get32 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderApiTools', @@ -1849,8 +2453,16 @@ export const tools = { get: get32, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post44 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderApiUpdate', @@ -1875,8 +2487,16 @@ export const api = { update: update2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post45 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderBuiltinByProviderAdd', @@ -1895,8 +2515,16 @@ export const add2 = { post: post45, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get33 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfo', @@ -1910,8 +2538,16 @@ export const info = { get: get33, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get34 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: @@ -1942,8 +2578,16 @@ export const credential = { schema: schema2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get35 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderCredentials', @@ -1957,8 +2601,16 @@ export const credentials3 = { get: get35, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post46 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredential', @@ -1977,8 +2629,16 @@ export const defaultCredential = { post: post46, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post47 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderBuiltinByProviderDelete', @@ -1997,8 +2657,16 @@ export const delete9 = { post: post47, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get36 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderIcon', @@ -2012,8 +2680,16 @@ export const icon2 = { get: get36, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get37 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderInfo', @@ -2027,8 +2703,16 @@ export const info2 = { get: get37, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get38 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchema', @@ -2044,8 +2728,16 @@ export const clientSchema = { get: get38, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete10 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2059,8 +2751,16 @@ export const delete10 = oc ) .output(zDeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get39 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2072,8 +2772,16 @@ export const get39 = oc ) .output(zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post48 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2099,8 +2807,16 @@ export const oauth = { customClient, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get40 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderBuiltinByProviderTools', @@ -2114,8 +2830,16 @@ export const tools2 = { get: get40, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post49 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderBuiltinByProviderUpdate', @@ -2151,8 +2875,16 @@ export const builtin = { byProvider: byProvider2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post50 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderMcpAuth', @@ -2166,8 +2898,16 @@ export const auth = { post: post50, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get41 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderMcpToolsByProviderId', @@ -2185,8 +2925,16 @@ export const tools3 = { byProviderId, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get42 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderMcpUpdateByProviderId', @@ -2204,8 +2952,16 @@ export const update4 = { byProviderId: byProviderId2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const delete11 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentToolProviderMcp', @@ -2215,8 +2971,16 @@ export const delete11 = oc .input(z.object({ body: zDeleteWorkspacesCurrentToolProviderMcpBody })) .output(zDeleteWorkspacesCurrentToolProviderMcpResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post51 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderMcp', @@ -2226,8 +2990,16 @@ export const post51 = oc .input(z.object({ body: zPostWorkspacesCurrentToolProviderMcpBody })) .output(zPostWorkspacesCurrentToolProviderMcpResponse) +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const put4 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PUT', operationId: 'putWorkspacesCurrentToolProviderMcp', @@ -2246,8 +3018,16 @@ export const mcp = { update: update4, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post52 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderWorkflowCreate', @@ -2261,8 +3041,16 @@ export const create2 = { post: post52, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post53 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderWorkflowDelete', @@ -2276,8 +3064,16 @@ export const delete12 = { post: post53, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get43 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderWorkflowGet', @@ -2290,8 +3086,16 @@ export const get44 = { get: get43, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get45 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviderWorkflowTools', @@ -2304,8 +3108,16 @@ export const tools4 = { get: get45, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post54 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentToolProviderWorkflowUpdate', @@ -2334,8 +3146,16 @@ export const toolProvider = { workflow, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get46 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolProviders', @@ -2348,8 +3168,16 @@ export const toolProviders = { get: get46, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get47 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolsApi', @@ -2362,8 +3190,16 @@ export const api2 = { get: get47, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get48 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolsBuiltin', @@ -2376,8 +3212,16 @@ export const builtin2 = { get: get48, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get49 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolsMcp', @@ -2390,8 +3234,16 @@ export const mcp2 = { get: get49, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get50 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentToolsWorkflow', @@ -2411,8 +3263,16 @@ export const tools5 = { workflow: workflow2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get51 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggerProviderByProviderIcon', @@ -2428,9 +3288,16 @@ export const icon3 = { /** * Get info for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get52 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggerProviderByProviderInfo', @@ -2447,9 +3314,16 @@ export const info3 = { /** * Remove custom OAuth client configuration + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const delete13 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteWorkspacesCurrentTriggerProviderByProviderOauthClient', @@ -2462,9 +3336,16 @@ export const delete13 = oc /** * Get OAuth client configuration for a provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get53 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggerProviderByProviderOauthClient', @@ -2477,9 +3358,16 @@ export const get53 = oc /** * Configure custom OAuth client for a provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post55 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentTriggerProviderByProviderOauthClient', @@ -2507,9 +3395,16 @@ export const oauth2 = { /** * Build a subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post56 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -2539,9 +3434,16 @@ export const build = { /** * Add a new subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post57 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreate', @@ -2563,9 +3465,16 @@ export const create3 = { /** * Get the request logs for a subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get54 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: @@ -2594,9 +3503,16 @@ export const logs = { /** * Update a subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post58 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -2626,9 +3542,16 @@ export const update6 = { /** * Verify and update a subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post59 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -2658,9 +3581,16 @@ export const verifyAndUpdate = { /** * Get a subscription instance for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get55 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: @@ -2694,9 +3624,16 @@ export const builder = { /** * List all trigger subscriptions for the current tenant's provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get56 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggerProviderByProviderSubscriptionsList', @@ -2713,9 +3650,16 @@ export const list3 = { /** * Initiate OAuth authorization flow for a trigger provider + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get57 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAuthorize', @@ -2740,9 +3684,16 @@ export const oauth3 = { /** * Verify credentials for an existing subscription (edit mode only) + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post60 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: @@ -2786,9 +3737,16 @@ export const byProvider3 = { /** * Delete a subscription instance + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post61 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsDelete', @@ -2809,9 +3767,16 @@ export const delete14 = { /** * Update a subscription instance + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post62 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpdate', @@ -2847,9 +3812,16 @@ export const triggerProvider = { /** * List all trigger providers for the current tenant + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get58 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentTriggers', @@ -2863,8 +3835,16 @@ export const triggers = { get: get58, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post63 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrent', @@ -2893,8 +3873,16 @@ export const current = { triggers, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post64 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCustomConfigWebappLogoUpload', @@ -2911,8 +3899,16 @@ export const webappLogo = { upload: upload2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post65 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCustomConfig', @@ -2927,8 +3923,16 @@ export const customConfig = { webappLogo, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post66 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesInfo', @@ -2942,8 +3946,16 @@ export const info4 = { post: post66, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const post67 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesSwitch', @@ -2957,8 +3969,16 @@ export const switch3 = { post: post67, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get59 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLang', @@ -2988,8 +4008,16 @@ export const byTenantId = { modelProviders: modelProviders2, } +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get60 = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspaces', diff --git a/packages/contracts/generated/api/readiness.json b/packages/contracts/generated/api/readiness.json new file mode 100644 index 0000000000..78fed3ccfa --- /dev/null +++ b/packages/contracts/generated/api/readiness.json @@ -0,0 +1,17 @@ +{ + "surfaces": { + "console": { + "notReady": 474, + "total": 570 + }, + "service": { + "notReady": 72, + "total": 88 + }, + "web": { + "notReady": 36, + "total": 41 + } + }, + "warning": "Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate." +} diff --git a/packages/contracts/generated/api/service/orpc.gen.ts b/packages/contracts/generated/api/service/orpc.gen.ts index 7f52f075ba..647cdd87b5 100644 --- a/packages/contracts/generated/api/service/orpc.gen.ts +++ b/packages/contracts/generated/api/service/orpc.gen.ts @@ -199,8 +199,16 @@ import { zPutConversationsByCIdVariablesByVariableIdResponse, } from './zod.gen' +/** + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated + */ export const get = oc .route({ + deprecated: true, + description: + 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getRoot', @@ -218,11 +226,16 @@ export const root = { * * Get all feedbacks for the application * Returns paginated list of all feedback submitted for messages in this app. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get2 = oc .route({ + deprecated: true, description: - 'Get all feedbacks for the application\nReturns paginated list of all feedback submitted for messages in this app.', + 'Get all feedbacks for the application\nReturns paginated list of all feedback submitted for messages in this app.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppFeedbacks', @@ -245,10 +258,16 @@ export const app = { * Get the status of an annotation reply action job * * Get the status of an annotation reply action job + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get3 = oc .route({ - description: 'Get the status of an annotation reply action job', + deprecated: true, + description: + 'Get the status of an annotation reply action job\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsAnnotationReplyByActionStatusByJobId', @@ -271,10 +290,16 @@ export const status = { * Enable or disable annotation reply feature * * Enable or disable annotation reply feature + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Enable or disable annotation reply feature', + deprecated: true, + description: + 'Enable or disable annotation reply feature\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsAnnotationReplyByAction', @@ -398,11 +423,16 @@ export const apps = { * * Convert audio to text using speech-to-text * Accepts an audio file upload and returns the transcribed text. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post3 = oc .route({ + deprecated: true, description: - 'Convert audio to text using speech-to-text\nAccepts an audio file upload and returns the transcribed text.', + 'Convert audio to text using speech-to-text\nAccepts an audio file upload and returns the transcribed text.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAudioToText', @@ -420,10 +450,16 @@ export const audioToText = { * Stop a running chat message generation * * Stop a running chat message generation + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post4 = oc .route({ - description: 'Stop a running chat message generation', + deprecated: true, + description: + 'Stop a running chat message generation\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessagesByTaskIdStop', @@ -448,11 +484,16 @@ export const byTaskId = { * Send a message in a chat conversation * This endpoint handles chat messages for chat, agent chat, and advanced chat applications. * Supports conversation management and both blocking and streaming response modes. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post5 = oc .route({ + deprecated: true, description: - 'Send a message in a chat conversation\nThis endpoint handles chat messages for chat, agent chat, and advanced chat applications.\nSupports conversation management and both blocking and streaming response modes.', + 'Send a message in a chat conversation\nThis endpoint handles chat messages for chat, agent chat, and advanced chat applications.\nSupports conversation management and both blocking and streaming response modes.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessages', @@ -472,10 +513,16 @@ export const chatMessages = { * Stop a running completion task * * Stop a running completion task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post6 = oc .route({ - description: 'Stop a running completion task', + deprecated: true, + description: + 'Stop a running completion task\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessagesByTaskIdStop', @@ -500,11 +547,16 @@ export const byTaskId2 = { * Create a completion for the given prompt * This endpoint generates a completion based on the provided inputs and query. * Supports both blocking and streaming response modes. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post7 = oc .route({ + deprecated: true, description: - 'Create a completion for the given prompt\nThis endpoint generates a completion based on the provided inputs and query.\nSupports both blocking and streaming response modes.', + 'Create a completion for the given prompt\nThis endpoint generates a completion based on the provided inputs and query.\nSupports both blocking and streaming response modes.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessages', @@ -524,10 +576,16 @@ export const completionMessages = { * Rename a conversation or auto-generate a name * * Rename a conversation or auto-generate a name + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post8 = oc .route({ - description: 'Rename a conversation or auto-generate a name', + deprecated: true, + description: + 'Rename a conversation or auto-generate a name\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postConversationsByCIdName', @@ -634,11 +692,16 @@ export const byCId = { * * List all conversations for the current user * Supports pagination using last_id and limit parameters. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ + deprecated: true, description: - 'List all conversations for the current user\nSupports pagination using last_id and limit parameters.', + 'List all conversations for the current user\nSupports pagination using last_id and limit parameters.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversations', @@ -659,11 +722,16 @@ export const conversations = { * * Upload a file to a knowledgebase pipeline * Accepts a single file upload via multipart/form-data. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post9 = oc .route({ + deprecated: true, description: - 'Upload a file to a knowledgebase pipeline\nAccepts a single file upload via multipart/form-data.', + 'Upload a file to a knowledgebase pipeline\nAccepts a single file upload via multipart/form-data.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsPipelineFileUpload', @@ -745,10 +813,16 @@ export const delete3 = oc * Get all knowledge type tags * * Get all knowledge type tags + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get7 = oc .route({ - description: 'Get all knowledge type tags', + deprecated: true, + description: + 'Get all knowledge type tags\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsTags', @@ -760,10 +834,16 @@ export const get7 = oc /** * Update a knowledge type tag + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch = oc .route({ - description: 'Update a knowledge type tag', + deprecated: true, + description: + 'Update a knowledge type tag\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsTags', @@ -777,10 +857,16 @@ export const patch = oc * Add a knowledge type tag * * Add a knowledge type tag + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post12 = oc .route({ - description: 'Add a knowledge type tag', + deprecated: true, + description: + 'Add a knowledge type tag\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsTags', @@ -802,10 +888,16 @@ export const tags = { /** * Create a new document by uploading a file + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post13 = oc .route({ - description: 'Create a new document by uploading a file', + deprecated: true, + description: + 'Create a new document by uploading a file\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByFile', @@ -817,10 +909,16 @@ export const post13 = oc /** * Create a new document by uploading a file + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post14 = oc .route({ - description: 'Create a new document by uploading a file', + deprecated: true, + description: + 'Create a new document by uploading a file\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByFile', @@ -836,10 +934,16 @@ export const createByFile = { /** * Create a new document by providing text content + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post15 = oc .route({ - description: 'Create a new document by providing text content', + deprecated: true, + description: + 'Create a new document by providing text content\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByText', @@ -857,13 +961,15 @@ export const post15 = oc /** * Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post16 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.', + 'Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByText', @@ -889,10 +995,16 @@ export const document_ = { /** * Download selected uploaded documents as a single ZIP archive + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post17 = oc .route({ - description: 'Download selected uploaded documents as a single ZIP archive', + deprecated: true, + description: + 'Download selected uploaded documents as a single ZIP archive\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip', @@ -915,10 +1027,16 @@ export const downloadZip = { * Update metadata for multiple documents * * Update metadata for multiple documents + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post18 = oc .route({ - description: 'Update metadata for multiple documents', + deprecated: true, + description: + 'Update metadata for multiple documents\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsMetadata', @@ -955,11 +1073,16 @@ export const metadata = { * NotFound: If the dataset with the given ID does not exist. * Forbidden: If the user does not have permission. * InvalidActionError: If the action is invalid or cannot be performed. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch2 = oc .route({ + deprecated: true, description: - 'Batch update document status\nArgs:\n tenant_id: tenant id\n dataset_id: dataset id\n action: action to perform (Literal["enable", "disable", "archive", "un_archive"])\n\nReturns:\n dict: A dictionary with a key \'result\' and a value \'success\'\n int: HTTP status code 200 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.\n Forbidden: If the user does not have permission.\n InvalidActionError: If the action is invalid or cannot be performed.', + 'Batch update document status\nArgs:\n tenant_id: tenant id\n dataset_id: dataset id\n action: action to perform (Literal["enable", "disable", "archive", "un_archive"])\n\nReturns:\n dict: A dictionary with a key \'result\' and a value \'success\'\n int: HTTP status code 200 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.\n Forbidden: If the user does not have permission.\n InvalidActionError: If the action is invalid or cannot be performed.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsStatusByAction', @@ -980,10 +1103,16 @@ export const status2 = { /** * Get indexing status for documents in a batch + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get8 = oc .route({ - description: 'Get indexing status for documents in a batch', + deprecated: true, + description: + 'Get indexing status for documents in a batch\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByBatchIndexingStatus', @@ -1003,10 +1132,16 @@ export const byBatch = { /** * Get a signed download URL for a document's original uploaded file + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get9 = oc .route({ - description: 'Get a signed download URL for a document\'s original uploaded file', + deprecated: true, + description: + 'Get a signed download URL for a document\'s original uploaded file\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdDownload', @@ -1046,10 +1181,16 @@ export const delete4 = oc /** * Update a specific child chunk + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch3 = oc .route({ - description: 'Update a specific child chunk', + deprecated: true, + description: + 'Update a specific child chunk\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: @@ -1075,10 +1216,16 @@ export const byChildChunkId = { /** * List child chunks for a segment + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get10 = oc .route({ - description: 'List child chunks for a segment', + deprecated: true, + description: + 'List child chunks for a segment\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', @@ -1096,10 +1243,16 @@ export const get10 = oc /** * Create a new child chunk for a segment + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post19 = oc .route({ - description: 'Create a new child chunk for a segment', + deprecated: true, + description: + 'Create a new child chunk for a segment\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', @@ -1140,10 +1293,16 @@ export const delete5 = oc /** * Get a specific segment by ID + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ - description: 'Get a specific segment by ID', + deprecated: true, + description: + 'Get a specific segment by ID\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', @@ -1155,10 +1314,16 @@ export const get11 = oc /** * Update a specific segment + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post20 = oc .route({ - description: 'Update a specific segment', + deprecated: true, + description: + 'Update a specific segment\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', @@ -1182,10 +1347,16 @@ export const bySegmentId = { /** * List segments in a document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get12 = oc .route({ - description: 'List segments in a document', + deprecated: true, + description: + 'List segments in a document\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegments', @@ -1202,10 +1373,16 @@ export const get12 = oc /** * Create segments in a document + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post21 = oc .route({ - description: 'Create segments in a document', + deprecated: true, + description: + 'Create segments in a document\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegments', @@ -1229,13 +1406,15 @@ export const segments = { /** * Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post22 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.', + 'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile', @@ -1248,13 +1427,15 @@ export const post22 = oc /** * Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post23 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.', + 'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile', @@ -1270,10 +1451,16 @@ export const updateByFile = { /** * Update an existing document by providing text content + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post24 = oc .route({ - description: 'Update an existing document by providing text content', + deprecated: true, + description: + 'Update an existing document by providing text content\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText', @@ -1291,13 +1478,15 @@ export const post24 = oc /** * Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead. * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * * @deprecated */ export const post25 = oc .route({ deprecated: true, description: - 'Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.', + 'Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText', @@ -1337,10 +1526,16 @@ export const delete6 = oc /** * Get a specific document by ID + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get13 = oc .route({ - description: 'Get a specific document by ID', + deprecated: true, + description: + 'Get a specific document by ID\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId', @@ -1352,10 +1547,16 @@ export const get13 = oc /** * Update an existing document by uploading a file + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch4 = oc .route({ - description: 'Update an existing document by uploading a file', + deprecated: true, + description: + 'Update an existing document by uploading a file\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentId', @@ -1377,10 +1578,16 @@ export const byDocumentId = { /** * List all documents in a dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get14 = oc .route({ - description: 'List all documents in a dataset', + deprecated: true, + description: + 'List all documents in a dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocuments', @@ -1404,11 +1611,16 @@ export const documents = { * * Perform hit testing on a dataset * Tests retrieval performance for the specified dataset. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post26 = oc .route({ + deprecated: true, description: - 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.', + 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdHitTesting', @@ -1432,10 +1644,16 @@ export const hitTesting = { * Enable or disable built-in metadata field * * Enable or disable built-in metadata field + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post27 = oc .route({ - description: 'Enable or disable built-in metadata field', + deprecated: true, + description: + 'Enable or disable built-in metadata field\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadataBuiltInByAction', @@ -1454,10 +1672,16 @@ export const byAction3 = { * Get all built-in metadata fields * * Get all built-in metadata fields + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ - description: 'Get all built-in metadata fields', + deprecated: true, + description: + 'Get all built-in metadata fields\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdMetadataBuiltIn', @@ -1496,10 +1720,16 @@ export const delete7 = oc * Update metadata name * * Update metadata name + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch5 = oc .route({ - description: 'Update metadata name', + deprecated: true, + description: + 'Update metadata name\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdMetadataByMetadataId', @@ -1524,10 +1754,16 @@ export const byMetadataId = { * Get all metadata for a dataset * * Get all metadata for a dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get16 = oc .route({ - description: 'Get all metadata for a dataset', + deprecated: true, + description: + 'Get all metadata for a dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdMetadata', @@ -1542,10 +1778,16 @@ export const get16 = oc * Create metadata for a dataset * * Create metadata for a dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post28 = oc .route({ - description: 'Create metadata for a dataset', + deprecated: true, + description: + 'Create metadata for a dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadata', @@ -1573,10 +1815,16 @@ export const metadata2 = { * Resource for getting datasource plugins * * List all datasource plugins for a rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get17 = oc .route({ - description: 'List all datasource plugins for a rag pipeline', + deprecated: true, + description: + 'List all datasource plugins for a rag pipeline\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdPipelineDatasourcePlugins', @@ -1600,10 +1848,16 @@ export const datasourcePlugins = { * Resource for getting datasource plugins * * Run a datasource node for a rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post29 = oc .route({ - description: 'Run a datasource node for a rag pipeline', + deprecated: true, + description: + 'Run a datasource node for a rag pipeline\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRun', @@ -1634,10 +1888,16 @@ export const datasource = { * Resource for running a rag pipeline * * Run a datasource node for a rag pipeline + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post30 = oc .route({ - description: 'Run a datasource node for a rag pipeline', + deprecated: true, + description: + 'Run a datasource node for a rag pipeline\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineRun', @@ -1663,11 +1923,16 @@ export const pipeline2 = { * * Perform hit testing on a dataset * Tests retrieval performance for the specified dataset. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post31 = oc .route({ + deprecated: true, description: - 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.', + 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdRetrieve', @@ -1691,10 +1956,16 @@ export const retrieve = { * Get all knowledge type tags * * Get tags bound to a specific dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get18 = oc .route({ - description: 'Get tags bound to a specific dataset', + deprecated: true, + description: + 'Get tags bound to a specific dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdTags', @@ -1742,10 +2013,16 @@ export const delete8 = oc /** * Get a specific dataset by ID + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get19 = oc .route({ - description: 'Get a specific dataset by ID', + deprecated: true, + description: + 'Get a specific dataset by ID\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetId', @@ -1757,10 +2034,16 @@ export const get19 = oc /** * Update an existing dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch6 = oc .route({ - description: 'Update an existing dataset', + deprecated: true, + description: + 'Update an existing dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetId', @@ -1787,10 +2070,16 @@ export const byDatasetId = { * Resource for getting datasets * * List all datasets + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get20 = oc .route({ - description: 'List all datasets', + deprecated: true, + description: + 'List all datasets\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasets', @@ -1804,10 +2093,16 @@ export const get20 = oc * Resource for creating datasets * * Create a new dataset + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post32 = oc .route({ - description: 'Create a new dataset', + deprecated: true, + description: + 'Create a new dataset\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasets', @@ -1832,11 +2127,16 @@ export const datasets = { * Get an end user by ID * This endpoint is scoped to the current app token's tenant/app to prevent * cross-tenant/app access when an end-user ID is known. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get21 = oc .route({ + deprecated: true, description: - 'Get an end user by ID\nThis endpoint is scoped to the current app token\'s tenant/app to prevent\ncross-tenant/app access when an end-user ID is known.', + 'Get an end user by ID\nThis endpoint is scoped to the current app token\'s tenant/app to prevent\ncross-tenant/app access when an end-user ID is known.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getEndUsersByEndUserId', @@ -1885,11 +2185,16 @@ export const upload = { * Preview or download a file uploaded via Service API * Provides secure file preview/download functionality. * Files can only be accessed if they belong to messages within the requesting app's context. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get22 = oc .route({ + deprecated: true, description: - 'Preview or download a file uploaded via Service API\nProvides secure file preview/download functionality.\nFiles can only be accessed if they belong to messages within the requesting app\'s context.', + 'Preview or download a file uploaded via Service API\nProvides secure file preview/download functionality.\nFiles can only be accessed if they belong to messages within the requesting app\'s context.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFilesByFileIdPreview', @@ -1920,10 +2225,16 @@ export const files = { /** * Get a paused human input form by token + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get23 = oc .route({ - description: 'Get a paused human input form by token', + deprecated: true, + description: + 'Get a paused human input form by token\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -1935,10 +2246,16 @@ export const get23 = oc /** * Submit a paused human input form by token + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post34 = oc .route({ - description: 'Submit a paused human input form by token', + deprecated: true, + description: + 'Submit a paused human input form by token\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', @@ -1971,11 +2288,16 @@ export const form = { * * Get basic application information * Returns basic information about the application including name, description, tags, and mode. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get24 = oc .route({ + deprecated: true, description: - 'Get basic application information\nReturns basic information about the application including name, description, tags, and mode.', + 'Get basic application information\nReturns basic information about the application including name, description, tags, and mode.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getInfo', @@ -1994,11 +2316,16 @@ export const info = { * * Submit feedback for a message * Allows users to rate messages as like/dislike and provide optional feedback content. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post35 = oc .route({ + deprecated: true, description: - 'Submit feedback for a message\nAllows users to rate messages as like/dislike and provide optional feedback content.', + 'Submit feedback for a message\nAllows users to rate messages as like/dislike and provide optional feedback content.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postMessagesByMessageIdFeedbacks', @@ -2023,11 +2350,16 @@ export const feedbacks2 = { * * Get suggested follow-up questions for a message * Returns AI-generated follow-up questions based on the message content. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get25 = oc .route({ + deprecated: true, description: - 'Get suggested follow-up questions for a message\nReturns AI-generated follow-up questions based on the message content.', + 'Get suggested follow-up questions for a message\nReturns AI-generated follow-up questions based on the message content.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessagesByMessageIdSuggested', @@ -2052,11 +2384,16 @@ export const byMessageId = { * * List messages in a conversation * Retrieves messages with pagination support using first_id. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get26 = oc .route({ + deprecated: true, description: - 'List messages in a conversation\nRetrieves messages with pagination support using first_id.', + 'List messages in a conversation\nRetrieves messages with pagination support using first_id.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessages', @@ -2077,11 +2414,16 @@ export const messages = { * * Get application metadata * Returns metadata about the application including configuration and settings. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get27 = oc .route({ + deprecated: true, description: - 'Get application metadata\nReturns metadata about the application including configuration and settings.', + 'Get application metadata\nReturns metadata about the application including configuration and settings.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMeta', @@ -2100,11 +2442,16 @@ export const meta = { * * Retrieve application input parameters and configuration * Returns the input form parameters and configuration for the application. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get28 = oc .route({ + deprecated: true, description: - 'Retrieve application input parameters and configuration\nReturns the input form parameters and configuration for the application.', + 'Retrieve application input parameters and configuration\nReturns the input form parameters and configuration for the application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getParameters', @@ -2123,11 +2470,16 @@ export const parameters = { * * Get application site configuration * Returns the site configuration for the application including theme, icons, and text. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get29 = oc .route({ + deprecated: true, description: - 'Get application site configuration\nReturns the site configuration for the application including theme, icons, and text.', + 'Get application site configuration\nReturns the site configuration for the application including theme, icons, and text.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSite', @@ -2146,11 +2498,16 @@ export const site = { * * Convert text to audio using text-to-speech * Converts the provided text to audio using the specified voice. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post36 = oc .route({ + deprecated: true, description: - 'Convert text to audio using text-to-speech\nConverts the provided text to audio using the specified voice.', + 'Convert text to audio using text-to-speech\nConverts the provided text to audio using the specified voice.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTextToAudio', @@ -2167,10 +2524,16 @@ export const textToAudio = { /** * Get workflow execution events stream after resume + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get30 = oc .route({ - description: 'Get workflow execution events stream after resume', + deprecated: true, + description: + 'Get workflow execution events stream after resume\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByTaskIdEvents', @@ -2202,11 +2565,16 @@ export const workflow = { * * Get workflow execution logs * Returns paginated workflow execution logs with filtering options. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get31 = oc .route({ + deprecated: true, description: - 'Get workflow execution logs\nReturns paginated workflow execution logs with filtering options.', + 'Get workflow execution logs\nReturns paginated workflow execution logs with filtering options.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsLogs', @@ -2226,11 +2594,16 @@ export const logs = { * * Get workflow run details * Returns detailed information about a specific workflow run. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get32 = oc .route({ + deprecated: true, description: - 'Get workflow run details\nReturns detailed information about a specific workflow run.', + 'Get workflow run details\nReturns detailed information about a specific workflow run.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsRunByWorkflowRunId', @@ -2251,11 +2624,16 @@ export const byWorkflowRunId = { * Execute a workflow * Runs a workflow with the provided inputs and returns the results. * Supports both blocking and streaming response modes. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post37 = oc .route({ + deprecated: true, description: - 'Execute a workflow\nRuns a workflow with the provided inputs and returns the results.\nSupports both blocking and streaming response modes.', + 'Execute a workflow\nRuns a workflow with the provided inputs and returns the results.\nSupports both blocking and streaming response modes.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsRun', @@ -2275,10 +2653,16 @@ export const run3 = { * Stop a running workflow task * * Stop a running workflow task + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post38 = oc .route({ - description: 'Stop a running workflow task', + deprecated: true, + description: + 'Stop a running workflow task\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsTasksByTaskIdStop', @@ -2306,11 +2690,16 @@ export const tasks = { * * Execute a specific workflow by ID * Executes a specific workflow version identified by its ID. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post39 = oc .route({ + deprecated: true, description: - 'Execute a specific workflow by ID\nExecutes a specific workflow version identified by its ID.', + 'Execute a specific workflow by ID\nExecutes a specific workflow version identified by its ID.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsByWorkflowIdRun', @@ -2346,11 +2735,16 @@ export const workflows = { * * Get available models by model type * Returns a list of available models for the specified model type. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get33 = oc .route({ + deprecated: true, description: - 'Get available models by model type\nReturns a list of available models for the specified model type.', + 'Get available models by model type\nReturns a list of available models for the specified model type.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelsModelTypesByModelType', diff --git a/packages/contracts/generated/api/service/types.gen.ts b/packages/contracts/generated/api/service/types.gen.ts index 10c1c9001a..ba6f822087 100644 --- a/packages/contracts/generated/api/service/types.gen.ts +++ b/packages/contracts/generated/api/service/types.gen.ts @@ -694,7 +694,7 @@ export type DeleteAppsAnnotationsByAnnotationIdError export type DeleteAppsAnnotationsByAnnotationIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -949,7 +949,7 @@ export type DeleteConversationsByCIdError export type DeleteConversationsByCIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1153,7 +1153,7 @@ export type DeleteDatasetsTagsError = DeleteDatasetsTagsErrors[keyof DeleteDatas export type DeleteDatasetsTagsResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1256,7 +1256,7 @@ export type PostDatasetsTagsBindingError export type PostDatasetsTagsBindingResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1284,7 +1284,7 @@ export type PostDatasetsTagsUnbindingError export type PostDatasetsTagsUnbindingResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1317,7 +1317,7 @@ export type DeleteDatasetsByDatasetIdError export type DeleteDatasetsByDatasetIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1698,7 +1698,7 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdError export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1897,7 +1897,7 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErr export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -2065,7 +2065,7 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -2404,7 +2404,7 @@ export type DeleteDatasetsByDatasetIdMetadataByMetadataIdError export type DeleteDatasetsByDatasetIdMetadataByMetadataIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } diff --git a/packages/contracts/generated/api/service/zod.gen.ts b/packages/contracts/generated/api/service/zod.gen.ts index ecd3d610fa..8a1b7c5a3d 100644 --- a/packages/contracts/generated/api/service/zod.gen.ts +++ b/packages/contracts/generated/api/service/zod.gen.ts @@ -768,7 +768,7 @@ export const zDeleteAppsAnnotationsByAnnotationIdPath = z.object({ /** * Annotation deleted successfully */ -export const zDeleteAppsAnnotationsByAnnotationIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsAnnotationsByAnnotationIdResponse = z.record(z.string(), z.never()) export const zPutAppsAnnotationsByAnnotationIdBody = zAnnotationCreatePayload @@ -839,7 +839,7 @@ export const zDeleteConversationsByCIdPath = z.object({ /** * Conversation deleted successfully */ -export const zDeleteConversationsByCIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteConversationsByCIdResponse = z.record(z.string(), z.never()) export const zPostConversationsByCIdNameBody = zConversationRenamePayload @@ -902,7 +902,7 @@ export const zDeleteDatasetsTagsBody = zTagDeletePayload /** * Tag deleted successfully */ -export const zDeleteDatasetsTagsResponse = z.record(z.string(), z.unknown()) +export const zDeleteDatasetsTagsResponse = z.record(z.string(), z.never()) /** * Tags retrieved successfully @@ -928,14 +928,14 @@ export const zPostDatasetsTagsBindingBody = zTagBindingPayload /** * Tags bound successfully */ -export const zPostDatasetsTagsBindingResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsTagsBindingResponse = z.record(z.string(), z.never()) export const zPostDatasetsTagsUnbindingBody = zTagUnbindingPayload /** * Tags unbound successfully */ -export const zPostDatasetsTagsUnbindingResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsTagsUnbindingResponse = z.record(z.string(), z.never()) export const zDeleteDatasetsByDatasetIdPath = z.object({ dataset_id: z.string(), @@ -944,7 +944,7 @@ export const zDeleteDatasetsByDatasetIdPath = z.object({ /** * Dataset deleted successfully */ -export const zDeleteDatasetsByDatasetIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteDatasetsByDatasetIdResponse = z.record(z.string(), z.never()) export const zGetDatasetsByDatasetIdPath = z.object({ dataset_id: z.string(), @@ -1088,7 +1088,7 @@ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({ */ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({ @@ -1174,7 +1174,7 @@ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdP */ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({ @@ -1256,7 +1256,7 @@ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdC * Child chunk deleted successfully */ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse - = z.record(z.string(), z.unknown()) + = z.record(z.string(), z.never()) export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody = zChildChunkUpdatePayload @@ -1394,7 +1394,7 @@ export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath = z.object({ */ export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse = z.record( z.string(), - z.unknown(), + z.never(), ) export const zPatchDatasetsByDatasetIdMetadataByMetadataIdBody = zMetadataUpdatePayload diff --git a/packages/contracts/generated/api/web/orpc.gen.ts b/packages/contracts/generated/api/web/orpc.gen.ts index 459d556145..eea2efcb7c 100644 --- a/packages/contracts/generated/api/web/orpc.gen.ts +++ b/packages/contracts/generated/api/web/orpc.gen.ts @@ -85,10 +85,16 @@ import { * Convert audio to text * * Convert audio file to text using speech-to-text service. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post = oc .route({ - description: 'Convert audio file to text using speech-to-text service.', + deprecated: true, + description: + 'Convert audio file to text using speech-to-text service.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postAudioToText', @@ -104,10 +110,16 @@ export const audioToText = { /** * Stop a running chat message task. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post2 = oc .route({ - description: 'Stop a running chat message task.', + deprecated: true, + description: + 'Stop a running chat message task.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessagesByTaskIdStop', @@ -127,10 +139,16 @@ export const byTaskId = { /** * Create a chat message for conversational applications. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post3 = oc .route({ - description: 'Create a chat message for conversational applications.', + deprecated: true, + description: + 'Create a chat message for conversational applications.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessages', @@ -147,10 +165,16 @@ export const chatMessages = { /** * Stop a running completion message task. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post4 = oc .route({ - description: 'Stop a running completion message task.', + deprecated: true, + description: + 'Stop a running completion message task.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessagesByTaskIdStop', @@ -170,10 +194,16 @@ export const byTaskId2 = { /** * Create a completion message for text generation applications. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post5 = oc .route({ - description: 'Create a completion message for text generation applications.', + deprecated: true, + description: + 'Create a completion message for text generation applications.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessages', @@ -190,10 +220,16 @@ export const completionMessages = { /** * Rename a specific conversation with a custom name or auto-generate one. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post6 = oc .route({ - description: 'Rename a specific conversation with a custom name or auto-generate one.', + deprecated: true, + description: + 'Rename a specific conversation with a custom name or auto-generate one.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postConversationsByCIdName', @@ -214,10 +250,16 @@ export const name = { /** * Pin a specific conversation to keep it at the top of the list. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch = oc .route({ - description: 'Pin a specific conversation to keep it at the top of the list.', + deprecated: true, + description: + 'Pin a specific conversation to keep it at the top of the list.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchConversationsByCIdPin', @@ -233,10 +275,16 @@ export const pin = { /** * Unpin a specific conversation to remove it from the top of the list. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const patch2 = oc .route({ - description: 'Unpin a specific conversation to remove it from the top of the list.', + deprecated: true, + description: + 'Unpin a specific conversation to remove it from the top of the list.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchConversationsByCIdUnpin', @@ -275,10 +323,16 @@ export const byCId = { /** * Retrieve paginated list of conversations for a chat application. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get = oc .route({ - description: 'Retrieve paginated list of conversations for a chat application.', + deprecated: true, + description: + 'Retrieve paginated list of conversations for a chat application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversations', @@ -295,10 +349,16 @@ export const conversations = { /** * Verify email code and complete login + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post7 = oc .route({ - description: 'Verify email code and complete login', + deprecated: true, + description: + 'Verify email code and complete login\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailCodeLoginValidity', @@ -314,10 +374,16 @@ export const validity = { /** * Send email verification code for login + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post8 = oc .route({ - description: 'Send email verification code for login', + deprecated: true, + description: + 'Send email verification code for login\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postEmailCodeLogin', @@ -382,10 +448,16 @@ export const files = { /** * Reset user password with verification token + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post10 = oc .route({ - description: 'Reset user password with verification token', + deprecated: true, + description: + 'Reset user password with verification token\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postForgotPasswordResets', @@ -401,10 +473,16 @@ export const resets = { /** * Verify password reset token validity + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post11 = oc .route({ - description: 'Verify password reset token validity', + deprecated: true, + description: + 'Verify password reset token validity\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postForgotPasswordValidity', @@ -420,10 +498,16 @@ export const validity2 = { /** * Send password reset email + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post12 = oc .route({ - description: 'Send password reset email', + deprecated: true, + description: + 'Send password reset email\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postForgotPassword', @@ -443,10 +527,16 @@ export const forgotPassword = { * Get human input form definition by token * * GET /api/form/human_input/ + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get2 = oc .route({ - description: 'GET /api/form/human_input/', + deprecated: true, + description: + 'GET /api/form/human_input/\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -469,11 +559,16 @@ export const get2 = oc * }, * "action": "Approve" * } + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post13 = oc .route({ + deprecated: true, description: - 'POST /api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}', + 'POST /api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', @@ -499,10 +594,16 @@ export const form = { /** * Check login status + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get3 = oc .route({ - description: 'Check login status', + deprecated: true, + description: + 'Check login status\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getLoginStatus', @@ -519,10 +620,16 @@ export const status = { * Authenticate user and login * * Authenticate user for web application access + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post14 = oc .route({ - description: 'Authenticate user for web application access', + deprecated: true, + description: + 'Authenticate user for web application access\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postLogin', @@ -540,10 +647,16 @@ export const login = { /** * Logout user from web application + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post15 = oc .route({ - description: 'Logout user from web application', + deprecated: true, + description: + 'Logout user from web application\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postLogout', @@ -558,10 +671,16 @@ export const logout = { /** * Submit feedback (like/dislike) for a specific message. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post16 = oc .route({ - description: 'Submit feedback (like/dislike) for a specific message.', + deprecated: true, + description: + 'Submit feedback (like/dislike) for a specific message.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postMessagesByMessageIdFeedbacks', @@ -582,10 +701,16 @@ export const feedbacks = { /** * Generate a new completion similar to an existing message (completion apps only). + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get4 = oc .route({ - description: 'Generate a new completion similar to an existing message (completion apps only).', + deprecated: true, + description: + 'Generate a new completion similar to an existing message (completion apps only).\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessagesByMessageIdMoreLikeThis', @@ -606,10 +731,16 @@ export const moreLikeThis = { /** * Get suggested follow-up questions after a message (chat apps only). + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get5 = oc .route({ - description: 'Get suggested follow-up questions after a message (chat apps only).', + deprecated: true, + description: + 'Get suggested follow-up questions after a message (chat apps only).\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessagesByMessageIdSuggestedQuestions', @@ -631,10 +762,16 @@ export const byMessageId = { /** * Retrieve paginated list of messages from a conversation in a chat application. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get6 = oc .route({ - description: 'Retrieve paginated list of messages from a conversation in a chat application.', + deprecated: true, + description: + 'Retrieve paginated list of messages from a conversation in a chat application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessages', @@ -653,10 +790,16 @@ export const messages = { * Get app meta * * Retrieve the metadata for a specific app. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get7 = oc .route({ - description: 'Retrieve the metadata for a specific app.', + deprecated: true, + description: + 'Retrieve the metadata for a specific app.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getMeta', @@ -674,10 +817,16 @@ export const meta = { * Retrieve app parameters * * Retrieve the parameters for a specific app. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get8 = oc .route({ - description: 'Retrieve the parameters for a specific app.', + deprecated: true, + description: + 'Retrieve the parameters for a specific app.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getParameters', @@ -693,10 +842,16 @@ export const parameters = { /** * Get authentication passport for web application access + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get9 = oc .route({ - description: 'Get authentication passport for web application access', + deprecated: true, + description: + 'Get authentication passport for web application access\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getPassport', @@ -813,10 +968,16 @@ export const byMessageId2 = { /** * Retrieve paginated list of saved messages for a completion application. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get11 = oc .route({ - description: 'Retrieve paginated list of saved messages for a completion application.', + deprecated: true, + description: + 'Retrieve paginated list of saved messages for a completion application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSavedMessages', @@ -828,10 +989,16 @@ export const get11 = oc /** * Save a specific message for later reference. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post18 = oc .route({ - description: 'Save a specific message for later reference.', + deprecated: true, + description: + 'Save a specific message for later reference.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postSavedMessages', @@ -851,10 +1018,16 @@ export const savedMessages = { * Retrieve app site info * * Retrieve app site information and configuration. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get12 = oc .route({ - description: 'Retrieve app site information and configuration.', + deprecated: true, + description: + 'Retrieve app site information and configuration.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSite', @@ -887,11 +1060,16 @@ export const site = { * Authentication would create circular dependency (can't authenticate without webapp loading). * * Only non-sensitive configuration data should be returned by this endpoint. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get13 = oc .route({ + deprecated: true, description: - 'Get system feature flags and configuration\nReturns the current system feature flags and configuration\nthat control various functionalities across the platform.\n\nReturns:\n dict: System feature configuration object\n\nThis endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,\nexcept it is intended for use by the web app, instead of the console dashboard.\n\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for webapp initialization.\n\nAuthentication would create circular dependency (can\'t authenticate without webapp loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.', + 'Get system feature flags and configuration\nReturns the current system feature flags and configuration\nthat control various functionalities across the platform.\n\nReturns:\n dict: System feature configuration object\n\nThis endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,\nexcept it is intended for use by the web app, instead of the console dashboard.\n\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for webapp initialization.\n\nAuthentication would create circular dependency (can\'t authenticate without webapp loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getSystemFeatures', @@ -909,10 +1087,16 @@ export const systemFeatures = { * Convert text to audio * * Convert text to audio using text-to-speech service. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post19 = oc .route({ - description: 'Convert text to audio using text-to-speech service.', + deprecated: true, + description: + 'Convert text to audio using text-to-speech service.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postTextToAudio', @@ -929,10 +1113,16 @@ export const textToAudio = { /** * Retrieve the access mode for a web application (public or restricted). + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get14 = oc .route({ - description: 'Retrieve the access mode for a web application (public or restricted).', + deprecated: true, + description: + 'Retrieve the access mode for a web application (public or restricted).\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWebappAccessMode', @@ -948,10 +1138,16 @@ export const accessMode = { /** * Check if user has permission to access a web application. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get15 = oc .route({ - description: 'Check if user has permission to access a web application.', + deprecated: true, + description: + 'Check if user has permission to access a web application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWebappPermission', @@ -976,10 +1172,16 @@ export const webapp = { * GET /api/workflow//events * * Returns Server-Sent Events stream. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const get16 = oc .route({ - description: 'GET /api/workflow//events\n\nReturns Server-Sent Events stream.', + deprecated: true, + description: + 'GET /api/workflow//events\n\nReturns Server-Sent Events stream.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByTaskIdEvents', @@ -1006,10 +1208,16 @@ export const workflow = { * Run workflow * * Execute a workflow with provided inputs and files. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post20 = oc .route({ - description: 'Execute a workflow with provided inputs and files.', + deprecated: true, + description: + 'Execute a workflow with provided inputs and files.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsRun', @@ -1028,10 +1236,16 @@ export const run = { * Stop workflow task * * Stop a running workflow task. + * + * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. + * + * @deprecated */ export const post21 = oc .route({ - description: 'Stop a running workflow task.', + deprecated: true, + description: + 'Stop a running workflow task.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsTasksByTaskIdStop', diff --git a/packages/contracts/generated/api/web/types.gen.ts b/packages/contracts/generated/api/web/types.gen.ts index d2cc6371ee..fed7ed8452 100644 --- a/packages/contracts/generated/api/web/types.gen.ts +++ b/packages/contracts/generated/api/web/types.gen.ts @@ -417,7 +417,7 @@ export type DeleteConversationsByCIdError export type DeleteConversationsByCIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } @@ -1250,7 +1250,7 @@ export type DeleteSavedMessagesByMessageIdError export type DeleteSavedMessagesByMessageIdResponses = { 204: { - [key: string]: unknown + [key: string]: never } } diff --git a/packages/contracts/generated/api/web/zod.gen.ts b/packages/contracts/generated/api/web/zod.gen.ts index 75f22ed271..3d4785891f 100644 --- a/packages/contracts/generated/api/web/zod.gen.ts +++ b/packages/contracts/generated/api/web/zod.gen.ts @@ -271,7 +271,7 @@ export const zDeleteConversationsByCIdPath = z.object({ /** * Conversation deleted successfully */ -export const zDeleteConversationsByCIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteConversationsByCIdResponse = z.record(z.string(), z.never()) export const zPostConversationsByCIdNamePath = z.object({ c_id: z.string(), @@ -482,7 +482,7 @@ export const zDeleteSavedMessagesByMessageIdPath = z.object({ /** * Message removed successfully */ -export const zDeleteSavedMessagesByMessageIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteSavedMessagesByMessageIdResponse = z.record(z.string(), z.never()) /** * Success diff --git a/packages/contracts/openapi-ts.api.config.ts b/packages/contracts/openapi-ts.api.config.ts index a044e38e53..d17b5dcbc3 100644 --- a/packages/contracts/openapi-ts.api.config.ts +++ b/packages/contracts/openapi-ts.api.config.ts @@ -11,6 +11,7 @@ type SwaggerSchema = JsonObject & { '$ref'?: string 'x-nullable'?: boolean 'additionalProperties'?: unknown + 'allOf'?: SwaggerSchema[] 'anyOf'?: SwaggerSchema[] 'const'?: unknown 'default'?: unknown @@ -19,6 +20,7 @@ type SwaggerSchema = JsonObject & { 'enum'?: unknown[] 'format'?: string 'items'?: SwaggerSchema + 'oneOf'?: SwaggerSchema[] 'properties'?: Record 'required'?: string[] 'type'?: string @@ -38,6 +40,8 @@ type SwaggerResponse = JsonObject & { } type SwaggerOperation = JsonObject & { + deprecated?: boolean + description?: string operationId?: string parameters?: SwaggerParameter[] responses?: Record @@ -54,8 +58,16 @@ type ApiSpec = { } type ApiJob = { + clean?: boolean document: SwaggerDocument outputPath: string + plugins?: UserConfig['plugins'] + source?: { + callback: () => void + enabled: true + path: null + serialize: () => string + } } type ApiContractOperation = { @@ -63,10 +75,17 @@ type ApiContractOperation = { path: string } +type ApiReadinessSurfaceStats = { + notReady: number + total: number +} + const currentDir = path.dirname(fileURLToPath(import.meta.url)) const apiOpenApiDir = path.resolve(currentDir, 'openapi') +const apiReadinessStatsPath = path.resolve(currentDir, 'generated/api/readiness.json') const operationMethods = new Set(['delete', 'get', 'patch', 'post', 'put']) +const noBodyResponseStatuses = new Set(['204', '205', '304']) const apiSpecs: ApiSpec[] = [ { filename: 'console-swagger.json', name: 'console' }, @@ -74,6 +93,9 @@ const apiSpecs: ApiSpec[] = [ { filename: 'service-swagger.json', name: 'service' }, ] +const inaccurateGeneratedContractDescription = 'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.' +const apiReadinessStats: Record = {} + const isObject = (value: unknown): value is JsonObject => { return !!value && typeof value === 'object' && !Array.isArray(value) } @@ -83,6 +105,13 @@ const unknownObjectSchema = (): SwaggerSchema => ({ type: 'object', }) +const noContentSchema = (): SwaggerSchema => ({ + // Hey API's Swagger 2.0 pipeline currently needs a response schema symbol even for no-content responses. + additionalProperties: false, + properties: {}, + type: 'object', +}) + const toWords = (value: string) => { return value .replace(/[{}]/g, '') @@ -425,7 +454,12 @@ const normalizeGetBodyParameters = ( const normalizeResponses = (operation: SwaggerOperation) => { const responses = operation.responses ??= {} - for (const response of Object.values(responses)) { + for (const [status, response] of Object.entries(responses)) { + if (noBodyResponseStatuses.has(status)) { + response.schema = noContentSchema() + continue + } + if (!response.schema) response.schema = unknownObjectSchema() } @@ -438,7 +472,103 @@ const normalizeResponses = (operation: SwaggerOperation) => { } } -const normalizeOperations = (document: SwaggerDocument) => { +const hasProperties = (schema: SwaggerSchema) => { + return isObject(schema.properties) && Object.keys(schema.properties).length > 0 +} + +const isEmptySchemaObject = (value: unknown) => { + return isObject(value) && Object.keys(value).length === 0 +} + +const isLooseObjectSchema = (schema: SwaggerSchema) => { + if (hasProperties(schema)) + return false + + if (schema.additionalProperties === true || isEmptySchemaObject(schema.additionalProperties)) + return true + + return schema.type === 'object' && schema.additionalProperties === undefined +} + +const hasLooseSchema = ( + schema: SwaggerSchema | undefined, + definitions: Record, + visitedRefs = new Set(), +): boolean => { + if (!schema) + return true + + const ref = schema?.$ref + if (ref?.startsWith('#/definitions/')) { + const refName = ref.slice('#/definitions/'.length) + if (visitedRefs.has(refName)) + return false + + return hasLooseSchema(definitions[refName], definitions, new Set([...visitedRefs, refName])) + } + + const normalizedSchema = withoutNullableWrapper(schema) + + for (const variants of [normalizedSchema.allOf, normalizedSchema.anyOf, normalizedSchema.oneOf]) { + if (Array.isArray(variants) && variants.some(item => !isNullSchema(item) && hasLooseSchema(item, definitions, visitedRefs))) + return true + } + + if (normalizedSchema.type === 'array') + return hasLooseSchema(normalizedSchema.items, definitions, visitedRefs) + + if (isLooseObjectSchema(normalizedSchema)) + return true + + if (isObject(normalizedSchema.additionalProperties) && hasLooseSchema(normalizedSchema.additionalProperties, definitions, visitedRefs)) + return true + + return Object.values(normalizedSchema.properties ?? {}) + .some(property => hasLooseSchema(property, definitions, visitedRefs)) +} + +const hasPossiblyInaccurateGeneratedContractTypes = ( + operation: SwaggerOperation, + definitions: Record, +) => { + const successResponses = Object.entries(operation.responses ?? {}) + .filter(([status]) => /^2\d\d$/.test(status)) + + if (successResponses.length === 0) + return true + + const successResponsesWithBody = successResponses.filter(([status]) => !noBodyResponseStatuses.has(status)) + if (successResponsesWithBody.some(([, response]) => hasLooseSchema(response.schema, definitions))) + return true + + return operation.parameters?.some((parameter) => { + return parameter.in === 'body' && hasLooseSchema(parameter.schema, definitions) + }) ?? false +} + +const appendOperationDescription = (operation: SwaggerOperation, description: string) => { + const currentDescription = operation.description?.trim() + operation.description = currentDescription ? `${currentDescription}\n\n${description}` : description +} + +const markPossiblyInaccurateGeneratedContract = (operation: SwaggerOperation) => { + operation.deprecated = true + appendOperationDescription(operation, inaccurateGeneratedContractDescription) +} + +const recordApiReadiness = (surface: string, isReady: boolean) => { + const stats = apiReadinessStats[surface] ??= { + notReady: 0, + total: 0, + } + + stats.total += 1 + + if (!isReady) + stats.notReady += 1 +} + +const normalizeOperations = (document: SwaggerDocument, surface: string) => { const definitions = document.definitions ??= {} for (const [routePath, pathItem] of Object.entries(document.paths ?? {})) { @@ -450,14 +580,19 @@ const normalizeOperations = (document: SwaggerDocument) => { swaggerOperation.operationId = operationId(method, routePath) normalizeResponses(swaggerOperation) + const hasPossiblyInaccurateTypes = hasPossiblyInaccurateGeneratedContractTypes(swaggerOperation, definitions) + recordApiReadiness(surface, !hasPossiblyInaccurateTypes) if (method === 'get') normalizeGetBodyParameters(swaggerOperation, definitions) + + if (hasPossiblyInaccurateTypes) + markPossiblyInaccurateGeneratedContract(swaggerOperation) } } } -const normalizeApiSwagger = (document: SwaggerDocument) => { +const normalizeApiSwagger = (document: SwaggerDocument, surface: string) => { document.definitions ??= {} // Flask-RESTX emits Pydantic nested $defs inside individual schemas while @@ -466,11 +601,25 @@ const normalizeApiSwagger = (document: SwaggerDocument) => { ensureReferencedDefinitions(document) normalizeNullableAnyOf(document) removeNullDefaults(document) - normalizeOperations(document) + normalizeOperations(document, surface) return document } +const writeApiReadinessStats = () => { + const sortedSurfaces = Object.entries(apiReadinessStats) + .sort(([left], [right]) => left.localeCompare(right)) + + fs.mkdirSync(path.dirname(apiReadinessStatsPath), { recursive: true }) + fs.writeFileSync( + apiReadinessStatsPath, + `${JSON.stringify({ + surfaces: Object.fromEntries(sortedSurfaces), + warning: inaccurateGeneratedContractDescription, + }, null, 2)}\n`, + ) +} + const topLevelPathSegment = (routePath: string) => { return routePath.split('/').filter(Boolean)[0] ?? 'root' } @@ -520,6 +669,50 @@ const cloneDocumentWithPaths = ( } satisfies SwaggerDocument } +const consoleContractEntryContent = (segments: string[]) => { + const contracts = segments.map((segment) => { + return { + importPath: toKebabCase(segment), + name: toCamelCase(segmentWords(segment)), + } + }) + + const imports = contracts + .map(contract => `import { ${contract.name} } from './${contract.importPath}/orpc.gen'`) + .join('\n') + const contractEntries = contracts.map(contract => ` ${contract.name},`).join('\n') + + return `// This file is auto-generated by @hey-api/openapi-ts + +${imports} + +export const contract = { +${contractEntries} +} +` +} + +const writeConsoleContractEntry = (segments: string[]) => { + const entryPath = path.resolve(currentDir, 'generated/api/console/orpc.gen.ts') + fs.mkdirSync(path.dirname(entryPath), { recursive: true }) + fs.writeFileSync(entryPath, consoleContractEntryContent(segments)) +} + +const createConsoleContractEntryJob = (document: SwaggerDocument, segments: string[]): ApiJob => { + return { + clean: false, + document, + outputPath: 'generated/api/console', + plugins: [], + source: { + callback: () => writeConsoleContractEntry(segments), + enabled: true, + path: null, + serialize: () => '', + }, + } +} + const splitConsoleDocument = (document: SwaggerDocument) => { const pathsBySegment = new Map>>() @@ -530,16 +723,17 @@ const splitConsoleDocument = (document: SwaggerDocument) => { pathsBySegment.set(segment, paths) } - return [...pathsBySegment.entries()] - .sort(([left], [right]) => left.localeCompare(right)) - .map(([segment, paths]): ApiJob => ({ - document: cloneDocumentWithPaths(document, paths), - outputPath: `generated/api/console/${toKebabCase(segment)}`, - })) + const segments = [...pathsBySegment.keys()].sort((left, right) => left.localeCompare(right)) + const jobs = segments.map((segment): ApiJob => ({ + document: cloneDocumentWithPaths(document, pathsBySegment.get(segment) ?? {}), + outputPath: `generated/api/console/${toKebabCase(segment)}`, + })) + + return [...jobs, createConsoleContractEntryJob(document, segments)] } const createApiJobs = (spec: ApiSpec): ApiJob[] => { - const document = normalizeApiSwagger(readApiSwagger(spec.filename)) + const document = normalizeApiSwagger(readApiSwagger(spec.filename), spec.name) if (spec.name === 'console') return splitConsoleDocument(document) @@ -552,19 +746,24 @@ const createApiJobs = (spec: ApiSpec): ApiJob[] => { ] } +const apiJobs = apiSpecs.flatMap(createApiJobs) +writeApiReadinessStats() + const createApiConfig = (job: ApiJob): UserConfig => ({ input: job.document, logs: { file: false, }, output: { + ...(job.clean === undefined ? {} : { clean: job.clean }), entryFile: false, fileName: { suffix: '.gen', }, path: job.outputPath, + ...(job.source ? { source: job.source } : {}), }, - plugins: [ + plugins: job.plugins ?? [ { 'comments': false, 'name': '@hey-api/typescript', @@ -597,4 +796,4 @@ const createApiConfig = (job: ApiJob): UserConfig => ({ ], }) -export default defineConfig(apiSpecs.flatMap(createApiJobs).map(createApiConfig)) +export default defineConfig(apiJobs.map(createApiConfig)) diff --git a/packages/contracts/package.json b/packages/contracts/package.json index c2dd43e990..507a95a779 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -15,8 +15,9 @@ }, "scripts": { "gen-api-contract": "pnpm gen-api-openapi && pnpm gen-api-contract-from-openapi", - "gen-api-contract-from-openapi": "node -e \"fs.rmSync('generated/api', { recursive: true, force: true })\" && openapi-ts -f openapi-ts.api.config.ts && vp fmt generated/api && eslint --fix generated/api", + "gen-api-contract-from-openapi": "node -e \"fs.rmSync('generated/api', { recursive: true, force: true })\" && openapi-ts -f openapi-ts.api.config.ts && vp fmt generated/api && eslint --fix generated/api && pnpm gen-api-readiness-readme", "gen-api-openapi": "uv run --project ../../api ../../api/dev/generate_swagger_specs.py --output-dir openapi", + "gen-api-readiness-readme": "node scripts/generate-api-readiness-readme.mjs && eslint --fix README.md", "gen-enterprise-contract": "openapi-ts -f openapi-ts.enterprise.config.ts", "type-check": "tsgo" }, diff --git a/packages/contracts/scripts/generate-api-readiness-readme.mjs b/packages/contracts/scripts/generate-api-readiness-readme.mjs new file mode 100644 index 0000000000..c75b944e2a --- /dev/null +++ b/packages/contracts/scripts/generate-api-readiness-readme.mjs @@ -0,0 +1,94 @@ +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' + +const currentDir = path.dirname(fileURLToPath(import.meta.url)) +const packageDir = path.resolve(currentDir, '..') +const readinessStatsPath = path.resolve(packageDir, 'generated/api/readiness.json') +const readmePath = path.resolve(packageDir, 'README.md') + +const readinessStartMarker = '' +const readinessEndMarker = '' + +const formatPercent = (ready, total) => { + return total === 0 ? '0.0%' : `${((ready / total) * 100).toFixed(1)}%` +} + +const collectStats = () => { + if (!fs.existsSync(readinessStatsPath)) { + throw new Error( + `Missing API readiness stats: ${readinessStatsPath}. Run "pnpm -C packages/contracts gen-api-contract-from-openapi" first.`, + ) + } + + return JSON.parse(fs.readFileSync(readinessStatsPath, 'utf8')) +} + +const tableRow = (surface, ready, notReady, total) => { + return `| ${surface} | ${ready} | ${notReady} | ${total} | ${formatPercent(ready, total)} |` +} + +const renderReadinessSection = (stats) => { + const rows = Object.entries(stats.surfaces) + .sort(([left], [right]) => left.localeCompare(right)) + .map(([surface, stat]) => tableRow(surface, stat.total - stat.notReady, stat.notReady, stat.total)) + + const totals = Object.values(stats.surfaces).reduce( + (summary, stat) => { + summary.notReady += stat.notReady + summary.total += stat.total + return summary + }, + { notReady: 0, total: 0 }, + ) + const totalReady = totals.total - totals.notReady + + if (totals.total === 0) + throw new Error(`No API readiness stats found in ${readinessStatsPath}`) + + return `${readinessStartMarker} + + + +Snapshot generated from \`packages/contracts/generated/api/readiness.json\` after running \`pnpm -C packages/contracts gen-api-contract-from-openapi\`. + +Are we OpenAPI ready? **No.** Current generated API contracts are **${formatPercent(totalReady, totals.total)} ready**. + +| Surface | Ready | Not ready | Total | Ready % | +| --- | ---: | ---: | ---: | ---: | +${rows.join('\n')} +| **total** | **${totalReady}** | **${totals.notReady}** | **${totals.total}** | **${formatPercent(totalReady, totals.total)}** | + +Readiness here means the generated contract operation is not marked with: + +> ${stats.warning} + +Operations marked with that warning should not be migrated to blindly. Prefer fixing backend OpenAPI annotations first so the generated contract has accurate request and response types, then migrate callers endpoint by endpoint. + +The current heuristic marks an operation as not ready when a request body or success response that should have a body contains a loose object type, or when an operation has no documented 2xx response. 204, 205, and 304 responses are treated as bodyless when the request type is otherwise accurate. + +${readinessEndMarker} +` +} + +const updateReadme = (readinessSection) => { + const readme = fs.readFileSync(readmePath, 'utf8') + const startIndex = readme.indexOf(readinessStartMarker) + const endIndex = readme.indexOf(readinessEndMarker) + + if (startIndex === -1 || endIndex === -1 || endIndex < startIndex) { + throw new Error( + `Missing readiness markers in ${readmePath}. Expected ${readinessStartMarker} and ${readinessEndMarker}.`, + ) + } + + const nextReadme = [ + readme.slice(0, startIndex), + readinessSection, + readme.slice(endIndex + readinessEndMarker.length), + ].join('') + + fs.writeFileSync(readmePath, nextReadme) +} + +updateReadme(renderReadinessSection(collectStats())) diff --git a/web/__tests__/base/notion-page-selector-flow.test.tsx b/web/__tests__/base/notion-page-selector-flow.test.tsx index ef813ee4bc..34f4c988e1 100644 --- a/web/__tests__/base/notion-page-selector-flow.test.tsx +++ b/web/__tests__/base/notion-page-selector-flow.test.tsx @@ -100,7 +100,7 @@ describe('Base Notion Page Selector Flow', () => { />, ) - await user.click(screen.getByTestId('checkbox-notion-page-checkbox-root-1')) + await user.click(screen.getByRole('checkbox', { name: 'Root 1' })) expect(onSelect).toHaveBeenLastCalledWith(expect.arrayContaining([ expect.objectContaining({ page_id: 'root-1', workspace_id: 'w1' }), diff --git a/web/__tests__/datasets/document-management.test.tsx b/web/__tests__/datasets/document-management.test.tsx index 96937332a3..8ce661ff4f 100644 --- a/web/__tests__/datasets/document-management.test.tsx +++ b/web/__tests__/datasets/document-management.test.tsx @@ -184,7 +184,7 @@ describe('Document Management Flow', () => { }) describe('Document Selection Integration', () => { - it('should manage selection state externally', () => { + it('should keep checkbox selection state owned outside the hook', () => { const docs = [ createDoc({ id: 'doc-1' }), createDoc({ id: 'doc-2' }), @@ -198,62 +198,9 @@ describe('Document Management Flow', () => { onSelectedIdChange, })) - expect(result.current.isAllSelected).toBe(false) - expect(result.current.isSomeSelected).toBe(false) - }) - - it('should select all documents', () => { - const docs = [ - createDoc({ id: 'doc-1' }), - createDoc({ id: 'doc-2' }), - ] - const onSelectedIdChange = vi.fn() - - const { result } = renderHook(() => useDocumentSelection({ - documents: docs, - selectedIds: [], - onSelectedIdChange, - })) - - act(() => { - result.current.onSelectAll() - }) - - expect(onSelectedIdChange).toHaveBeenCalledWith( - expect.arrayContaining(['doc-1', 'doc-2']), - ) - }) - - it('should detect all-selected state', () => { - const docs = [ - createDoc({ id: 'doc-1' }), - createDoc({ id: 'doc-2' }), - ] - - const { result } = renderHook(() => useDocumentSelection({ - documents: docs, - selectedIds: ['doc-1', 'doc-2'], - onSelectedIdChange: vi.fn(), - })) - - expect(result.current.isAllSelected).toBe(true) - }) - - it('should detect partial selection', () => { - const docs = [ - createDoc({ id: 'doc-1' }), - createDoc({ id: 'doc-2' }), - createDoc({ id: 'doc-3' }), - ] - - const { result } = renderHook(() => useDocumentSelection({ - documents: docs, - selectedIds: ['doc-1'], - onSelectedIdChange: vi.fn(), - })) - - expect(result.current.isSomeSelected).toBe(true) - expect(result.current.isAllSelected).toBe(false) + expect(result.current.downloadableSelectedIds).toEqual([]) + expect(result.current.hasErrorDocumentsSelected).toBe(false) + expect(onSelectedIdChange).not.toHaveBeenCalled() }) it('should identify downloadable selected documents (FILE type only)', () => { @@ -311,8 +258,9 @@ describe('Document Management Flow', () => { expect(sortResult.current.sortField).toBe('created_at') expect(sortResult.current.sortOrder).toBe('desc') - // Selection starts empty - expect(selResult.current.isAllSelected).toBe(false) + // Selection-derived batch metadata starts empty. + expect(selResult.current.downloadableSelectedIds).toEqual([]) + expect(selResult.current.hasErrorDocumentsSelected).toBe(false) }) }) }) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx index 734b39bd41..5b740971cb 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx @@ -311,7 +311,7 @@ const ProviderConfigModal: FC = ({ onOpenChange={setIsConfigDialogOpen} onOpenChangeComplete={handleConfigDialogOpenChangeComplete} > - +
diff --git a/web/app/components/app/annotation/__tests__/filter.spec.tsx b/web/app/components/app/annotation/__tests__/filter.spec.tsx index 5353a32c4b..1d7b895d6d 100644 --- a/web/app/components/app/annotation/__tests__/filter.spec.tsx +++ b/web/app/components/app/annotation/__tests__/filter.spec.tsx @@ -1,7 +1,7 @@ +import type { AnnotationCountResponse } from '@dify/contracts/api/console/apps/types.gen' import type { UseQueryResult } from '@tanstack/react-query' import type { Mock } from 'vitest' import type { QueryParam } from '../filter' -import type { AnnotationsCountResponse } from '@/models/log' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { fireEvent, render, screen } from '@testing-library/react' import * as React from 'react' @@ -69,7 +69,7 @@ describe('Filter', () => { it('should render nothing when data is loading', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ isLoading: true }), + createMockQueryResult({ isLoading: true }), ) // Act @@ -90,7 +90,7 @@ describe('Filter', () => { it('should render nothing when data is undefined', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ data: undefined, isLoading: false }), + createMockQueryResult({ data: undefined, isLoading: false }), ) // Act @@ -111,7 +111,7 @@ describe('Filter', () => { it('should render filter and children when data is available', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 20 }, isLoading: false, }), @@ -141,7 +141,7 @@ describe('Filter', () => { it('should call useAnnotationsCount with appId', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 10 }, isLoading: false, }), @@ -165,7 +165,7 @@ describe('Filter', () => { it('should display keyword value in input', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 10 }, isLoading: false, }), @@ -195,7 +195,7 @@ describe('Filter', () => { it('should call setQueryParams when typing in search input', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 20 }, isLoading: false, }), @@ -224,7 +224,7 @@ describe('Filter', () => { it('should call setQueryParams with empty keyword when clearing input', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 20 }, isLoading: false, }), @@ -257,7 +257,7 @@ describe('Filter', () => { it('should handle empty keyword in queryParams', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 5 }, isLoading: false, }), @@ -281,7 +281,7 @@ describe('Filter', () => { it('should handle undefined keyword in queryParams', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 5 }, isLoading: false, }), @@ -305,7 +305,7 @@ describe('Filter', () => { it('should handle zero count', () => { // Arrange mockUseAnnotationsCount.mockReturnValue( - createMockQueryResult({ + createMockQueryResult({ data: { count: 0 }, isLoading: false, }), diff --git a/web/app/components/app/annotation/__tests__/list.spec.tsx b/web/app/components/app/annotation/__tests__/list.spec.tsx index ad6a1e5e9c..883c1adfe0 100644 --- a/web/app/components/app/annotation/__tests__/list.spec.tsx +++ b/web/app/components/app/annotation/__tests__/list.spec.tsx @@ -19,8 +19,6 @@ const createAnnotation = (overrides: Partial = {}): AnnotationIt hit_count: overrides.hit_count ?? 2, }) -const getCheckboxes = (container: HTMLElement) => container.querySelectorAll('[data-testid^="checkbox"]') - describe('List', () => { beforeEach(() => { vi.clearAllMocks() @@ -51,7 +49,7 @@ describe('List', () => { it('should toggle single and bulk selection states', () => { const list = [createAnnotation({ id: 'a', question: 'A' }), createAnnotation({ id: 'b', question: 'B' })] const onSelectedIdsChange = vi.fn() - const { container, rerender } = render( + const { rerender } = render( { />, ) - const checkboxes = getCheckboxes(container) - fireEvent.click(checkboxes[1]!) + fireEvent.click(screen.getByRole('checkbox', { name: 'A' })) expect(onSelectedIdsChange).toHaveBeenCalledWith(['a']) rerender( @@ -78,11 +75,10 @@ describe('List', () => { onCancel={vi.fn()} />, ) - const updatedCheckboxes = getCheckboxes(container) - fireEvent.click(updatedCheckboxes[1]!) + fireEvent.click(screen.getByRole('checkbox', { name: 'A' })) expect(onSelectedIdsChange).toHaveBeenCalledWith([]) - fireEvent.click(updatedCheckboxes[0]!) + fireEvent.click(screen.getByRole('checkbox', { name: 'common.operation.selectAll' })) expect(onSelectedIdsChange).toHaveBeenCalledWith(['a', 'b']) }) diff --git a/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx b/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx index 497c623f3e..00f91ab429 100644 --- a/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx +++ b/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx @@ -91,7 +91,7 @@ describe('AddAnnotationModal', () => { typeQuestion('Question value') typeAnswer('Answer value') - fireEvent.click(screen.getByTestId('checkbox-create-next-checkbox')) + fireEvent.click(screen.getByText('appAnnotation.addModal.createNext')) await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.operation.add' })) @@ -106,8 +106,7 @@ describe('AddAnnotationModal', () => { typeQuestion('Question value') typeAnswer('Answer value') - const createNextToggle = screen.getByText('appAnnotation.addModal.createNext').previousElementSibling as HTMLElement - fireEvent.click(createNextToggle) + fireEvent.click(screen.getByText('appAnnotation.addModal.createNext')) await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.operation.add' })) diff --git a/web/app/components/app/annotation/add-annotation-modal/index.tsx b/web/app/components/app/annotation/add-annotation-modal/index.tsx index 53f3cd5bdd..f94b072e39 100644 --- a/web/app/components/app/annotation/add-annotation-modal/index.tsx +++ b/web/app/components/app/annotation/add-annotation-modal/index.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import type { AnnotationItemBasic } from '../type' import { Button } from '@langgenius/dify-ui/button' +import { Checkbox } from '@langgenius/dify-ui/checkbox' import { Drawer, DrawerBackdrop, @@ -16,7 +17,6 @@ import { toast } from '@langgenius/dify-ui/toast' import * as React from 'react' import { useState } from 'react' import { useTranslation } from 'react-i18next' -import Checkbox from '@/app/components/base/checkbox' import AnnotationFull from '@/app/components/billing/annotation-full' import { useProviderContext } from '@/context/provider-context' import EditItem, { EditItemType } from './edit-item' @@ -128,10 +128,10 @@ const AddAnnotationModal: FC = ({
)}
-
- setIsCreateNext(!isCreateNext)} /> -
{t('addModal.createNext', { ns: 'appAnnotation' })}
-
+
diff --git a/web/app/components/app/annotation/list.tsx b/web/app/components/app/annotation/list.tsx index caad4dd523..fa12c95ae3 100644 --- a/web/app/components/app/annotation/list.tsx +++ b/web/app/components/app/annotation/list.tsx @@ -1,13 +1,13 @@ 'use client' import type { FC } from 'react' import type { AnnotationItem } from './type' +import { Checkbox } from '@langgenius/dify-ui/checkbox' import { cn } from '@langgenius/dify-ui/cn' import { RiDeleteBinLine, RiEditLine } from '@remixicon/react' import * as React from 'react' import { useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import ActionButton from '@/app/components/base/action-button' -import Checkbox from '@/app/components/base/checkbox' import useTimestamp from '@/hooks/use-timestamp' import BatchAction from './batch-action' import RemoveAnnotationConfirmModal from './remove-annotation-confirm-modal' @@ -44,15 +44,15 @@ const List: FC = ({ return list.some(item => selectedIds.includes(item.id)) }, [list, selectedIds]) - const handleSelectAll = useCallback(() => { + const handleSelectAll = useCallback((checked: boolean) => { const currentPageIds = list.map(item => item.id) const otherPageIds = selectedIds.filter(id => !currentPageIds.includes(id)) - if (isAllSelected) - onSelectedIdsChange(otherPageIds) - else + if (checked) onSelectedIdsChange([...otherPageIds, ...currentPageIds]) - }, [isAllSelected, list, selectedIds, onSelectedIdsChange]) + else + onSelectedIdsChange(otherPageIds) + }, [list, selectedIds, onSelectedIdsChange]) return ( <> @@ -65,7 +65,8 @@ const List: FC = ({ className="mr-2" checked={isAllSelected} indeterminate={!isAllSelected && isSomeSelected} - onCheck={handleSelectAll} + aria-label={t('operation.selectAll', { ns: 'common' })} + onCheckedChange={handleSelectAll} /> {t('table.header.question', { ns: 'appAnnotation' })} @@ -90,11 +91,12 @@ const List: FC = ({ { - if (selectedIds.includes(item.id)) - onSelectedIdsChange(selectedIds.filter(id => id !== item.id)) - else + aria-label={item.question} + onCheckedChange={(checked) => { + if (checked) onSelectedIdsChange([...selectedIds, item.id]) + else + onSelectedIdsChange(selectedIds.filter(id => id !== item.id)) }} /> diff --git a/web/app/components/app/app-access-control/access-control-dialog.tsx b/web/app/components/app/app-access-control/access-control-dialog.tsx index ed1301386c..8fa022a78b 100644 --- a/web/app/components/app/app-access-control/access-control-dialog.tsx +++ b/web/app/components/app/app-access-control/access-control-dialog.tsx @@ -28,7 +28,7 @@ const AccessControlDialog = ({ !open && close()}> diff --git a/web/app/components/app/configuration/config-var/config-modal/__tests__/form-fields.spec.tsx b/web/app/components/app/configuration/config-var/config-modal/__tests__/form-fields.spec.tsx index cdb1d17833..7a77821c18 100644 --- a/web/app/components/app/configuration/config-var/config-modal/__tests__/form-fields.spec.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/__tests__/form-fields.spec.tsx @@ -70,12 +70,6 @@ vi.mock('@/app/components/workflow/nodes/_base/components/editor/code-editor', ( ), })) -vi.mock('@/app/components/base/checkbox', () => ({ - default: ({ onCheck, checked }: { onCheck: () => void, checked: boolean }) => ( - - ), -})) - vi.mock('@langgenius/dify-ui/select', async (importOriginal) => { const actual = await importOriginal() @@ -230,7 +224,7 @@ describe('ConfigModalFormFields', () => { expect(screen.queryByText('variableConfig.hiddenDescription')).not.toBeInTheDocument() fireEvent.click(screen.getByText('single-file-setting')) fireEvent.click(screen.getByText('upload-file')) - fireEvent.click(screen.getAllByText('unchecked')[0]!) + fireEvent.click(screen.getByRole('checkbox', { name: 'variableConfig.required' })) expect(singleFileProps.onFilePayloadChange).toHaveBeenCalledWith({ number_limits: 1 }) expect(singleFileProps.payloadChangeHandlers.default).toHaveBeenCalledWith(expect.objectContaining({ @@ -416,17 +410,14 @@ describe('ConfigModalFormFields', () => { requiredProps.tempPayload = { ...requiredProps.tempPayload, type: InputVarType.textInput, required: true, hide: false } const { unmount } = render() - const buttons = screen.getAllByRole('button') - const hideButton = buttons.find(btn => btn.textContent === 'unchecked' && btn !== buttons[0]) - expect(hideButton).toBeDefined() + expect(screen.getByRole('checkbox', { name: 'variableConfig.hidden' })).toHaveAttribute('aria-disabled', 'true') unmount() const hideProps = createBaseProps() hideProps.tempPayload = { ...hideProps.tempPayload, type: InputVarType.textInput, required: false, hide: true } render() - const allButtons = screen.getAllByRole('button') - const checkedHideButton = allButtons.find(btn => btn.textContent === 'checked') - expect(checkedHideButton).toBeDefined() + expect(screen.getByRole('checkbox', { name: 'variableConfig.required' })).toHaveAttribute('aria-disabled', 'true') + expect(screen.getByRole('checkbox', { name: 'variableConfig.hidden' })).toHaveAttribute('aria-checked', 'true') }) }) diff --git a/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx b/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx index 4bd938c3f6..c932c15896 100644 --- a/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx @@ -3,6 +3,7 @@ import type { ChangeEvent, FC } from 'react' import type { Item as SelectOptionItem } from './type-select' import type { FileEntity } from '@/app/components/base/file-uploader/types' import type { InputVar, UploadFileSetting } from '@/app/components/workflow/types' +import { Checkbox } from '@langgenius/dify-ui/checkbox' import { Select, SelectContent, @@ -14,7 +15,6 @@ import { } from '@langgenius/dify-ui/select' import * as React from 'react' import { Trans } from 'react-i18next' -import Checkbox from '@/app/components/base/checkbox' import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader' import { Infotip } from '@/app/components/base/infotip' import Input from '@/app/components/base/input' @@ -232,16 +232,26 @@ const ConfigModalFormFields: FC = ({ )} -
- onPayloadChange('required')(!tempPayload.required)} /> +
+ {!isFileInput && ( -
- onPayloadChange('hide')(!tempPayload.hide)} /> -
+
+ +
= ({ onClose() }} > - + -
+
{t('generate.title', { ns: 'appDebug' })}
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 b603243e00..bd3951a485 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 @@ -209,9 +209,9 @@ export const GetCodeGeneratorResModal: FC = ( onClose() }} > - + -
+
{t('codegen.title', { ns: 'appDebug' })}
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 1be3799480..e8d8266586 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 @@ -59,7 +59,6 @@ const defaultProviderContext = { const defaultModalContext: ModalContextState = { setShowAccountSettingModal: noop, - setShowApiBasedExtensionModal: noop, setShowModerationSettingModal: noop, setShowExternalDataToolModal: noop, setShowPricingModal: noop, diff --git a/web/app/components/app/overview/settings/__tests__/index.spec.tsx b/web/app/components/app/overview/settings/__tests__/index.spec.tsx index 8023155e5e..462227fbbe 100644 --- a/web/app/components/app/overview/settings/__tests__/index.spec.tsx +++ b/web/app/components/app/overview/settings/__tests__/index.spec.tsx @@ -55,7 +55,6 @@ const mockUseProviderContext = vi.fn<() => ProviderContextState>() const buildModalContext = (): ModalContextState => ({ setShowAccountSettingModal: mockSetShowAccountSettingModal, - setShowApiBasedExtensionModal: vi.fn(), setShowModerationSettingModal: vi.fn(), setShowExternalDataToolModal: vi.fn(), setShowPricingModal: mockSetShowPricingModal, diff --git a/web/app/components/app/switch-app-modal/index.tsx b/web/app/components/app/switch-app-modal/index.tsx index b88579fbe5..f3ca9a911a 100644 --- a/web/app/components/app/switch-app-modal/index.tsx +++ b/web/app/components/app/switch-app-modal/index.tsx @@ -11,6 +11,7 @@ import { AlertDialogTitle, } from '@langgenius/dify-ui/alert-dialog' import { Button } from '@langgenius/dify-ui/button' +import { Checkbox } from '@langgenius/dify-ui/checkbox' import { cn } from '@langgenius/dify-ui/cn' import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog' import { toast } from '@langgenius/dify-ui/toast' @@ -19,7 +20,6 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { useStore as useAppStore } from '@/app/components/app/store' import AppIcon from '@/app/components/base/app-icon' -import Checkbox from '@/app/components/base/checkbox' import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' import Input from '@/app/components/base/input' import AppsFull from '@/app/components/billing/apps-full-in-dialog' @@ -165,14 +165,12 @@ const SwitchAppModal = ({ show, appDetail, inAppDetail = false, onSuccess, onClo {isAppsFull && }
- setRemoveOriginal(!removeOriginal)} /> - +
diff --git a/web/app/components/apps/__tests__/list.spec.tsx b/web/app/components/apps/__tests__/list.spec.tsx index 0c6f1702d7..75442c1ebd 100644 --- a/web/app/components/apps/__tests__/list.spec.tsx +++ b/web/app/components/apps/__tests__/list.spec.tsx @@ -415,7 +415,7 @@ describe('List', () => { it('should handle checkbox change', () => { renderList() - const checkbox = screen.getByTestId('checkbox-undefined') + const checkbox = screen.getByRole('checkbox', { name: 'app.showMyCreatedAppsOnly' }) fireEvent.click(checkbox) expect(mockSetIsCreatedByMe).toHaveBeenCalledWith(true) diff --git a/web/app/components/apps/list.tsx b/web/app/components/apps/list.tsx index e330f2f2d1..7b70a1aeea 100644 --- a/web/app/components/apps/list.tsx +++ b/web/app/components/apps/list.tsx @@ -2,12 +2,12 @@ import type { FC } from 'react' import type { AppListQuery } from '@/contract/console/apps' +import { Checkbox } from '@langgenius/dify-ui/checkbox' import { cn } from '@langgenius/dify-ui/cn' import { keepPreviousData, useInfiniteQuery, useSuspenseQuery } from '@tanstack/react-query' import { useDebounce } from 'ahooks' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import Checkbox from '@/app/components/base/checkbox' import Input from '@/app/components/base/input' import TabSliderNew from '@/app/components/base/tab-slider-new' import { NEED_REFRESH_APP_LIST_KEY } from '@/config' @@ -161,9 +161,9 @@ const List: FC = ({ return () => observer?.disconnect() }, [isLoading, isFetchingNextPage, fetchNextPage, error, hasNextPage, canAccessAppList]) - const handleCreatedByMeChange = useCallback(() => { - setIsCreatedByMe(!isCreatedByMe) - }, [isCreatedByMe, setIsCreatedByMe]) + const handleCreatedByMeChange = useCallback((checked: boolean) => { + setIsCreatedByMe(checked) + }, [setIsCreatedByMe]) const pages = useMemo(() => data?.pages ?? [], [data?.pages]) const apps = useMemo(() => pages.flatMap(({ data: pageApps }) => pageApps), [pages]) @@ -207,7 +207,7 @@ const List: FC = ({ />