diff --git a/api/controllers/common/controller_schemas.py b/api/controllers/common/controller_schemas.py index c12d576473..8eeed8f0a0 100644 --- a/api/controllers/common/controller_schemas.py +++ b/api/controllers/common/controller_schemas.py @@ -62,7 +62,7 @@ class WorkflowListQuery(BaseModel): class WorkflowRunPayload(BaseModel): inputs: dict[str, Any] - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) class WorkflowUpdatePayload(BaseModel): diff --git a/api/controllers/common/fields.py b/api/controllers/common/fields.py index a90a26e730..06d68a5df1 100644 --- a/api/controllers/common/fields.py +++ b/api/controllers/common/fields.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any -from pydantic import BaseModel, ConfigDict, Field, computed_field +from pydantic import BaseModel, ConfigDict, Field, RootModel, computed_field from fields.base import ResponseModel from graphon.file import helpers as file_helpers @@ -24,6 +24,34 @@ class SimpleResultResponse(ResponseModel): result: str +class GeneratedAppResponse(RootModel[JSONValue]): + root: JSONValue + + +class EventStreamResponse(RootModel[str]): + root: str + + +class TextFileResponse(RootModel[str]): + root: str + + +class RedirectResponse(RootModel[str]): + root: str + + +class BinaryFileResponse(RootModel[bytes]): + root: bytes + + +class AudioBinaryResponse(RootModel[bytes]): + root: bytes + + +class AudioTranscriptResponse(ResponseModel): + text: str + + class SimpleResultMessageResponse(ResponseModel): result: str message: str diff --git a/api/controllers/console/app/advanced_prompt_template.py b/api/controllers/console/app/advanced_prompt_template.py index ca8e709682..90098739a4 100644 --- a/api/controllers/console/app/advanced_prompt_template.py +++ b/api/controllers/console/app/advanced_prompt_template.py @@ -1,10 +1,17 @@ +from typing import Any + from flask import request -from flask_restx import Resource, fields +from flask_restx import Resource from pydantic import BaseModel, Field -from controllers.common.schema import DEFAULT_REF_TEMPLATE_OPENAPI_3_0, query_params_from_model +from controllers.common.schema import ( + DEFAULT_REF_TEMPLATE_OPENAPI_3_0, + query_params_from_model, + register_response_schema_models, +) from controllers.console import console_ns from controllers.console.wraps import account_initialization_required, setup_required +from fields.base import ResponseModel from libs.login import login_required from services.advanced_prompt_template_service import AdvancedPromptTemplateArgs, AdvancedPromptTemplateService @@ -16,10 +23,16 @@ class AdvancedPromptTemplateQuery(BaseModel): model_name: str = Field(..., description="Model name") +class AdvancedPromptTemplateResponse(ResponseModel): + chat_prompt_config: dict[str, Any] | None = Field(default=None) + completion_prompt_config: dict[str, Any] | None = Field(default=None) + + console_ns.schema_model( AdvancedPromptTemplateQuery.__name__, AdvancedPromptTemplateQuery.model_json_schema(ref_template=DEFAULT_REF_TEMPLATE_OPENAPI_3_0), ) +register_response_schema_models(console_ns, AdvancedPromptTemplateResponse) @console_ns.route("/app/prompt-templates") @@ -28,7 +41,9 @@ class AdvancedPromptTemplateList(Resource): @console_ns.doc(description="Get advanced prompt templates based on app mode and model configuration") @console_ns.doc(params=query_params_from_model(AdvancedPromptTemplateQuery)) @console_ns.response( - 200, "Prompt templates retrieved successfully", fields.List(fields.Raw(description="Prompt template data")) + 200, + "Prompt templates retrieved successfully", + console_ns.models[AdvancedPromptTemplateResponse.__name__], ) @console_ns.response(400, "Invalid request parameters") @setup_required diff --git a/api/controllers/console/app/agent.py b/api/controllers/console/app/agent.py index 833ca97fa7..b2b3ac942c 100644 --- a/api/controllers/console/app/agent.py +++ b/api/controllers/console/app/agent.py @@ -1,12 +1,15 @@ -from flask import request -from flask_restx import Resource, fields -from pydantic import BaseModel, Field, field_validator +from typing import Any -from controllers.common.schema import query_params_from_model, register_schema_models +from flask import request +from flask_restx import Resource +from pydantic import BaseModel, Field, RootModel, field_validator + +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.wraps import get_app_model from controllers.console.wraps import account_initialization_required, setup_required, with_current_user from extensions.ext_database import db +from fields.base import ResponseModel from libs.helper import uuid_value from libs.login import login_required from models import Account @@ -28,7 +31,53 @@ class AgentLogQuery(BaseModel): return uuid_value(value) +class AgentLogMetaResponse(ResponseModel): + status: str + executor: str + start_time: str + elapsed_time: float | None = None + total_tokens: int + agent_mode: str + iterations: int + + +class AgentToolCallResponse(ResponseModel): + status: str + error: str | None = None + time_cost: float | int + tool_name: str + tool_label: str + tool_input: dict[str, Any] + tool_output: dict[str, Any] + tool_parameters: dict[str, Any] + tool_icon: Any = Field(default=None) + + +class AgentIterationLogResponse(ResponseModel): + tokens: int + tool_calls: list[AgentToolCallResponse] + tool_raw: dict[str, Any] + thought: str | None = None + created_at: str + files: list[Any] = Field(default_factory=list) + + +class AgentLogResponse(ResponseModel): + meta: AgentLogMetaResponse + iterations: list[AgentIterationLogResponse] + files: list[Any] = Field(default_factory=list) + + +class AgentSkillUploadResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class AgentSkillStandardizeResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models(console_ns, AgentLogQuery) +register_response_schema_models(console_ns, AgentLogResponse, AgentSkillUploadResponse, AgentSkillStandardizeResponse) @console_ns.route("/apps//agent/logs") @@ -37,9 +86,7 @@ class AgentLogApi(Resource): @console_ns.doc(description="Get agent execution logs for an application") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(AgentLogQuery)) - @console_ns.response( - 200, "Agent logs retrieved successfully", fields.List(fields.Raw(description="Agent log entries")) - ) + @console_ns.response(200, "Agent logs retrieved successfully", console_ns.models[AgentLogResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @setup_required @login_required @@ -57,7 +104,7 @@ class AgentSkillUploadApi(Resource): @console_ns.doc("upload_agent_skill") @console_ns.doc(description="Upload + validate a Skill package (.zip/.skill) and extract its manifest") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(201, "Skill validated") + @console_ns.response(201, "Skill validated", console_ns.models[AgentSkillUploadResponse.__name__]) @console_ns.response(400, "Invalid skill package") @setup_required @login_required @@ -97,7 +144,11 @@ class AgentSkillStandardizeApi(Resource): @console_ns.doc("standardize_agent_skill") @console_ns.doc(description="Validate + standardize a Skill into the agent drive (ENG-594)") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(201, "Skill standardized into drive") + @console_ns.response( + 201, + "Skill standardized into drive", + console_ns.models[AgentSkillStandardizeResponse.__name__], + ) @console_ns.response(400, "Invalid skill package or no bound agent") @setup_required @login_required diff --git a/api/controllers/console/app/annotation.py b/api/controllers/console/app/annotation.py index 497f365363..dd0b7e9ef5 100644 --- a/api/controllers/console/app/annotation.py +++ b/api/controllers/console/app/annotation.py @@ -6,7 +6,7 @@ from flask_restx import Resource from pydantic import BaseModel, Field, TypeAdapter, field_validator from controllers.common.errors import NoFileUploadedError, TooManyFilesError -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -24,6 +24,7 @@ from fields.annotation_fields import ( AnnotationHitHistoryList, AnnotationList, ) +from fields.base import ResponseModel from libs.helper import uuid_value from libs.login import login_required from services.annotation_service import ( @@ -56,7 +57,10 @@ class CreateAnnotationPayload(BaseModel): question: str | None = Field(default=None, description="Question text") answer: str | None = Field(default=None, description="Answer text") content: str | None = Field(default=None, description="Content text") - annotation_reply: dict[str, Any] | None = Field(default=None, description="Annotation reply data") + annotation_reply: dict[str, Any] | None = Field( + default=None, + description="Annotation reply data", + ) @field_validator("message_id") @classmethod @@ -70,7 +74,7 @@ class UpdateAnnotationPayload(BaseModel): question: str | None = None answer: str | None = None content: str | None = None - annotation_reply: dict[str, Any] | None = None + annotation_reply: dict[str, Any] | None = Field(default=None) class AnnotationReplyStatusQuery(BaseModel): @@ -91,6 +95,25 @@ class AnnotationFilePayload(BaseModel): return uuid_value(value) +class AnnotationJobStatusResponse(ResponseModel): + job_id: str | None = None + job_status: str | None = None + error_msg: str | None = None + record_count: int | None = None + + +class AnnotationEmbeddingModelResponse(ResponseModel): + embedding_provider_name: str | None = None + embedding_model_name: str | None = None + + +class AnnotationSettingResponse(ResponseModel): + id: str | None = None + enabled: bool + score_threshold: float | None = None + embedding_model: AnnotationEmbeddingModelResponse | None = None + + register_schema_models( console_ns, Annotation, @@ -107,6 +130,16 @@ register_schema_models( AnnotationHitHistoryListQuery, AnnotationFilePayload, ) +register_response_schema_models( + console_ns, + Annotation, + AnnotationList, + AnnotationExportList, + AnnotationHitHistory, + AnnotationHitHistoryList, + AnnotationJobStatusResponse, + AnnotationSettingResponse, +) @console_ns.route("/apps//annotation-reply/") @@ -115,7 +148,7 @@ class AnnotationReplyActionApi(Resource): @console_ns.doc(description="Enable or disable annotation reply for an app") @console_ns.doc(params={"app_id": "Application ID", "action": "Action to perform (enable/disable)"}) @console_ns.expect(console_ns.models[AnnotationReplyPayload.__name__]) - @console_ns.response(200, "Action completed successfully") + @console_ns.response(200, "Action completed successfully", console_ns.models[AnnotationJobStatusResponse.__name__]) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -142,7 +175,11 @@ class AppAnnotationSettingDetailApi(Resource): @console_ns.doc("get_annotation_setting") @console_ns.doc(description="Get annotation settings for an app") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Annotation settings retrieved successfully") + @console_ns.response( + 200, + "Annotation settings retrieved successfully", + console_ns.models[AnnotationSettingResponse.__name__], + ) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -159,7 +196,7 @@ class AppAnnotationSettingUpdateApi(Resource): @console_ns.doc(description="Update annotation settings for an app") @console_ns.doc(params={"app_id": "Application ID", "annotation_setting_id": "Annotation setting ID"}) @console_ns.expect(console_ns.models[AnnotationSettingUpdatePayload.__name__]) - @console_ns.response(200, "Settings updated successfully") + @console_ns.response(200, "Settings updated successfully", console_ns.models[AnnotationSettingResponse.__name__]) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -182,7 +219,11 @@ class AnnotationReplyActionStatusApi(Resource): @console_ns.doc("get_annotation_reply_action_status") @console_ns.doc(description="Get status of annotation reply action job") @console_ns.doc(params={"app_id": "Application ID", "job_id": "Job ID", "action": "Action type"}) - @console_ns.response(200, "Job status retrieved successfully") + @console_ns.response( + 200, + "Job status retrieved successfully", + console_ns.models[AnnotationJobStatusResponse.__name__], + ) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -211,7 +252,7 @@ class AnnotationApi(Resource): @console_ns.doc(description="Get annotations for an app with pagination") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(AnnotationListQuery)) - @console_ns.response(200, "Annotations retrieved successfully") + @console_ns.response(200, "Annotations retrieved successfully", console_ns.models[AnnotationList.__name__]) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -263,6 +304,7 @@ class AnnotationApi(Resource): @login_required @account_initialization_required @edit_permission_required + @console_ns.response(204, "Annotations deleted successfully") def delete(self, app_id: UUID): # Use request.args.getlist to get annotation_ids array directly @@ -341,6 +383,7 @@ class AnnotationUpdateDeleteApi(Resource): @login_required @account_initialization_required @edit_permission_required + @console_ns.response(204, "Annotation deleted successfully") def delete(self, app_id: UUID, annotation_id: UUID): AppAnnotationService.delete_app_annotation(str(app_id), str(annotation_id)) return "", 204 @@ -351,7 +394,11 @@ class AnnotationBatchImportApi(Resource): @console_ns.doc("batch_import_annotations") @console_ns.doc(description="Batch import annotations from CSV file with rate limiting and security checks") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Batch import started successfully") + @console_ns.response( + 200, + "Batch import started successfully", + console_ns.models[AnnotationJobStatusResponse.__name__], + ) @console_ns.response(403, "Insufficient permissions") @console_ns.response(400, "No file uploaded or too many files") @console_ns.response(413, "File too large") @@ -404,7 +451,11 @@ class AnnotationBatchImportStatusApi(Resource): @console_ns.doc("get_batch_import_status") @console_ns.doc(description="Get status of batch import job") @console_ns.doc(params={"app_id": "Application ID", "job_id": "Job ID"}) - @console_ns.response(200, "Job status retrieved successfully") + @console_ns.response( + 200, + "Job status retrieved successfully", + console_ns.models[AnnotationJobStatusResponse.__name__], + ) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required diff --git a/api/controllers/console/app/app.py b/api/controllers/console/app/app.py index 598bb13577..71e685cb71 100644 --- a/api/controllers/console/app/app.py +++ b/api/controllers/console/app/app.py @@ -211,6 +211,11 @@ class AppTracePayload(BaseModel): return value +class AppTraceResponse(ResponseModel): + enabled: bool + tracing_provider: str | None = None + + type JSONValue = Any @@ -452,7 +457,7 @@ class AppExportResponse(ResponseModel): register_enum_models(console_ns, RetrievalMethod, WorkflowExecutionStatus, DatasetPermissionEnum) -register_response_schema_models(console_ns, RedirectUrlResponse, SimpleResultResponse) +register_response_schema_models(console_ns, AppTraceResponse, RedirectUrlResponse, SimpleResultResponse) register_schema_models( console_ns, @@ -817,7 +822,7 @@ class AppIconApi(Resource): @console_ns.doc(description="Update application icon") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[AppIconPayload.__name__]) - @console_ns.response(200, "Icon updated successfully") + @console_ns.response(200, "Icon updated successfully", console_ns.models[AppDetail.__name__]) @console_ns.response(403, "Insufficient permissions") @setup_required @login_required @@ -887,7 +892,11 @@ class AppTraceApi(Resource): @console_ns.doc("get_app_trace") @console_ns.doc(description="Get app tracing configuration") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Trace configuration retrieved successfully") + @console_ns.response( + 200, + "Trace configuration retrieved successfully", + console_ns.models[AppTraceResponse.__name__], + ) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/app/audio.py b/api/controllers/console/app/audio.py index f0d904faef..7ef43570c2 100644 --- a/api/controllers/console/app/audio.py +++ b/api/controllers/console/app/audio.py @@ -1,12 +1,14 @@ import logging +from typing import Any from flask import request -from flask_restx import Resource, fields -from pydantic import BaseModel, Field +from flask_restx import Resource +from pydantic import BaseModel, Field, RootModel from werkzeug.exceptions import InternalServerError import services -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.fields import AudioBinaryResponse +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( AppUnavailableError, @@ -51,7 +53,12 @@ class AudioTranscriptResponse(BaseModel): text: str = Field(description="Transcribed text from audio") +class TextToSpeechVoiceListResponse(RootModel[list[dict[str, Any]]]): + root: list[dict[str, Any]] + + register_schema_models(console_ns, AudioTranscriptResponse, TextToSpeechPayload, TextToSpeechVoiceQuery) +register_response_schema_models(console_ns, AudioBinaryResponse, TextToSpeechVoiceListResponse) @console_ns.route("/apps//audio-to-text") @@ -113,7 +120,11 @@ class ChatMessageTextApi(Resource): @console_ns.doc(description="Convert text to speech for chat messages") @console_ns.doc(params={"app_id": "App ID"}) @console_ns.expect(console_ns.models[TextToSpeechPayload.__name__]) - @console_ns.response(200, "Text to speech conversion successful") + @console_ns.response( + 200, + "Text to speech conversion successful", + console_ns.models[AudioBinaryResponse.__name__], + ) @console_ns.response(400, "Bad request - Invalid parameters") @get_app_model @setup_required @@ -164,7 +175,9 @@ class TextModesApi(Resource): @console_ns.doc(params={"app_id": "App ID"}) @console_ns.doc(params=query_params_from_model(TextToSpeechVoiceQuery)) @console_ns.response( - 200, "TTS voices retrieved successfully", fields.List(fields.Raw(description="Available voices")) + 200, + "TTS voices retrieved successfully", + console_ns.models[TextToSpeechVoiceListResponse.__name__], ) @console_ns.response(400, "Invalid language parameter") @get_app_model diff --git a/api/controllers/console/app/completion.py b/api/controllers/console/app/completion.py index e5eabf6c49..452d80bd5f 100644 --- a/api/controllers/console/app/completion.py +++ b/api/controllers/console/app/completion.py @@ -7,7 +7,7 @@ from pydantic import BaseModel, Field, field_validator from werkzeug.exceptions import BadRequest, InternalServerError, NotFound import services -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( @@ -64,8 +64,14 @@ class BaseMessagePayload(BaseModel): # Soul, so no override ``model_config`` is sent; chat / agent-chat / completion # debugging still pass it. Optional here, required in practice by those modes # downstream when their config is built from args. - model_config_data: dict[str, Any] = Field(default_factory=dict, alias="model_config") - files: list[Any] | None = Field(default=None, description="Uploaded files") + model_config_data: dict[str, Any] = Field( + default_factory=dict, + alias="model_config", + ) + files: list[Any] | None = Field( + default=None, + description="Uploaded files", + ) response_mode: Literal["blocking", "streaming"] = Field(default="blocking", description="Response mode") retriever_from: str = Field(default="dev", description="Retriever source") @@ -88,7 +94,7 @@ class ChatMessagePayload(BaseMessagePayload): register_schema_models(console_ns, CompletionMessagePayload, ChatMessagePayload) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models(console_ns, GeneratedAppResponse, SimpleResultResponse) # define completion message api for user @@ -98,7 +104,7 @@ class CompletionMessageApi(Resource): @console_ns.doc(description="Generate completion message for debugging") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[CompletionMessagePayload.__name__]) - @console_ns.response(200, "Completion generated successfully") + @console_ns.response(200, "Completion generated successfully", console_ns.models[GeneratedAppResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(404, "App not found") @setup_required @@ -170,7 +176,7 @@ class ChatMessageApi(Resource): @console_ns.doc(description="Generate chat message for debugging") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[ChatMessagePayload.__name__]) - @console_ns.response(200, "Chat message generated successfully") + @console_ns.response(200, "Chat message generated successfully", console_ns.models[GeneratedAppResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(404, "App or conversation not found") @setup_required diff --git a/api/controllers/console/app/generator.py b/api/controllers/console/app/generator.py index 7d7fa98238..1cf0ec82eb 100644 --- a/api/controllers/console/app/generator.py +++ b/api/controllers/console/app/generator.py @@ -1,11 +1,12 @@ from collections.abc import Sequence -from typing import Literal +from typing import Any, Literal from flask_restx import Resource -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel from sqlalchemy.orm import Session -from controllers.common.schema import register_enum_models, register_schema_models +from controllers.common.fields import SimpleDataResponse +from controllers.common.schema import register_enum_models, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( CompletionRequestError, @@ -36,7 +37,11 @@ class InstructionGeneratePayload(BaseModel): current: str = Field(default="", description="Current instruction text") language: str = Field(default="javascript", description="Programming language (javascript/python)") instruction: str = Field(..., description="Instruction for generation") - model_config_data: ModelConfig = Field(..., alias="model_config", description="Model configuration") + model_config_data: ModelConfig = Field( + ..., + alias="model_config", + description="Model configuration", + ) ideal_output: str = Field(default="", description="Expected ideal output") @@ -62,13 +67,21 @@ class WorkflowGeneratePayload(BaseModel): mode: Literal["workflow", "advanced-chat"] = Field(..., description="Target app mode for the generated graph") instruction: str = Field(..., description="Natural-language workflow description") ideal_output: str = Field(default="", description="Optional sample output for grounding") - model_config_data: ModelConfig = Field(..., alias="model_config", description="Model configuration") + model_config_data: ModelConfig = Field( + ..., + alias="model_config", + description="Model configuration", + ) current_graph: dict | None = Field( default=None, description="Existing draft graph to refine (cmd+k `/refine`); omit for create-from-scratch", ) +class GeneratorResponse(RootModel[Any]): + root: Any + + register_enum_models(console_ns, LLMMode) register_schema_models( console_ns, @@ -80,6 +93,7 @@ register_schema_models( WorkflowGeneratePayload, ModelConfig, ) +register_response_schema_models(console_ns, GeneratorResponse, SimpleDataResponse) @console_ns.route("/rule-generate") @@ -87,7 +101,11 @@ class RuleGenerateApi(Resource): @console_ns.doc("generate_rule_config") @console_ns.doc(description="Generate rule configuration using LLM") @console_ns.expect(console_ns.models[RuleGeneratePayload.__name__]) - @console_ns.response(200, "Rule configuration generated successfully") + @console_ns.response( + 200, + "Rule configuration generated successfully", + console_ns.models[GeneratorResponse.__name__], + ) @console_ns.response(400, "Invalid request parameters") @console_ns.response(402, "Provider quota exceeded") @setup_required @@ -116,7 +134,7 @@ class RuleCodeGenerateApi(Resource): @console_ns.doc("generate_rule_code") @console_ns.doc(description="Generate code rules using LLM") @console_ns.expect(console_ns.models[RuleCodeGeneratePayload.__name__]) - @console_ns.response(200, "Code rules generated successfully") + @console_ns.response(200, "Code rules generated successfully", console_ns.models[GeneratorResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(402, "Provider quota exceeded") @setup_required @@ -148,7 +166,7 @@ class RuleStructuredOutputGenerateApi(Resource): @console_ns.doc("generate_structured_output") @console_ns.doc(description="Generate structured output rules using LLM") @console_ns.expect(console_ns.models[RuleStructuredOutputPayload.__name__]) - @console_ns.response(200, "Structured output generated successfully") + @console_ns.response(200, "Structured output generated successfully", console_ns.models[GeneratorResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(402, "Provider quota exceeded") @setup_required @@ -180,7 +198,7 @@ class InstructionGenerateApi(Resource): @console_ns.doc("generate_instruction") @console_ns.doc(description="Generate instruction for workflow nodes or general use") @console_ns.expect(console_ns.models[InstructionGeneratePayload.__name__]) - @console_ns.response(200, "Instruction generated successfully") + @console_ns.response(200, "Instruction generated successfully", console_ns.models[GeneratorResponse.__name__]) @console_ns.response(400, "Invalid request parameters or flow/workflow not found") @console_ns.response(402, "Provider quota exceeded") @setup_required @@ -275,7 +293,7 @@ class InstructionGenerationTemplateApi(Resource): @console_ns.doc("get_instruction_template") @console_ns.doc(description="Get instruction generation template") @console_ns.expect(console_ns.models[InstructionTemplatePayload.__name__]) - @console_ns.response(200, "Template retrieved successfully") + @console_ns.response(200, "Template retrieved successfully", console_ns.models[SimpleDataResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @setup_required @login_required @@ -307,7 +325,7 @@ class WorkflowGenerateApi(Resource): @console_ns.doc("generate_workflow_graph") @console_ns.doc(description="Generate a Dify workflow graph from natural language") @console_ns.expect(console_ns.models[WorkflowGeneratePayload.__name__]) - @console_ns.response(200, "Workflow graph generated successfully") + @console_ns.response(200, "Workflow graph generated successfully", console_ns.models[GeneratorResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(402, "Provider quota exceeded") @setup_required diff --git a/api/controllers/console/app/mcp_server.py b/api/controllers/console/app/mcp_server.py index 157bec4fbc..8d1eb70073 100644 --- a/api/controllers/console/app/mcp_server.py +++ b/api/controllers/console/app/mcp_server.py @@ -27,13 +27,19 @@ from models.model import App, AppMCPServer class MCPServerCreatePayload(BaseModel): description: str | None = Field(default=None, description="Server description") - parameters: dict[str, Any] = Field(..., description="Server parameters configuration") + parameters: dict[str, Any] = Field( + ..., + description="Server parameters configuration", + ) class MCPServerUpdatePayload(BaseModel): id: str = Field(..., description="Server ID") description: str | None = Field(default=None, description="Server description") - parameters: dict[str, Any] = Field(..., description="Server parameters configuration") + parameters: dict[str, Any] = Field( + ..., + description="Server parameters configuration", + ) status: str | None = Field(default=None, description="Server status") diff --git a/api/controllers/console/app/message.py b/api/controllers/console/app/message.py index e698f7e234..cbab951bf6 100644 --- a/api/controllers/console/app/message.py +++ b/api/controllers/console/app/message.py @@ -10,7 +10,7 @@ from sqlalchemy import exists, func, select from werkzeug.exceptions import InternalServerError, NotFound from controllers.common.controller_schemas import MessageFeedbackPayload as _MessageFeedbackPayloadBase -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import SimpleResultResponse, TextFileResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( @@ -166,7 +166,7 @@ register_schema_models( MessageDetailResponse, MessageInfiniteScrollPaginationResponse, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models(console_ns, SimpleResultResponse, TextFileResponse) @console_ns.route("/apps//chat-messages") @@ -373,7 +373,11 @@ class MessageFeedbackExportApi(Resource): @console_ns.doc(description="Export user feedback data for Google Sheets") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(FeedbackExportQuery)) - @console_ns.response(200, "Feedback data exported successfully") + @console_ns.response( + 200, + "Feedback data exported successfully", + console_ns.models[TextFileResponse.__name__], + ) @console_ns.response(400, "Invalid parameters") @console_ns.response(500, "Internal server error") @get_app_model diff --git a/api/controllers/console/app/model_config.py b/api/controllers/console/app/model_config.py index 8951a71510..6e2e20c0a3 100644 --- a/api/controllers/console/app/model_config.py +++ b/api/controllers/console/app/model_config.py @@ -5,7 +5,8 @@ from flask import request from flask_restx import Resource from pydantic import BaseModel, Field -from controllers.common.schema import register_schema_models +from controllers.common.fields import SimpleResultResponse +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.wraps import get_app_model from controllers.console.wraps import ( @@ -29,19 +30,44 @@ from services.app_model_config_service import AppModelConfigService class ModelConfigRequest(BaseModel): provider: str | None = Field(default=None, description="Model provider") model: str | None = Field(default=None, description="Model name") - configs: dict[str, Any] | None = Field(default=None, description="Model configuration parameters") + configs: dict[str, Any] | None = Field( + default=None, + description="Model configuration parameters", + ) opening_statement: str | None = Field(default=None, description="Opening statement") suggested_questions: list[str] | None = Field(default=None, description="Suggested questions") - more_like_this: dict[str, Any] | None = Field(default=None, description="More like this configuration") - speech_to_text: dict[str, Any] | None = Field(default=None, description="Speech to text configuration") - text_to_speech: dict[str, Any] | None = Field(default=None, description="Text to speech configuration") - retrieval_model: dict[str, Any] | None = Field(default=None, description="Retrieval model configuration") - tools: list[dict[str, Any]] | None = Field(default=None, description="Available tools") - dataset_configs: dict[str, Any] | None = Field(default=None, description="Dataset configurations") - agent_mode: dict[str, Any] | None = Field(default=None, description="Agent mode configuration") + more_like_this: dict[str, Any] | None = Field( + default=None, + description="More like this configuration", + ) + speech_to_text: dict[str, Any] | None = Field( + default=None, + description="Speech to text configuration", + ) + text_to_speech: dict[str, Any] | None = Field( + default=None, + description="Text to speech configuration", + ) + retrieval_model: dict[str, Any] | None = Field( + default=None, + description="Retrieval model configuration", + ) + tools: list[dict[str, Any]] | None = Field( + default=None, + description="Available tools", + ) + dataset_configs: dict[str, Any] | None = Field( + default=None, + description="Dataset configurations", + ) + agent_mode: dict[str, Any] | None = Field( + default=None, + description="Agent mode configuration", + ) register_schema_models(console_ns, ModelConfigRequest) +register_response_schema_models(console_ns, SimpleResultResponse) @console_ns.route("/apps//model-config") @@ -50,7 +76,11 @@ class ModelConfigResource(Resource): @console_ns.doc(description="Update application model configuration") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[ModelConfigRequest.__name__]) - @console_ns.response(200, "Model configuration updated successfully") + @console_ns.response( + 200, + "Model configuration updated successfully", + console_ns.models[SimpleResultResponse.__name__], + ) @console_ns.response(400, "Invalid configuration") @console_ns.response(404, "App not found") @setup_required diff --git a/api/controllers/console/app/ops_trace.py b/api/controllers/console/app/ops_trace.py index 2e20c3876a..c9f9308c2e 100644 --- a/api/controllers/console/app/ops_trace.py +++ b/api/controllers/console/app/ops_trace.py @@ -1,15 +1,16 @@ from typing import Any from flask import request -from flask_restx import Resource, fields +from flask_restx import Resource from pydantic import BaseModel, Field from werkzeug.exceptions import BadRequest -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import TracingConfigCheckError, TracingConfigIsExist, TracingConfigNotExist from controllers.console.app.wraps import get_app_model from controllers.console.wraps import account_initialization_required, setup_required +from fields.base import ResponseModel from libs.login import login_required from models import App from services.ops_service import OpsService @@ -21,10 +22,27 @@ class TraceProviderQuery(BaseModel): class TraceConfigPayload(BaseModel): tracing_provider: str = Field(..., description="Tracing provider name") - tracing_config: dict[str, Any] = Field(..., description="Tracing configuration data") + tracing_config: dict[str, Any] = Field( + ..., + description="Tracing configuration data", + ) + + +class TraceAppConfigResponse(ResponseModel): + result: str | None = None + error: str | None = None + has_not_configured: bool | None = None + id: str | None = None + app_id: str | None = None + tracing_provider: str | None = None + tracing_config: dict[str, Any] | None = Field(default=None) + is_active: bool | None = None + created_at: str | None = None + updated_at: str | None = None register_schema_models(console_ns, TraceProviderQuery, TraceConfigPayload) +register_response_schema_models(console_ns, TraceAppConfigResponse) @console_ns.route("/apps//trace-config") @@ -38,7 +56,9 @@ class TraceAppConfigApi(Resource): @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(TraceProviderQuery)) @console_ns.response( - 200, "Tracing configuration retrieved successfully", fields.Raw(description="Tracing configuration data") + 200, + "Tracing configuration retrieved successfully", + console_ns.models[TraceAppConfigResponse.__name__], ) @console_ns.response(400, "Invalid request parameters") @setup_required @@ -63,7 +83,9 @@ class TraceAppConfigApi(Resource): @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[TraceConfigPayload.__name__]) @console_ns.response( - 201, "Tracing configuration created successfully", fields.Raw(description="Created configuration data") + 201, + "Tracing configuration created successfully", + console_ns.models[TraceAppConfigResponse.__name__], ) @console_ns.response(400, "Invalid request parameters or configuration already exists") @setup_required @@ -90,7 +112,11 @@ class TraceAppConfigApi(Resource): @console_ns.doc(description="Update an existing tracing configuration for an application") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[TraceConfigPayload.__name__]) - @console_ns.response(200, "Tracing configuration updated successfully", fields.Raw(description="Success response")) + @console_ns.response( + 200, + "Tracing configuration updated successfully", + console_ns.models[TraceAppConfigResponse.__name__], + ) @console_ns.response(400, "Invalid request parameters or configuration not found") @setup_required @login_required @@ -113,7 +139,7 @@ class TraceAppConfigApi(Resource): @console_ns.doc("delete_trace_app_config") @console_ns.doc(description="Delete an existing tracing configuration for an application") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.expect(console_ns.models[TraceProviderQuery.__name__]) + @console_ns.doc(params=query_params_from_model(TraceProviderQuery)) @console_ns.response(204, "Tracing configuration deleted successfully") @console_ns.response(400, "Invalid request parameters or configuration not found") @setup_required diff --git a/api/controllers/console/app/statistic.py b/api/controllers/console/app/statistic.py index 61d871e885..bc0120fe4f 100644 --- a/api/controllers/console/app/statistic.py +++ b/api/controllers/console/app/statistic.py @@ -2,15 +2,16 @@ from decimal import Decimal import sqlalchemy as sa from flask import abort, jsonify, request -from flask_restx import Resource, fields +from flask_restx import Resource from pydantic import BaseModel, Field, field_validator -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.wraps import get_app_model from controllers.console.wraps import account_initialization_required, setup_required, with_current_user from core.app.entities.app_invoke_entities import InvokeFrom from extensions.ext_database import db +from fields.base import ResponseModel from libs.datetime_utils import parse_time_range from libs.helper import convert_datetime_to_date from libs.login import login_required @@ -31,7 +32,92 @@ class StatisticTimeRangeQuery(BaseModel): return value +class DailyMessageStatisticItem(ResponseModel): + date: str + message_count: int + + +class DailyMessageStatisticResponse(ResponseModel): + data: list[DailyMessageStatisticItem] + + +class DailyConversationStatisticItem(ResponseModel): + date: str + conversation_count: int + + +class DailyConversationStatisticResponse(ResponseModel): + data: list[DailyConversationStatisticItem] + + +class DailyTerminalStatisticItem(ResponseModel): + date: str + terminal_count: int + + +class DailyTerminalStatisticResponse(ResponseModel): + data: list[DailyTerminalStatisticItem] + + +class DailyTokenCostStatisticItem(ResponseModel): + date: str + token_count: int + total_price: str | float + currency: str + + +class DailyTokenCostStatisticResponse(ResponseModel): + data: list[DailyTokenCostStatisticItem] + + +class AverageSessionInteractionStatisticItem(ResponseModel): + date: str + interactions: float + + +class AverageSessionInteractionStatisticResponse(ResponseModel): + data: list[AverageSessionInteractionStatisticItem] + + +class UserSatisfactionRateStatisticItem(ResponseModel): + date: str + rate: float + + +class UserSatisfactionRateStatisticResponse(ResponseModel): + data: list[UserSatisfactionRateStatisticItem] + + +class AverageResponseTimeStatisticItem(ResponseModel): + date: str + latency: float + + +class AverageResponseTimeStatisticResponse(ResponseModel): + data: list[AverageResponseTimeStatisticItem] + + +class TokensPerSecondStatisticItem(ResponseModel): + date: str + tps: float + + +class TokensPerSecondStatisticResponse(ResponseModel): + data: list[TokensPerSecondStatisticItem] + + register_schema_models(console_ns, StatisticTimeRangeQuery) +register_response_schema_models( + console_ns, + DailyMessageStatisticResponse, + DailyConversationStatisticResponse, + DailyTerminalStatisticResponse, + DailyTokenCostStatisticResponse, + AverageSessionInteractionStatisticResponse, + UserSatisfactionRateStatisticResponse, + AverageResponseTimeStatisticResponse, + TokensPerSecondStatisticResponse, +) @console_ns.route("/apps//statistics/daily-messages") @@ -43,7 +129,7 @@ class DailyMessageStatistic(Resource): @console_ns.response( 200, "Daily message statistics retrieved successfully", - fields.List(fields.Raw(description="Daily message count data")), + console_ns.models[DailyMessageStatisticResponse.__name__], ) @get_app_model @setup_required @@ -103,7 +189,7 @@ class DailyConversationStatistic(Resource): @console_ns.response( 200, "Daily conversation statistics retrieved successfully", - fields.List(fields.Raw(description="Daily conversation count data")), + console_ns.models[DailyConversationStatisticResponse.__name__], ) @get_app_model @setup_required @@ -162,7 +248,7 @@ class DailyTerminalsStatistic(Resource): @console_ns.response( 200, "Daily terminal statistics retrieved successfully", - fields.List(fields.Raw(description="Daily terminal count data")), + console_ns.models[DailyTerminalStatisticResponse.__name__], ) @get_app_model @setup_required @@ -222,7 +308,7 @@ class DailyTokenCostStatistic(Resource): @console_ns.response( 200, "Daily token cost statistics retrieved successfully", - fields.List(fields.Raw(description="Daily token cost data")), + console_ns.models[DailyTokenCostStatisticResponse.__name__], ) @get_app_model @setup_required @@ -285,7 +371,7 @@ class AverageSessionInteractionStatistic(Resource): @console_ns.response( 200, "Average session interaction statistics retrieved successfully", - fields.List(fields.Raw(description="Average session interaction data")), + console_ns.models[AverageSessionInteractionStatisticResponse.__name__], ) @setup_required @login_required @@ -364,7 +450,7 @@ class UserSatisfactionRateStatistic(Resource): @console_ns.response( 200, "User satisfaction rate statistics retrieved successfully", - fields.List(fields.Raw(description="User satisfaction rate data")), + console_ns.models[UserSatisfactionRateStatisticResponse.__name__], ) @get_app_model @setup_required @@ -433,7 +519,7 @@ class AverageResponseTimeStatistic(Resource): @console_ns.response( 200, "Average response time statistics retrieved successfully", - fields.List(fields.Raw(description="Average response time data")), + console_ns.models[AverageResponseTimeStatisticResponse.__name__], ) @setup_required @login_required @@ -493,7 +579,7 @@ class TokensPerSecondStatistic(Resource): @console_ns.response( 200, "Tokens per second statistics retrieved successfully", - fields.List(fields.Raw(description="Tokens per second data")), + console_ns.models[TokensPerSecondStatisticResponse.__name__], ) @get_app_model @setup_required diff --git a/api/controllers/console/app/workflow.py b/api/controllers/console/app/workflow.py index 22eeac955c..8600f6cbf5 100644 --- a/api/controllers/console/app/workflow.py +++ b/api/controllers/console/app/workflow.py @@ -6,14 +6,14 @@ from typing import Any, NotRequired, TypedDict from flask import abort, request from flask_restx import Resource, fields -from pydantic import AliasChoices, BaseModel, Field, ValidationError, field_validator +from pydantic import AliasChoices, BaseModel, Field, RootModel, 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.errors import InvalidArgumentError -from controllers.common.fields import NewAppResponse, SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, NewAppResponse, SimpleResultResponse from controllers.common.schema import ( query_params_from_model, register_response_schema_model, @@ -99,16 +99,20 @@ class SyncDraftWorkflowPayload(BaseModel): graph: dict[str, Any] features: dict[str, Any] hash: str | None = None - environment_variables: list[dict[str, Any]] = Field(default_factory=list) - conversation_variables: list[dict[str, Any]] = Field(default_factory=list) + environment_variables: list[dict[str, Any]] = Field( + default_factory=list, + ) + conversation_variables: list[dict[str, Any]] = Field( + default_factory=list, + ) class BaseWorkflowRunPayload(BaseModel): - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) class AdvancedChatWorkflowRunPayload(BaseWorkflowRunPayload): - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) query: str = "" conversation_id: str | None = None parent_message_id: str | None = None @@ -122,11 +126,11 @@ class AdvancedChatWorkflowRunPayload(BaseWorkflowRunPayload): class IterationNodeRunPayload(BaseModel): - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) class LoopNodeRunPayload(BaseModel): - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) class DraftWorkflowRunPayload(BaseWorkflowRunPayload): @@ -151,7 +155,10 @@ class ConvertToWorkflowPayload(BaseModel): class WorkflowFeaturesPayload(BaseModel): - features: dict[str, Any] = Field(..., description="Workflow feature configuration") + features: dict[str, Any] = Field( + ..., + description="Workflow feature configuration", + ) class WorkflowOnlineUsersPayload(BaseModel): @@ -167,7 +174,7 @@ class WorkflowConversationVariableResponse(ResponseModel): id: str name: str value_type: str - value: Any = Field(json_schema_extra={"type": "object"}) + value: Any description: str @field_validator("value_type", mode="before") @@ -186,7 +193,7 @@ class PipelineVariableResponse(ResponseModel): max_length: int | None = None required: bool unit: str | None = None - default_value: Any = Field(default=None, json_schema_extra={"type": "object"}) + default_value: Any = Field(default=None) options: list[str] | None = None placeholder: str | None = None tooltips: str | None = None @@ -203,14 +210,18 @@ class WorkflowEnvironmentVariableResponse(ResponseModel): value_type: str id: str name: str - value: Any = Field(json_schema_extra={"type": "object"}) + value: Any 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")) + 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 @@ -267,6 +278,46 @@ class WorkflowOnlineUsersResponse(ResponseModel): data: list[WorkflowOnlineUsersByApp] +class WorkflowPublishResponse(ResponseModel): + result: str + created_at: int + + +class WorkflowRestoreResponse(ResponseModel): + result: str + hash: str + updated_at: int + + +class DefaultBlockConfigsResponse(RootModel[list[dict[str, Any]]]): + root: list[dict[str, Any]] + + +class DefaultBlockConfigResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class HumanInputFormPreviewResponse(ResponseModel): + form_id: str + node_id: str + node_title: str + form_content: str + inputs: list[dict[str, Any]] = Field(default_factory=list) + actions: list[dict[str, Any]] = Field(default_factory=list) + display_in_ui: bool | None = None + form_token: str | None = None + resolved_default_values: dict[str, Any] = Field(default_factory=dict) + expiration_time: int | None = None + + +class HumanInputFormSubmitResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class EmptyObjectResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + class DraftWorkflowTriggerRunPayload(BaseModel): node_id: str @@ -304,6 +355,14 @@ register_response_schema_models( WorkflowOnlineUser, WorkflowOnlineUsersByApp, WorkflowOnlineUsersResponse, + WorkflowPublishResponse, + WorkflowRestoreResponse, + DefaultBlockConfigsResponse, + DefaultBlockConfigResponse, + HumanInputFormPreviewResponse, + HumanInputFormSubmitResponse, + EmptyObjectResponse, + GeneratedAppResponse, NewAppResponse, SimpleResultResponse, ) @@ -475,7 +534,7 @@ class AdvancedChatDraftWorkflowRunApi(Resource): @console_ns.doc(description="Run draft workflow for advanced chat application") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[AdvancedChatWorkflowRunPayload.__name__]) - @console_ns.response(200, "Workflow run started successfully") + @console_ns.response(200, "Workflow run started successfully", console_ns.models[GeneratedAppResponse.__name__]) @console_ns.response(400, "Invalid request parameters") @console_ns.response(403, "Permission denied") @setup_required @@ -520,7 +579,11 @@ class AdvancedChatDraftRunIterationNodeApi(Resource): @console_ns.doc(description="Run draft workflow iteration node for advanced chat") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[IterationNodeRunPayload.__name__]) - @console_ns.response(200, "Iteration node run started successfully") + @console_ns.response( + 200, + "Iteration node run started successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @console_ns.response(404, "Node not found") @setup_required @@ -558,7 +621,11 @@ class WorkflowDraftRunIterationNodeApi(Resource): @console_ns.doc(description="Run draft workflow iteration node") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[IterationNodeRunPayload.__name__]) - @console_ns.response(200, "Workflow iteration node run started successfully") + @console_ns.response( + 200, + "Workflow iteration node run started successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @console_ns.response(404, "Node not found") @setup_required @@ -596,7 +663,7 @@ class AdvancedChatDraftRunLoopNodeApi(Resource): @console_ns.doc(description="Run draft workflow loop node for advanced chat") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[LoopNodeRunPayload.__name__]) - @console_ns.response(200, "Loop node run started successfully") + @console_ns.response(200, "Loop node run started successfully", console_ns.models[GeneratedAppResponse.__name__]) @console_ns.response(403, "Permission denied") @console_ns.response(404, "Node not found") @setup_required @@ -634,7 +701,11 @@ class WorkflowDraftRunLoopNodeApi(Resource): @console_ns.doc(description="Run draft workflow loop node") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[LoopNodeRunPayload.__name__]) - @console_ns.response(200, "Workflow loop node run started successfully") + @console_ns.response( + 200, + "Workflow loop node run started successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @console_ns.response(404, "Node not found") @setup_required @@ -674,7 +745,10 @@ class HumanInputFormPreviewPayload(BaseModel): class HumanInputFormSubmitPayload(BaseModel): - form_inputs: dict[str, Any] = Field(..., description="Values the user provides for the form's own fields") + form_inputs: dict[str, Any] = Field( + ..., + description="Values the user provides for the form's own fields", + ) inputs: dict[str, Any] = Field( ..., description="Values used to fill missing upstream variables referenced in form_content", @@ -704,6 +778,7 @@ class AdvancedChatDraftHumanInputFormPreviewApi(Resource): @console_ns.doc(description="Get human input form preview for advanced chat workflow") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[HumanInputFormPreviewPayload.__name__]) + @console_ns.response(200, "Human input form preview", console_ns.models[HumanInputFormPreviewResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -733,6 +808,11 @@ class AdvancedChatDraftHumanInputFormRunApi(Resource): @console_ns.doc(description="Submit human input form preview for advanced chat workflow") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[HumanInputFormSubmitPayload.__name__]) + @console_ns.response( + 200, + "Human input form submission result", + console_ns.models[HumanInputFormSubmitResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -762,6 +842,7 @@ class WorkflowDraftHumanInputFormPreviewApi(Resource): @console_ns.doc(description="Get human input form preview for workflow") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[HumanInputFormPreviewPayload.__name__]) + @console_ns.response(200, "Human input form preview", console_ns.models[HumanInputFormPreviewResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -791,6 +872,11 @@ class WorkflowDraftHumanInputFormRunApi(Resource): @console_ns.doc(description="Submit human input form preview for workflow") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[HumanInputFormSubmitPayload.__name__]) + @console_ns.response( + 200, + "Human input form submission result", + console_ns.models[HumanInputFormSubmitResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -820,6 +906,7 @@ class WorkflowDraftHumanInputDeliveryTestApi(Resource): @console_ns.doc(description="Test human input delivery for workflow") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models[HumanInputDeliveryTestPayload.__name__]) + @console_ns.response(200, "Human input delivery test result", console_ns.models[EmptyObjectResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -848,7 +935,11 @@ class DraftWorkflowRunApi(Resource): @console_ns.doc(description="Run draft workflow") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[DraftWorkflowRunPayload.__name__]) - @console_ns.response(200, "Draft workflow run started successfully") + @console_ns.response( + 200, + "Draft workflow run started successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @setup_required @login_required @@ -990,6 +1081,7 @@ class PublishedWorkflowApi(Resource): return dump_response(WorkflowResponse, workflow) @console_ns.expect(console_ns.models[PublishWorkflowPayload.__name__]) + @console_ns.response(200, "Workflow published successfully", console_ns.models[WorkflowPublishResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1033,7 +1125,11 @@ class DefaultBlockConfigsApi(Resource): @console_ns.doc("get_default_block_configs") @console_ns.doc(description="Get default block configurations for workflow") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Default block configurations retrieved successfully") + @console_ns.response( + 200, + "Default block configurations retrieved successfully", + console_ns.models[DefaultBlockConfigsResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -1053,7 +1149,11 @@ class DefaultBlockConfigApi(Resource): @console_ns.doc("get_default_block_config") @console_ns.doc(description="Get default block configuration by type") @console_ns.doc(params={"app_id": "Application ID", "block_type": "Block type"}) - @console_ns.response(200, "Default block configuration retrieved successfully") + @console_ns.response( + 200, + "Default block configuration retrieved successfully", + console_ns.models[DefaultBlockConfigResponse.__name__], + ) @console_ns.response(404, "Block type not found") @console_ns.doc(params=query_params_from_model(DefaultBlockConfigQuery)) @setup_required @@ -1205,7 +1305,7 @@ class DraftWorkflowRestoreApi(Resource): @console_ns.doc("restore_workflow_to_draft") @console_ns.doc(description="Restore a published workflow version into the draft workflow") @console_ns.doc(params={"app_id": "Application ID", "workflow_id": "Published workflow ID"}) - @console_ns.response(200, "Workflow restored successfully") + @console_ns.response(200, "Workflow restored successfully", console_ns.models[WorkflowRestoreResponse.__name__]) @console_ns.response(400, "Source workflow must be published") @console_ns.response(404, "Workflow not found") @setup_required @@ -1290,6 +1390,7 @@ class WorkflowByIdApi(Resource): @account_initialization_required @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW]) @edit_permission_required + @console_ns.response(204, "Workflow deleted successfully") def delete(self, app_model: App, workflow_id: str): """ Delete workflow @@ -1361,7 +1462,11 @@ class DraftWorkflowTriggerRunApi(Resource): }, ) ) - @console_ns.response(200, "Trigger event received and workflow executed successfully") + @console_ns.response( + 200, + "Trigger event received and workflow executed successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @console_ns.response(500, "Internal server error") @setup_required @@ -1425,7 +1530,11 @@ class DraftWorkflowTriggerNodeApi(Resource): @console_ns.doc("poll_draft_workflow_trigger_node") @console_ns.doc(description="Poll for trigger events and execute single node when event arrives") @console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"}) - @console_ns.response(200, "Trigger event received and node executed successfully") + @console_ns.response( + 200, + "Trigger event received and node executed successfully", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(403, "Permission denied") @console_ns.response(500, "Internal server error") @setup_required @@ -1505,7 +1614,7 @@ class DraftWorkflowTriggerRunAllApi(Resource): @console_ns.doc(description="Full workflow debug when the start node is a trigger") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.expect(console_ns.models[DraftWorkflowTriggerRunAllPayload.__name__]) - @console_ns.response(200, "Workflow executed successfully") + @console_ns.response(200, "Workflow executed successfully", console_ns.models[GeneratedAppResponse.__name__]) @console_ns.response(403, "Permission denied") @console_ns.response(500, "Internal server error") @setup_required diff --git a/api/controllers/console/app/workflow_draft_variable.py b/api/controllers/console/app/workflow_draft_variable.py index c23a0d63a6..11411115c1 100644 --- a/api/controllers/console/app/workflow_draft_variable.py +++ b/api/controllers/console/app/workflow_draft_variable.py @@ -1,7 +1,7 @@ import logging from collections.abc import Callable from functools import wraps -from typing import Any, Concatenate, TypedDict +from typing import Any, Concatenate, TypedDict, override from uuid import UUID from flask import Response, request @@ -10,7 +10,8 @@ from pydantic import BaseModel, Field from sqlalchemy.orm import sessionmaker from controllers.common.errors import InvalidArgumentError, NotFoundError -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.fields import SimpleResultResponse +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( DraftWorkflowNotExist, @@ -28,6 +29,7 @@ from extensions.ext_database import db from factories import variable_factory from factories.file_factory import build_from_mapping, build_from_mappings from factories.variable_factory import build_segment_with_type +from fields.base import ResponseModel from graphon.file import helpers as file_helpers from graphon.variables.segment_group import SegmentGroup from graphon.variables.segments import ArrayFileSegment, FileSegment, Segment @@ -42,6 +44,28 @@ logger = logging.getLogger(__name__) _file_access_controller = DatabaseFileAccessController() +class OpaqueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "object"} + + +class JsonValueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return { + "anyOf": [ + {"type": "string"}, + {"type": "integer"}, + {"type": "number"}, + {"type": "boolean"}, + {"type": "object", "additionalProperties": True}, + {"type": "array", "items": {}}, + {"type": "null"}, + ] + } + + class WorkflowDraftVariableListQuery(BaseModel): page: int = Field(default=1, ge=1, le=100_000, description="Page number") limit: int = Field(default=20, ge=1, le=100, description="Items per page") @@ -54,12 +78,33 @@ class WorkflowDraftVariableUpdatePayload(BaseModel): class ConversationVariableUpdatePayload(BaseModel): conversation_variables: list[dict[str, Any]] = Field( - ..., description="Conversation variables for the draft workflow" + ..., + description="Conversation variables for the draft workflow", ) class EnvironmentVariableUpdatePayload(BaseModel): - environment_variables: list[dict[str, Any]] = Field(..., description="Environment variables for the draft workflow") + environment_variables: list[dict[str, Any]] = Field( + ..., + description="Environment variables for the draft workflow", + ) + + +class EnvironmentVariableItemResponse(ResponseModel): + id: str + type: str + name: str + description: str | None = None + selector: list[str] + value_type: str + value: Any + edited: bool + visible: bool + editable: bool + + +class EnvironmentVariableListResponse(ResponseModel): + items: list[EnvironmentVariableItemResponse] register_schema_models( @@ -69,6 +114,7 @@ register_schema_models( ConversationVariableUpdatePayload, EnvironmentVariableUpdatePayload, ) +register_response_schema_models(console_ns, SimpleResultResponse, EnvironmentVariableListResponse) def _convert_values_to_json_serializable_object(value: Segment): @@ -155,8 +201,8 @@ _WORKFLOW_DRAFT_VARIABLE_WITHOUT_VALUE_FIELDS = { _WORKFLOW_DRAFT_VARIABLE_FIELDS = { **_WORKFLOW_DRAFT_VARIABLE_WITHOUT_VALUE_FIELDS, - "value": fields.Raw(attribute=_serialize_var_value), - "full_content": fields.Raw(attribute=_serialize_full_content), + "value": JsonValueRawField(attribute=_serialize_var_value), + "full_content": OpaqueRawField(attribute=_serialize_full_content), } _WORKFLOW_DRAFT_ENV_VARIABLE_FIELDS = { @@ -181,7 +227,7 @@ def _get_items(var_list: WorkflowDraftVariableList) -> list[WorkflowDraftVariabl _WORKFLOW_DRAFT_VARIABLE_LIST_WITHOUT_VALUE_FIELDS = { "items": fields.List(fields.Nested(_WORKFLOW_DRAFT_VARIABLE_WITHOUT_VALUE_FIELDS), attribute=_get_items), - "total": fields.Raw(), + "total": fields.Integer, } _WORKFLOW_DRAFT_VARIABLE_LIST_FIELDS = { @@ -544,7 +590,11 @@ class ConversationVariableCollectionApi(Resource): @console_ns.doc("update_conversation_variables") @console_ns.doc(description="Update conversation variables for workflow draft") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Conversation variables updated successfully") + @console_ns.response( + 200, + "Conversation variables updated successfully", + console_ns.models[SimpleResultResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -587,7 +637,11 @@ class EnvironmentVariableCollectionApi(Resource): @console_ns.doc("get_environment_variables") @console_ns.doc(description="Get environment variables for workflow") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Environment variables retrieved successfully") + @console_ns.response( + 200, + "Environment variables retrieved successfully", + console_ns.models[EnvironmentVariableListResponse.__name__], + ) @console_ns.response(404, "Draft workflow not found") @_api_prerequisite def get(self, _current_user: Account, app_model: App): @@ -625,7 +679,11 @@ class EnvironmentVariableCollectionApi(Resource): @console_ns.doc("update_environment_variables") @console_ns.doc(description="Update environment variables for workflow draft") @console_ns.doc(params={"app_id": "Application ID"}) - @console_ns.response(200, "Environment variables updated successfully") + @console_ns.response( + 200, + "Environment variables updated successfully", + console_ns.models[SimpleResultResponse.__name__], + ) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/app/workflow_node_output_inspector.py b/api/controllers/console/app/workflow_node_output_inspector.py index ed4dbe9b3e..98f86ad7cb 100644 --- a/api/controllers/console/app/workflow_node_output_inspector.py +++ b/api/controllers/console/app/workflow_node_output_inspector.py @@ -30,6 +30,7 @@ from uuid import UUID from flask import Response from flask_restx import Resource +from controllers.common.fields import EventStreamResponse from controllers.common.schema import register_response_schema_models from controllers.console import console_ns from controllers.console.app.wraps import get_app_model @@ -62,6 +63,7 @@ _STREAM_HARD_TIMEOUT_TICKS = 1800 # 30 min register_response_schema_models( console_ns, + EventStreamResponse, CheckResultView, NodeOutputView, NodeOutputsView, @@ -327,7 +329,11 @@ class WorkflowDraftRunNodeOutputEventsApi(Resource): @console_ns.doc("stream_workflow_draft_run_node_output_events") @console_ns.doc(description="Server-Sent Events stream of inspector deltas for a draft workflow run.") @console_ns.doc(params={"app_id": "Application ID", "run_id": "Workflow run ID"}) - @console_ns.response(200, "Workflow run node output event stream") + @console_ns.response( + 200, + "Workflow run node output event stream", + console_ns.models[EventStreamResponse.__name__], + ) @console_ns.response(404, "Workflow run not found") @setup_required @login_required @@ -424,7 +430,11 @@ class WorkflowPublishedRunNodeOutputEventsApi(Resource): @console_ns.doc("stream_workflow_published_run_node_output_events") @console_ns.doc(description="Server-Sent Events stream of inspector deltas for a published workflow run.") @console_ns.doc(params={"app_id": "Application ID", "run_id": "Workflow run ID"}) - @console_ns.response(200, "Workflow run node output event stream") + @console_ns.response( + 200, + "Workflow run node output event stream", + console_ns.models[EventStreamResponse.__name__], + ) @console_ns.response(404, "Workflow run not found") @setup_required @login_required diff --git a/api/controllers/console/app/workflow_statistic.py b/api/controllers/console/app/workflow_statistic.py index 8b3c996729..ec2a5ffce1 100644 --- a/api/controllers/console/app/workflow_statistic.py +++ b/api/controllers/console/app/workflow_statistic.py @@ -3,11 +3,12 @@ from flask_restx import Resource from pydantic import BaseModel, Field, field_validator from sqlalchemy.orm import sessionmaker -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.wraps import get_app_model from controllers.console.wraps import account_initialization_required, setup_required, with_current_user from extensions.ext_database import db +from fields.base import ResponseModel from libs.datetime_utils import parse_time_range from libs.login import login_required from models.account import Account @@ -28,7 +29,50 @@ class WorkflowStatisticQuery(BaseModel): return value +class WorkflowDailyRunsStatisticItem(ResponseModel): + date: str + runs: int + + +class WorkflowDailyRunsStatisticResponse(ResponseModel): + data: list[WorkflowDailyRunsStatisticItem] + + +class WorkflowDailyTerminalsStatisticItem(ResponseModel): + date: str + terminal_count: int + + +class WorkflowDailyTerminalsStatisticResponse(ResponseModel): + data: list[WorkflowDailyTerminalsStatisticItem] + + +class WorkflowDailyTokenCostStatisticItem(ResponseModel): + date: str + token_count: int + + +class WorkflowDailyTokenCostStatisticResponse(ResponseModel): + data: list[WorkflowDailyTokenCostStatisticItem] + + +class WorkflowAverageAppInteractionStatisticItem(ResponseModel): + date: str + interactions: float + + +class WorkflowAverageAppInteractionStatisticResponse(ResponseModel): + data: list[WorkflowAverageAppInteractionStatisticItem] + + register_schema_models(console_ns, WorkflowStatisticQuery) +register_response_schema_models( + console_ns, + WorkflowDailyRunsStatisticResponse, + WorkflowDailyTerminalsStatisticResponse, + WorkflowDailyTokenCostStatisticResponse, + WorkflowAverageAppInteractionStatisticResponse, +) @console_ns.route("/apps//workflow/statistics/daily-conversations") @@ -42,7 +86,11 @@ class WorkflowDailyRunsStatistic(Resource): @console_ns.doc(description="Get workflow daily runs statistics") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(WorkflowStatisticQuery)) - @console_ns.response(200, "Daily runs statistics retrieved successfully") + @console_ns.response( + 200, + "Daily runs statistics retrieved successfully", + console_ns.models[WorkflowDailyRunsStatisticResponse.__name__], + ) @get_app_model @setup_required @login_required @@ -81,7 +129,11 @@ class WorkflowDailyTerminalsStatistic(Resource): @console_ns.doc(description="Get workflow daily terminals statistics") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(WorkflowStatisticQuery)) - @console_ns.response(200, "Daily terminals statistics retrieved successfully") + @console_ns.response( + 200, + "Daily terminals statistics retrieved successfully", + console_ns.models[WorkflowDailyTerminalsStatisticResponse.__name__], + ) @get_app_model @setup_required @login_required @@ -120,7 +172,11 @@ class WorkflowDailyTokenCostStatistic(Resource): @console_ns.doc(description="Get workflow daily token cost statistics") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(WorkflowStatisticQuery)) - @console_ns.response(200, "Daily token cost statistics retrieved successfully") + @console_ns.response( + 200, + "Daily token cost statistics retrieved successfully", + console_ns.models[WorkflowDailyTokenCostStatisticResponse.__name__], + ) @get_app_model @setup_required @login_required @@ -159,7 +215,11 @@ class WorkflowAverageAppInteractionStatistic(Resource): @console_ns.doc(description="Get workflow average app interaction statistics") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.doc(params=query_params_from_model(WorkflowStatisticQuery)) - @console_ns.response(200, "Average app interaction statistics retrieved successfully") + @console_ns.response( + 200, + "Average app interaction statistics retrieved successfully", + console_ns.models[WorkflowAverageAppInteractionStatisticResponse.__name__], + ) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/auth/data_source_bearer_auth.py b/api/controllers/console/auth/data_source_bearer_auth.py index 33f6fb14ae..f06db79949 100644 --- a/api/controllers/console/auth/data_source_bearer_auth.py +++ b/api/controllers/console/auth/data_source_bearer_auth.py @@ -3,6 +3,7 @@ from uuid import UUID from flask_restx import Resource from pydantic import BaseModel, Field +from controllers.common.fields import SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from fields.base import ResponseModel from libs.login import login_required @@ -33,7 +34,12 @@ class ApiKeyAuthDataSourceListResponse(ResponseModel): register_schema_models(console_ns, ApiKeyAuthBindingPayload) -register_response_schema_models(console_ns, ApiKeyAuthDataSourceItem, ApiKeyAuthDataSourceListResponse) +register_response_schema_models( + console_ns, + SimpleResultResponse, + ApiKeyAuthDataSourceItem, + ApiKeyAuthDataSourceListResponse, +) @console_ns.route("/api-key-auth/data-source") @@ -64,6 +70,7 @@ class ApiKeyAuthDataSource(Resource): @console_ns.route("/api-key-auth/data-source/binding") class ApiKeyAuthDataSourceBinding(Resource): + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/auth/data_source_oauth.py b/api/controllers/console/auth/data_source_oauth.py index 997dac9210..f1493b5e6f 100644 --- a/api/controllers/console/auth/data_source_oauth.py +++ b/api/controllers/console/auth/data_source_oauth.py @@ -7,7 +7,8 @@ from flask_restx import Resource from pydantic import BaseModel, Field from configs import dify_config -from controllers.common.schema import register_schema_models +from controllers.common.fields import RedirectResponse +from controllers.common.schema import query_params_from_model, register_response_schema_model, register_schema_models from libs.login import login_required from libs.oauth_data_source import NotionOAuth @@ -29,12 +30,24 @@ class OAuthDataSourceSyncResponse(BaseModel): result: str = Field(description="Operation result") +class OAuthDataSourceCallbackQuery(BaseModel): + code: str | None = Field(default=None, description="Authorization code from OAuth provider") + error: str | None = Field(default=None, description="Error message from OAuth provider") + + +class OAuthDataSourceBindingQuery(BaseModel): + code: str = Field(description="Authorization code from OAuth provider") + + register_schema_models( console_ns, OAuthDataSourceResponse, OAuthDataSourceBindingResponse, OAuthDataSourceSyncResponse, + OAuthDataSourceCallbackQuery, + OAuthDataSourceBindingQuery, ) +register_response_schema_model(console_ns, RedirectResponse) def get_oauth_providers(): @@ -84,14 +97,9 @@ class OAuthDataSource(Resource): class OAuthDataSourceCallback(Resource): @console_ns.doc("oauth_data_source_callback") @console_ns.doc(description="Handle OAuth callback from data source provider") - @console_ns.doc( - params={ - "provider": "Data source provider name (notion)", - "code": "Authorization code from OAuth provider", - "error": "Error message from OAuth provider", - } - ) - @console_ns.response(302, "Redirect to console with result") + @console_ns.doc(params={"provider": "Data source provider name (notion)"}) + @console_ns.doc(params=query_params_from_model(OAuthDataSourceCallbackQuery)) + @console_ns.response(302, "Redirect to console with result", console_ns.models[RedirectResponse.__name__]) @console_ns.response(400, "Invalid provider") def get(self, provider: str): OAUTH_DATASOURCE_PROVIDERS = get_oauth_providers() @@ -115,9 +123,8 @@ class OAuthDataSourceCallback(Resource): class OAuthDataSourceBinding(Resource): @console_ns.doc("oauth_data_source_binding") @console_ns.doc(description="Bind OAuth data source with authorization code") - @console_ns.doc( - params={"provider": "Data source provider name (notion)", "code": "Authorization code from OAuth provider"} - ) + @console_ns.doc(params={"provider": "Data source provider name (notion)"}) + @console_ns.doc(params=query_params_from_model(OAuthDataSourceBindingQuery)) @console_ns.response( 200, "Data source binding success", diff --git a/api/controllers/console/auth/email_register.py b/api/controllers/console/auth/email_register.py index c22b14159c..912eb26574 100644 --- a/api/controllers/console/auth/email_register.py +++ b/api/controllers/console/auth/email_register.py @@ -15,6 +15,7 @@ from controllers.console.auth.error import ( InvalidTokenError, PasswordMismatchError, ) +from fields.base import ResponseModel from libs.helper import EmailStr, extract_remote_ip from libs.helper import timezone as validate_timezone_string from libs.password import valid_password @@ -58,8 +59,24 @@ class EmailRegisterResetPayload(BaseModel): return validate_timezone_string(value) +class EmailRegisterTokenPairResponse(ResponseModel): + access_token: str + refresh_token: str + csrf_token: str + + +class EmailRegisterResetResponse(ResponseModel): + result: str + data: EmailRegisterTokenPairResponse + + register_schema_models(console_ns, EmailRegisterSendPayload, EmailRegisterValidityPayload, EmailRegisterResetPayload) -register_response_schema_models(console_ns, SimpleResultDataResponse, VerificationTokenResponse) +register_response_schema_models( + console_ns, + SimpleResultDataResponse, + VerificationTokenResponse, + EmailRegisterResetResponse, +) @console_ns.route("/email-register/send-email") @@ -67,6 +84,7 @@ class EmailRegisterSendEmailApi(Resource): @setup_required @email_password_login_enabled @email_register_enabled + @console_ns.expect(console_ns.models[EmailRegisterSendPayload.__name__]) @console_ns.response(200, "Success", console_ns.models[SimpleResultDataResponse.__name__]) def post(self): args = EmailRegisterSendPayload.model_validate(console_ns.payload) @@ -92,6 +110,7 @@ class EmailRegisterCheckApi(Resource): @setup_required @email_password_login_enabled @email_register_enabled + @console_ns.expect(console_ns.models[EmailRegisterValidityPayload.__name__]) @console_ns.response(200, "Success", console_ns.models[VerificationTokenResponse.__name__]) def post(self): args = EmailRegisterValidityPayload.model_validate(console_ns.payload) @@ -133,6 +152,8 @@ class EmailRegisterResetApi(Resource): @setup_required @email_password_login_enabled @email_register_enabled + @console_ns.expect(console_ns.models[EmailRegisterResetPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[EmailRegisterResetResponse.__name__]) def post(self): args = EmailRegisterResetPayload.model_validate(console_ns.payload) diff --git a/api/controllers/console/auth/oauth.py b/api/controllers/console/auth/oauth.py index 2254fa4981..31649812fe 100644 --- a/api/controllers/console/auth/oauth.py +++ b/api/controllers/console/auth/oauth.py @@ -4,10 +4,13 @@ import urllib.parse import httpx from flask import current_app, redirect, request from flask_restx import Resource +from pydantic import BaseModel, Field from werkzeug.exceptions import Unauthorized from configs import dify_config from constants.languages import languages +from controllers.common.fields import RedirectResponse +from controllers.common.schema import query_params_from_model, register_response_schema_model, register_schema_models from events.tenant_event import tenant_was_created from extensions.ext_database import db from libs.datetime_utils import naive_utc_now @@ -31,6 +34,21 @@ from .. import console_ns logger = logging.getLogger(__name__) +class OAuthLoginQuery(BaseModel): + invite_token: str | None = Field(default=None, description="Optional invitation token") + timezone: str | None = Field(default=None, description="Preferred timezone") + language: str | None = Field(default=None, description="Preferred interface language") + + +class OAuthCallbackQuery(BaseModel): + code: str = Field(description="Authorization code from OAuth provider") + state: str | None = Field(default=None, description="OAuth state parameter") + + +register_schema_models(console_ns, OAuthLoginQuery, OAuthCallbackQuery) +register_response_schema_model(console_ns, RedirectResponse) + + def get_oauth_providers(): with current_app.app_context(): if not dify_config.GITHUB_CLIENT_ID or not dify_config.GITHUB_CLIENT_SECRET: @@ -83,10 +101,9 @@ def _preferred_interface_language(language: str | None = None) -> str: class OAuthLogin(Resource): @console_ns.doc("oauth_login") @console_ns.doc(description="Initiate OAuth login process") - @console_ns.doc( - params={"provider": "OAuth provider name (github/google)", "invite_token": "Optional invitation token"} - ) - @console_ns.response(302, "Redirect to OAuth authorization URL") + @console_ns.doc(params={"provider": "OAuth provider name (github/google)"}) + @console_ns.doc(params=query_params_from_model(OAuthLoginQuery)) + @console_ns.response(302, "Redirect to OAuth authorization URL", console_ns.models[RedirectResponse.__name__]) @console_ns.response(400, "Invalid provider") def get(self, provider: str): invite_token = request.args.get("invite_token") or None @@ -110,14 +127,9 @@ class OAuthLogin(Resource): class OAuthCallback(Resource): @console_ns.doc("oauth_callback") @console_ns.doc(description="Handle OAuth callback and complete login process") - @console_ns.doc( - params={ - "provider": "OAuth provider name (github/google)", - "code": "Authorization code from OAuth provider", - "state": "Optional state parameter (used for invite token)", - } - ) - @console_ns.response(302, "Redirect to console with access token") + @console_ns.doc(params={"provider": "OAuth provider name (github/google)"}) + @console_ns.doc(params=query_params_from_model(OAuthCallbackQuery)) + @console_ns.response(302, "Redirect to console with access token", console_ns.models[RedirectResponse.__name__]) @console_ns.response(400, "OAuth process failed") def get(self, provider: str): OAUTH_PROVIDERS = get_oauth_providers() diff --git a/api/controllers/console/auth/oauth_server.py b/api/controllers/console/auth/oauth_server.py index 7e48558977..46e2983c12 100644 --- a/api/controllers/console/auth/oauth_server.py +++ b/api/controllers/console/auth/oauth_server.py @@ -1,6 +1,6 @@ from collections.abc import Callable from functools import wraps -from typing import Concatenate +from typing import Any, Concatenate from flask import jsonify, request from flask.typing import ResponseReturnValue @@ -8,6 +8,7 @@ from flask_restx import Resource from pydantic import BaseModel from werkzeug.exceptions import BadRequest, NotFound +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console.wraps import account_initialization_required, setup_required, with_current_user from graphon.model_runtime.utils.encoders import jsonable_encoder from libs.login import login_required @@ -36,6 +37,41 @@ class OAuthTokenRequest(BaseModel): refresh_token: str | None = None +class OAuthProviderAppResponse(BaseModel): + app_icon: str + app_label: dict[str, Any] + scope: str + + +class OAuthProviderAuthorizeResponse(BaseModel): + code: str + + +class OAuthProviderTokenResponse(BaseModel): + access_token: str + token_type: str + expires_in: int + refresh_token: str + + +class OAuthProviderAccountResponse(BaseModel): + name: str + email: str + avatar: str | None = None + interface_language: str + timezone: str + + +register_schema_models(console_ns, OAuthClientPayload, OAuthProviderRequest, OAuthTokenRequest) +register_response_schema_models( + console_ns, + OAuthProviderAccountResponse, + OAuthProviderAppResponse, + OAuthProviderAuthorizeResponse, + OAuthProviderTokenResponse, +) + + def oauth_server_client_id_required[T, **P, R]( view: Callable[Concatenate[T, OAuthProviderApp, P], R], ) -> Callable[Concatenate[T, P], R]: @@ -110,6 +146,8 @@ def oauth_server_access_token_required[T, **P, R]( @console_ns.route("/oauth/provider") class OAuthServerAppApi(Resource): @setup_required + @console_ns.expect(console_ns.models[OAuthProviderRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[OAuthProviderAppResponse.__name__]) @oauth_server_client_id_required def post(self, oauth_provider_app: OAuthProviderApp): payload = OAuthProviderRequest.model_validate(request.get_json()) @@ -134,6 +172,8 @@ class OAuthServerUserAuthorizeApi(Resource): @login_required @account_initialization_required @with_current_user + @console_ns.expect(console_ns.models[OAuthClientPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[OAuthProviderAuthorizeResponse.__name__]) @oauth_server_client_id_required def post(self, oauth_provider_app: OAuthProviderApp, current_user: Account): user_account_id = current_user.id @@ -148,6 +188,8 @@ class OAuthServerUserAuthorizeApi(Resource): @console_ns.route("/oauth/provider/token") class OAuthServerUserTokenApi(Resource): @setup_required + @console_ns.expect(console_ns.models[OAuthTokenRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[OAuthProviderTokenResponse.__name__]) @oauth_server_client_id_required def post(self, oauth_provider_app: OAuthProviderApp): payload = OAuthTokenRequest.model_validate(request.get_json()) @@ -198,6 +240,8 @@ class OAuthServerUserTokenApi(Resource): @console_ns.route("/oauth/provider/account") class OAuthServerUserAccountApi(Resource): @setup_required + @console_ns.expect(console_ns.models[OAuthClientPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[OAuthProviderAccountResponse.__name__]) @oauth_server_client_id_required @oauth_server_access_token_required def post(self, oauth_provider_app: OAuthProviderApp, account: Account): diff --git a/api/controllers/console/billing/billing.py b/api/controllers/console/billing/billing.py index fdd4c27652..1c2d129e6c 100644 --- a/api/controllers/console/billing/billing.py +++ b/api/controllers/console/billing/billing.py @@ -1,12 +1,12 @@ import base64 -from typing import Literal +from typing import Any, Literal from flask import request from flask_restx import Resource -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel from werkzeug.exceptions import BadRequest -from controllers.common.schema import register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -30,11 +30,18 @@ class PartnerTenantsPayload(BaseModel): click_id: str = Field(..., description="Click Id from partner referral link") +class BillingResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models(console_ns, SubscriptionQuery, PartnerTenantsPayload) +register_response_schema_models(console_ns, BillingResponse) @console_ns.route("/billing/subscription") class Subscription(Resource): + @console_ns.doc(params=query_params_from_model(SubscriptionQuery)) + @console_ns.response(200, "Success", console_ns.models[BillingResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -49,6 +56,7 @@ class Subscription(Resource): @console_ns.route("/billing/invoices") class Invoices(Resource): + @console_ns.response(200, "Success", console_ns.models[BillingResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -66,7 +74,7 @@ class PartnerTenants(Resource): @console_ns.doc(description="Sync partner tenants bindings") @console_ns.doc(params={"partner_key": "Partner key"}) @console_ns.expect(console_ns.models[PartnerTenantsPayload.__name__]) - @console_ns.response(200, "Tenants synced to partner successfully") + @console_ns.response(200, "Tenants synced to partner successfully", console_ns.models[BillingResponse.__name__]) @console_ns.response(400, "Invalid partner information") @setup_required @login_required diff --git a/api/controllers/console/billing/compliance.py b/api/controllers/console/billing/compliance.py index 8bc474964a..ea5852586a 100644 --- a/api/controllers/console/billing/compliance.py +++ b/api/controllers/console/billing/compliance.py @@ -1,8 +1,10 @@ +from typing import Any + from flask import request from flask_restx import Resource -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel -from controllers.common.schema import query_params_from_model +from controllers.common.schema import query_params_from_model, register_response_schema_models from libs.helper import extract_remote_ip from libs.login import login_required from models import Account @@ -23,10 +25,15 @@ class ComplianceDownloadQuery(BaseModel): doc_name: str = Field(..., description="Compliance document name") +class ComplianceDownloadResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + console_ns.schema_model( ComplianceDownloadQuery.__name__, ComplianceDownloadQuery.model_json_schema(ref_template=DEFAULT_REF_TEMPLATE_OPENAPI_3_0), ) +register_response_schema_models(console_ns, ComplianceDownloadResponse) @console_ns.route("/compliance/download") @@ -34,6 +41,7 @@ class ComplianceApi(Resource): @console_ns.doc(params=query_params_from_model(ComplianceDownloadQuery)) @console_ns.doc("download_compliance_document") @console_ns.doc(description="Get compliance document download link") + @console_ns.response(200, "Success", console_ns.models[ComplianceDownloadResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/datasets/datasets.py b/api/controllers/console/datasets/datasets.py index 4ee8ae176a..ca2ef5d6e2 100644 --- a/api/controllers/console/datasets/datasets.py +++ b/api/controllers/console/datasets/datasets.py @@ -95,13 +95,13 @@ class DatasetUpdatePayload(BaseModel): indexing_technique: str | None = None embedding_model: str | None = None embedding_model_provider: str | None = None - retrieval_model: dict[str, Any] | None = None - summary_index_setting: dict[str, Any] | None = None + retrieval_model: dict[str, Any] | None = Field(default=None) + summary_index_setting: dict[str, Any] | None = Field(default=None) partial_member_list: list[dict[str, str]] | None = None - external_retrieval_model: dict[str, Any] | None = None + external_retrieval_model: dict[str, Any] | None = Field(default=None) external_knowledge_id: str | None = None external_knowledge_api_id: str | None = None - icon_info: dict[str, Any] | None = None + icon_info: dict[str, Any] | None = Field(default=None) is_multimodal: bool | None = False @field_validator("indexing_technique") diff --git a/api/controllers/console/datasets/datasets_document.py b/api/controllers/console/datasets/datasets_document.py index 401aa2454e..d4d50600a0 100644 --- a/api/controllers/console/datasets/datasets_document.py +++ b/api/controllers/console/datasets/datasets_document.py @@ -10,13 +10,13 @@ from uuid import UUID import sqlalchemy as sa from flask import request, send_file from flask_restx import Resource -from pydantic import BaseModel, Field, field_validator +from pydantic import BaseModel, Field, RootModel, field_validator from sqlalchemy import asc, desc, func, select from werkzeug.exceptions import Forbidden, NotFound import services from controllers.common.controller_schemas import DocumentBatchDownloadZipPayload -from controllers.common.fields import SimpleResultMessageResponse, SimpleResultResponse, UrlResponse +from controllers.common.fields import BinaryFileResponse, SimpleResultMessageResponse, SimpleResultResponse, UrlResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from core.errors.error import ( @@ -145,6 +145,10 @@ class DocumentWithSegmentsListResponse(ResponseModel): page: int +class OpaqueObjectResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models( console_ns, KnowledgeConfig, @@ -158,6 +162,7 @@ register_schema_models( ) register_response_schema_models( console_ns, + BinaryFileResponse, SimpleResultMessageResponse, SimpleResultResponse, UrlResponse, @@ -167,6 +172,7 @@ register_response_schema_models( DocumentWithSegmentsResponse, DatasetAndDocumentResponse, DocumentWithSegmentsListResponse, + OpaqueObjectResponse, ) @@ -216,7 +222,7 @@ class GetProcessRuleApi(Resource): @console_ns.doc("get_process_rule") @console_ns.doc(description="Get dataset document processing rules") @console_ns.doc(params={"document_id": "Document ID (optional)"}) - @console_ns.response(200, "Process rules retrieved successfully") + @console_ns.response(200, "Process rules retrieved successfully", console_ns.models[OpaqueObjectResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -537,7 +543,11 @@ class DocumentIndexingEstimateApi(DocumentResource): @console_ns.doc("estimate_document_indexing") @console_ns.doc(description="Estimate document indexing cost") @console_ns.doc(params={"dataset_id": "Dataset ID", "document_id": "Document ID"}) - @console_ns.response(200, "Indexing estimate calculated successfully") + @console_ns.response( + 200, + "Indexing estimate calculated successfully", + console_ns.models[OpaqueObjectResponse.__name__], + ) @console_ns.response(404, "Document not found") @console_ns.response(400, "Document already finished") @setup_required @@ -606,6 +616,11 @@ class DocumentIndexingEstimateApi(DocumentResource): @console_ns.route("/datasets//batch//indexing-estimate") class DocumentBatchIndexingEstimateApi(DocumentResource): + @console_ns.response( + 200, + "Batch indexing estimate calculated successfully", + console_ns.models[OpaqueObjectResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -824,7 +839,7 @@ class DocumentApi(DocumentResource): "metadata": "Metadata inclusion (all/only/without)", } ) - @console_ns.response(200, "Document retrieved successfully") + @console_ns.response(200, "Document retrieved successfully", console_ns.models[OpaqueObjectResponse.__name__]) @console_ns.response(404, "Document not found") @setup_required @login_required @@ -966,6 +981,7 @@ class DocumentBatchDownloadZipApi(DocumentResource): @console_ns.doc("download_dataset_documents_as_zip") @console_ns.doc(description="Download selected dataset documents as a single ZIP archive (upload-file only)") + @console_ns.response(200, "ZIP archive generated successfully", console_ns.models[BinaryFileResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1324,6 +1340,11 @@ class WebsiteDocumentSyncApi(DocumentResource): @console_ns.route("/datasets//documents//pipeline-execution-log") class DocumentPipelineExecutionLogApi(DocumentResource): + @console_ns.response( + 200, + "Document pipeline execution log retrieved successfully", + console_ns.models[OpaqueObjectResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -1464,7 +1485,7 @@ class DocumentSummaryStatusApi(DocumentResource): @console_ns.doc("get_document_summary_status") @console_ns.doc(description="Get summary index generation status for a document") @console_ns.doc(params={"dataset_id": "Dataset ID", "document_id": "Document ID"}) - @console_ns.response(200, "Summary status retrieved successfully") + @console_ns.response(200, "Summary status retrieved successfully", console_ns.models[OpaqueObjectResponse.__name__]) @console_ns.response(404, "Document not found") @setup_required @login_required diff --git a/api/controllers/console/datasets/external.py b/api/controllers/console/datasets/external.py index 2bd9f12b29..fb19ad81c6 100644 --- a/api/controllers/console/datasets/external.py +++ b/api/controllers/console/datasets/external.py @@ -1,13 +1,19 @@ +from typing import Any from uuid import UUID from flask import request from flask_restx import Resource, fields, marshal -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel from werkzeug.exceptions import Forbidden, InternalServerError, NotFound import services from controllers.common.fields import UsageCountResponse -from controllers.common.schema import get_or_create_model, register_response_schema_models, register_schema_models +from controllers.common.schema import ( + get_or_create_model, + query_params_from_model, + register_response_schema_models, + register_schema_models, +) from controllers.console import console_ns from controllers.console.datasets.error import DatasetNameDuplicateError from controllers.console.wraps import ( @@ -17,6 +23,7 @@ from controllers.console.wraps import ( with_current_tenant_id, with_current_user, ) +from fields.base import ResponseModel from fields.dataset_fields import ( dataset_detail_fields, dataset_retrieval_model_fields, @@ -88,13 +95,15 @@ class ExternalDatasetCreatePayload(BaseModel): external_knowledge_id: str name: str = Field(..., min_length=1, max_length=100) description: str | None = Field(None, max_length=400) - external_retrieval_model: dict[str, object] | None = None + external_retrieval_model: dict[str, object] | None = Field(default=None) class ExternalHitTestingPayload(BaseModel): query: str - external_retrieval_model: dict[str, object] | None = None - metadata_filtering_conditions: dict[str, object] | None = None + external_retrieval_model: dict[str, object] | None = Field(default=None) + metadata_filtering_conditions: dict[str, object] | None = Field( + default=None, + ) class BedrockRetrievalPayload(BaseModel): @@ -109,6 +118,34 @@ class ExternalApiTemplateListQuery(BaseModel): keyword: str | None = Field(default=None, description="Search keyword") +class ExternalKnowledgeDatasetBindingResponse(ResponseModel): + id: str + name: str + + +class ExternalKnowledgeApiResponse(ResponseModel): + id: str + tenant_id: str + name: str + description: str + settings: dict[str, Any] | None = Field(default=None) + dataset_bindings: list[ExternalKnowledgeDatasetBindingResponse] = Field(default_factory=list) + created_by: str + created_at: str + + +class ExternalKnowledgeApiListResponse(ResponseModel): + data: list[ExternalKnowledgeApiResponse] + has_more: bool + limit: int + total: int + page: int + + +class ExternalRetrievalTestResponse(RootModel[dict[str, Any] | list[dict[str, Any]]]): + root: dict[str, Any] | list[dict[str, Any]] + + register_schema_models( console_ns, ExternalKnowledgeApiPayload, @@ -117,20 +154,24 @@ register_schema_models( BedrockRetrievalPayload, ExternalApiTemplateListQuery, ) +register_response_schema_models( + console_ns, + ExternalKnowledgeApiResponse, + ExternalKnowledgeApiListResponse, + ExternalRetrievalTestResponse, +) @console_ns.route("/datasets/external-knowledge-api") class ExternalApiTemplateListApi(Resource): @console_ns.doc("get_external_api_templates") @console_ns.doc(description="Get external knowledge API templates") - @console_ns.doc( - params={ - "page": "Page number (default: 1)", - "limit": "Number of items per page (default: 20)", - "keyword": "Search keyword", - } + @console_ns.doc(params=query_params_from_model(ExternalApiTemplateListQuery)) + @console_ns.response( + 200, + "External API templates retrieved successfully", + console_ns.models[ExternalKnowledgeApiListResponse.__name__], ) - @console_ns.response(200, "External API templates retrieved successfully") @setup_required @login_required @with_current_tenant_id @@ -154,6 +195,11 @@ class ExternalApiTemplateListApi(Resource): @login_required @account_initialization_required @console_ns.expect(console_ns.models[ExternalKnowledgeApiPayload.__name__]) + @console_ns.response( + 201, + "External API template created successfully", + console_ns.models[ExternalKnowledgeApiResponse.__name__], + ) @with_current_user @with_current_tenant_id def post(self, current_tenant_id: str, current_user: Account): @@ -180,7 +226,11 @@ class ExternalApiTemplateApi(Resource): @console_ns.doc("get_external_api_template") @console_ns.doc(description="Get external knowledge API template details") @console_ns.doc(params={"external_knowledge_api_id": "External knowledge API ID"}) - @console_ns.response(200, "External API template retrieved successfully") + @console_ns.response( + 200, + "External API template retrieved successfully", + console_ns.models[ExternalKnowledgeApiResponse.__name__], + ) @console_ns.response(404, "Template not found") @setup_required @login_required @@ -196,6 +246,11 @@ class ExternalApiTemplateApi(Resource): return external_knowledge_api.to_dict(), 200 + @console_ns.response( + 200, + "External API template updated successfully", + console_ns.models[ExternalKnowledgeApiResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -293,7 +348,11 @@ class ExternalKnowledgeHitTestingApi(Resource): @console_ns.doc(description="Test external knowledge retrieval for dataset") @console_ns.doc(params={"dataset_id": "Dataset ID"}) @console_ns.expect(console_ns.models[ExternalHitTestingPayload.__name__]) - @console_ns.response(200, "External hit testing completed successfully") + @console_ns.response( + 200, + "External hit testing completed successfully", + console_ns.models[ExternalRetrievalTestResponse.__name__], + ) @console_ns.response(404, "Dataset not found") @console_ns.response(400, "Invalid parameters") @setup_required @@ -334,7 +393,11 @@ class BedrockRetrievalApi(Resource): @console_ns.doc("bedrock_retrieval_test") @console_ns.doc(description="Bedrock retrieval test (internal use only)") @console_ns.expect(console_ns.models[BedrockRetrievalPayload.__name__]) - @console_ns.response(200, "Bedrock retrieval test completed") + @console_ns.response( + 200, + "Bedrock retrieval test completed", + console_ns.models[ExternalRetrievalTestResponse.__name__], + ) def post(self): payload = BedrockRetrievalPayload.model_validate(console_ns.payload or {}) diff --git a/api/controllers/console/datasets/hit_testing_base.py b/api/controllers/console/datasets/hit_testing_base.py index 6141d2d1d5..e3efe80487 100644 --- a/api/controllers/console/datasets/hit_testing_base.py +++ b/api/controllers/console/datasets/hit_testing_base.py @@ -32,7 +32,7 @@ logger = logging.getLogger(__name__) class HitTestingPayload(BaseModel): query: str = Field(max_length=250) retrieval_model: RetrievalModel | None = None - external_retrieval_model: dict[str, Any] | None = None + external_retrieval_model: dict[str, Any] | None = Field(default=None) attachment_ids: list[str] | None = None diff --git a/api/controllers/console/datasets/rag_pipeline/datasource_auth.py b/api/controllers/console/datasets/rag_pipeline/datasource_auth.py index c7cae85d37..980f116e21 100644 --- a/api/controllers/console/datasets/rag_pipeline/datasource_auth.py +++ b/api/controllers/console/datasets/rag_pipeline/datasource_auth.py @@ -6,8 +6,8 @@ from pydantic import BaseModel, Field from werkzeug.exceptions import Forbidden, NotFound from configs import dify_config -from controllers.common.fields import SimpleResultResponse -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.fields import RedirectResponse, SimpleResultResponse +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -16,7 +16,9 @@ from controllers.console.wraps import ( with_current_tenant_id, with_current_user, ) +from core.plugin.entities.plugin_daemon import PluginOAuthAuthorizationUrlResponse from core.plugin.impl.oauth import OAuthHandler +from fields.base import ResponseModel from graphon.model_runtime.errors.validate import CredentialsValidateFailedError from graphon.model_runtime.utils.encoders import jsonable_encoder from libs.login import login_required @@ -38,11 +40,11 @@ class DatasourceCredentialDeletePayload(BaseModel): class DatasourceCredentialUpdatePayload(BaseModel): credential_id: str name: str | None = Field(default=None, max_length=100) - credentials: dict[str, Any] | None = None + credentials: dict[str, Any] | None = Field(default=None) class DatasourceCustomClientPayload(BaseModel): - client_params: dict[str, Any] | None = None + client_params: dict[str, Any] | None = Field(default=None) enable_oauth_custom_client: bool | None = None @@ -55,8 +57,25 @@ class DatasourceUpdateNamePayload(BaseModel): name: str = Field(max_length=100) +class DatasourceOAuthAuthorizationQuery(BaseModel): + credential_id: str | None = Field(default=None, description="Credential ID to reauthorize") + + +class DatasourceOAuthCallbackQuery(BaseModel): + code: str | None = Field(default=None, description="Authorization code from OAuth provider") + state: str | None = Field(default=None, description="OAuth state parameter") + error: str | None = Field(default=None, description="Error message from OAuth provider") + context_id: str | None = Field(default=None, description="OAuth proxy context ID") + + +class DatasourceCredentialsResponse(ResponseModel): + result: Any + + register_schema_models( console_ns, + DatasourceOAuthAuthorizationQuery, + DatasourceOAuthCallbackQuery, DatasourceCredentialPayload, DatasourceCredentialDeletePayload, DatasourceCredentialUpdatePayload, @@ -64,11 +83,23 @@ register_schema_models( DatasourceDefaultPayload, DatasourceUpdateNamePayload, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models( + console_ns, + DatasourceCredentialsResponse, + PluginOAuthAuthorizationUrlResponse, + RedirectResponse, + SimpleResultResponse, +) @console_ns.route("/oauth/plugin//datasource/get-authorization-url") class DatasourcePluginOAuthAuthorizationUrl(Resource): + @console_ns.doc(params=query_params_from_model(DatasourceOAuthAuthorizationQuery)) + @console_ns.response( + 200, + "Authorization URL retrieved successfully", + console_ns.models[PluginOAuthAuthorizationUrlResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -118,6 +149,12 @@ class DatasourcePluginOAuthAuthorizationUrl(Resource): @console_ns.route("/oauth/plugin//datasource/callback") class DatasourceOAuthCallback(Resource): + @console_ns.doc(params=query_params_from_model(DatasourceOAuthCallbackQuery)) + @console_ns.response( + 302, + "Redirect to console OAuth callback page", + console_ns.models[RedirectResponse.__name__], + ) @setup_required def get(self, provider_id: str): context_id = request.cookies.get("context_id") or request.args.get("context_id") @@ -176,6 +213,7 @@ class DatasourceOAuthCallback(Resource): @console_ns.route("/auth/plugin/datasource/") class DatasourceAuth(Resource): @console_ns.expect(console_ns.models[DatasourceCredentialPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -200,6 +238,7 @@ class DatasourceAuth(Resource): @setup_required @login_required @account_initialization_required + @console_ns.response(200, "Success", console_ns.models[DatasourceCredentialsResponse.__name__]) @with_current_user @with_current_tenant_id def get(self, current_tenant_id: str, user: Account, provider_id: str): @@ -243,6 +282,7 @@ class DatasourceAuthDeleteApi(Resource): @console_ns.route("/auth/plugin/datasource//update") class DatasourceAuthUpdateApi(Resource): @console_ns.expect(console_ns.models[DatasourceCredentialUpdatePayload.__name__]) + @console_ns.response(201, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -266,6 +306,7 @@ class DatasourceAuthUpdateApi(Resource): @console_ns.route("/auth/plugin/datasource/list") class DatasourceAuthListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[DatasourceCredentialsResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -278,6 +319,7 @@ class DatasourceAuthListApi(Resource): @console_ns.route("/auth/plugin/datasource/default-list") class DatasourceHardCodeAuthListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[DatasourceCredentialsResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -291,6 +333,7 @@ class DatasourceHardCodeAuthListApi(Resource): @console_ns.route("/auth/plugin/datasource//custom-client") class DatasourceAuthOauthCustomClient(Resource): @console_ns.expect(console_ns.models[DatasourceCustomClientPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py b/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py index a872eb8861..b0af108444 100644 --- a/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py +++ b/api/controllers/console/datasets/rag_pipeline/datasource_content_preview.py @@ -1,9 +1,11 @@ +from typing import Any + from flask_restx import ( # type: ignore Resource, # type: ignore ) -from pydantic import BaseModel +from pydantic import BaseModel, RootModel -from controllers.common.schema import register_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.datasets.wraps import get_rag_pipeline from controllers.console.wraps import account_initialization_required, setup_required, with_current_user @@ -14,17 +16,23 @@ from services.rag_pipeline.rag_pipeline import RagPipelineService class Parser(BaseModel): - inputs: dict + inputs: dict[str, Any] datasource_type: str credential_id: str | None = None +class DataSourceContentPreviewResponse(RootModel[Any]): + root: Any + + register_schema_models(console_ns, Parser) +register_response_schema_models(console_ns, DataSourceContentPreviewResponse) @console_ns.route("/rag/pipelines//workflows/published/datasource/nodes//preview") class DataSourceContentPreviewApi(Resource): @console_ns.expect(console_ns.models[Parser.__name__]) + @console_ns.response(200, "Success", console_ns.models[DataSourceContentPreviewResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py index ca41573cb8..3187124f12 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline.py @@ -74,7 +74,9 @@ class PipelineTemplateDetailResponse(ResponseModel): class CustomizedPipelineTemplatePayload(BaseModel): name: str = Field(..., min_length=1, max_length=40) description: str = Field(default="", max_length=400) - icon_info: dict[str, object] = Field(default_factory=lambda: IconInfo(icon="").model_dump()) + icon_info: dict[str, object] = Field( + default_factory=lambda: IconInfo(icon="").model_dump(), + ) register_schema_models( diff --git a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py index cd326dffe9..af417f24df 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_draft_variable.py @@ -11,13 +11,14 @@ from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import Forbidden from controllers.common.errors import InvalidArgumentError, NotFoundError -from controllers.common.schema import register_schema_models +from controllers.common.schema import query_params_from_model, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( DraftWorkflowNotExist, ) from controllers.console.app.workflow_draft_variable import ( _WORKFLOW_DRAFT_VARIABLE_FIELDS, # type: ignore[private-usage] + EnvironmentVariableListResponse, workflow_draft_variable_list_model, workflow_draft_variable_list_without_value_model, workflow_draft_variable_model, @@ -40,14 +41,9 @@ logger = logging.getLogger(__name__) _file_access_controller = DatabaseFileAccessController() -def _create_pagination_parser(): - class PaginationQuery(BaseModel): - page: int = Field(default=1, ge=1, le=100_000) - limit: int = Field(default=20, ge=1, le=100) - - register_schema_models(console_ns, PaginationQuery) - - return PaginationQuery +class PaginationQuery(BaseModel): + page: int = Field(default=1, ge=1, le=100_000) + limit: int = Field(default=20, ge=1, le=100) class WorkflowDraftVariablePatchPayload(BaseModel): @@ -55,7 +51,7 @@ class WorkflowDraftVariablePatchPayload(BaseModel): value: Any | None = None -register_schema_models(console_ns, WorkflowDraftVariablePatchPayload) +register_schema_models(console_ns, PaginationQuery, WorkflowDraftVariablePatchPayload) def _api_prerequisite[T, **P, R]( @@ -87,14 +83,19 @@ def _api_prerequisite[T, **P, R]( @console_ns.route("/rag/pipelines//workflows/draft/variables") class RagPipelineVariableCollectionApi(Resource): + @console_ns.doc(params=query_params_from_model(PaginationQuery)) + @console_ns.response( + 200, + "Workflow variables retrieved successfully", + workflow_draft_variable_list_without_value_model, + ) @_api_prerequisite @marshal_with(workflow_draft_variable_list_without_value_model) def get(self, current_user: Account, pipeline: Pipeline): """ Get draft workflow """ - pagination = _create_pagination_parser() - query = pagination.model_validate(request.args.to_dict()) + query = PaginationQuery.model_validate(request.args.to_dict()) # fetch draft workflow by app_model rag_pipeline_service = RagPipelineService() @@ -116,6 +117,7 @@ class RagPipelineVariableCollectionApi(Resource): return workflow_vars + @console_ns.response(204, "Workflow variables deleted successfully") @_api_prerequisite def delete(self, current_user: Account, pipeline: Pipeline): draft_var_srv = WorkflowDraftVariableService( @@ -146,6 +148,7 @@ def validate_node_id(node_id: str) -> NoReturn | None: @console_ns.route("/rag/pipelines//workflows/draft/nodes//variables") class RagPipelineNodeVariableCollectionApi(Resource): + @console_ns.response(200, "Node variables retrieved successfully", workflow_draft_variable_list_model) @_api_prerequisite @marshal_with(workflow_draft_variable_list_model) def get(self, current_user: Account, pipeline: Pipeline, node_id: str): @@ -158,6 +161,7 @@ class RagPipelineNodeVariableCollectionApi(Resource): return node_vars + @console_ns.response(204, "Node variables deleted successfully") @_api_prerequisite def delete(self, current_user: Account, pipeline: Pipeline, node_id: str): validate_node_id(node_id) @@ -172,6 +176,7 @@ class RagPipelineVariableApi(Resource): _PATCH_NAME_FIELD = "name" _PATCH_VALUE_FIELD = "value" + @console_ns.response(200, "Variable retrieved successfully", workflow_draft_variable_model) @_api_prerequisite @marshal_with(workflow_draft_variable_model) def get(self, _current_user: Account, pipeline: Pipeline, variable_id: UUID): @@ -186,6 +191,7 @@ class RagPipelineVariableApi(Resource): raise NotFoundError(description=f"variable not found, id={variable_id_str}") return variable + @console_ns.response(200, "Variable updated successfully", workflow_draft_variable_model) @_api_prerequisite @marshal_with(workflow_draft_variable_model) @console_ns.expect(console_ns.models[WorkflowDraftVariablePatchPayload.__name__]) @@ -257,6 +263,7 @@ class RagPipelineVariableApi(Resource): db.session.commit() return variable + @console_ns.response(204, "Variable deleted successfully") @_api_prerequisite def delete(self, _current_user: Account, pipeline: Pipeline, variable_id: UUID): draft_var_srv = WorkflowDraftVariableService( @@ -275,6 +282,8 @@ class RagPipelineVariableApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/variables//reset") class RagPipelineVariableResetApi(Resource): + @console_ns.response(200, "Variable reset successfully", workflow_draft_variable_model) + @console_ns.response(204, "Variable reset (no content)") @_api_prerequisite def put(self, _current_user: Account, pipeline: Pipeline, variable_id: UUID): draft_var_srv = WorkflowDraftVariableService( @@ -318,6 +327,7 @@ def _get_variable_list(pipeline: Pipeline, node_id: str, current_user_id: str) - @console_ns.route("/rag/pipelines//workflows/draft/system-variables") class RagPipelineSystemVariableCollectionApi(Resource): + @console_ns.response(200, "System variables retrieved successfully", workflow_draft_variable_list_model) @_api_prerequisite @marshal_with(workflow_draft_variable_list_model) def get(self, current_user: Account, pipeline: Pipeline): @@ -326,6 +336,11 @@ class RagPipelineSystemVariableCollectionApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/environment-variables") class RagPipelineEnvironmentVariableCollectionApi(Resource): + @console_ns.response( + 200, + "Environment variables retrieved successfully", + console_ns.models[EnvironmentVariableListResponse.__name__], + ) @_api_prerequisite def get(self, _current_user: Account, pipeline: Pipeline): """ 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 53e0d0c293..e9d26974c1 100644 --- a/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py +++ b/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py @@ -5,14 +5,14 @@ from uuid import UUID from flask import abort, request from flask_restx import Resource -from pydantic import BaseModel, Field, ValidationError +from pydantic import BaseModel, Field, RootModel, ValidationError 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.fields import SimpleResultResponse -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import ( ConversationCompletedError, @@ -21,6 +21,8 @@ from controllers.console.app.error import ( ) from controllers.console.app.workflow import ( RESTORE_SOURCE_WORKFLOW_MUST_BE_PUBLISHED_MESSAGE, + DefaultBlockConfigResponse, + DefaultBlockConfigsResponse, WorkflowPaginationResponse, WorkflowResponse, ) @@ -67,14 +69,14 @@ logger = logging.getLogger(__name__) class DraftWorkflowSyncPayload(BaseModel): graph: dict[str, Any] hash: str | None = None - environment_variables: list[dict[str, Any]] | None = None - conversation_variables: list[dict[str, Any]] | None = None - rag_pipeline_variables: list[dict[str, Any]] | None = None - features: dict[str, Any] | None = None + environment_variables: list[dict[str, Any]] | None = Field(default=None) + conversation_variables: list[dict[str, Any]] | None = Field(default=None) + rag_pipeline_variables: list[dict[str, Any]] | None = Field(default=None) + features: dict[str, Any] | None = Field(default=None) class NodeRunPayload(BaseModel): - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) class NodeRunRequiredPayload(BaseModel): @@ -131,6 +133,14 @@ class RagPipelineWorkflowPublishResponse(ResponseModel): created_at: int +class RagPipelineOpaqueResponse(RootModel[Any]): + root: Any + + +class RagPipelineStepParametersResponse(ResponseModel): + variables: Any + + register_schema_models( console_ns, DraftWorkflowSyncPayload, @@ -149,6 +159,10 @@ register_schema_models( ) register_response_schema_models( console_ns, + DefaultBlockConfigResponse, + DefaultBlockConfigsResponse, + RagPipelineOpaqueResponse, + RagPipelineStepParametersResponse, RagPipelineWorkflowPublishResponse, RagPipelineWorkflowSyncResponse, SimpleResultResponse, @@ -192,6 +206,7 @@ class DraftRagPipelineApi(Resource): @with_current_user @get_rag_pipeline @edit_permission_required + @console_ns.expect(console_ns.models[DraftWorkflowSyncPayload.__name__]) @console_ns.response(200, "Success", console_ns.models[RagPipelineWorkflowSyncResponse.__name__]) def post(self, current_user: Account, pipeline: Pipeline): """ @@ -244,6 +259,7 @@ class DraftRagPipelineApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/iteration/nodes//run") class RagPipelineDraftRunIterationNodeApi(Resource): @console_ns.expect(console_ns.models[NodeRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -277,6 +293,7 @@ class RagPipelineDraftRunIterationNodeApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/loop/nodes//run") class RagPipelineDraftRunLoopNodeApi(Resource): @console_ns.expect(console_ns.models[NodeRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -310,6 +327,7 @@ class RagPipelineDraftRunLoopNodeApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/run") class DraftRagPipelineRunApi(Resource): @console_ns.expect(console_ns.models[DraftWorkflowRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -340,6 +358,7 @@ class DraftRagPipelineRunApi(Resource): @console_ns.route("/rag/pipelines//workflows/published/run") class PublishedRagPipelineRunApi(Resource): @console_ns.expect(console_ns.models[PublishedWorkflowRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -371,6 +390,7 @@ class PublishedRagPipelineRunApi(Resource): @console_ns.route("/rag/pipelines//workflows/published/datasource/nodes//run") class RagPipelinePublishedDatasourceNodeRunApi(Resource): @console_ns.expect(console_ns.models[DatasourceNodeRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -402,6 +422,7 @@ class RagPipelinePublishedDatasourceNodeRunApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/datasource/nodes//run") class RagPipelineDraftDatasourceNodeRunApi(Resource): @console_ns.expect(console_ns.models[DatasourceNodeRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -541,6 +562,11 @@ class PublishedRagPipelineApi(Resource): @console_ns.route("/rag/pipelines//workflows/default-workflow-block-configs") class DefaultRagPipelineBlockConfigsApi(Resource): + @console_ns.response( + 200, + "Default block configs retrieved successfully", + console_ns.models[DefaultBlockConfigsResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -557,6 +583,12 @@ class DefaultRagPipelineBlockConfigsApi(Resource): @console_ns.route("/rag/pipelines//workflows/default-workflow-block-configs/") class DefaultRagPipelineBlockConfigApi(Resource): + @console_ns.doc(params=query_params_from_model(DefaultBlockConfigQuery)) + @console_ns.response( + 200, + "Default block config retrieved successfully", + console_ns.models[DefaultBlockConfigResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -582,6 +614,7 @@ class DefaultRagPipelineBlockConfigApi(Resource): @console_ns.route("/rag/pipelines//workflows") class PublishedAllRagPipelineApi(Resource): + @console_ns.doc(params=query_params_from_model(WorkflowListQuery)) @console_ns.response( 200, "Published workflows retrieved successfully", @@ -673,6 +706,7 @@ class RagPipelineByIdApi(Resource): @edit_permission_required @with_current_user @get_rag_pipeline + @console_ns.expect(console_ns.models[WorkflowUpdatePayload.__name__]) def patch(self, current_user: Account, pipeline: Pipeline, workflow_id: str): """ Update workflow attributes @@ -734,6 +768,8 @@ class RagPipelineByIdApi(Resource): @console_ns.route("/rag/pipelines//workflows/published/processing/parameters") class PublishedRagPipelineSecondStepApi(Resource): + @console_ns.doc(params=query_params_from_model(NodeIdQuery)) + @console_ns.response(200, "Success", console_ns.models[RagPipelineStepParametersResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -754,6 +790,8 @@ class PublishedRagPipelineSecondStepApi(Resource): @console_ns.route("/rag/pipelines//workflows/published/pre-processing/parameters") class PublishedRagPipelineFirstStepApi(Resource): + @console_ns.doc(params=query_params_from_model(NodeIdQuery)) + @console_ns.response(200, "Success", console_ns.models[RagPipelineStepParametersResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -774,6 +812,8 @@ class PublishedRagPipelineFirstStepApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/pre-processing/parameters") class DraftRagPipelineFirstStepApi(Resource): + @console_ns.doc(params=query_params_from_model(NodeIdQuery)) + @console_ns.response(200, "Success", console_ns.models[RagPipelineStepParametersResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -794,6 +834,8 @@ class DraftRagPipelineFirstStepApi(Resource): @console_ns.route("/rag/pipelines//workflows/draft/processing/parameters") class DraftRagPipelineSecondStepApi(Resource): + @console_ns.doc(params=query_params_from_model(NodeIdQuery)) + @console_ns.response(200, "Success", console_ns.models[RagPipelineStepParametersResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -815,6 +857,7 @@ class DraftRagPipelineSecondStepApi(Resource): @console_ns.route("/rag/pipelines//workflow-runs") class RagPipelineWorkflowRunListApi(Resource): + @console_ns.doc(params=query_params_from_model(WorkflowRunQuery)) @console_ns.response( 200, "Workflow runs retrieved successfully", @@ -903,6 +946,7 @@ class RagPipelineWorkflowRunNodeExecutionListApi(Resource): @console_ns.route("/rag/pipelines/datasource-plugins") class DatasourceListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -939,6 +983,7 @@ class RagPipelineWorkflowLastRunApi(Resource): @console_ns.route("/rag/pipelines/transform/datasets/") class RagPipelineTransformApi(Resource): + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -986,6 +1031,8 @@ class RagPipelineDatasourceVariableApi(Resource): @console_ns.route("/rag/pipelines/recommended-plugins") class RagPipelineRecommendedPluginApi(Resource): + @console_ns.doc(params=query_params_from_model(RagPipelineRecommendedPluginQuery)) + @console_ns.response(200, "Success", console_ns.models[RagPipelineOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/datasets/website.py b/api/controllers/console/datasets/website.py index 9b0d5132b1..39be3f3ce5 100644 --- a/api/controllers/console/datasets/website.py +++ b/api/controllers/console/datasets/website.py @@ -1,10 +1,10 @@ -from typing import Literal +from typing import Any, Literal from flask import request from flask_restx import Resource -from pydantic import BaseModel +from pydantic import BaseModel, RootModel -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.datasets.error import WebsiteCrawlError from controllers.console.wraps import account_initialization_required, setup_required @@ -22,7 +22,12 @@ class WebsiteCrawlStatusQuery(BaseModel): provider: Literal["firecrawl", "watercrawl", "jinareader"] +class WebsiteCrawlResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models(console_ns, WebsiteCrawlPayload, WebsiteCrawlStatusQuery) +register_response_schema_models(console_ns, WebsiteCrawlResponse) @console_ns.route("/website/crawl") @@ -30,7 +35,7 @@ class WebsiteCrawlApi(Resource): @console_ns.doc("crawl_website") @console_ns.doc(description="Crawl website content") @console_ns.expect(console_ns.models[WebsiteCrawlPayload.__name__]) - @console_ns.response(200, "Website crawl initiated successfully") + @console_ns.response(200, "Website crawl initiated successfully", console_ns.models[WebsiteCrawlResponse.__name__]) @console_ns.response(400, "Invalid crawl parameters") @setup_required @login_required @@ -58,7 +63,7 @@ class WebsiteCrawlStatusApi(Resource): @console_ns.doc(description="Get website crawl status") @console_ns.doc(params={"job_id": "Crawl job ID", "provider": "Crawl provider (firecrawl/watercrawl/jinareader)"}) @console_ns.doc(params=query_params_from_model(WebsiteCrawlStatusQuery)) - @console_ns.response(200, "Crawl status retrieved successfully") + @console_ns.response(200, "Crawl status retrieved successfully", console_ns.models[WebsiteCrawlResponse.__name__]) @console_ns.response(404, "Crawl job not found") @console_ns.response(400, "Invalid provider") @setup_required diff --git a/api/controllers/console/explore/audio.py b/api/controllers/console/explore/audio.py index 42b611cafd..756dfe84f6 100644 --- a/api/controllers/console/explore/audio.py +++ b/api/controllers/console/explore/audio.py @@ -5,7 +5,8 @@ from werkzeug.exceptions import InternalServerError import services from controllers.common.controller_schemas import TextToAudioPayload -from controllers.common.schema import register_schema_model +from controllers.common.fields import AudioBinaryResponse, AudioTranscriptResponse +from controllers.common.schema import register_response_schema_models, register_schema_model from controllers.console.app.error import ( AppUnavailableError, AudioTooLargeError, @@ -34,6 +35,7 @@ from .. import console_ns logger = logging.getLogger(__name__) register_schema_model(console_ns, TextToAudioPayload) +register_response_schema_models(console_ns, AudioBinaryResponse, AudioTranscriptResponse) @console_ns.route( @@ -41,6 +43,7 @@ register_schema_model(console_ns, TextToAudioPayload) endpoint="installed_app_audio", ) class ChatAudioApi(InstalledAppResource): + @console_ns.response(200, "Success", console_ns.models[AudioTranscriptResponse.__name__]) def post(self, installed_app: InstalledApp): app_model = installed_app.app if app_model is None: @@ -84,6 +87,7 @@ class ChatAudioApi(InstalledAppResource): ) class ChatTextApi(InstalledAppResource): @console_ns.expect(console_ns.models[TextToAudioPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[AudioBinaryResponse.__name__]) def post(self, installed_app: InstalledApp): app_model = installed_app.app if app_model is None: diff --git a/api/controllers/console/explore/banner.py b/api/controllers/console/explore/banner.py index 757061d8dd..a6321bb797 100644 --- a/api/controllers/console/explore/banner.py +++ b/api/controllers/console/explore/banner.py @@ -1,17 +1,44 @@ +from typing import Any, cast + from flask import request -from flask_restx import Resource +from flask_restx import Namespace, Resource +from pydantic import BaseModel, Field, RootModel from sqlalchemy import select +from controllers.common.schema import query_params_from_model, register_response_schema_models from controllers.console import api from controllers.console.explore.wraps import explore_banner_enabled from extensions.ext_database import db +from fields.base import ResponseModel from models.enums import BannerStatus from models.model import ExporleBanner +class BannerListQuery(BaseModel): + language: str = Field(default="en-US", description="Banner language") + + +class BannerResponse(ResponseModel): + id: str + content: Any + link: str | None = None + sort: int + status: str + created_at: str | None = None + + +class BannerListResponse(RootModel[list[BannerResponse]]): + root: list[BannerResponse] + + +register_response_schema_models(cast(Namespace, api), BannerListResponse) + + class BannerApi(Resource): """Resource for banner list.""" + @api.doc(params=query_params_from_model(BannerListQuery)) + @api.response(200, "Success", api.models[BannerListResponse.__name__]) @explore_banner_enabled def get(self): """Get banner list.""" diff --git a/api/controllers/console/explore/completion.py b/api/controllers/console/explore/completion.py index 1db177a29d..729be6a909 100644 --- a/api/controllers/console/explore/completion.py +++ b/api/controllers/console/explore/completion.py @@ -6,7 +6,7 @@ from pydantic import BaseModel, Field, field_validator from werkzeug.exceptions import InternalServerError, NotFound import services -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console.app.error import ( AppUnavailableError, @@ -44,7 +44,7 @@ logger = logging.getLogger(__name__) class CompletionMessageExplorePayload(BaseModel): inputs: dict[str, Any] query: str = "" - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) response_mode: Literal["blocking", "streaming"] | None = None retriever_from: str = Field(default="explore_app") @@ -52,7 +52,7 @@ class CompletionMessageExplorePayload(BaseModel): class ChatMessagePayload(BaseModel): inputs: dict[str, Any] query: str - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) conversation_id: str | None = None parent_message_id: str | None = None retriever_from: str = Field(default="explore_app") @@ -73,7 +73,7 @@ class ChatMessagePayload(BaseModel): register_schema_models(console_ns, CompletionMessageExplorePayload, ChatMessagePayload) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models(console_ns, GeneratedAppResponse, SimpleResultResponse) # define completion api for user @@ -83,6 +83,7 @@ register_response_schema_models(console_ns, SimpleResultResponse) ) class CompletionApi(InstalledAppResource): @console_ns.expect(console_ns.models[CompletionMessageExplorePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @with_current_user def post(self, current_user: Account, installed_app: InstalledApp): app_model = installed_app.app @@ -158,6 +159,7 @@ class CompletionStopApi(InstalledAppResource): ) class ChatApi(InstalledAppResource): @console_ns.expect(console_ns.models[ChatMessagePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @with_current_user def post(self, current_user: Account, installed_app: InstalledApp): app_model = installed_app.app diff --git a/api/controllers/console/explore/conversation.py b/api/controllers/console/explore/conversation.py index 5b625debea..2004e648f1 100644 --- a/api/controllers/console/explore/conversation.py +++ b/api/controllers/console/explore/conversation.py @@ -36,7 +36,12 @@ class ConversationListQuery(BaseModel): register_schema_models(console_ns, ConversationListQuery, ConversationRenamePayload) -register_response_schema_models(console_ns, ResultResponse) +register_response_schema_models( + console_ns, + ConversationInfiniteScrollPagination, + ResultResponse, + SimpleConversation, +) @console_ns.route( @@ -45,6 +50,7 @@ register_response_schema_models(console_ns, ResultResponse) ) class ConversationListApi(InstalledAppResource): @console_ns.doc(params=query_params_from_model(ConversationListQuery)) + @console_ns.response(200, "Success", console_ns.models[ConversationInfiniteScrollPagination.__name__]) @with_current_user def get(self, current_user: Account, installed_app: InstalledApp): app_model = installed_app.app @@ -118,6 +124,7 @@ class ConversationApi(InstalledAppResource): ) class ConversationRenameApi(InstalledAppResource): @console_ns.expect(console_ns.models[ConversationRenamePayload.__name__]) + @console_ns.response(200, "Conversation renamed successfully", console_ns.models[SimpleConversation.__name__]) @with_current_user def post(self, current_user: Account, installed_app: InstalledApp, c_id: UUID): app_model = installed_app.app diff --git a/api/controllers/console/explore/installed_app.py b/api/controllers/console/explore/installed_app.py index 0ab7a96f11..1483789750 100644 --- a/api/controllers/console/explore/installed_app.py +++ b/api/controllers/console/explore/installed_app.py @@ -9,7 +9,7 @@ from sqlalchemy import and_, exists, or_, select from werkzeug.exceptions import BadRequest, Forbidden, NotFound from controllers.common.fields import SimpleMessageResponse, SimpleResultMessageResponse -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.explore.wraps import InstalledAppResource from controllers.console.wraps import ( @@ -153,6 +153,7 @@ register_response_schema_models(console_ns, SimpleMessageResponse, SimpleResultM class InstalledAppsListApi(Resource): @login_required @account_initialization_required + @console_ns.doc(params=query_params_from_model(InstalledAppsListQuery)) @console_ns.response(200, "Success", console_ns.models[InstalledAppListResponse.__name__]) @with_current_user @with_current_tenant_id @@ -234,6 +235,7 @@ class InstalledAppsListApi(Resource): @login_required @account_initialization_required @cloud_edition_billing_resource_check("apps") + @console_ns.expect(console_ns.models[InstalledAppCreatePayload.__name__]) @console_ns.response(200, "Success", console_ns.models[SimpleMessageResponse.__name__]) @with_current_tenant_id def post(self, current_tenant_id: str): @@ -295,6 +297,7 @@ class InstalledAppApi(InstalledAppResource): return "", 204 @console_ns.response(200, "Success", console_ns.models[SimpleResultMessageResponse.__name__]) + @console_ns.expect(console_ns.models[InstalledAppUpdatePayload.__name__]) def patch(self, installed_app: InstalledApp): payload = InstalledAppUpdatePayload.model_validate(console_ns.payload or {}) diff --git a/api/controllers/console/explore/message.py b/api/controllers/console/explore/message.py index 88c0e679ad..1c82f6ba9d 100644 --- a/api/controllers/console/explore/message.py +++ b/api/controllers/console/explore/message.py @@ -7,6 +7,7 @@ from pydantic import BaseModel, TypeAdapter from werkzeug.exceptions import InternalServerError, NotFound from controllers.common.controller_schemas import MessageFeedbackPayload, MessageListQuery +from controllers.common.fields import GeneratedAppResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console.app.error import ( AppMoreLikeThisDisabledError, @@ -52,7 +53,13 @@ class MoreLikeThisQuery(BaseModel): register_schema_models(console_ns, MessageListQuery, MessageFeedbackPayload, MoreLikeThisQuery) -register_response_schema_models(console_ns, ResultResponse, SuggestedQuestionsResponse) +register_response_schema_models( + console_ns, + GeneratedAppResponse, + MessageInfiniteScrollPagination, + ResultResponse, + SuggestedQuestionsResponse, +) @console_ns.route( @@ -61,6 +68,7 @@ register_response_schema_models(console_ns, ResultResponse, SuggestedQuestionsRe ) class MessageListApi(InstalledAppResource): @console_ns.doc(params=query_params_from_model(MessageListQuery)) + @console_ns.response(200, "Success", console_ns.models[MessageInfiniteScrollPagination.__name__]) @with_current_user def get(self, current_user: Account, installed_app: InstalledApp): app_model = installed_app.app @@ -130,6 +138,7 @@ class MessageFeedbackApi(InstalledAppResource): ) class MessageMoreLikeThisApi(InstalledAppResource): @console_ns.doc(params=query_params_from_model(MoreLikeThisQuery)) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @with_current_user def get(self, current_user: Account, installed_app: InstalledApp, message_id: UUID): app_model = installed_app.app diff --git a/api/controllers/console/explore/parameter.py b/api/controllers/console/explore/parameter.py index 0f29627746..37d29eda3f 100644 --- a/api/controllers/console/explore/parameter.py +++ b/api/controllers/console/explore/parameter.py @@ -1,6 +1,9 @@ from typing import Any, cast +from pydantic import BaseModel, Field + from controllers.common import fields +from controllers.common.schema import register_response_schema_models from controllers.console import console_ns from controllers.console.app.error import AppUnavailableError from controllers.console.explore.wraps import InstalledAppResource @@ -9,10 +12,18 @@ from models.model import AppMode, InstalledApp from services.app_service import AppService +class ExploreAppMetaResponse(BaseModel): + tool_icons: dict[str, Any] = Field(default_factory=dict) + + +register_response_schema_models(console_ns, fields.Parameters, ExploreAppMetaResponse) + + @console_ns.route("/installed-apps//parameters", endpoint="installed_app_parameters") class AppParameterApi(InstalledAppResource): """Resource for app variables.""" + @console_ns.response(200, "Success", console_ns.models[fields.Parameters.__name__]) def get(self, installed_app: InstalledApp): """Retrieve app parameters.""" app_model = installed_app.app @@ -42,6 +53,7 @@ class AppParameterApi(InstalledAppResource): @console_ns.route("/installed-apps//meta", endpoint="installed_app_meta") class ExploreAppMetaApi(InstalledAppResource): + @console_ns.response(200, "Success", console_ns.models[ExploreAppMetaResponse.__name__]) def get(self, installed_app: InstalledApp): """Get app meta""" app_model = installed_app.app diff --git a/api/controllers/console/explore/recommended_app.py b/api/controllers/console/explore/recommended_app.py index 44f9c1e7e3..c559dc7375 100644 --- a/api/controllers/console/explore/recommended_app.py +++ b/api/controllers/console/explore/recommended_app.py @@ -3,10 +3,10 @@ from uuid import UUID from flask import request from flask_restx import Resource -from pydantic import BaseModel, Field, computed_field, field_validator +from pydantic import BaseModel, Field, RootModel, computed_field, field_validator from constants.languages import languages -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import account_initialization_required, with_current_user from fields.base import ResponseModel @@ -65,6 +65,10 @@ class RecommendedAppListResponse(ResponseModel): categories: list[str] +class RecommendedAppDetailResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models( console_ns, RecommendedAppsQuery, @@ -72,6 +76,7 @@ register_schema_models( RecommendedAppResponse, RecommendedAppListResponse, ) +register_response_schema_models(console_ns, RecommendedAppDetailResponse) @console_ns.route("/explore/apps") @@ -100,6 +105,7 @@ class RecommendedAppListApi(Resource): @console_ns.route("/explore/apps/") class RecommendedAppApi(Resource): + @console_ns.response(200, "Success", console_ns.models[RecommendedAppDetailResponse.__name__]) @login_required @account_initialization_required def get(self, app_id: UUID): diff --git a/api/controllers/console/explore/saved_message.py b/api/controllers/console/explore/saved_message.py index b8c0a9bb84..3e8f1ce908 100644 --- a/api/controllers/console/explore/saved_message.py +++ b/api/controllers/console/explore/saved_message.py @@ -19,12 +19,13 @@ from services.errors.message import MessageNotExistsError from services.saved_message_service import SavedMessageService register_schema_models(console_ns, SavedMessageListQuery, SavedMessageCreatePayload) -register_response_schema_models(console_ns, ResultResponse) +register_response_schema_models(console_ns, ResultResponse, SavedMessageInfiniteScrollPagination) @console_ns.route("/installed-apps//saved-messages", endpoint="installed_app_saved_messages") class SavedMessageListApi(InstalledAppResource): @console_ns.doc(params=query_params_from_model(SavedMessageListQuery)) + @console_ns.response(200, "Success", console_ns.models[SavedMessageInfiniteScrollPagination.__name__]) @with_current_user def get(self, current_user: Account, installed_app: InstalledApp): app_model = installed_app.app diff --git a/api/controllers/console/explore/trial.py b/api/controllers/console/explore/trial.py index 2e7796574f..094415f46d 100644 --- a/api/controllers/console/explore/trial.py +++ b/api/controllers/console/explore/trial.py @@ -3,14 +3,25 @@ from typing import Any, Literal, cast from flask import request from flask_restx import Resource, fields, marshal, marshal_with -from pydantic import BaseModel +from pydantic import BaseModel, Field from sqlalchemy import select from werkzeug.exceptions import Forbidden, InternalServerError, NotFound import services +from controllers.common.fields import ( + AudioBinaryResponse, + AudioTranscriptResponse, + GeneratedAppResponse, + SimpleResultResponse, +) from controllers.common.fields import Parameters as ParametersResponse from controllers.common.fields import Site as SiteResponse -from controllers.common.schema import get_or_create_model, register_schema_models +from controllers.common.schema import ( + get_or_create_model, + query_params_from_model, + register_response_schema_models, + register_schema_models, +) from controllers.console import console_ns from controllers.console.app.error import ( AppUnavailableError, @@ -54,6 +65,7 @@ from fields.app_fields import ( ) from fields.dataset_fields import dataset_fields from fields.member_fields import simple_account_fields +from fields.message_fields import SuggestedQuestionsResponse from fields.workflow_fields import ( conversation_variable_fields, pipeline_variable_fields, @@ -119,16 +131,28 @@ workflow_fields_copy["conversation_variables"] = fields.List(fields.Nested(conve workflow_fields_copy["rag_pipeline_variables"] = fields.List(fields.Nested(pipeline_variable_model)) workflow_model = get_or_create_model("TrialWorkflow", workflow_fields_copy) +dataset_model = get_or_create_model("TrialDataset", dataset_fields) +dataset_list_model = get_or_create_model( + "TrialDatasetList", + { + "data": fields.List(fields.Nested(dataset_model)), + "has_more": fields.Boolean, + "limit": fields.Integer, + "total": fields.Integer, + "page": fields.Integer, + }, +) + class WorkflowRunRequest(BaseModel): inputs: dict - files: list | None = None + files: list | None = Field(default=None) class ChatRequest(BaseModel): inputs: dict query: str - files: list | None = None + files: list | None = Field(default=None) conversation_id: str | None = None parent_message_id: str | None = None retriever_from: str = "explore_app" @@ -144,17 +168,41 @@ class TextToSpeechRequest(BaseModel): class CompletionRequest(BaseModel): inputs: dict query: str = "" - files: list | None = None + files: list | None = Field(default=None) response_mode: Literal["blocking", "streaming"] | None = None retriever_from: str = "explore_app" -register_schema_models(console_ns, WorkflowRunRequest, ChatRequest, TextToSpeechRequest, CompletionRequest) +class TrialDatasetListQuery(BaseModel): + page: int = Field(default=1, ge=1, description="Page number") + limit: int = Field(default=20, ge=1, description="Number of items per page") + ids: list[str] = Field(default_factory=list, description="Dataset IDs") + + +register_schema_models( + console_ns, + WorkflowRunRequest, + ChatRequest, + TextToSpeechRequest, + CompletionRequest, + TrialDatasetListQuery, +) +register_response_schema_models( + console_ns, + ParametersResponse, + AudioBinaryResponse, + AudioTranscriptResponse, + GeneratedAppResponse, + SimpleResultResponse, + SiteResponse, + SuggestedQuestionsResponse, +) class TrialAppWorkflowRunApi(TrialAppResource): @trial_feature_enable @console_ns.expect(console_ns.models[WorkflowRunRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @with_current_user def post(self, current_user: Account, trial_app): """ @@ -195,6 +243,7 @@ class TrialAppWorkflowRunApi(TrialAppResource): class TrialAppWorkflowTaskStopApi(TrialAppResource): + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @trial_feature_enable def post(self, trial_app, task_id: str): """ @@ -219,6 +268,7 @@ class TrialAppWorkflowTaskStopApi(TrialAppResource): class TrialChatApi(TrialAppResource): @console_ns.expect(console_ns.models[ChatRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @trial_feature_enable @with_current_user def post(self, current_user: Account, trial_app): @@ -273,6 +323,7 @@ class TrialChatApi(TrialAppResource): class TrialMessageSuggestedQuestionApi(TrialAppResource): + @console_ns.response(200, "Success", console_ns.models[SuggestedQuestionsResponse.__name__]) @with_current_user def get(self, current_user: Account, trial_app, message_id): app_model = trial_app @@ -308,6 +359,7 @@ class TrialMessageSuggestedQuestionApi(TrialAppResource): class TrialChatAudioApi(TrialAppResource): + @console_ns.response(200, "Success", console_ns.models[AudioTranscriptResponse.__name__]) @trial_feature_enable @with_current_user def post(self, current_user: Account, trial_app): @@ -351,6 +403,7 @@ class TrialChatAudioApi(TrialAppResource): class TrialChatTextApi(TrialAppResource): @console_ns.expect(console_ns.models[TextToSpeechRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[AudioBinaryResponse.__name__]) @trial_feature_enable @with_current_user def post(self, current_user: Account, trial_app): @@ -397,6 +450,7 @@ class TrialChatTextApi(TrialAppResource): class TrialCompletionApi(TrialAppResource): @console_ns.expect(console_ns.models[CompletionRequest.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @trial_feature_enable @with_current_user def post(self, current_user: Account, trial_app): @@ -446,6 +500,7 @@ class TrialCompletionApi(TrialAppResource): class TrialSitApi(Resource): """Resource for trial app sites.""" + @console_ns.response(200, "Success", console_ns.models[SiteResponse.__name__]) @get_app_model_with_trial(None) def get(self, app_model): """Retrieve app site info. @@ -467,6 +522,7 @@ class TrialSitApi(Resource): class TrialAppParameterApi(Resource): """Resource for app variables.""" + @console_ns.response(200, "Success", console_ns.models[ParametersResponse.__name__]) @get_app_model_with_trial(None) def get(self, app_model): """Retrieve app parameters.""" @@ -495,6 +551,7 @@ class TrialAppParameterApi(Resource): class AppApi(Resource): + @console_ns.response(200, "Success", app_detail_with_site_model) @get_app_model_with_trial(None) @marshal_with(app_detail_with_site_model) def get(self, app_model): @@ -507,6 +564,7 @@ class AppApi(Resource): class AppWorkflowApi(Resource): + @console_ns.response(200, "Success", workflow_model) @get_app_model_with_trial(None) @marshal_with(workflow_model) def get(self, app_model): @@ -519,6 +577,8 @@ class AppWorkflowApi(Resource): class DatasetListApi(Resource): + @console_ns.doc(params=query_params_from_model(TrialDatasetListQuery)) + @console_ns.response(200, "Success", dataset_list_model) @get_app_model_with_trial(None) def get(self, app_model): page = request.args.get("page", default=1, type=int) diff --git a/api/controllers/console/explore/workflow.py b/api/controllers/console/explore/workflow.py index ebd13e586b..f4e9e3cd7e 100644 --- a/api/controllers/console/explore/workflow.py +++ b/api/controllers/console/explore/workflow.py @@ -3,7 +3,7 @@ import logging from werkzeug.exceptions import InternalServerError from controllers.common.controller_schemas import WorkflowRunPayload -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_model from controllers.console.app.error import ( CompletionRequestError, @@ -36,12 +36,13 @@ from .. import console_ns logger = logging.getLogger(__name__) register_schema_model(console_ns, WorkflowRunPayload) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models(console_ns, GeneratedAppResponse, SimpleResultResponse) @console_ns.route("/installed-apps//workflows/run") class InstalledAppWorkflowRunApi(InstalledAppResource): @console_ns.expect(console_ns.models[WorkflowRunPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[GeneratedAppResponse.__name__]) @with_current_user def post(self, current_user: Account, installed_app: InstalledApp): """ diff --git a/api/controllers/console/extension.py b/api/controllers/console/extension.py index 6f1da8783e..6d9362ae0b 100644 --- a/api/controllers/console/extension.py +++ b/api/controllers/console/extension.py @@ -14,7 +14,7 @@ from models.api_based_extension import APIBasedExtension from services.api_based_extension_service import APIBasedExtensionService from services.code_based_extension_service import CodeBasedExtensionService -from ..common.schema import DEFAULT_REF_TEMPLATE_OPENAPI_3_0, register_schema_models +from ..common.schema import DEFAULT_REF_TEMPLATE_OPENAPI_3_0, query_params_from_model, register_schema_models from . import console_ns from .wraps import account_initialization_required, setup_required, with_current_tenant_id @@ -60,7 +60,13 @@ class APIBasedExtensionResponse(ResponseModel): return to_timestamp(value) -register_schema_models(console_ns, APIBasedExtensionPayload, CodeBasedExtensionResponse, APIBasedExtensionResponse) +register_schema_models( + console_ns, + CodeBasedExtensionQuery, + APIBasedExtensionPayload, + CodeBasedExtensionResponse, + APIBasedExtensionResponse, +) console_ns.schema_model( "APIBasedExtensionListResponse", TypeAdapter(list[APIBasedExtensionResponse]).json_schema(ref_template=DEFAULT_REF_TEMPLATE_OPENAPI_3_0), @@ -90,7 +96,7 @@ def _serialize_saved_api_based_extension(extension: APIBasedExtension, api_key: class CodeBasedExtensionAPI(Resource): @console_ns.doc("get_code_based_extension") @console_ns.doc(description="Get code-based extension data by module name") - @console_ns.doc(params={"module": "Extension module name"}) + @console_ns.doc(params=query_params_from_model(CodeBasedExtensionQuery)) @console_ns.response( 200, "Success", diff --git a/api/controllers/console/human_input_form.py b/api/controllers/console/human_input_form.py index 0ca9d18168..9700667f4a 100644 --- a/api/controllers/console/human_input_form.py +++ b/api/controllers/console/human_input_form.py @@ -5,15 +5,18 @@ Console/Studio Human Input Form APIs. import json import logging from collections.abc import Generator +from typing import Any from flask import Response, jsonify, request from flask_restx import Resource +from pydantic import RootModel from sqlalchemy import select from sqlalchemy.orm import Session, sessionmaker from controllers.common.errors import InvalidArgumentError, NotFoundError +from controllers.common.fields import EventStreamResponse from controllers.common.human_input import HumanInputFormSubmitPayload -from controllers.common.schema import register_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -40,7 +43,22 @@ from services.workflow_event_snapshot_service import build_workflow_event_stream logger = logging.getLogger(__name__) + +class ConsoleHumanInputFormDefinitionResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class ConsoleHumanInputFormSubmitResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models(console_ns, HumanInputFormSubmitPayload) +register_response_schema_models( + console_ns, + ConsoleHumanInputFormDefinitionResponse, + ConsoleHumanInputFormSubmitResponse, + EventStreamResponse, +) def _jsonify_form_definition(form: Form) -> Response: @@ -67,6 +85,7 @@ class ConsoleHumanInputFormApi(Resource): @setup_required @login_required @account_initialization_required + @console_ns.response(200, "Success", console_ns.models[ConsoleHumanInputFormDefinitionResponse.__name__]) @with_current_tenant_id def get(self, current_tenant_id: str, form_token: str): """ @@ -89,6 +108,7 @@ class ConsoleHumanInputFormApi(Resource): @with_current_tenant_id @model_validate(HumanInputFormSubmitPayload) @console_ns.expect(console_ns.models[HumanInputFormSubmitPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ConsoleHumanInputFormSubmitResponse.__name__]) def post( self, payload: HumanInputFormSubmitPayload, @@ -136,6 +156,7 @@ class ConsoleHumanInputFormApi(Resource): class ConsoleWorkflowEventsApi(Resource): """Console API for getting workflow execution events after resume.""" + @console_ns.response(200, "SSE event stream", console_ns.models[EventStreamResponse.__name__]) @account_initialization_required @login_required @with_current_user diff --git a/api/controllers/console/notification.py b/api/controllers/console/notification.py index ee59f3d564..798d674f9e 100644 --- a/api/controllers/console/notification.py +++ b/api/controllers/console/notification.py @@ -6,7 +6,7 @@ from flask_restx import Resource from pydantic import BaseModel, Field from controllers.common.fields import SimpleResultResponse -from controllers.common.schema import register_response_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -14,6 +14,7 @@ from controllers.console.wraps import ( setup_required, with_current_user, ) +from fields.base import ResponseModel from libs.login import login_required from models import Account from services.billing_service import BillingService @@ -56,7 +57,23 @@ class DismissNotificationPayload(BaseModel): notification_id: str = Field(...) -register_response_schema_models(console_ns, SimpleResultResponse) +class NotificationItemResponse(ResponseModel): + notification_id: str | None = None + frequency: str | None = None + lang: str + title: str + subtitle: str + body: str + title_pic_url: str + + +class NotificationResponse(ResponseModel): + should_show: bool + notifications: list[NotificationItemResponse] + + +register_schema_models(console_ns, DismissNotificationPayload) +register_response_schema_models(console_ns, SimpleResultResponse, NotificationResponse) @console_ns.route("/notification") @@ -74,6 +91,7 @@ class NotificationApi(Resource): 401: "Unauthorized", }, ) + @console_ns.response(200, "Success", console_ns.models[NotificationResponse.__name__]) @setup_required @login_required @with_current_user @@ -121,6 +139,7 @@ class NotificationDismissApi(Resource): @with_current_user @account_initialization_required @only_edition_cloud + @console_ns.expect(console_ns.models[DismissNotificationPayload.__name__]) @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) def post(self, current_user: Account): payload = DismissNotificationPayload.model_validate(request.get_json()) diff --git a/api/controllers/console/snippets/payloads.py b/api/controllers/console/snippets/payloads.py index 24cc990fa7..70730e754d 100644 --- a/api/controllers/console/snippets/payloads.py +++ b/api/controllers/console/snippets/payloads.py @@ -76,7 +76,7 @@ class CreateSnippetPayload(BaseModel): description: str | None = Field(default=None, max_length=2000) type: Literal["node", "group"] = "node" icon_info: IconInfo | None = None - graph: dict[str, Any] | None = None + graph: dict[str, Any] | None = Field(default=None) input_fields: list[InputFieldDefinition] | None = Field(default_factory=list) @@ -97,7 +97,7 @@ class SnippetDraftSyncPayload(BaseModel): default=None, description="Ignored. Snippet workflows do not persist conversation variables.", ) - input_fields: list[dict[str, Any]] | None = None + input_fields: list[dict[str, Any]] | None = Field(default=None) class SnippetWorkflowListQuery(BaseModel): @@ -118,7 +118,7 @@ class SnippetDraftRunPayload(BaseModel): """Payload for running snippet draft workflow.""" inputs: dict[str, Any] - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) class SnippetDraftNodeRunPayload(BaseModel): @@ -126,25 +126,25 @@ class SnippetDraftNodeRunPayload(BaseModel): inputs: dict[str, Any] query: str = "" - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) class SnippetIterationNodeRunPayload(BaseModel): """Payload for running an iteration node in snippet draft workflow.""" - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) class SnippetLoopNodeRunPayload(BaseModel): """Payload for running a loop node in snippet draft workflow.""" - inputs: dict[str, Any] | None = None + inputs: dict[str, Any] | None = Field(default=None) class PublishWorkflowPayload(BaseModel): """Payload for publishing snippet workflow.""" - knowledge_base_setting: dict[str, Any] | None = None + knowledge_base_setting: dict[str, Any] | None = Field(default=None) class SnippetImportPayload(BaseModel): diff --git a/api/controllers/console/snippets/snippet_workflow.py b/api/controllers/console/snippets/snippet_workflow.py index c54d555686..243c29e671 100644 --- a/api/controllers/console/snippets/snippet_workflow.py +++ b/api/controllers/console/snippets/snippet_workflow.py @@ -4,17 +4,21 @@ from functools import wraps from flask import request from flask_restx import Resource -from pydantic import Field +from pydantic import BaseModel, Field from sqlalchemy.orm import Session, sessionmaker from werkzeug.exceptions import BadRequest, InternalServerError, NotFound +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.app.error import DraftWorkflowNotExist, DraftWorkflowNotSync from controllers.console.app.workflow import ( RESTORE_SOURCE_WORKFLOW_MUST_BE_PUBLISHED_MESSAGE, + DefaultBlockConfigsResponse, WorkflowPaginationResponse, + WorkflowPublishResponse, WorkflowResponse, + WorkflowRestoreResponse, ) from controllers.console.snippets.payloads import ( PublishWorkflowPayload, @@ -69,6 +73,10 @@ class SnippetWorkflowResponse(WorkflowResponse): input_fields: list[dict] = Field(default_factory=list) +class SnippetDraftConfigResponse(BaseModel): + parallel_depth_limit: int + + register_schema_models( console_ns, SnippetDraftSyncPayload, @@ -82,8 +90,14 @@ register_schema_models( ) register_response_schema_models( console_ns, + DefaultBlockConfigsResponse, + GeneratedAppResponse, + SimpleResultResponse, + SnippetDraftConfigResponse, SnippetWorkflowResponse, + WorkflowPublishResponse, WorkflowPaginationResponse, + WorkflowRestoreResponse, WorkflowRunPaginationResponse, WorkflowRunDetailResponse, WorkflowRunNodeExecutionListResponse, @@ -155,7 +169,11 @@ class SnippetDraftWorkflowApi(Resource): @console_ns.doc("sync_snippet_draft_workflow") @console_ns.expect(console_ns.models.get(SnippetDraftSyncPayload.__name__)) - @console_ns.response(200, "Draft workflow synced successfully") + @console_ns.response( + 200, + "Draft workflow synced successfully", + console_ns.models[WorkflowRestoreResponse.__name__], + ) @console_ns.response(400, "Hash mismatch") @setup_required @login_required @@ -191,7 +209,11 @@ class SnippetDraftWorkflowApi(Resource): @console_ns.route("/snippets//workflows/draft/config") class SnippetDraftConfigApi(Resource): @console_ns.doc("get_snippet_draft_config") - @console_ns.response(200, "Draft config retrieved successfully") + @console_ns.response( + 200, + "Draft config retrieved successfully", + console_ns.models[SnippetDraftConfigResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -235,7 +257,7 @@ class SnippetPublishedWorkflowApi(Resource): @console_ns.doc("publish_snippet_workflow") @console_ns.expect(console_ns.models.get(PublishWorkflowPayload.__name__)) - @console_ns.response(200, "Workflow published successfully") + @console_ns.response(200, "Workflow published successfully", console_ns.models[WorkflowPublishResponse.__name__]) @console_ns.response(400, "No draft workflow found") @setup_required @login_required @@ -269,7 +291,11 @@ class SnippetPublishedWorkflowApi(Resource): @console_ns.route("/snippets//workflows/default-workflow-block-configs") class SnippetDefaultBlockConfigsApi(Resource): @console_ns.doc("get_snippet_default_block_configs") - @console_ns.response(200, "Default block configs retrieved successfully") + @console_ns.response( + 200, + "Default block configs retrieved successfully", + console_ns.models[DefaultBlockConfigsResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -326,7 +352,7 @@ class SnippetDraftWorkflowRestoreApi(Resource): @console_ns.doc("restore_snippet_workflow_to_draft") @console_ns.doc(description="Restore a published snippet workflow version into the draft workflow") @console_ns.doc(params={"snippet_id": "Snippet ID", "workflow_id": "Published workflow ID"}) - @console_ns.response(200, "Workflow restored successfully") + @console_ns.response(200, "Workflow restored successfully", console_ns.models[WorkflowRestoreResponse.__name__]) @console_ns.response(400, "Source workflow must be published") @console_ns.response(404, "Workflow not found") @setup_required @@ -362,6 +388,7 @@ class SnippetDraftWorkflowRestoreApi(Resource): @console_ns.route("/snippets//workflow-runs") class SnippetWorkflowRunsApi(Resource): @console_ns.doc("list_snippet_workflow_runs") + @console_ns.doc(params=query_params_from_model(WorkflowRunQuery)) @console_ns.response( 200, "Workflow runs retrieved successfully", @@ -535,7 +562,11 @@ class SnippetDraftRunIterationNodeApi(Resource): @console_ns.doc(description="Run draft workflow iteration node for snippet") @console_ns.doc(params={"snippet_id": "Snippet ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models.get(SnippetIterationNodeRunPayload.__name__)) - @console_ns.response(200, "Iteration node run started successfully (SSE stream)") + @console_ns.response( + 200, + "Iteration node run started successfully (SSE stream)", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(404, "Snippet or draft workflow not found") @setup_required @login_required @@ -576,7 +607,11 @@ class SnippetDraftRunLoopNodeApi(Resource): @console_ns.doc(description="Run draft workflow loop node for snippet") @console_ns.doc(params={"snippet_id": "Snippet ID", "node_id": "Node ID"}) @console_ns.expect(console_ns.models.get(SnippetLoopNodeRunPayload.__name__)) - @console_ns.response(200, "Loop node run started successfully (SSE stream)") + @console_ns.response( + 200, + "Loop node run started successfully (SSE stream)", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(404, "Snippet or draft workflow not found") @setup_required @login_required @@ -615,7 +650,11 @@ class SnippetDraftRunLoopNodeApi(Resource): class SnippetDraftWorkflowRunApi(Resource): @console_ns.doc("run_snippet_draft_workflow") @console_ns.expect(console_ns.models.get(SnippetDraftRunPayload.__name__)) - @console_ns.response(200, "Draft workflow run started successfully (SSE stream)") + @console_ns.response( + 200, + "Draft workflow run started successfully (SSE stream)", + console_ns.models[GeneratedAppResponse.__name__], + ) @console_ns.response(404, "Snippet or draft workflow not found") @setup_required @login_required @@ -654,7 +693,7 @@ class SnippetDraftWorkflowRunApi(Resource): @console_ns.route("/snippets//workflow-runs/tasks//stop") class SnippetWorkflowTaskStopApi(Resource): @console_ns.doc("stop_snippet_workflow_task") - @console_ns.response(200, "Task stopped successfully") + @console_ns.response(200, "Task stopped successfully", console_ns.models[SimpleResultResponse.__name__]) @console_ns.response(404, "Snippet not found") @setup_required @login_required diff --git a/api/controllers/console/snippets/snippet_workflow_draft_variable.py b/api/controllers/console/snippets/snippet_workflow_draft_variable.py index 5c52287daa..a28ba07b5d 100644 --- a/api/controllers/console/snippets/snippet_workflow_draft_variable.py +++ b/api/controllers/console/snippets/snippet_workflow_draft_variable.py @@ -23,6 +23,7 @@ from controllers.common.schema import query_params_from_model from controllers.console import console_ns from controllers.console.app.error import DraftWorkflowNotExist from controllers.console.app.workflow_draft_variable import ( + EnvironmentVariableListResponse, WorkflowDraftVariableListQuery, WorkflowDraftVariableUpdatePayload, ensure_variable_access, @@ -306,7 +307,11 @@ class SnippetSystemVariableCollectionApi(Resource): class SnippetEnvironmentVariableCollectionApi(Resource): @console_ns.doc("get_snippet_environment_variables") @console_ns.doc(description="Get environment variables from snippet draft workflow graph") - @console_ns.response(200, "Environment variables retrieved successfully") + @console_ns.response( + 200, + "Environment variables retrieved successfully", + console_ns.models[EnvironmentVariableListResponse.__name__], + ) @console_ns.response(404, "Draft workflow not found") @_snippet_draft_var_prerequisite def get(self, _current_user: Account, snippet: CustomizedSnippet) -> dict[str, list[dict[str, Any]]]: diff --git a/api/controllers/console/spec.py b/api/controllers/console/spec.py index 1795e2d172..27b07b4dd8 100644 --- a/api/controllers/console/spec.py +++ b/api/controllers/console/spec.py @@ -1,7 +1,10 @@ import logging +from typing import Any from flask_restx import Resource +from pydantic import RootModel +from controllers.common.schema import register_response_schema_models from controllers.console.wraps import ( account_initialization_required, setup_required, @@ -14,8 +17,16 @@ from . import console_ns logger = logging.getLogger(__name__) +class SchemaDefinitionsResponse(RootModel[Any]): + root: Any + + +register_response_schema_models(console_ns, SchemaDefinitionsResponse) + + @console_ns.route("/spec/schema-definitions") class SpecSchemaDefinitionsApi(Resource): + @console_ns.response(200, "Success", console_ns.models[SchemaDefinitionsResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/tag/tags.py b/api/controllers/console/tag/tags.py index d2ec06c062..a9a1157a29 100644 --- a/api/controllers/console/tag/tags.py +++ b/api/controllers/console/tag/tags.py @@ -7,7 +7,7 @@ from pydantic import BaseModel, Field, field_validator from werkzeug.exceptions import Forbidden from controllers.common.fields import SimpleResultResponse -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -95,12 +95,7 @@ class TagListApi(Resource): @setup_required @login_required @account_initialization_required - @console_ns.doc( - params={ - "type": 'Tag type filter. Can be "knowledge", "app", or "snippet".', - "keyword": "Search keyword for tag name.", - } - ) + @console_ns.doc(params=query_params_from_model(TagListQueryParam)) @console_ns.doc(responses={200: ("Success", [console_ns.models[TagResponse.__name__]])}) @with_current_tenant_id def get(self, current_tenant_id: str): diff --git a/api/controllers/console/workspace/account.py b/api/controllers/console/workspace/account.py index 1b83e9c482..0ac26168bc 100644 --- a/api/controllers/console/workspace/account.py +++ b/api/controllers/console/workspace/account.py @@ -6,7 +6,7 @@ from typing import Any, Literal import pytz from flask import request from flask_restx import Resource -from pydantic import BaseModel, Field, field_validator, model_validator +from pydantic import BaseModel, Field, RootModel, field_validator, model_validator from sqlalchemy import select from werkzeug.exceptions import NotFound @@ -236,6 +236,10 @@ class EducationAutocompleteResponse(ResponseModel): has_next: bool | None = None +class EducationActivateResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + register_schema_models( console_ns, AccountIntegrateResponse, @@ -248,6 +252,7 @@ register_response_schema_models( console_ns, AccountResponse, AvatarUrlResponse, + EducationActivateResponse, SimpleResultDataResponse, SimpleResultResponse, VerificationTokenResponse, @@ -556,6 +561,7 @@ class EducationVerifyApi(Resource): @console_ns.route("/account/education") class EducationApi(Resource): @console_ns.expect(console_ns.models[EducationActivatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[EducationActivateResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/agent_providers.py b/api/controllers/console/workspace/agent_providers.py index 8e968bb07f..4ba2faefc7 100644 --- a/api/controllers/console/workspace/agent_providers.py +++ b/api/controllers/console/workspace/agent_providers.py @@ -1,5 +1,9 @@ -from flask_restx import Resource, fields +from typing import Any +from flask_restx import Resource +from pydantic import RootModel + +from controllers.common.schema import register_response_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -13,6 +17,17 @@ from models import Account from services.agent_service import AgentService +class AgentProviderListResponse(RootModel[list[dict[str, Any]]]): + root: list[dict[str, Any]] + + +class AgentProviderResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +register_response_schema_models(console_ns, AgentProviderListResponse, AgentProviderResponse) + + @console_ns.route("/workspaces/current/agent-providers") class AgentProviderListApi(Resource): @console_ns.doc("list_agent_providers") @@ -20,7 +35,7 @@ class AgentProviderListApi(Resource): @console_ns.response( 200, "Success", - fields.List(fields.Raw(description="Agent provider information")), + console_ns.models[AgentProviderListResponse.__name__], ) @setup_required @login_required @@ -39,7 +54,7 @@ class AgentProviderApi(Resource): @console_ns.response( 200, "Success", - fields.Raw(description="Agent provider details"), + console_ns.models[AgentProviderResponse.__name__], ) @setup_required @login_required diff --git a/api/controllers/console/workspace/endpoint.py b/api/controllers/console/workspace/endpoint.py index f69c527317..9c5aa166bc 100644 --- a/api/controllers/console/workspace/endpoint.py +++ b/api/controllers/console/workspace/endpoint.py @@ -61,11 +61,15 @@ class EndpointCreateResponse(BaseModel): class EndpointListResponse(BaseModel): - endpoints: list[dict[str, Any]] = Field(description="Endpoint information") + endpoints: list[dict[str, Any]] = Field( + description="Endpoint information", + ) class PluginEndpointListResponse(BaseModel): - endpoints: list[dict[str, Any]] = Field(description="Endpoint information") + endpoints: list[dict[str, Any]] = Field( + description="Endpoint information", + ) class EndpointDeleteResponse(BaseModel): diff --git a/api/controllers/console/workspace/load_balancing_config.py b/api/controllers/console/workspace/load_balancing_config.py index 969483d138..5983a4e10b 100644 --- a/api/controllers/console/workspace/load_balancing_config.py +++ b/api/controllers/console/workspace/load_balancing_config.py @@ -2,7 +2,7 @@ from flask_restx import Resource from pydantic import BaseModel from werkzeug.exceptions import Forbidden -from controllers.common.schema import register_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -10,6 +10,7 @@ from controllers.console.wraps import ( with_current_tenant_id, with_current_user, ) +from fields.base import ResponseModel from graphon.model_runtime.entities.model_entities import ModelType from graphon.model_runtime.errors.validate import CredentialsValidateFailedError from libs.login import login_required @@ -23,7 +24,13 @@ class LoadBalancingCredentialPayload(BaseModel): credentials: dict[str, object] +class LoadBalancingCredentialValidateResponse(ResponseModel): + result: str + error: str | None = None + + register_schema_models(console_ns, LoadBalancingCredentialPayload) +register_response_schema_models(console_ns, LoadBalancingCredentialValidateResponse) @console_ns.route( @@ -31,6 +38,11 @@ register_schema_models(console_ns, LoadBalancingCredentialPayload) ) class LoadBalancingCredentialsValidateApi(Resource): @console_ns.expect(console_ns.models[LoadBalancingCredentialPayload.__name__]) + @console_ns.response( + 200, + "Credential validation result", + console_ns.models[LoadBalancingCredentialValidateResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -75,6 +87,11 @@ class LoadBalancingCredentialsValidateApi(Resource): ) class LoadBalancingConfigCredentialsValidateApi(Resource): @console_ns.expect(console_ns.models[LoadBalancingCredentialPayload.__name__]) + @console_ns.response( + 200, + "Credential validation result", + console_ns.models[LoadBalancingCredentialValidateResponse.__name__], + ) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/members.py b/api/controllers/console/workspace/members.py index 6e343f98d7..6fea541715 100644 --- a/api/controllers/console/workspace/members.py +++ b/api/controllers/console/workspace/members.py @@ -8,7 +8,7 @@ from sqlalchemy import func, select import services from configs import dify_config -from controllers.common.fields import SimpleResultDataResponse, VerificationTokenResponse +from controllers.common.fields import SimpleResultDataResponse, SimpleResultResponse, VerificationTokenResponse from controllers.common.schema import register_enum_models, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.auth.error import ( @@ -29,6 +29,7 @@ from controllers.console.wraps import ( ) from extensions.ext_database import db from extensions.ext_redis import redis_client +from fields.base import ResponseModel from fields.member_fields import AccountWithRole, AccountWithRoleList from libs.helper import extract_remote_ip from libs.login import login_required @@ -61,6 +62,24 @@ class OwnerTransferPayload(BaseModel): token: str +class MemberInviteResultResponse(ResponseModel): + status: str + email: str + url: str | None = None + message: str | None = None + + +class MemberInviteResponse(ResponseModel): + result: str + invitation_results: list[MemberInviteResultResponse] + tenant_id: str + + +class MemberActionTenantResponse(ResponseModel): + result: str + tenant_id: str + + register_enum_models(console_ns, TenantAccountRole) register_schema_models( console_ns, @@ -72,7 +91,14 @@ register_schema_models( OwnerTransferCheckPayload, OwnerTransferPayload, ) -register_response_schema_models(console_ns, SimpleResultDataResponse, VerificationTokenResponse) +register_response_schema_models( + console_ns, + SimpleResultDataResponse, + SimpleResultResponse, + VerificationTokenResponse, + MemberInviteResponse, + MemberActionTenantResponse, +) def _is_role_enabled(role: TenantAccountRole | str, tenant_id: str) -> bool: @@ -152,6 +178,7 @@ class MemberInviteEmailApi(Resource): """Invite a new member by email.""" @console_ns.expect(console_ns.models[MemberInvitePayload.__name__]) + @console_ns.response(201, "Success", console_ns.models[MemberInviteResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -221,6 +248,7 @@ class MemberInviteEmailApi(Resource): class MemberCancelInviteApi(Resource): """Cancel an invitation by member id.""" + @console_ns.response(200, "Success", console_ns.models[MemberActionTenantResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -254,6 +282,7 @@ class MemberUpdateRoleApi(Resource): """Update member role.""" @console_ns.expect(console_ns.models[MemberRoleUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -396,6 +425,7 @@ class OwnerTransferCheckApi(Resource): @console_ns.route("/workspaces/current/members//owner-transfer") class OwnerTransfer(Resource): @console_ns.expect(console_ns.models[OwnerTransferPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/model_providers.py b/api/controllers/console/workspace/model_providers.py index dc05b73436..07c124890c 100644 --- a/api/controllers/console/workspace/model_providers.py +++ b/api/controllers/console/workspace/model_providers.py @@ -5,7 +5,7 @@ from flask import request, send_file from flask_restx import Resource from pydantic import BaseModel, Field, field_validator -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import BinaryFileResponse, SimpleResultResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( @@ -15,6 +15,7 @@ from controllers.console.wraps import ( with_current_tenant_id, with_current_user, ) +from fields.base import ResponseModel from graphon.model_runtime.entities.model_entities import ModelType from graphon.model_runtime.errors.validate import CredentialsValidateFailedError from graphon.model_runtime.utils.encoders import jsonable_encoder @@ -22,6 +23,7 @@ from libs.helper import uuid_value from libs.login import login_required from models import Account from services.billing_service import BillingService +from services.entities.model_provider_entities import ProviderResponse from services.model_provider_service import ModelProviderService @@ -82,6 +84,23 @@ class ParserPreferredProviderType(BaseModel): preferred_provider_type: Literal["system", "custom"] +class ModelProviderListResponse(ResponseModel): + data: list[ProviderResponse] + + +class ProviderCredentialResponse(ResponseModel): + credentials: dict[str, Any] | None = Field(default=None) + + +class ProviderCredentialValidateResponse(ResponseModel): + result: Literal["success", "error"] + error: str | None = None + + +class ModelProviderPaymentCheckoutUrlResponse(ResponseModel): + payment_link: str + + register_schema_models( console_ns, ParserModelList, @@ -93,12 +112,21 @@ register_schema_models( ParserCredentialValidate, ParserPreferredProviderType, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models( + console_ns, + BinaryFileResponse, + SimpleResultResponse, + ModelProviderListResponse, + ModelProviderPaymentCheckoutUrlResponse, + ProviderCredentialResponse, + ProviderCredentialValidateResponse, +) @console_ns.route("/workspaces/current/model-providers") class ModelProviderListApi(Resource): @console_ns.doc(params=query_params_from_model(ParserModelList)) + @console_ns.response(200, "Success", console_ns.models[ModelProviderListResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -116,6 +144,7 @@ class ModelProviderListApi(Resource): @console_ns.route("/workspaces/current/model-providers//credentials") class ModelProviderCredentialApi(Resource): @console_ns.doc(params=query_params_from_model(ParserCredentialId)) + @console_ns.response(200, "Success", console_ns.models[ProviderCredentialResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -133,6 +162,7 @@ class ModelProviderCredentialApi(Resource): return {"credentials": credentials} @console_ns.expect(console_ns.models[ParserCredentialCreate.__name__]) + @console_ns.response(201, "Credential created successfully", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -157,6 +187,7 @@ class ModelProviderCredentialApi(Resource): return {"result": "success"}, 201 @console_ns.expect(console_ns.models[ParserCredentialUpdate.__name__]) + @console_ns.response(200, "Credential updated successfully", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -225,6 +256,11 @@ class ModelProviderCredentialSwitchApi(Resource): @console_ns.route("/workspaces/current/model-providers//credentials/validate") class ModelProviderValidateApi(Resource): @console_ns.expect(console_ns.models[ParserCredentialValidate.__name__]) + @console_ns.response( + 200, + "Credential validation result", + console_ns.models[ProviderCredentialValidateResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -262,6 +298,7 @@ class ModelProviderIconApi(Resource): Get model provider icon """ + @console_ns.response(200, "Success", console_ns.models[BinaryFileResponse.__name__]) def get(self, tenant_id: str, provider: str, icon_type: str, lang: str): model_provider_service = ModelProviderService() icon, mimetype = model_provider_service.get_model_provider_icon( @@ -298,6 +335,7 @@ class PreferredProviderTypeUpdateApi(Resource): @console_ns.route("/workspaces/current/model-providers//checkout-url") class ModelProviderPaymentCheckoutUrlApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ModelProviderPaymentCheckoutUrlResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/models.py b/api/controllers/console/workspace/models.py index 860acce443..2139d6f18e 100644 --- a/api/controllers/console/workspace/models.py +++ b/api/controllers/console/workspace/models.py @@ -20,12 +20,19 @@ from controllers.console.wraps import ( with_current_tenant_id, with_current_user, ) -from graphon.model_runtime.entities.model_entities import ModelType +from core.entities.provider_entities import CredentialConfiguration +from fields.base import ResponseModel +from graphon.model_runtime.entities.model_entities import ModelType, ParameterRule from graphon.model_runtime.errors.validate import CredentialsValidateFailedError from graphon.model_runtime.utils.encoders import jsonable_encoder from libs.helper import uuid_value from libs.login import login_required from models import Account +from services.entities.model_provider_entities import ( + DefaultModelResponse, + ModelWithProviderEntityResponse, + ProviderWithModelsResponse, +) from services.model_load_balancing_service import ModelLoadBalancingService from services.model_provider_service import ModelProviderService @@ -52,7 +59,7 @@ class ParserDeleteModels(BaseModel): class LoadBalancingPayload(BaseModel): - configs: list[dict[str, Any]] | None = None + configs: list[dict[str, Any]] | None = Field(default=None) enabled: bool | None = None @@ -125,6 +132,40 @@ class ParserSwitch(BaseModel): credential_id: str +class DefaultModelDataResponse(ResponseModel): + data: DefaultModelResponse | None = None + + +class ModelWithProviderListResponse(ResponseModel): + data: list[ModelWithProviderEntityResponse] + + +class ProviderWithModelsDataResponse(ResponseModel): + data: list[ProviderWithModelsResponse] + + +class ModelCredentialLoadBalancingResponse(ResponseModel): + enabled: bool + configs: list[dict[str, Any]] = Field(default_factory=list) + + +class ModelCredentialResponse(ResponseModel): + credentials: dict[str, Any] = Field(default_factory=dict) + current_credential_id: str | None = None + current_credential_name: str | None = None + load_balancing: ModelCredentialLoadBalancingResponse + available_credentials: list[CredentialConfiguration] + + +class ModelCredentialValidateResponse(ResponseModel): + result: str + error: str | None = None + + +class ModelParameterRulesResponse(ResponseModel): + data: list[ParameterRule] + + register_schema_models( console_ns, ParserGetDefault, @@ -139,7 +180,16 @@ register_schema_models( Inner, ParserSwitch, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models( + console_ns, + SimpleResultResponse, + DefaultModelDataResponse, + ModelWithProviderListResponse, + ProviderWithModelsDataResponse, + ModelCredentialResponse, + ModelCredentialValidateResponse, + ModelParameterRulesResponse, +) register_enum_models(console_ns, ModelType) @@ -147,6 +197,7 @@ register_enum_models(console_ns, ModelType) @console_ns.route("/workspaces/current/default-model") class DefaultModelApi(Resource): @console_ns.doc(params=query_params_from_model(ParserGetDefault)) + @console_ns.response(200, "Success", console_ns.models[DefaultModelDataResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -196,6 +247,7 @@ class DefaultModelApi(Resource): @console_ns.route("/workspaces/current/model-providers//models") class ModelProviderModelApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ModelWithProviderListResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -207,6 +259,7 @@ class ModelProviderModelApi(Resource): return jsonable_encoder({"data": models}) @console_ns.expect(console_ns.models[ParserPostModels.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -273,6 +326,7 @@ class ModelProviderModelApi(Resource): @console_ns.route("/workspaces/current/model-providers//models/credentials") class ModelProviderModelCredentialApi(Resource): @console_ns.doc(params=query_params_from_model(ParserGetCredentials)) + @console_ns.response(200, "Success", console_ns.models[ModelCredentialResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -331,6 +385,7 @@ class ModelProviderModelCredentialApi(Resource): ) @console_ns.expect(console_ns.models[ParserCreateCredential.__name__]) + @console_ns.response(201, "Credential created successfully", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -362,6 +417,7 @@ class ModelProviderModelCredentialApi(Resource): return {"result": "success"}, 201 @console_ns.expect(console_ns.models[ParserUpdateCredential.__name__]) + @console_ns.response(200, "Credential updated successfully", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -486,6 +542,11 @@ register_schema_models(console_ns, ParserSwitch, ParserValidate) @console_ns.route("/workspaces/current/model-providers//models/credentials/validate") class ModelProviderModelValidateApi(Resource): @console_ns.expect(console_ns.models[ParserValidate.__name__]) + @console_ns.response( + 200, + "Credential validation result", + console_ns.models[ModelCredentialValidateResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -521,6 +582,7 @@ class ModelProviderModelValidateApi(Resource): @console_ns.route("/workspaces/current/model-providers//models/parameter-rules") class ModelProviderModelParameterRuleApi(Resource): @console_ns.doc(params=query_params_from_model(ParserParameter)) + @console_ns.response(200, "Success", console_ns.models[ModelParameterRulesResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -538,6 +600,7 @@ class ModelProviderModelParameterRuleApi(Resource): @console_ns.route("/workspaces/current/models/model-types/") class ModelProviderAvailableModelApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ProviderWithModelsDataResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/plugin.py b/api/controllers/console/workspace/plugin.py index 1f9867f458..be5bef0efa 100644 --- a/api/controllers/console/workspace/plugin.py +++ b/api/controllers/console/workspace/plugin.py @@ -4,12 +4,12 @@ from typing import Any, Literal from flask import request, send_file from flask_restx import Resource -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel from werkzeug.datastructures import FileStorage from werkzeug.exceptions import Forbidden from configs import dify_config -from controllers.common.fields import SuccessResponse +from controllers.common.fields import BinaryFileResponse, SuccessResponse from controllers.common.schema import ( query_params_from_model, register_enum_models, @@ -157,6 +157,58 @@ class PluginDebuggingKeyResponse(ResponseModel): port: int +class PluginDaemonOperationResponse(RootModel[Any]): + root: Any + + +class PluginListResponse(ResponseModel): + plugins: Any + total: int + + +class PluginVersionsResponse(ResponseModel): + versions: Any + + +class PluginInstallationsResponse(ResponseModel): + plugins: Any + + +class PluginManifestResponse(ResponseModel): + manifest: Any + + +class PluginTasksResponse(ResponseModel): + tasks: Any + + +class PluginTaskResponse(ResponseModel): + task: Any + + +class PluginPermissionResponse(ResponseModel): + install_permission: TenantPluginPermission.InstallPermission + debug_permission: TenantPluginPermission.DebugPermission + + +class PluginDynamicOptionsResponse(ResponseModel): + options: Any + + +class PluginOperationSuccessResponse(ResponseModel): + success: bool + message: str | None = None + + +class PluginPreferencesResponse(ResponseModel): + permission: PluginPermissionSettingsPayload + auto_upgrade: PluginAutoUpgradeSettingsPayload + + +class PluginReadmeResponse(ResponseModel): + readme: str + + register_schema_models( console_ns, ParserList, @@ -180,7 +232,24 @@ register_schema_models( ParserExcludePlugin, ParserReadme, ) -register_response_schema_models(console_ns, PluginDebuggingKeyResponse, SuccessResponse) +register_response_schema_models( + console_ns, + BinaryFileResponse, + PluginDaemonOperationResponse, + PluginDebuggingKeyResponse, + PluginDynamicOptionsResponse, + PluginInstallationsResponse, + PluginListResponse, + PluginManifestResponse, + PluginOperationSuccessResponse, + PluginPermissionResponse, + PluginPreferencesResponse, + PluginReadmeResponse, + PluginTaskResponse, + PluginTasksResponse, + PluginVersionsResponse, + SuccessResponse, +) register_enum_models( console_ns, @@ -227,6 +296,7 @@ class PluginDebuggingKeyApi(Resource): @console_ns.route("/workspaces/current/plugin/list") class PluginListApi(Resource): @console_ns.doc(params=query_params_from_model(ParserList)) + @console_ns.response(200, "Success", console_ns.models[PluginListResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -245,6 +315,7 @@ class PluginListApi(Resource): @console_ns.route("/workspaces/current/plugin/list/latest-versions") class PluginListLatestVersionsApi(Resource): @console_ns.expect(console_ns.models[ParserLatest.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginVersionsResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -262,6 +333,7 @@ class PluginListLatestVersionsApi(Resource): @console_ns.route("/workspaces/current/plugin/list/installations/ids") class PluginListInstallationsFromIdsApi(Resource): @console_ns.expect(console_ns.models[ParserLatest.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginInstallationsResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -280,6 +352,7 @@ class PluginListInstallationsFromIdsApi(Resource): @console_ns.route("/workspaces/current/plugin/icon") class PluginIconApi(Resource): @console_ns.doc(params=query_params_from_model(ParserIcon)) + @console_ns.response(200, "Success", console_ns.models[BinaryFileResponse.__name__]) @setup_required def get(self): args = ParserIcon.model_validate(request.args.to_dict(flat=True)) @@ -296,6 +369,7 @@ class PluginIconApi(Resource): @console_ns.route("/workspaces/current/plugin/asset") class PluginAssetApi(Resource): @console_ns.doc(params=query_params_from_model(ParserAsset)) + @console_ns.response(200, "Success", console_ns.models[BinaryFileResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -312,6 +386,7 @@ class PluginAssetApi(Resource): @console_ns.route("/workspaces/current/plugin/upload/pkg") class PluginUploadFromPkgApi(Resource): + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -331,6 +406,7 @@ class PluginUploadFromPkgApi(Resource): @console_ns.route("/workspaces/current/plugin/upload/github") class PluginUploadFromGithubApi(Resource): @console_ns.expect(console_ns.models[ParserGithubUpload.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -349,6 +425,7 @@ class PluginUploadFromGithubApi(Resource): @console_ns.route("/workspaces/current/plugin/upload/bundle") class PluginUploadFromBundleApi(Resource): + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -368,6 +445,7 @@ class PluginUploadFromBundleApi(Resource): @console_ns.route("/workspaces/current/plugin/install/pkg") class PluginInstallFromPkgApi(Resource): @console_ns.expect(console_ns.models[ParserPluginIdentifiers.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -387,6 +465,7 @@ class PluginInstallFromPkgApi(Resource): @console_ns.route("/workspaces/current/plugin/install/github") class PluginInstallFromGithubApi(Resource): @console_ns.expect(console_ns.models[ParserGithubInstall.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -412,6 +491,7 @@ class PluginInstallFromGithubApi(Resource): @console_ns.route("/workspaces/current/plugin/install/marketplace") class PluginInstallFromMarketplaceApi(Resource): @console_ns.expect(console_ns.models[ParserPluginIdentifiers.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -431,6 +511,7 @@ class PluginInstallFromMarketplaceApi(Resource): @console_ns.route("/workspaces/current/plugin/marketplace/pkg") class PluginFetchMarketplacePkgApi(Resource): @console_ns.doc(params=query_params_from_model(ParserPluginIdentifierQuery)) + @console_ns.response(200, "Success", console_ns.models[PluginManifestResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -455,6 +536,7 @@ class PluginFetchMarketplacePkgApi(Resource): @console_ns.route("/workspaces/current/plugin/fetch-manifest") class PluginFetchManifestApi(Resource): @console_ns.doc(params=query_params_from_model(ParserPluginIdentifierQuery)) + @console_ns.response(200, "Success", console_ns.models[PluginManifestResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -474,6 +556,7 @@ class PluginFetchManifestApi(Resource): @console_ns.route("/workspaces/current/plugin/tasks") class PluginFetchInstallTasksApi(Resource): @console_ns.doc(params=query_params_from_model(ParserTasks)) + @console_ns.response(200, "Success", console_ns.models[PluginTasksResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -490,6 +573,7 @@ class PluginFetchInstallTasksApi(Resource): @console_ns.route("/workspaces/current/plugin/tasks/") class PluginFetchInstallTaskApi(Resource): + @console_ns.response(200, "Success", console_ns.models[PluginTaskResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -550,6 +634,7 @@ class PluginDeleteInstallTaskItemApi(Resource): @console_ns.route("/workspaces/current/plugin/upgrade/marketplace") class PluginUpgradeFromMarketplaceApi(Resource): @console_ns.expect(console_ns.models[ParserMarketplaceUpgrade.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -571,6 +656,7 @@ class PluginUpgradeFromMarketplaceApi(Resource): @console_ns.route("/workspaces/current/plugin/upgrade/github") class PluginUpgradeFromGithubApi(Resource): @console_ns.expect(console_ns.models[ParserGithubUpgrade.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDaemonOperationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -636,6 +722,7 @@ class PluginChangePermissionApi(Resource): @console_ns.route("/workspaces/current/plugin/permission/fetch") class PluginFetchPermissionApi(Resource): + @console_ns.response(200, "Success", console_ns.models[PluginPermissionResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -661,6 +748,7 @@ class PluginFetchPermissionApi(Resource): @console_ns.route("/workspaces/current/plugin/parameters/dynamic-options") class PluginFetchDynamicSelectOptionsApi(Resource): @console_ns.doc(params=query_params_from_model(ParserDynamicOptions)) + @console_ns.response(200, "Success", console_ns.models[PluginDynamicOptionsResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -690,6 +778,7 @@ class PluginFetchDynamicSelectOptionsApi(Resource): @console_ns.route("/workspaces/current/plugin/parameters/dynamic-options-with-credentials") class PluginFetchDynamicSelectOptionsWithCredentialsApi(Resource): @console_ns.expect(console_ns.models[ParserDynamicOptionsWithCredentials.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginDynamicOptionsResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -720,6 +809,7 @@ class PluginFetchDynamicSelectOptionsWithCredentialsApi(Resource): @console_ns.route("/workspaces/current/plugin/preferences/change") class PluginChangePreferencesApi(Resource): @console_ns.expect(console_ns.models[ParserPreferencesChange.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginOperationSuccessResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -770,6 +860,7 @@ class PluginChangePreferencesApi(Resource): @console_ns.route("/workspaces/current/plugin/preferences/fetch") class PluginFetchPreferencesApi(Resource): + @console_ns.response(200, "Success", console_ns.models[PluginPreferencesResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -809,6 +900,7 @@ class PluginFetchPreferencesApi(Resource): @console_ns.route("/workspaces/current/plugin/preferences/autoupgrade/exclude") class PluginAutoUpgradeExcludePluginApi(Resource): @console_ns.expect(console_ns.models[ParserExcludePlugin.__name__]) + @console_ns.response(200, "Success", console_ns.models[PluginOperationSuccessResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -823,6 +915,7 @@ class PluginAutoUpgradeExcludePluginApi(Resource): @console_ns.route("/workspaces/current/plugin/readme") class PluginReadmeApi(Resource): @console_ns.doc(params=query_params_from_model(ParserReadme)) + @console_ns.response(200, "Success", console_ns.models[PluginReadmeResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/workspace/snippets.py b/api/controllers/console/workspace/snippets.py index ca27066ef1..4bd493d25e 100644 --- a/api/controllers/console/workspace/snippets.py +++ b/api/controllers/console/workspace/snippets.py @@ -1,14 +1,17 @@ import logging import re +from typing import Any from urllib.parse import quote from flask import Response, request from flask_restx import Resource, marshal +from pydantic import RootModel from sqlalchemy.orm import Session, sessionmaker from werkzeug.datastructures import MultiDict from werkzeug.exceptions import NotFound -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.fields import TextFileResponse +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.snippets.payloads import ( CreateSnippetPayload, @@ -25,6 +28,7 @@ from controllers.console.wraps import ( with_current_user, ) from extensions.ext_database import db +from fields.base import ResponseModel from fields.snippet_fields import snippet_fields, snippet_list_fields, snippet_pagination_fields from libs.login import login_required from models import Account @@ -38,6 +42,19 @@ _TAG_IDS_BRACKET_PATTERN = re.compile(r"^tag_ids\[(\d+)\]$") _CREATOR_IDS_BRACKET_PATTERN = re.compile(r"^creator_ids\[(\d+)\]$") +class SnippetImportResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class SnippetDependencyCheckResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class SnippetUseCountResponse(ResponseModel): + result: str + use_count: int + + def _snippet_service() -> SnippetService: return SnippetService(sessionmaker(bind=db.engine, expire_on_commit=False)) @@ -79,6 +96,13 @@ register_schema_models( SnippetImportPayload, IncludeSecretQuery, ) +register_response_schema_models( + console_ns, + TextFileResponse, + SnippetImportResponse, + SnippetDependencyCheckResponse, + SnippetUseCountResponse, +) # Create namespace models for marshaling snippet_model = console_ns.model("Snippet", snippet_fields) @@ -260,7 +284,8 @@ class CustomizedSnippetExportApi(Resource): @console_ns.doc("export_customized_snippet") @console_ns.doc(description="Export snippet configuration as DSL") @console_ns.doc(params={"snippet_id": "Snippet ID to export"}) - @console_ns.response(200, "Snippet exported successfully") + @console_ns.doc(params=query_params_from_model(IncludeSecretQuery)) + @console_ns.response(200, "Snippet exported successfully", console_ns.models[TextFileResponse.__name__]) @console_ns.response(404, "Snippet not found") @setup_required @login_required @@ -304,8 +329,8 @@ class CustomizedSnippetImportApi(Resource): @console_ns.doc("import_customized_snippet") @console_ns.doc(description="Import snippet from DSL") @console_ns.expect(console_ns.models.get(SnippetImportPayload.__name__)) - @console_ns.response(200, "Snippet imported successfully") - @console_ns.response(202, "Import pending confirmation") + @console_ns.response(200, "Snippet imported successfully", console_ns.models[SnippetImportResponse.__name__]) + @console_ns.response(202, "Import pending confirmation", console_ns.models[SnippetImportResponse.__name__]) @console_ns.response(400, "Import failed") @setup_required @login_required @@ -343,7 +368,7 @@ class CustomizedSnippetImportConfirmApi(Resource): @console_ns.doc("confirm_snippet_import") @console_ns.doc(description="Confirm a pending snippet import") @console_ns.doc(params={"import_id": "Import ID to confirm"}) - @console_ns.response(200, "Import confirmed successfully") + @console_ns.response(200, "Import confirmed successfully", console_ns.models[SnippetImportResponse.__name__]) @console_ns.response(400, "Import failed") @setup_required @login_required @@ -367,7 +392,11 @@ class CustomizedSnippetCheckDependenciesApi(Resource): @console_ns.doc("check_snippet_dependencies") @console_ns.doc(description="Check dependencies for a snippet") @console_ns.doc(params={"snippet_id": "Snippet ID"}) - @console_ns.response(200, "Dependencies checked successfully") + @console_ns.response( + 200, + "Dependencies checked successfully", + console_ns.models[SnippetDependencyCheckResponse.__name__], + ) @console_ns.response(404, "Snippet not found") @setup_required @login_required @@ -397,7 +426,7 @@ class CustomizedSnippetUseCountIncrementApi(Resource): @console_ns.doc("increment_snippet_use_count") @console_ns.doc(description="Increment snippet use count by 1") @console_ns.doc(params={"snippet_id": "Snippet ID"}) - @console_ns.response(200, "Use count incremented successfully") + @console_ns.response(200, "Use count incremented successfully", console_ns.models[SnippetUseCountResponse.__name__]) @console_ns.response(404, "Snippet not found") @setup_required @login_required diff --git a/api/controllers/console/workspace/tool_providers.py b/api/controllers/console/workspace/tool_providers.py index 4f1fd6be0a..94600f3886 100644 --- a/api/controllers/console/workspace/tool_providers.py +++ b/api/controllers/console/workspace/tool_providers.py @@ -5,13 +5,13 @@ from urllib.parse import urlparse from flask import make_response, redirect, request, send_file from flask_restx import Resource -from pydantic import BaseModel, Field, HttpUrl, field_validator, model_validator +from pydantic import BaseModel, Field, HttpUrl, RootModel, field_validator, model_validator from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import Forbidden from configs import dify_config -from controllers.common.fields import SimpleResultResponse -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.fields import BinaryFileResponse, RedirectResponse, SimpleResultResponse +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console import console_ns from controllers.console.wraps import ( account_initialization_required, @@ -26,7 +26,7 @@ from core.entities.mcp_provider import IdentityMode, MCPAuthentication, MCPConfi from core.mcp.auth.auth_flow import auth, handle_callback from core.mcp.error import MCPAuthError, MCPError, MCPRefreshTokenError from core.mcp.mcp_client import MCPClient -from core.plugin.entities.plugin_daemon import CredentialType +from core.plugin.entities.plugin_daemon import CredentialType, PluginOAuthAuthorizationUrlResponse from core.plugin.impl.oauth import OAuthHandler from core.tools.entities.tool_entities import ApiProviderSchemaType, WorkflowToolParameterConfiguration from extensions.ext_database import db @@ -77,7 +77,7 @@ class BuiltinToolAddPayload(BaseModel): class BuiltinToolUpdatePayload(BaseModel): credential_id: str - credentials: dict[str, Any] | None = None + credentials: dict[str, Any] | None = Field(default=None) name: str | None = Field(default=None, max_length=30) @@ -108,6 +108,13 @@ class ProviderQuery(BaseModel): provider: str +class BuiltinCredentialListQuery(BaseModel): + include_credential_ids: list[str] = Field( + default_factory=list, + description="Credential IDs to include even if visibility would hide them", + ) + + class ApiToolProviderDeletePayload(BaseModel): provider: str @@ -199,7 +206,7 @@ class BuiltinProviderDefaultCredentialPayload(BaseModel): class ToolOAuthCustomClientPayload(BaseModel): - client_params: dict[str, Any] | None = None + client_params: dict[str, Any] | None = Field(default=None) enable_oauth_custom_client: bool | None = True @@ -261,8 +268,27 @@ class MCPCallbackQuery(BaseModel): state: str +class ToolOAuthCustomClientResponse(RootModel[dict[str, Any]]): + root: dict[str, Any] + + +class ToolOAuthClientSchemaResponse(RootModel[list[dict[str, Any]]]): + root: list[dict[str, Any]] + + +class ToolProviderOpaqueResponse(RootModel[Any]): + root: Any + + register_schema_models( console_ns, + ToolProviderListQuery, + UrlQuery, + ProviderQuery, + BuiltinCredentialListQuery, + WorkflowToolGetQuery, + WorkflowToolListQuery, + MCPCallbackQuery, BuiltinToolCredentialDeletePayload, BuiltinToolAddPayload, BuiltinToolUpdatePayload, @@ -281,11 +307,22 @@ register_schema_models( MCPProviderDeletePayload, MCPAuthPayload, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models( + console_ns, + BinaryFileResponse, + PluginOAuthAuthorizationUrlResponse, + RedirectResponse, + SimpleResultResponse, + ToolOAuthClientSchemaResponse, + ToolOAuthCustomClientResponse, + ToolProviderOpaqueResponse, +) @console_ns.route("/workspaces/current/tool-providers") class ToolProviderListApi(Resource): + @console_ns.doc(params=query_params_from_model(ToolProviderListQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -300,6 +337,7 @@ class ToolProviderListApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//tools") class ToolBuiltinProviderListToolsApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -315,6 +353,7 @@ class ToolBuiltinProviderListToolsApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//info") class ToolBuiltinProviderInfoApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -326,6 +365,7 @@ class ToolBuiltinProviderInfoApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//delete") class ToolBuiltinProviderDeleteApi(Resource): @console_ns.expect(console_ns.models[BuiltinToolCredentialDeletePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -344,6 +384,7 @@ class ToolBuiltinProviderDeleteApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//add") class ToolBuiltinProviderAddApi(Resource): @console_ns.expect(console_ns.models[BuiltinToolAddPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -366,6 +407,7 @@ class ToolBuiltinProviderAddApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//update") class ToolBuiltinProviderUpdateApi(Resource): @console_ns.expect(console_ns.models[BuiltinToolUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -388,6 +430,8 @@ class ToolBuiltinProviderUpdateApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//credentials") class ToolBuiltinProviderGetCredentialsApi(Resource): + @console_ns.doc(params=query_params_from_model(BuiltinCredentialListQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -412,6 +456,7 @@ class ToolBuiltinProviderGetCredentialsApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//icon") class ToolBuiltinProviderIconApi(Resource): + @console_ns.response(200, "Success", console_ns.models[BinaryFileResponse.__name__]) @setup_required def get(self, provider: str): icon_bytes, mimetype = BuiltinToolManageService.get_builtin_tool_provider_icon(provider) @@ -422,6 +467,7 @@ class ToolBuiltinProviderIconApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/add") class ToolApiProviderAddApi(Resource): @console_ns.expect(console_ns.models[ApiToolProviderAddPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -447,6 +493,8 @@ class ToolApiProviderAddApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/remote") class ToolApiProviderGetRemoteSchemaApi(Resource): + @console_ns.doc(params=query_params_from_model(UrlQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -465,6 +513,8 @@ class ToolApiProviderGetRemoteSchemaApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/tools") class ToolApiProviderListToolsApi(Resource): + @console_ns.doc(params=query_params_from_model(ProviderQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -486,6 +536,7 @@ class ToolApiProviderListToolsApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/update") class ToolApiProviderUpdateApi(Resource): @console_ns.expect(console_ns.models[ApiToolProviderUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -513,6 +564,7 @@ class ToolApiProviderUpdateApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/delete") class ToolApiProviderDeleteApi(Resource): @console_ns.expect(console_ns.models[ApiToolProviderDeletePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -531,6 +583,8 @@ class ToolApiProviderDeleteApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/get") class ToolApiProviderGetApi(Resource): + @console_ns.doc(params=query_params_from_model(ProviderQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -549,6 +603,7 @@ class ToolApiProviderGetApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//credential/schema/") class ToolBuiltinProviderCredentialsSchemaApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -564,6 +619,7 @@ class ToolBuiltinProviderCredentialsSchemaApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/schema") class ToolApiProviderSchemaApi(Resource): @console_ns.expect(console_ns.models[ApiToolSchemaPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -578,6 +634,7 @@ class ToolApiProviderSchemaApi(Resource): @console_ns.route("/workspaces/current/tool-provider/api/test/pre") class ToolApiProviderPreviousTestApi(Resource): @console_ns.expect(console_ns.models[ApiToolTestPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -598,6 +655,7 @@ class ToolApiProviderPreviousTestApi(Resource): @console_ns.route("/workspaces/current/tool-provider/workflow/create") class ToolWorkflowProviderCreateApi(Resource): @console_ns.expect(console_ns.models[WorkflowToolCreatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -624,6 +682,7 @@ class ToolWorkflowProviderCreateApi(Resource): @console_ns.route("/workspaces/current/tool-provider/workflow/update") class ToolWorkflowProviderUpdateApi(Resource): @console_ns.expect(console_ns.models[WorkflowToolUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -650,6 +709,7 @@ class ToolWorkflowProviderUpdateApi(Resource): @console_ns.route("/workspaces/current/tool-provider/workflow/delete") class ToolWorkflowProviderDeleteApi(Resource): @console_ns.expect(console_ns.models[WorkflowToolDeletePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -668,6 +728,8 @@ class ToolWorkflowProviderDeleteApi(Resource): @console_ns.route("/workspaces/current/tool-provider/workflow/get") class ToolWorkflowProviderGetApi(Resource): + @console_ns.doc(params=query_params_from_model(WorkflowToolGetQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -697,6 +759,8 @@ class ToolWorkflowProviderGetApi(Resource): @console_ns.route("/workspaces/current/tool-provider/workflow/tools") class ToolWorkflowProviderListToolApi(Resource): + @console_ns.doc(params=query_params_from_model(WorkflowToolListQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -717,6 +781,7 @@ class ToolWorkflowProviderListToolApi(Resource): @console_ns.route("/workspaces/current/tools/builtin") class ToolBuiltinListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -736,6 +801,7 @@ class ToolBuiltinListApi(Resource): @console_ns.route("/workspaces/current/tools/api") class ToolApiListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -753,6 +819,7 @@ class ToolApiListApi(Resource): @console_ns.route("/workspaces/current/tools/workflow") class ToolWorkflowListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -772,6 +839,7 @@ class ToolWorkflowListApi(Resource): @console_ns.route("/workspaces/current/tool-labels") class ToolLabelsApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -782,6 +850,11 @@ class ToolLabelsApi(Resource): @console_ns.route("/oauth/plugin//tool/authorization-url") class ToolPluginOAuthApi(Resource): + @console_ns.response( + 200, + "Authorization URL retrieved successfully", + console_ns.models[PluginOAuthAuthorizationUrlResponse.__name__], + ) @setup_required @login_required @is_admin_or_owner_required @@ -823,6 +896,11 @@ class ToolPluginOAuthApi(Resource): @console_ns.route("/oauth/plugin//tool/callback") class ToolOAuthCallback(Resource): + @console_ns.response( + 302, + "Redirect to console OAuth callback page", + console_ns.models[RedirectResponse.__name__], + ) @setup_required def get(self, provider: str): context_id = request.cookies.get("context_id") @@ -877,6 +955,7 @@ class ToolOAuthCallback(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//default-credential") class ToolBuiltinProviderSetDefaultApi(Resource): @console_ns.expect(console_ns.models[BuiltinProviderDefaultCredentialPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -892,6 +971,7 @@ class ToolBuiltinProviderSetDefaultApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//oauth/custom-client") class ToolOAuthCustomClient(Resource): @console_ns.expect(console_ns.models[ToolOAuthCustomClientPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -912,6 +992,7 @@ class ToolOAuthCustomClient(Resource): @setup_required @login_required @account_initialization_required + @console_ns.response(200, "Success", console_ns.models[ToolOAuthCustomClientResponse.__name__]) @with_current_tenant_id def get(self, current_tenant_id: str, provider: str): return jsonable_encoder( @@ -921,6 +1002,7 @@ class ToolOAuthCustomClient(Resource): @setup_required @login_required @account_initialization_required + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @with_current_tenant_id def delete(self, current_tenant_id: str, provider: str): return jsonable_encoder( @@ -930,6 +1012,7 @@ class ToolOAuthCustomClient(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//oauth/client-schema") class ToolBuiltinProviderGetOauthClientSchemaApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolOAuthClientSchemaResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -944,6 +1027,8 @@ class ToolBuiltinProviderGetOauthClientSchemaApi(Resource): @console_ns.route("/workspaces/current/tool-provider/builtin//credential/info") class ToolBuiltinProviderGetCredentialInfoApi(Resource): + @console_ns.doc(params=query_params_from_model(BuiltinCredentialListQuery)) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -967,6 +1052,7 @@ class ToolBuiltinProviderGetCredentialInfoApi(Resource): @console_ns.route("/workspaces/current/tool-provider/mcp") class ToolProviderMCPApi(Resource): @console_ns.expect(console_ns.models[MCPProviderCreatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1021,6 +1107,7 @@ class ToolProviderMCPApi(Resource): return jsonable_encoder(result) @console_ns.expect(console_ns.models[MCPProviderUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1091,6 +1178,7 @@ class ToolProviderMCPApi(Resource): @console_ns.route("/workspaces/current/tool-provider/mcp/auth") class ToolMCPAuthApi(Resource): @console_ns.expect(console_ns.models[MCPAuthPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1164,6 +1252,7 @@ class ToolMCPAuthApi(Resource): @console_ns.route("/workspaces/current/tool-provider/mcp/tools/") class ToolMCPDetailApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1177,6 +1266,7 @@ class ToolMCPDetailApi(Resource): @console_ns.route("/workspaces/current/tools/mcp") class ToolMCPListAllApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1192,6 +1282,7 @@ class ToolMCPListAllApi(Resource): @console_ns.route("/workspaces/current/tool-provider/mcp/update/") class ToolMCPUpdateApi(Resource): + @console_ns.response(200, "Success", console_ns.models[ToolProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -1208,6 +1299,12 @@ class ToolMCPUpdateApi(Resource): @console_ns.route("/mcp/oauth/callback") class ToolMCPCallbackApi(Resource): + @console_ns.doc(params=query_params_from_model(MCPCallbackQuery)) + @console_ns.response( + 302, + "Redirect to console OAuth callback page", + console_ns.models[RedirectResponse.__name__], + ) def get(self): raw_args = request.args.to_dict() query = MCPCallbackQuery.model_validate(raw_args) diff --git a/api/controllers/console/workspace/trigger_providers.py b/api/controllers/console/workspace/trigger_providers.py index d862ba4ff4..ff1a5c18bd 100644 --- a/api/controllers/console/workspace/trigger_providers.py +++ b/api/controllers/console/workspace/trigger_providers.py @@ -3,13 +3,13 @@ from typing import Any from flask import make_response, redirect, request from flask_restx import Resource -from pydantic import BaseModel, model_validator +from pydantic import BaseModel, Field, RootModel, model_validator from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import BadRequest, Forbidden from configs import dify_config from controllers.common.errors import NotFoundError -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import BinaryFileResponse, RedirectResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from core.plugin.entities.plugin_daemon import CredentialType from core.plugin.impl.oauth import OAuthHandler @@ -48,9 +48,9 @@ class TriggerSubscriptionBuilderVerifyPayload(BaseModel): class TriggerSubscriptionBuilderUpdatePayload(BaseModel): name: str | None = None - parameters: dict[str, Any] | None = None - properties: dict[str, Any] | None = None - credentials: dict[str, Any] | None = None + parameters: dict[str, Any] | None = Field(default=None) + properties: dict[str, Any] | None = Field(default=None) + credentials: dict[str, Any] | None = Field(default=None) @model_validator(mode="after") def check_at_least_one_field(self): @@ -60,10 +60,30 @@ class TriggerSubscriptionBuilderUpdatePayload(BaseModel): class TriggerOAuthClientPayload(BaseModel): - client_params: dict[str, Any] | None = None + client_params: dict[str, Any] | None = Field(default=None) enabled: bool | None = None +class TriggerOAuthAuthorizeResponse(BaseModel): + authorization_url: str + subscription_builder_id: str + subscription_builder: Any + + +class TriggerOAuthClientResponse(BaseModel): + configured: bool + system_configured: bool + custom_configured: bool + oauth_client_schema: Any + custom_enabled: bool + redirect_uri: str + params: dict[str, Any] + + +class TriggerProviderOpaqueResponse(RootModel[Any]): + root: Any + + register_schema_models( console_ns, TriggerSubscriptionBuilderCreatePayload, @@ -71,11 +91,20 @@ register_schema_models( TriggerSubscriptionBuilderUpdatePayload, TriggerOAuthClientPayload, ) -register_response_schema_models(console_ns, SimpleResultResponse) +register_response_schema_models( + console_ns, + BinaryFileResponse, + RedirectResponse, + SimpleResultResponse, + TriggerOAuthAuthorizeResponse, + TriggerOAuthClientResponse, + TriggerProviderOpaqueResponse, +) @console_ns.route("/workspaces/current/trigger-provider//icon") class TriggerProviderIconApi(Resource): + @console_ns.response(200, "Success", console_ns.models[BinaryFileResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -86,6 +115,7 @@ class TriggerProviderIconApi(Resource): @console_ns.route("/workspaces/current/triggers") class TriggerProviderListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -97,6 +127,7 @@ class TriggerProviderListApi(Resource): @console_ns.route("/workspaces/current/trigger-provider//info") class TriggerProviderInfoApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -108,6 +139,7 @@ class TriggerProviderInfoApi(Resource): @console_ns.route("/workspaces/current/trigger-provider//subscriptions/list") class TriggerSubscriptionListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -136,6 +168,7 @@ class TriggerSubscriptionListApi(Resource): ) class TriggerSubscriptionBuilderCreateApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderCreatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -164,6 +197,7 @@ class TriggerSubscriptionBuilderCreateApi(Resource): "/workspaces/current/trigger-provider//subscriptions/builder/", ) class TriggerSubscriptionBuilderGetApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -180,6 +214,7 @@ class TriggerSubscriptionBuilderGetApi(Resource): ) class TriggerSubscriptionBuilderVerifyApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderVerifyPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -211,6 +246,7 @@ class TriggerSubscriptionBuilderVerifyApi(Resource): ) class TriggerSubscriptionBuilderUpdateApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -242,6 +278,7 @@ class TriggerSubscriptionBuilderUpdateApi(Resource): "/workspaces/current/trigger-provider//subscriptions/builder/logs/", ) class TriggerSubscriptionBuilderLogsApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -261,6 +298,7 @@ class TriggerSubscriptionBuilderLogsApi(Resource): ) class TriggerSubscriptionBuilderBuildApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -294,6 +332,7 @@ class TriggerSubscriptionBuilderBuildApi(Resource): ) class TriggerSubscriptionUpdateApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderUpdatePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -382,6 +421,11 @@ class TriggerSubscriptionDeleteApi(Resource): @console_ns.route("/workspaces/current/trigger-provider//subscriptions/oauth/authorize") class TriggerOAuthAuthorizeApi(Resource): + @console_ns.response( + 200, + "Authorization URL retrieved successfully", + console_ns.models[TriggerOAuthAuthorizeResponse.__name__], + ) @setup_required @login_required @account_initialization_required @@ -463,6 +507,11 @@ class TriggerOAuthAuthorizeApi(Resource): @console_ns.route("/oauth/plugin//trigger/callback") class TriggerOAuthCallbackApi(Resource): + @console_ns.response( + 302, + "Redirect to console OAuth callback page", + console_ns.models[RedirectResponse.__name__], + ) @setup_required def get(self, provider: str): """Handle OAuth callback for trigger provider""" @@ -528,6 +577,7 @@ class TriggerOAuthCallbackApi(Resource): @console_ns.route("/workspaces/current/trigger-provider//oauth/client") class TriggerOAuthClientManageApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TriggerOAuthClientResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -572,6 +622,7 @@ class TriggerOAuthClientManageApi(Resource): raise @console_ns.expect(console_ns.models[TriggerOAuthClientPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @setup_required @login_required @is_admin_or_owner_required @@ -600,6 +651,7 @@ class TriggerOAuthClientManageApi(Resource): @login_required @is_admin_or_owner_required @account_initialization_required + @console_ns.response(200, "Success", console_ns.models[SimpleResultResponse.__name__]) @with_current_tenant_id def delete(self, tenant_id: str, provider: str): """Remove custom OAuth client configuration""" @@ -622,6 +674,7 @@ class TriggerOAuthClientManageApi(Resource): ) class TriggerSubscriptionVerifyApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderVerifyPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) @setup_required @login_required @edit_permission_required diff --git a/api/controllers/console/workspace/workspace.py b/api/controllers/console/workspace/workspace.py index ad41290987..7cf88e4453 100644 --- a/api/controllers/console/workspace/workspace.py +++ b/api/controllers/console/workspace/workspace.py @@ -96,6 +96,76 @@ class TenantInfoResponse(ResponseModel): return to_timestamp(value) +class TenantListItemResponse(ResponseModel): + id: str + name: str | None = None + plan: str | None = None + status: str | None = None + created_at: int | None = None + current: bool + + @field_validator("plan", "status", mode="before") + @classmethod + def _normalize_enum_like(cls, value): + if value is None: + return None + if isinstance(value, str): + return value + return str(getattr(value, "value", value)) + + @field_validator("created_at", mode="before") + @classmethod + def _normalize_created_at(cls, value: datetime | int | None): + return to_timestamp(value) + + +class TenantListResponse(ResponseModel): + workspaces: list[TenantListItemResponse] + + +class WorkspaceListItemResponse(ResponseModel): + id: str + name: str | None = None + status: str | None = None + created_at: int | None = None + + @field_validator("status", mode="before") + @classmethod + def _normalize_status(cls, value): + if value is None: + return None + if isinstance(value, str): + return value + return str(getattr(value, "value", value)) + + @field_validator("created_at", mode="before") + @classmethod + def _normalize_created_at(cls, value: datetime | int | None): + return to_timestamp(value) + + +class WorkspaceListResponse(ResponseModel): + data: list[WorkspaceListItemResponse] + has_more: bool + limit: int + page: int + total: int + + +class SwitchWorkspaceResponse(ResponseModel): + result: str + new_tenant: TenantInfoResponse + + +class WorkspaceMutationResponse(ResponseModel): + result: str + tenant: TenantInfoResponse + + +class WorkspaceLogoUploadResponse(ResponseModel): + id: str + + class WorkspacePermissionResponse(ResponseModel): workspace_id: str allow_member_invite: bool @@ -112,6 +182,11 @@ register_schema_models( register_response_schema_models( console_ns, TenantInfoResponse, + TenantListResponse, + WorkspaceListResponse, + SwitchWorkspaceResponse, + WorkspaceMutationResponse, + WorkspaceLogoUploadResponse, WorkspaceCustomConfigResponse, WorkspacePermissionResponse, ) @@ -152,6 +227,7 @@ workspace_fields = {"id": fields.String, "name": fields.String, "status": fields @console_ns.route("/workspaces") class TenantListApi(Resource): + @console_ns.response(200, "Success", console_ns.models[TenantListResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -202,6 +278,7 @@ class TenantListApi(Resource): @console_ns.route("/all-workspaces") class WorkspaceListApi(Resource): @console_ns.doc(params=query_params_from_model(WorkspaceListQuery)) + @console_ns.response(200, "Success", console_ns.models[WorkspaceListResponse.__name__]) @setup_required @admin_required def get(self): @@ -256,6 +333,7 @@ class TenantApi(Resource): @console_ns.route("/workspaces/switch") class SwitchWorkspaceApi(Resource): @console_ns.expect(console_ns.models[SwitchWorkspacePayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[SwitchWorkspaceResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -280,6 +358,7 @@ class SwitchWorkspaceApi(Resource): @console_ns.route("/workspaces/custom-config") class CustomConfigWorkspaceApi(Resource): @console_ns.expect(console_ns.models[WorkspaceCustomConfigPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[WorkspaceMutationResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -307,6 +386,7 @@ class CustomConfigWorkspaceApi(Resource): @console_ns.route("/workspaces/custom-config/webapp-logo/upload") class WebappLogoWorkspaceApi(Resource): + @console_ns.response(201, "Logo uploaded", console_ns.models[WorkspaceLogoUploadResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -348,6 +428,7 @@ class WebappLogoWorkspaceApi(Resource): @console_ns.route("/workspaces/info") class WorkspaceInfoApi(Resource): @console_ns.expect(console_ns.models[WorkspaceInfoPayload.__name__]) + @console_ns.response(200, "Success", console_ns.models[WorkspaceMutationResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/openapi/__init__.py b/api/controllers/openapi/__init__.py index a117c18064..e8406ea00c 100644 --- a/api/controllers/openapi/__init__.py +++ b/api/controllers/openapi/__init__.py @@ -20,6 +20,7 @@ openapi_ns = Namespace("openapi", description="User-scoped operations", path="/" # Register response/query models BEFORE importing controller modules so that # @openapi_ns.response / @openapi_ns.expect decorators can resolve model names. +from controllers.common.fields import EventStreamResponse from controllers.common.schema import register_enum_models, register_response_schema_models, register_schema_models from controllers.openapi._models import ( AccountPayload, @@ -42,8 +43,10 @@ from controllers.openapi._models import ( DeviceMutateRequest, DeviceMutateResponse, DevicePollRequest, + DeviceTokenResponse, FormSubmitResponse, HealthResponse, + HumanInputFormDefinitionResponse, MemberActionResponse, MemberInvitePayload, MemberInviteResponse, @@ -92,6 +95,7 @@ register_schema_models( register_response_schema_models( openapi_ns, ErrorBody, + EventStreamResponse, TagItem, UsageInfo, MessageMetadata, @@ -120,7 +124,9 @@ register_response_schema_models( MemberActionResponse, TaskStopResponse, FormSubmitResponse, + HumanInputFormDefinitionResponse, DeviceCodeResponse, + DeviceTokenResponse, DeviceLookupResponse, DeviceMutateResponse, FileResponse, diff --git a/api/controllers/openapi/_models.py b/api/controllers/openapi/_models.py index a80ab63b42..7c225c85f6 100644 --- a/api/controllers/openapi/_models.py +++ b/api/controllers/openapi/_models.py @@ -87,12 +87,8 @@ class AppDescribeInfo(AppInfoResponse): class AppDescribeResponse(BaseModel): info: AppDescribeInfo | None = None - # `parameters` (the app-config blob) and `input_schema` (a Draft 2020-12 JSON Schema derived - # per-app) are deliberately open JSON, not under-annotated. The `x-dify-opaque` marker tells the - # contract generator's readiness detector to treat them as intentional, so the route is not - # flagged "annotations incomplete". CLI/web consume them as opaque objects either way. - parameters: dict[str, Any] | None = Field(default=None, json_schema_extra={"x-dify-opaque": True}) - input_schema: dict[str, Any] | None = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + parameters: dict[str, Any] | None = Field(default=None) + input_schema: dict[str, Any] | None = Field(default=None) class ChatMessageResponse(BaseModel): @@ -150,6 +146,18 @@ class WorkspacePayload(BaseModel): role: str +class DeviceTokenResponse(BaseModel): + token: str + expires_at: str + subject_type: Literal["account", "external_sso"] + account: AccountPayload | None = None + workspaces: list[WorkspacePayload] = [] + default_workspace_id: str | None = None + token_id: str + subject_email: str | None = None + subject_issuer: str | None = None + + class AccountResponse(BaseModel): subject_type: str subject_email: str | None = None @@ -292,7 +300,7 @@ class AppListQuery(BaseModel): class AppRunRequest(BaseModel): inputs: dict[str, Any] query: str | None = None - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) conversation_id: UUIDStrOrEmpty | None = None auto_generate_name: bool = True workflow_id: str | None = None @@ -469,3 +477,11 @@ class FormSubmitResponse(BaseModel): than an under-annotated open object.""" model_config = ConfigDict(extra="forbid") + + +class HumanInputFormDefinitionResponse(BaseModel): + form_content: str + inputs: list[dict[str, Any]] = Field(default_factory=list) + resolved_default_values: dict[str, str] + user_actions: list[dict[str, Any]] = Field(default_factory=list) + expiration_time: int | None = None diff --git a/api/controllers/openapi/app_run.py b/api/controllers/openapi/app_run.py index 3101b2de42..76ddd16659 100644 --- a/api/controllers/openapi/app_run.py +++ b/api/controllers/openapi/app_run.py @@ -18,6 +18,7 @@ from werkzeug.exceptions import ( ) import services +from controllers.common.fields import EventStreamResponse from controllers.openapi import openapi_ns from controllers.openapi._audit import emit_app_run from controllers.openapi._contract import accepts, returns @@ -136,7 +137,7 @@ _DISPATCH: dict[AppMode, Callable[[App, Any, AppRunRequest], Any]] = { @openapi_ns.route("/apps//run") class AppRunApi(Resource): @auth_router.guard(scope=Scope.APPS_RUN) - @openapi_ns.response(200, "Run result (SSE stream)") + @openapi_ns.response(200, "Run result (SSE stream)", openapi_ns.models[EventStreamResponse.__name__]) @accepts(body=AppRunRequest) def post(self, app_id: str, *, auth_data: AuthData, body: AppRunRequest): app_model, caller, caller_kind = auth_data.require_app_context() diff --git a/api/controllers/openapi/human_input_form.py b/api/controllers/openapi/human_input_form.py index e04dc8a1af..995315150c 100644 --- a/api/controllers/openapi/human_input_form.py +++ b/api/controllers/openapi/human_input_form.py @@ -18,7 +18,7 @@ from controllers.common.human_input import HumanInputFormSubmitPayload, stringif from controllers.common.schema import register_schema_models from controllers.openapi import openapi_ns from controllers.openapi._contract import accepts, returns -from controllers.openapi._models import FormSubmitResponse +from controllers.openapi._models import FormSubmitResponse, HumanInputFormDefinitionResponse from controllers.openapi.auth.composition import auth_router from controllers.openapi.auth.data import AuthData from core.workflow.human_input_policy import HumanInputSurface, is_recipient_type_allowed_for_surface @@ -57,7 +57,7 @@ def _ensure_form_is_allowed_for_openapi(form) -> None: @openapi_ns.route("/apps//form/human_input/") class OpenApiWorkflowHumanInputFormApi(Resource): - @openapi_ns.response(200, "Form definition") + @openapi_ns.response(200, "Form definition", openapi_ns.models[HumanInputFormDefinitionResponse.__name__]) @auth_router.guard(scope=Scope.APPS_RUN) def get(self, app_id: str, form_token: str, *, auth_data: AuthData): app_model, caller, caller_kind = auth_data.require_app_context() diff --git a/api/controllers/openapi/oauth_device.py b/api/controllers/openapi/oauth_device.py index e061f36a6b..cee187daaf 100644 --- a/api/controllers/openapi/oauth_device.py +++ b/api/controllers/openapi/oauth_device.py @@ -42,6 +42,7 @@ from controllers.openapi._models import ( DeviceMutateRequest, DeviceMutateResponse, DevicePollRequest, + DeviceTokenResponse, WorkspacePayload, ) from extensions.ext_database import db @@ -130,6 +131,7 @@ class OAuthDeviceTokenApi(Resource): """RFC 8628 poll.""" @openapi_ns.expect(openapi_ns.models[DevicePollRequest.__name__]) + @openapi_ns.response(200, "Device token", openapi_ns.models[DeviceTokenResponse.__name__]) def post(self): payload = _validate_json(DevicePollRequest) device_code = payload.device_code diff --git a/api/controllers/openapi/workflow_events.py b/api/controllers/openapi/workflow_events.py index f21306e491..61ebb3012d 100644 --- a/api/controllers/openapi/workflow_events.py +++ b/api/controllers/openapi/workflow_events.py @@ -13,9 +13,12 @@ from collections.abc import Generator from flask import Response, request from flask_restx import Resource +from pydantic import BaseModel, Field from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import NotFound, UnprocessableEntity +from controllers.common.fields import EventStreamResponse +from controllers.common.schema import query_params_from_model from controllers.openapi import openapi_ns from controllers.openapi.auth.composition import auth_router from controllers.openapi.auth.data import AuthData @@ -34,9 +37,15 @@ from repositories.factory import DifyAPIRepositoryFactory from services.workflow_event_snapshot_service import build_workflow_event_stream +class WorkflowEventsQuery(BaseModel): + include_state_snapshot: bool = Field(default=False, description="Whether to include workflow state snapshots") + continue_on_pause: bool = Field(default=False, description="Whether to keep the event stream open on pause") + + @openapi_ns.route("/apps//tasks//events") class OpenApiWorkflowEventsApi(Resource): - @openapi_ns.response(200, "SSE event stream") + @openapi_ns.doc(params=query_params_from_model(WorkflowEventsQuery)) + @openapi_ns.response(200, "SSE event stream", openapi_ns.models[EventStreamResponse.__name__]) @auth_router.guard(scope=Scope.APPS_RUN) def get(self, app_id: str, task_id: str, *, auth_data: AuthData): app_model, caller, caller_kind = auth_data.require_app_context() diff --git a/api/controllers/service_api/app/annotation.py b/api/controllers/service_api/app/annotation.py index 8906d544e8..e99018a985 100644 --- a/api/controllers/service_api/app/annotation.py +++ b/api/controllers/service_api/app/annotation.py @@ -6,12 +6,13 @@ from flask_restx import Resource from flask_restx.api import HTTPStatus from pydantic import BaseModel, Field, TypeAdapter -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console.wraps import edit_permission_required from controllers.service_api import service_api_ns from controllers.service_api.wraps import validate_app_token from extensions.ext_redis import redis_client from fields.annotation_fields import Annotation, AnnotationList +from fields.base import ResponseModel from models.model import App from services.annotation_service import ( AppAnnotationService, @@ -38,6 +39,12 @@ class AnnotationListQuery(BaseModel): keyword: str = Field(default="", description="Keyword to search annotations") +class AnnotationJobStatusResponse(ResponseModel): + job_id: str + job_status: str + error_msg: str | None = None + + register_schema_models( service_api_ns, AnnotationCreatePayload, @@ -46,6 +53,7 @@ register_schema_models( Annotation, AnnotationList, ) +register_response_schema_models(service_api_ns, AnnotationJobStatusResponse) @service_api_ns.route("/apps/annotation-reply/") @@ -60,6 +68,11 @@ class AnnotationReplyActionApi(Resource): 401: "Unauthorized - invalid API token", } ) + @service_api_ns.response( + 200, + "Action completed successfully", + service_api_ns.models[AnnotationJobStatusResponse.__name__], + ) @validate_app_token def post(self, app_model: App, action: Literal["enable", "disable"]): """Enable or disable annotation reply feature.""" @@ -89,6 +102,11 @@ class AnnotationReplyActionStatusApi(Resource): 404: "Job not found", } ) + @service_api_ns.response( + 200, + "Job status retrieved successfully", + service_api_ns.models[AnnotationJobStatusResponse.__name__], + ) @validate_app_token def get(self, app_model: App, job_id: UUID, action: str): """Get the status of an annotation reply action job.""" diff --git a/api/controllers/service_api/app/app.py b/api/controllers/service_api/app/app.py index 27b0d8753d..cc55876bd5 100644 --- a/api/controllers/service_api/app/app.py +++ b/api/controllers/service_api/app/app.py @@ -1,6 +1,7 @@ from typing import Any, cast from flask_restx import Resource +from pydantic import Field from controllers.common.fields import Parameters from controllers.common.schema import register_response_schema_models @@ -21,7 +22,11 @@ class AppInfoResponse(ResponseModel): author_name: str | None -register_response_schema_models(service_api_ns, AppInfoResponse) +class AppMetaResponse(ResponseModel): + tool_icons: dict[str, Any] = Field(default_factory=dict) + + +register_response_schema_models(service_api_ns, Parameters, AppMetaResponse, AppInfoResponse) @service_api_ns.route("/parameters") @@ -37,6 +42,7 @@ class AppParameterApi(Resource): 404: "Application not found", } ) + @service_api_ns.response(200, "Parameters retrieved successfully", service_api_ns.models[Parameters.__name__]) @validate_app_token def get(self, app_model: App): """Retrieve app parameters. @@ -74,6 +80,7 @@ class AppMetaApi(Resource): 404: "Application not found", } ) + @service_api_ns.response(200, "Metadata retrieved successfully", service_api_ns.models[AppMetaResponse.__name__]) @validate_app_token def get(self, app_model: App): """Get app metadata. diff --git a/api/controllers/service_api/app/audio.py b/api/controllers/service_api/app/audio.py index e818573b8f..0c2047a824 100644 --- a/api/controllers/service_api/app/audio.py +++ b/api/controllers/service_api/app/audio.py @@ -6,7 +6,8 @@ from werkzeug.exceptions import InternalServerError import services from controllers.common.controller_schemas import TextToAudioPayload -from controllers.common.schema import register_schema_model +from controllers.common.fields import AudioBinaryResponse, AudioTranscriptResponse +from controllers.common.schema import register_response_schema_models, register_schema_model from controllers.service_api import service_api_ns from controllers.service_api.app.error import ( AppUnavailableError, @@ -33,6 +34,8 @@ from services.errors.audio import ( logger = logging.getLogger(__name__) +register_response_schema_models(service_api_ns, AudioBinaryResponse, AudioTranscriptResponse) + @service_api_ns.route("/audio-to-text") class AudioApi(Resource): @@ -48,6 +51,11 @@ class AudioApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Audio successfully transcribed", + service_api_ns.models[AudioTranscriptResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.FORM)) def post(self, app_model: App, end_user: EndUser): """Convert audio to text using speech-to-text. @@ -102,6 +110,11 @@ class TextApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Text successfully converted to audio", + service_api_ns.models[AudioBinaryResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON)) def post(self, app_model: App, end_user: EndUser): """Convert text to audio using text-to-speech. diff --git a/api/controllers/service_api/app/completion.py b/api/controllers/service_api/app/completion.py index c2294a3fc1..7009bbfeaf 100644 --- a/api/controllers/service_api/app/completion.py +++ b/api/controllers/service_api/app/completion.py @@ -8,7 +8,7 @@ from pydantic import BaseModel, Field, field_validator from werkzeug.exceptions import BadRequest, InternalServerError, NotFound import services -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.service_api import service_api_ns from controllers.service_api.app.error import ( @@ -53,7 +53,7 @@ def _resolve_agent_app_streaming(*, app_mode: AppMode, response_mode: str | None class CompletionRequestPayload(BaseModel): inputs: dict[str, Any] query: str = Field(default="") - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) response_mode: Literal["blocking", "streaming"] | None = None retriever_from: str = Field(default="dev") trace_session_id: str | None = Field(default=None, description="Trace session ID for observability grouping") @@ -62,7 +62,7 @@ class CompletionRequestPayload(BaseModel): class ChatRequestPayload(BaseModel): inputs: dict[str, Any] query: str - files: list[dict[str, Any]] | None = None + files: list[dict[str, Any]] | None = Field(default=None) response_mode: Literal["blocking", "streaming"] | None = None conversation_id: UUIDStrOrEmpty | None = Field(default=None, description="Conversation UUID") retriever_from: str = Field(default="dev") @@ -87,7 +87,7 @@ class ChatRequestPayload(BaseModel): register_schema_models(service_api_ns, CompletionRequestPayload, ChatRequestPayload) -register_response_schema_models(service_api_ns, SimpleResultResponse) +register_response_schema_models(service_api_ns, GeneratedAppResponse, SimpleResultResponse) @service_api_ns.route("/completion-messages") @@ -104,6 +104,11 @@ class CompletionApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Completion created successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) def post(self, app_model: App, end_user: EndUser): """Create a completion for the given prompt. @@ -205,6 +210,11 @@ class ChatApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Message sent successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) def post(self, app_model: App, end_user: EndUser): """Send a message in a chat conversation. diff --git a/api/controllers/service_api/app/conversation.py b/api/controllers/service_api/app/conversation.py index f121374ca9..f6be7f74cc 100644 --- a/api/controllers/service_api/app/conversation.py +++ b/api/controllers/service_api/app/conversation.py @@ -10,7 +10,7 @@ from werkzeug.exceptions import BadRequest, NotFound import services from controllers.common.controller_schemas import ConversationRenamePayload -from controllers.common.schema import query_params_from_model, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.service_api import service_api_ns from controllers.service_api.app.error import NotChatAppError from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token @@ -134,6 +134,13 @@ register_schema_models( ConversationVariableResponse, ConversationVariableInfiniteScrollPaginationResponse, ) +register_response_schema_models( + service_api_ns, + ConversationInfiniteScrollPagination, + SimpleConversation, + ConversationVariableResponse, + ConversationVariableInfiniteScrollPaginationResponse, +) @service_api_ns.route("/conversations") @@ -148,6 +155,11 @@ class ConversationApi(Resource): 404: "Last conversation not found", } ) + @service_api_ns.response( + 200, + "Conversations retrieved successfully", + service_api_ns.models[ConversationInfiniteScrollPagination.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY)) def get(self, app_model: App, end_user: EndUser): """List all conversations for the current user. @@ -224,6 +236,11 @@ class ConversationRenameApi(Resource): 404: "Conversation not found", } ) + @service_api_ns.response( + 200, + "Conversation renamed successfully", + service_api_ns.models[SimpleConversation.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON)) def post(self, app_model: App, end_user: EndUser, c_id: UUID): """Rename a conversation or auto-generate a name.""" diff --git a/api/controllers/service_api/app/file_preview.py b/api/controllers/service_api/app/file_preview.py index 11317016df..7e68399fb0 100644 --- a/api/controllers/service_api/app/file_preview.py +++ b/api/controllers/service_api/app/file_preview.py @@ -7,8 +7,9 @@ from flask_restx import Resource from pydantic import BaseModel, Field from sqlalchemy import select +from controllers.common.fields import BinaryFileResponse from controllers.common.file_response import enforce_download_for_html -from controllers.common.schema import query_params_from_model, register_schema_model +from controllers.common.schema import query_params_from_model, register_response_schema_model, register_schema_model from controllers.service_api import service_api_ns from controllers.service_api.app.error import ( FileAccessDeniedError, @@ -27,6 +28,7 @@ class FilePreviewQuery(BaseModel): register_schema_model(service_api_ns, FilePreviewQuery) +register_response_schema_model(service_api_ns, BinaryFileResponse) @service_api_ns.route("/files//preview") @@ -50,6 +52,11 @@ class FilePreviewApi(Resource): 404: "File not found", } ) + @service_api_ns.response( + 200, + "File retrieved successfully", + service_api_ns.models[BinaryFileResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY)) def get(self, app_model: App, end_user: EndUser, file_id: UUID): """ diff --git a/api/controllers/service_api/app/human_input_form.py b/api/controllers/service_api/app/human_input_form.py index 87cdca4988..1dc247d751 100644 --- a/api/controllers/service_api/app/human_input_form.py +++ b/api/controllers/service_api/app/human_input_form.py @@ -8,17 +8,20 @@ paused human input forms in workflow/chatflow runs. import json import logging from collections.abc import Sequence +from typing import Any from flask import Response from flask_restx import Resource +from pydantic import ConfigDict, Field from werkzeug.exceptions import BadRequest, NotFound from controllers.common.human_input import HumanInputFormSubmitPayload, stringify_form_default_values -from controllers.common.schema import register_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.service_api import service_api_ns from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.workflow.human_input_policy import HumanInputSurface, is_recipient_type_allowed_for_surface from extensions.ext_database import db +from fields.base import ResponseModel from graphon.nodes.human_input.entities import FormInputConfig from libs.helper import to_timestamp from models.model import App, EndUser @@ -27,7 +30,20 @@ from services.human_input_service import Form, FormNotFoundError, HumanInputServ logger = logging.getLogger(__name__) +class HumanInputFormDefinitionResponse(ResponseModel): + form_content: str + inputs: list[dict[str, Any]] = Field(default_factory=list) + resolved_default_values: dict[str, str] + user_actions: list[dict[str, Any]] = Field(default_factory=list) + expiration_time: int | None = None + + +class HumanInputFormSubmitResponse(ResponseModel): + model_config = ConfigDict(extra="forbid") + + register_schema_models(service_api_ns, HumanInputFormSubmitPayload) +register_response_schema_models(service_api_ns, HumanInputFormDefinitionResponse, HumanInputFormSubmitResponse) def _jsonify_form_definition(form: Form, *, inputs: Sequence[FormInputConfig] = ()) -> Response: @@ -67,6 +83,11 @@ class WorkflowHumanInputFormApi(Resource): 412: "Form already submitted or expired", } ) + @service_api_ns.response( + 200, + "Form retrieved successfully", + service_api_ns.models[HumanInputFormDefinitionResponse.__name__], + ) @validate_app_token def get(self, app_model: App, form_token: str): service = HumanInputService(db.engine) @@ -93,6 +114,11 @@ class WorkflowHumanInputFormApi(Resource): 412: "Form already submitted or expired", } ) + @service_api_ns.response( + 200, + "Form submitted successfully", + service_api_ns.models[HumanInputFormSubmitResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) def post(self, app_model: App, end_user: EndUser, form_token: str): payload = HumanInputFormSubmitPayload.model_validate(service_api_ns.payload or {}) diff --git a/api/controllers/service_api/app/message.py b/api/controllers/service_api/app/message.py index bdb16794ef..adbea6570d 100644 --- a/api/controllers/service_api/app/message.py +++ b/api/controllers/service_api/app/message.py @@ -14,6 +14,7 @@ from controllers.service_api import service_api_ns from controllers.service_api.app.error import NotChatAppError from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.app.entities.app_invoke_entities import InvokeFrom +from fields.base import ResponseModel from fields.conversation_fields import ResultResponse from fields.message_fields import MessageInfiniteScrollPagination, MessageListItem from models.enums import FeedbackRating @@ -33,8 +34,32 @@ class FeedbackListQuery(BaseModel): limit: int = Field(default=20, ge=1, le=101, description="Number of feedbacks per page") +class AppFeedbackResponse(ResponseModel): + id: str + app_id: str + conversation_id: str + message_id: str + rating: str + content: str | None = None + from_source: str + from_end_user_id: str | None = None + from_account_id: str | None = None + created_at: str + updated_at: str + + +class AppFeedbackListResponse(ResponseModel): + data: list[AppFeedbackResponse] + + register_schema_models(service_api_ns, MessageListQuery, MessageFeedbackPayload, FeedbackListQuery) -register_response_schema_models(service_api_ns, ResultResponse, SimpleResultStringListResponse) +register_response_schema_models( + service_api_ns, + ResultResponse, + SimpleResultStringListResponse, + MessageInfiniteScrollPagination, + AppFeedbackListResponse, +) @service_api_ns.route("/messages") @@ -49,6 +74,11 @@ class MessageListApi(Resource): 404: "Conversation or first message not found", } ) + @service_api_ns.response( + 200, + "Messages retrieved successfully", + service_api_ns.models[MessageInfiniteScrollPagination.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY)) def get(self, app_model: App, end_user: EndUser): """List messages in a conversation. @@ -129,6 +159,11 @@ class AppGetFeedbacksApi(Resource): 401: "Unauthorized - invalid API token", } ) + @service_api_ns.response( + 200, + "Feedbacks retrieved successfully", + service_api_ns.models[AppFeedbackListResponse.__name__], + ) @validate_app_token def get(self, app_model: App): """Get all feedbacks for the application. diff --git a/api/controllers/service_api/app/workflow.py b/api/controllers/service_api/app/workflow.py index 04fb9900a2..b655e0beb4 100644 --- a/api/controllers/service_api/app/workflow.py +++ b/api/controllers/service_api/app/workflow.py @@ -11,7 +11,7 @@ from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import BadRequest, InternalServerError, NotFound from controllers.common.controller_schemas import WorkflowRunPayload as WorkflowRunPayloadBase -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.service_api import service_api_ns from controllers.service_api.app.error import ( @@ -69,7 +69,7 @@ class WorkflowLogQuery(BaseModel): register_schema_models(service_api_ns, WorkflowRunPayload, WorkflowLogQuery) -register_response_schema_models(service_api_ns, SimpleResultResponse) +register_response_schema_models(service_api_ns, GeneratedAppResponse, SimpleResultResponse) def _enum_value(value): @@ -97,7 +97,7 @@ class WorkflowRunResponse(ResponseModel): id: str workflow_id: str status: str - inputs: dict | list | str | int | float | bool | None = None + inputs: dict | list | str | int | float | bool | None = Field(default=None) outputs: dict = Field(default_factory=dict) error: str | None = None total_steps: int | None = None @@ -139,7 +139,7 @@ class WorkflowRunForLogResponse(ResponseModel): class WorkflowAppLogPartialResponse(ResponseModel): id: str workflow_run: WorkflowRunForLogResponse | None = None - details: dict | list | str | int | float | bool | None = None + details: dict | list | str | int | float | bool | None = Field(default=None) created_from: str | None = None created_by_role: str | None = None created_by_account: SimpleAccount | None = None @@ -165,7 +165,7 @@ class WorkflowAppLogPaginationResponse(ResponseModel): data: list[WorkflowAppLogPartialResponse] -register_schema_models( +register_response_schema_models( service_api_ns, WorkflowRunResponse, WorkflowRunForLogResponse, @@ -262,6 +262,11 @@ class WorkflowRunApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Workflow executed successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) def post(self, app_model: App, end_user: EndUser): """Execute a workflow. @@ -322,6 +327,11 @@ class WorkflowRunByIdApi(Resource): 500: "Internal server error", } ) + @service_api_ns.response( + 200, + "Workflow executed successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) def post(self, app_model: App, end_user: EndUser, workflow_id: str): """Run specific workflow by ID. diff --git a/api/controllers/service_api/app/workflow_events.py b/api/controllers/service_api/app/workflow_events.py index b281b271c0..6dc9ef6e8d 100644 --- a/api/controllers/service_api/app/workflow_events.py +++ b/api/controllers/service_api/app/workflow_events.py @@ -7,9 +7,12 @@ from collections.abc import Generator from flask import Response, request from flask_restx import Resource +from pydantic import BaseModel, Field from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import NotFound +from controllers.common.fields import EventStreamResponse +from controllers.common.schema import query_params_from_model, register_response_schema_model, register_schema_models from controllers.service_api import service_api_ns from controllers.service_api.app.error import NotWorkflowAppError from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token @@ -27,26 +30,24 @@ from repositories.factory import DifyAPIRepositoryFactory from services.workflow_event_snapshot_service import build_workflow_event_stream +class WorkflowEventsQuery(BaseModel): + user: str = Field(..., description="End user identifier") + include_state_snapshot: bool = Field(default=False, description="Replay from persisted state snapshot") + continue_on_pause: bool = Field(default=False, description="Keep the stream open across workflow_paused events") + + +register_schema_models(service_api_ns, WorkflowEventsQuery) +register_response_schema_model(service_api_ns, EventStreamResponse) + + @service_api_ns.route("/workflow//events") class WorkflowEventsApi(Resource): """Service API for getting workflow execution events after resume.""" @service_api_ns.doc("get_workflow_events") @service_api_ns.doc(description="Get workflow execution events stream after resume") - @service_api_ns.doc( - params={ - "task_id": "Workflow run ID", - "user": "End user identifier (query param)", - "include_state_snapshot": ( - "Whether to replay from persisted state snapshot, " - 'specify `"true"` to include a status snapshot of executed nodes' - ), - "continue_on_pause": ( - "Whether to keep the stream open across workflow_paused events," - 'specify `"true"` to keep the stream open for `workflow_paused` events.' - ), - } - ) + @service_api_ns.doc(params={"task_id": "Workflow run ID"}) + @service_api_ns.doc(params=query_params_from_model(WorkflowEventsQuery)) @service_api_ns.doc( responses={ 200: "SSE event stream", @@ -54,6 +55,7 @@ class WorkflowEventsApi(Resource): 404: "Workflow run not found", } ) + @service_api_ns.response(200, "SSE event stream", service_api_ns.models[EventStreamResponse.__name__]) @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY, required=True)) def get(self, app_model: App, end_user: EndUser, task_id: str): app_mode = AppMode.value_of(app_model.mode) diff --git a/api/controllers/service_api/dataset/dataset.py b/api/controllers/service_api/dataset/dataset.py index 4bcf969701..89b8a0816f 100644 --- a/api/controllers/service_api/dataset/dataset.py +++ b/api/controllers/service_api/dataset/dataset.py @@ -57,7 +57,7 @@ class DatasetCreatePayload(BaseModel): retrieval_model: RetrievalModel | None = None embedding_model: str | None = None embedding_model_provider: str | None = None - summary_index_setting: dict | None = None + summary_index_setting: dict | None = Field(default=None) class DatasetUpdatePayload(BaseModel): @@ -69,11 +69,15 @@ class DatasetUpdatePayload(BaseModel): embedding_model_provider: str | None = None retrieval_model: RetrievalModel | None = None partial_member_list: list[dict[str, str]] | None = None - external_retrieval_model: dict[str, Any] | None = None + external_retrieval_model: dict[str, Any] | None = Field(default=None) external_knowledge_id: str | None = None external_knowledge_api_id: str | None = None +class DocumentStatusPayload(BaseModel): + document_ids: list[str] = Field(default_factory=list, description="Document IDs to update") + + class TagNamePayload(BaseModel): name: str = Field(..., min_length=1, max_length=50) @@ -175,6 +179,7 @@ register_schema_models( service_api_ns, DatasetCreatePayload, DatasetUpdatePayload, + DocumentStatusPayload, TagCreatePayload, TagUpdatePayload, TagDeletePayload, @@ -535,6 +540,7 @@ class DocumentStatusApi(DatasetApiResource): 400: "Bad request - invalid action", } ) + @service_api_ns.expect(service_api_ns.models[DocumentStatusPayload.__name__]) def patch(self, tenant_id, dataset_id: UUID, action: Literal["enable", "disable", "archive", "un_archive"]): """ Batch update document status. diff --git a/api/controllers/service_api/dataset/document.py b/api/controllers/service_api/dataset/document.py index d1b81e8162..c71feb1aa7 100644 --- a/api/controllers/service_api/dataset/document.py +++ b/api/controllers/service_api/dataset/document.py @@ -8,7 +8,7 @@ deprecated in generated API docs so clients migrate toward the canonical paths. import json from collections.abc import Mapping from contextlib import ExitStack -from typing import Self +from typing import Any, Literal, Self from uuid import UUID from flask import request, send_file @@ -25,7 +25,7 @@ from controllers.common.errors import ( TooManyFilesError, UnsupportedFileTypeError, ) -from controllers.common.fields import UrlResponse +from controllers.common.fields import BinaryFileResponse, UrlResponse from controllers.common.schema import ( query_params_from_model, register_enum_models, @@ -51,6 +51,7 @@ from extensions.ext_database import db from fields.base import ResponseModel from fields.document_fields import ( DocumentListResponse, + DocumentMetadataResponse, DocumentResponse, DocumentStatusListResponse, ) @@ -117,6 +118,10 @@ class DocumentListQuery(BaseModel): status: str | None = Field(default=None, description="Document status filter") +class DocumentGetQuery(BaseModel): + metadata: Literal["all", "only", "without"] = Field(default="all", description="Metadata response mode") + + DOCUMENT_CREATE_BY_FILE_PARAMS = { "dataset_id": "Dataset ID", "file": { @@ -155,6 +160,40 @@ class DocumentAndBatchResponse(ResponseModel): batch: str +class DocumentDetailResponse(ResponseModel): + id: str + position: int | None = None + data_source_type: str | None = None + data_source_info: dict[str, Any] | None = Field(default=None) + dataset_process_rule_id: str | None = None + dataset_process_rule: dict[str, Any] | None = Field(default=None) + document_process_rule: dict[str, Any] | None = Field(default=None) + name: str | None = None + created_from: str | None = None + created_by: str | None = None + created_at: int | None = None + tokens: int | None = None + indexing_status: str | None = None + completed_at: int | None = None + updated_at: int | None = None + indexing_latency: float | None = None + error: str | None = None + enabled: bool | None = None + disabled_at: int | None = None + disabled_by: str | None = None + archived: bool | None = None + doc_type: str | None = None + doc_metadata: list[DocumentMetadataResponse] | None = None + segment_count: int | None = None + average_segment_length: float | None = None + hit_count: int | None = None + display_status: str | None = None + doc_form: str | None = None + doc_language: str | None = None + summary_index_status: str | None = None + need_summary: bool | None = None + + register_enum_models(service_api_ns, RetrievalMethod) register_schema_models( @@ -164,6 +203,7 @@ register_schema_models( DocumentTextCreatePayload, DocumentTextUpdate, DocumentListQuery, + DocumentGetQuery, DocumentBatchDownloadZipPayload, Rule, PreProcessingRule, @@ -171,9 +211,11 @@ register_schema_models( ) register_response_schema_models( service_api_ns, + BinaryFileResponse, UrlResponse, DocumentResponse, DocumentAndBatchResponse, + DocumentDetailResponse, DocumentListResponse, DocumentStatusListResponse, ) @@ -716,6 +758,11 @@ class DocumentBatchDownloadZipApi(DatasetApiResource): 404: "Document or dataset not found", } ) + @service_api_ns.response( + 200, + "ZIP archive generated successfully", + service_api_ns.models[BinaryFileResponse.__name__], + ) @cloud_edition_billing_rate_limit_check("knowledge", "dataset") def post(self, tenant_id, dataset_id: UUID): payload = DocumentBatchDownloadZipPayload.model_validate(service_api_ns.payload or {}) @@ -851,6 +898,7 @@ class DocumentApi(DatasetApiResource): @service_api_ns.doc("get_document") @service_api_ns.doc(description="Get a specific document by ID") @service_api_ns.doc(params={"dataset_id": "Dataset ID", "document_id": "Document ID"}) + @service_api_ns.doc(params=query_params_from_model(DocumentGetQuery)) @service_api_ns.doc( responses={ 200: "Document retrieved successfully", @@ -859,6 +907,11 @@ class DocumentApi(DatasetApiResource): 404: "Document not found", } ) + @service_api_ns.response( + 200, + "Document retrieved successfully", + service_api_ns.models[DocumentDetailResponse.__name__], + ) def get(self, tenant_id, dataset_id: UUID, document_id: UUID): dataset_id_str = str(dataset_id) document_id_str = str(document_id) diff --git a/api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py b/api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py index 19b1d008b7..a1a8b588c4 100644 --- a/api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py +++ b/api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py @@ -3,19 +3,26 @@ from typing import Any from uuid import UUID from flask import request -from pydantic import BaseModel +from pydantic import BaseModel, Field, RootModel from sqlalchemy import select from werkzeug.exceptions import Forbidden, NotFound import services from controllers.common.errors import FilenameNotExistsError, NoFileUploadedError, TooManyFilesError -from controllers.common.schema import register_schema_model +from controllers.common.fields import GeneratedAppResponse +from controllers.common.schema import ( + query_params_from_model, + register_response_schema_models, + register_schema_model, + register_schema_models, +) from controllers.service_api import service_api_ns from controllers.service_api.dataset.error import PipelineRunError from controllers.service_api.dataset.rag_pipeline.serializers import serialize_upload_file from controllers.service_api.wraps import DatasetApiResource from core.app.apps.pipeline.pipeline_generator import PipelineGenerator from core.app.entities.app_invoke_entities import InvokeFrom +from fields.base import ResponseModel from libs import helper from libs.login import current_user from models import Account @@ -38,8 +45,50 @@ class DatasourceNodeRunPayload(BaseModel): is_published: bool +class DatasourcePluginsQuery(BaseModel): + is_published: bool = True + + +class DatasourceCredentialInfoResponse(ResponseModel): + id: str | None = None + name: str | None = None + type: str | None = None + is_default: bool | None = None + + +class DatasourcePluginResponse(ResponseModel): + node_id: str | None = None + plugin_id: str | None = None + provider_name: str | None = None + datasource_type: str | None = None + title: str | None = None + user_input_variables: list[dict[str, Any]] = Field(default_factory=list) + credentials: list[DatasourceCredentialInfoResponse] + + +class DatasourcePluginListResponse(RootModel[list[DatasourcePluginResponse]]): + pass + + +class PipelineUploadFileResponse(ResponseModel): + id: str + name: str + size: int + extension: str + mime_type: str | None = None + created_by: str + created_at: str | None = None + + register_schema_model(service_api_ns, DatasourceNodeRunPayload) register_schema_model(service_api_ns, PipelineRunApiEntity) +register_schema_models(service_api_ns, DatasourcePluginsQuery) +register_response_schema_models( + service_api_ns, + DatasourcePluginListResponse, + GeneratedAppResponse, + PipelineUploadFileResponse, +) @service_api_ns.route("/datasets//pipeline/datasource-plugins") @@ -53,18 +102,18 @@ class DatasourcePluginsApi(DatasetApiResource): "dataset_id": "Dataset ID", } ) - @service_api_ns.doc( - params={ - "is_published": "Whether to get published or draft datasource plugins " - "(true for published, false for draft, default: true)" - } - ) + @service_api_ns.doc(params=query_params_from_model(DatasourcePluginsQuery)) @service_api_ns.doc( responses={ 200: "Datasource plugins retrieved successfully", 401: "Unauthorized - invalid API token", } ) + @service_api_ns.response( + 200, + "Datasource plugins retrieved successfully", + service_api_ns.models[DatasourcePluginListResponse.__name__], + ) def get(self, tenant_id: str, dataset_id: UUID): """Resource for getting datasource plugins.""" dataset_id_str = str(dataset_id) @@ -95,15 +144,6 @@ class DatasourceNodeRunApi(DatasetApiResource): "dataset_id": "Dataset ID", } ) - @service_api_ns.doc( - body={ - "inputs": "User input variables", - "datasource_type": "Datasource type, e.g. online_document", - "credential_id": "Credential ID", - "is_published": "Whether to get published or draft datasource plugins " - "(true for published, false for draft, default: true)", - } - ) @service_api_ns.doc( responses={ 200: "Datasource node run successfully", @@ -111,6 +151,11 @@ class DatasourceNodeRunApi(DatasetApiResource): } ) @service_api_ns.expect(service_api_ns.models[DatasourceNodeRunPayload.__name__]) + @service_api_ns.response( + 200, + "Datasource node run successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) def post(self, tenant_id: str, dataset_id: UUID, node_id: str): """Resource for getting datasource plugins.""" dataset_id_str = str(dataset_id) @@ -157,17 +202,6 @@ class PipelineRunApi(DatasetApiResource): "dataset_id": "Dataset ID", } ) - @service_api_ns.doc( - body={ - "inputs": "User input variables", - "datasource_type": "Datasource type, e.g. online_document", - "datasource_info_list": "Datasource info list", - "start_node_id": "Start node ID", - "is_published": "Whether to get published or draft datasource plugins " - "(true for published, false for draft, default: true)", - "streaming": "Whether to stream the response(streaming or blocking), default: streaming", - } - ) @service_api_ns.doc( responses={ 200: "Pipeline run successfully", @@ -175,6 +209,11 @@ class PipelineRunApi(DatasetApiResource): } ) @service_api_ns.expect(service_api_ns.models[PipelineRunApiEntity.__name__]) + @service_api_ns.response( + 200, + "Pipeline run successfully", + service_api_ns.models[GeneratedAppResponse.__name__], + ) def post(self, tenant_id: str, dataset_id: UUID): """Resource for running a rag pipeline.""" dataset_id_str = str(dataset_id) @@ -220,6 +259,11 @@ class KnowledgebasePipelineFileUploadApi(DatasetApiResource): 415: "Unsupported file type", } ) + @service_api_ns.response( + 201, + "File uploaded successfully", + service_api_ns.models[PipelineUploadFileResponse.__name__], + ) def post(self, tenant_id: str): """Upload a file for use in conversations. diff --git a/api/controllers/service_api/workspace/models.py b/api/controllers/service_api/workspace/models.py index 5ac65fc4e6..63806ab252 100644 --- a/api/controllers/service_api/workspace/models.py +++ b/api/controllers/service_api/workspace/models.py @@ -1,12 +1,22 @@ from flask_login import current_user from flask_restx import Resource +from controllers.common.schema import register_response_schema_models from controllers.service_api import service_api_ns from controllers.service_api.wraps import validate_dataset_token +from fields.base import ResponseModel from graphon.model_runtime.utils.encoders import jsonable_encoder +from services.entities.model_provider_entities import ProviderWithModelsResponse from services.model_provider_service import ModelProviderService +class ProviderWithModelsListResponse(ResponseModel): + data: list[ProviderWithModelsResponse] + + +register_response_schema_models(service_api_ns, ProviderWithModelsListResponse) + + @service_api_ns.route("/workspaces/current/models/model-types/") class ModelProviderAvailableModelApi(Resource): @service_api_ns.doc("get_available_models") @@ -18,6 +28,11 @@ class ModelProviderAvailableModelApi(Resource): 401: "Unauthorized - invalid API token", } ) + @service_api_ns.response( + 200, + "Models retrieved successfully", + service_api_ns.models[ProviderWithModelsListResponse.__name__], + ) @validate_dataset_token def get(self, _, model_type: str): """Get available models by model type. diff --git a/api/controllers/web/app.py b/api/controllers/web/app.py index 6d05743bfe..d5722faf00 100644 --- a/api/controllers/web/app.py +++ b/api/controllers/web/app.py @@ -8,7 +8,7 @@ from werkzeug.exceptions import Unauthorized from constants import HEADER_NAME_APP_CODE from controllers.common import fields -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from core.app.app_config.common.parameters_mapping import get_parameters_from_feature_dict from libs.passport import PassportService from libs.token import extract_webapp_passport @@ -32,9 +32,24 @@ class AppAccessModeQuery(BaseModel): app_code: str | None = Field(default=None, alias="appCode", description="Application code") -register_schema_models(web_ns, AppAccessModeQuery) +class AppPermissionQuery(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + app_id: str = Field(..., alias="appId", description="Application ID") + + +class AppMetaResponse(BaseModel): + tool_icons: dict[str, Any] = Field( + default_factory=dict, + description="Tool icon metadata keyed by tool name", + ) + + +register_schema_models(web_ns, AppAccessModeQuery, AppPermissionQuery) register_response_schema_models( web_ns, + fields.Parameters, + AppMetaResponse, fields.AccessModeResponse, fields.BooleanResultResponse, ) @@ -56,6 +71,7 @@ class AppParameterApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[fields.Parameters.__name__]) def get(self, app_model: App, end_user: EndUser): """Retrieve app parameters.""" if app_model.mode in {AppMode.ADVANCED_CHAT, AppMode.WORKFLOW}: @@ -92,6 +108,7 @@ class AppMeta(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[AppMetaResponse.__name__]) def get(self, app_model: App, end_user: EndUser): """Get app meta""" return AppService().get_app_meta(app_model) @@ -101,12 +118,7 @@ class AppMeta(WebApiResource): class AppAccessMode(Resource): @web_ns.doc("Get App Access Mode") @web_ns.doc(description="Retrieve the access mode for a web application (public or restricted).") - @web_ns.doc( - params={ - "appId": {"description": "Application ID", "type": "string", "required": False}, - "appCode": {"description": "Application code", "type": "string", "required": False}, - } - ) + @web_ns.doc(params=query_params_from_model(AppAccessModeQuery)) @web_ns.doc( responses={ 200: "Success", @@ -139,7 +151,7 @@ class AppAccessMode(Resource): class AppWebAuthPermission(Resource): @web_ns.doc("Check App Permission") @web_ns.doc(description="Check if user has permission to access a web application.") - @web_ns.doc(params={"appId": {"description": "Application ID", "type": "string", "required": True}}) + @web_ns.doc(params=query_params_from_model(AppPermissionQuery)) @web_ns.doc( responses={ 200: "Success", diff --git a/api/controllers/web/audio.py b/api/controllers/web/audio.py index 8ddbc3abb8..c762c91486 100644 --- a/api/controllers/web/audio.py +++ b/api/controllers/web/audio.py @@ -7,6 +7,7 @@ from werkzeug.exceptions import InternalServerError import services from controllers.common.controller_schemas import TextToAudioPayload as TextToAudioPayloadBase +from controllers.common.fields import AudioBinaryResponse, AudioTranscriptResponse from controllers.web import web_ns from controllers.web.error import ( AppUnavailableError, @@ -32,7 +33,7 @@ from services.errors.audio import ( UnsupportedAudioTypeServiceError, ) -from ..common.schema import register_schema_models +from ..common.schema import register_response_schema_models, register_schema_models class TextToAudioPayload(TextToAudioPayloadBase): @@ -45,6 +46,7 @@ class TextToAudioPayload(TextToAudioPayloadBase): register_schema_models(web_ns, TextToAudioPayload) +register_response_schema_models(web_ns, AudioBinaryResponse, AudioTranscriptResponse) logger = logging.getLogger(__name__) @@ -69,6 +71,7 @@ class AudioApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[AudioTranscriptResponse.__name__]) def post(self, app_model: App, end_user: EndUser): """Convert audio to text""" file = request.files["file"] @@ -117,6 +120,7 @@ class TextApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[AudioBinaryResponse.__name__]) def post(self, app_model: App, end_user: EndUser): """Convert text to audio""" try: diff --git a/api/controllers/web/completion.py b/api/controllers/web/completion.py index d4c02b6592..2bb7db015a 100644 --- a/api/controllers/web/completion.py +++ b/api/controllers/web/completion.py @@ -5,7 +5,7 @@ from pydantic import BaseModel, Field, field_validator from werkzeug.exceptions import BadRequest, InternalServerError, NotFound import services -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import ( @@ -47,9 +47,14 @@ def _resolve_agent_app_streaming(*, app_mode: AppMode, response_mode: str | None class CompletionMessagePayload(BaseModel): - inputs: dict[str, Any] = Field(description="Input variables for the completion") + inputs: dict[str, Any] = Field( + description="Input variables for the completion", + ) query: str = Field(default="", description="Query text for completion") - files: list[dict[str, Any]] | None = Field(default=None, description="Files to be processed") + files: list[dict[str, Any]] | None = Field( + default=None, + description="Files to be processed", + ) response_mode: Literal["blocking", "streaming"] | None = Field( default=None, description="Response mode: blocking or streaming" ) @@ -57,9 +62,14 @@ class CompletionMessagePayload(BaseModel): class ChatMessagePayload(BaseModel): - inputs: dict[str, Any] = Field(description="Input variables for the chat") + inputs: dict[str, Any] = Field( + description="Input variables for the chat", + ) query: str = Field(description="User query/message") - files: list[dict[str, Any]] | None = Field(default=None, description="Files to be processed") + files: list[dict[str, Any]] | None = Field( + default=None, + description="Files to be processed", + ) response_mode: Literal["blocking", "streaming"] | None = Field( default=None, description="Response mode: blocking or streaming" ) @@ -76,7 +86,7 @@ class ChatMessagePayload(BaseModel): register_schema_models(web_ns, CompletionMessagePayload, ChatMessagePayload) -register_response_schema_models(web_ns, SimpleResultResponse) +register_response_schema_models(web_ns, GeneratedAppResponse, SimpleResultResponse) # define completion api for user @@ -95,6 +105,7 @@ class CompletionApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[GeneratedAppResponse.__name__]) def post(self, app_model: App, end_user: EndUser): if app_model.mode != AppMode.COMPLETION: raise NotCompletionAppError() @@ -178,6 +189,7 @@ class ChatApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[GeneratedAppResponse.__name__]) def post(self, app_model: App, end_user: EndUser): app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT, AppMode.AGENT}: diff --git a/api/controllers/web/conversation.py b/api/controllers/web/conversation.py index fd85922207..73461b1a29 100644 --- a/api/controllers/web/conversation.py +++ b/api/controllers/web/conversation.py @@ -7,7 +7,7 @@ from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import NotFound from controllers.common.controller_schemas import ConversationRenamePayload -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import NotChatAppError from controllers.web.wraps import WebApiResource @@ -40,37 +40,14 @@ class ConversationListQuery(BaseModel): register_schema_models(web_ns, ConversationListQuery, ConversationRenamePayload) -register_response_schema_models(web_ns, ResultResponse) +register_response_schema_models(web_ns, ConversationInfiniteScrollPagination, ResultResponse, SimpleConversation) @web_ns.route("/conversations") class ConversationListApi(WebApiResource): @web_ns.doc("Get Conversation List") @web_ns.doc(description="Retrieve paginated list of conversations for a chat application.") - @web_ns.doc( - params={ - "last_id": {"description": "Last conversation ID for pagination", "type": "string", "required": False}, - "limit": { - "description": "Number of conversations to return (1-100)", - "type": "integer", - "required": False, - "default": 20, - }, - "pinned": { - "description": "Filter by pinned status", - "type": "string", - "enum": ["true", "false"], - "required": False, - }, - "sort_by": { - "description": "Sort order", - "type": "string", - "enum": ["created_at", "-created_at", "updated_at", "-updated_at"], - "required": False, - "default": "-updated_at", - }, - } - ) + @web_ns.doc(params=query_params_from_model(ConversationListQuery)) @web_ns.doc( responses={ 200: "Success", @@ -81,6 +58,7 @@ class ConversationListApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[ConversationInfiniteScrollPagination.__name__]) def get(self, app_model: App, end_user: EndUser): app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT, AppMode.AGENT}: @@ -166,6 +144,8 @@ class ConversationRenameApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Conversation renamed successfully", web_ns.models[SimpleConversation.__name__]) + @web_ns.expect(web_ns.models[ConversationRenamePayload.__name__]) def post(self, app_model: App, end_user: EndUser, c_id: UUID): app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT, AppMode.AGENT}: diff --git a/api/controllers/web/human_input_form.py b/api/controllers/web/human_input_form.py index 3065d57b5d..14b982dd23 100644 --- a/api/controllers/web/human_input_form.py +++ b/api/controllers/web/human_input_form.py @@ -9,7 +9,7 @@ from typing import Any, NotRequired, TypedDict from flask import Response, request from flask_restx import Resource -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict, Field from sqlalchemy import select from sqlalchemy.orm import sessionmaker from werkzeug.exceptions import Forbidden @@ -17,7 +17,7 @@ from werkzeug.exceptions import Forbidden from configs import dify_config from controllers.common.errors import NotFoundError from controllers.common.human_input import HumanInputFormSubmitPayload, stringify_form_default_values -from controllers.common.schema import register_schema_models +from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import WebFormRateLimitExceededError from controllers.web.site import serialize_app_site_payload @@ -38,7 +38,26 @@ class HumanInputUploadTokenResponse(BaseModel): expires_at: int -register_schema_models(web_ns, HumanInputUploadTokenResponse) +class HumanInputFormDefinitionResponse(BaseModel): + form_content: Any + inputs: Any + resolved_default_values: dict[str, str] + user_actions: Any + expiration_time: int + site: dict[str, Any] | None = Field(default=None) + + +class HumanInputFormSubmitResponse(BaseModel): + model_config = ConfigDict(extra="forbid") + + +register_schema_models(web_ns, HumanInputFormSubmitPayload) +register_response_schema_models( + web_ns, + HumanInputUploadTokenResponse, + HumanInputFormDefinitionResponse, + HumanInputFormSubmitResponse, +) _FORM_SUBMIT_RATE_LIMITER = RateLimiter( @@ -100,6 +119,7 @@ def _jsonify_form_definition( class HumanInputFormUploadTokenApi(Resource): """API for issuing HITL upload tokens for active human input forms.""" + @web_ns.response(200, "Success", web_ns.models[HumanInputUploadTokenResponse.__name__]) def post(self, form_token: str): """ Issue an upload token for a human input form. @@ -130,6 +150,7 @@ class HumanInputFormApi(Resource): # NOTE(QuantumGhost): this endpoint is unauthenticated on purpose for now. # def get(self, _app_model: App, _end_user: EndUser, form_token: str): + @web_ns.response(200, "Success", web_ns.models[HumanInputFormDefinitionResponse.__name__]) def get(self, form_token: str): """ Get human input form definition by token. @@ -160,6 +181,8 @@ class HumanInputFormApi(Resource): ) # def post(self, _app_model: App, _end_user: EndUser, form_token: str): + @web_ns.response(200, "Success", web_ns.models[HumanInputFormSubmitResponse.__name__]) + @web_ns.expect(web_ns.models[HumanInputFormSubmitPayload.__name__]) def post(self, form_token: str): """ Submit human input form by token. diff --git a/api/controllers/web/login.py b/api/controllers/web/login.py index 2b9f8eac0f..2d8c38f550 100644 --- a/api/controllers/web/login.py +++ b/api/controllers/web/login.py @@ -14,7 +14,7 @@ from controllers.common.fields import ( SimpleResultDataResponse, SimpleResultResponse, ) -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.console.auth.error import ( AuthenticationFailedError, EmailCodeError, @@ -62,7 +62,12 @@ class EmailCodeLoginVerifyPayload(BaseModel): token: str = Field(min_length=1) -register_schema_models(web_ns, LoginPayload, EmailCodeLoginSendPayload, EmailCodeLoginVerifyPayload) +class LoginStatusQuery(BaseModel): + app_code: str | None = Field(default=None, description="Web app code") + user_id: str | None = Field(default=None, description="End user session ID") + + +register_schema_models(web_ns, LoginPayload, EmailCodeLoginSendPayload, EmailCodeLoginVerifyPayload, LoginStatusQuery) register_response_schema_models( web_ns, AccessTokenResultResponse, @@ -122,6 +127,7 @@ class LoginStatusApi(Resource): @setup_required @web_ns.doc("web_app_login_status") @web_ns.doc(description="Check login status") + @web_ns.doc(params=query_params_from_model(LoginStatusQuery)) @web_ns.doc( responses={ 200: "Login status", diff --git a/api/controllers/web/message.py b/api/controllers/web/message.py index ea94140112..65ef02471a 100644 --- a/api/controllers/web/message.py +++ b/api/controllers/web/message.py @@ -7,6 +7,7 @@ from pydantic import BaseModel, Field, TypeAdapter from werkzeug.exceptions import InternalServerError, NotFound from controllers.common.controller_schemas import MessageFeedbackPayload, MessageListQuery +from controllers.common.fields import GeneratedAppResponse from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import ( @@ -48,29 +49,20 @@ class MessageMoreLikeThisQuery(BaseModel): register_schema_models(web_ns, MessageListQuery, MessageFeedbackPayload, MessageMoreLikeThisQuery) -register_response_schema_models(web_ns, ResultResponse, SuggestedQuestionsResponse) +register_response_schema_models( + web_ns, + GeneratedAppResponse, + ResultResponse, + SuggestedQuestionsResponse, + WebMessageInfiniteScrollPagination, +) @web_ns.route("/messages") class MessageListApi(WebApiResource): @web_ns.doc("Get Message List") @web_ns.doc(description="Retrieve paginated list of messages from a conversation in a chat application.") - @web_ns.doc( - params={ - "conversation_id": {"description": "Conversation UUID", "type": "string", "required": True}, - "first_id": { - "description": "First message ID for pagination", - "type": "string", - "required": False, - }, - "limit": { - "description": "Number of messages to return (1-100)", - "type": "integer", - "required": False, - "default": 20, - }, - } - ) + @web_ns.doc(params=query_params_from_model(MessageListQuery)) @web_ns.doc( responses={ 200: "Success", @@ -81,6 +73,7 @@ class MessageListApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[WebMessageInfiniteScrollPagination.__name__]) def get(self, app_model: App, end_user: EndUser): app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT, AppMode.AGENT}: @@ -133,6 +126,7 @@ class MessageFeedbackApi(WebApiResource): } ) @web_ns.response(200, "Feedback submitted successfully", web_ns.models[ResultResponse.__name__]) + @web_ns.expect(web_ns.models[MessageFeedbackPayload.__name__]) def post(self, app_model: App, end_user: EndUser, message_id: UUID): message_id_str = str(message_id) @@ -167,6 +161,7 @@ class MessageMoreLikeThisApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[GeneratedAppResponse.__name__]) def get(self, app_model: App, end_user: EndUser, message_id: UUID): if app_model.mode != "completion": raise NotCompletionAppError() diff --git a/api/controllers/web/passport.py b/api/controllers/web/passport.py index 0293df74b0..00439ffca4 100644 --- a/api/controllers/web/passport.py +++ b/api/controllers/web/passport.py @@ -4,11 +4,14 @@ from typing import Any from flask import make_response, request from flask_restx import Resource +from pydantic import BaseModel, Field from sqlalchemy import func, select from werkzeug.exceptions import NotFound, Unauthorized from configs import dify_config from constants import HEADER_NAME_APP_CODE +from controllers.common.fields import AccessTokenData +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import WebAppAuthRequiredError from extensions.ext_database import db @@ -19,12 +22,21 @@ from services.feature_service import FeatureService from services.webapp_auth_service import WebAppAuthService, WebAppAuthType +class PassportQuery(BaseModel): + user_id: str | None = Field(default=None, description="End user session ID") + + +register_schema_models(web_ns, PassportQuery) +register_response_schema_models(web_ns, AccessTokenData) + + @web_ns.route("/passport") class PassportResource(Resource): """Base resource for passport.""" @web_ns.doc("get_passport") @web_ns.doc(description="Get authentication passport for web application access") + @web_ns.doc(params=query_params_from_model(PassportQuery)) @web_ns.doc( responses={ 200: "Passport retrieved successfully", @@ -32,6 +44,7 @@ class PassportResource(Resource): 404: "Application or user not found", } ) + @web_ns.response(200, "Passport retrieved successfully", web_ns.models[AccessTokenData.__name__]) def get(self): system_features = FeatureService.get_system_features() app_code = request.headers.get(HEADER_NAME_APP_CODE) diff --git a/api/controllers/web/remote_files.py b/api/controllers/web/remote_files.py index 659d9aa663..1772300b5c 100644 --- a/api/controllers/web/remote_files.py +++ b/api/controllers/web/remote_files.py @@ -86,6 +86,7 @@ class RemoteFileUploadApi(WebApiResource): } ) @web_ns.response(201, "Remote file uploaded", web_ns.models[FileWithSignedUrl.__name__]) + @web_ns.expect(web_ns.models[RemoteFileUploadPayload.__name__]) def post(self, app_model: App, end_user: EndUser): """Upload a file from a remote URL. diff --git a/api/controllers/web/saved_message.py b/api/controllers/web/saved_message.py index 7ce72e56ab..e3baa028e5 100644 --- a/api/controllers/web/saved_message.py +++ b/api/controllers/web/saved_message.py @@ -5,7 +5,7 @@ from pydantic import TypeAdapter from werkzeug.exceptions import NotFound from controllers.common.controller_schemas import SavedMessageCreatePayload, SavedMessageListQuery -from controllers.common.schema import register_response_schema_models, register_schema_models +from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import NotCompletionAppError from controllers.web.wraps import WebApiResource @@ -16,24 +16,14 @@ from services.errors.message import MessageNotExistsError from services.saved_message_service import SavedMessageService register_schema_models(web_ns, SavedMessageListQuery, SavedMessageCreatePayload) -register_response_schema_models(web_ns, ResultResponse) +register_response_schema_models(web_ns, ResultResponse, SavedMessageInfiniteScrollPagination) @web_ns.route("/saved-messages") class SavedMessageListApi(WebApiResource): @web_ns.doc("Get Saved Messages") @web_ns.doc(description="Retrieve paginated list of saved messages for a completion application.") - @web_ns.doc( - params={ - "last_id": {"description": "Last message ID for pagination", "type": "string", "required": False}, - "limit": { - "description": "Number of messages to return (1-100)", - "type": "integer", - "required": False, - "default": 20, - }, - } - ) + @web_ns.doc(params=query_params_from_model(SavedMessageListQuery)) @web_ns.doc( responses={ 200: "Success", @@ -44,6 +34,7 @@ class SavedMessageListApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[SavedMessageInfiniteScrollPagination.__name__]) def get(self, app_model: App, end_user: EndUser): if app_model.mode != "completion": raise NotCompletionAppError() @@ -78,6 +69,7 @@ class SavedMessageListApi(WebApiResource): } ) @web_ns.response(200, "Message saved successfully", web_ns.models[ResultResponse.__name__]) + @web_ns.expect(web_ns.models[SavedMessageCreatePayload.__name__]) def post(self, app_model: App, end_user: EndUser): if app_model.mode != "completion": raise NotCompletionAppError() diff --git a/api/controllers/web/site.py b/api/controllers/web/site.py index 19b04b7acc..5e0f832651 100644 --- a/api/controllers/web/site.py +++ b/api/controllers/web/site.py @@ -1,19 +1,64 @@ from typing import Any, cast from flask_restx import fields, marshal, marshal_with +from pydantic import Field from sqlalchemy import select from werkzeug.exceptions import Forbidden from configs import dify_config +from controllers.common.schema import register_response_schema_models from controllers.web import web_ns from controllers.web.wraps import WebApiResource from extensions.ext_database import db +from fields.base import ResponseModel from libs.helper import AppIconUrlField from models.account import TenantStatus from models.model import App, EndUser, Site from services.feature_service import FeatureService +class AppSiteModelConfigResponse(ResponseModel): + opening_statement: str | None = None + suggested_questions: Any + suggested_questions_after_answer: Any + more_like_this: Any + model: Any + user_input_form: Any + pre_prompt: str | None = None + + +class AppSiteResponse(ResponseModel): + title: str | None = None + chat_color_theme: str | None = None + chat_color_theme_inverted: bool | None = None + icon_type: str | None = None + icon: str | None = None + icon_background: str | None = None + icon_url: str | None = None + description: str | None = None + copyright: str | None = None + privacy_policy: str | None = None + custom_disclaimer: str | None = None + default_language: str | None = None + prompt_public: bool | None = None + show_workflow_steps: bool | None = None + use_icon_as_answer_icon: bool | None = None + + +class AppSiteInfoResponse(ResponseModel): + app_id: str + end_user_id: str | None = None + enable_site: bool + site: AppSiteResponse + model_config_: AppSiteModelConfigResponse | None = Field(default=None, alias="model_config") + plan: str | None = None + can_replace_logo: bool + custom_config: dict[str, Any] | None = Field(default=None) + + +register_response_schema_models(web_ns, AppSiteInfoResponse) + + @web_ns.route("/site") class AppSiteApi(WebApiResource): """Resource for app sites.""" @@ -69,6 +114,7 @@ class AppSiteApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[AppSiteInfoResponse.__name__]) @marshal_with(app_fields) def get(self, app_model: App, end_user: EndUser): """Retrieve app site info.""" diff --git a/api/controllers/web/workflow.py b/api/controllers/web/workflow.py index 00b3434922..06d9c02fed 100644 --- a/api/controllers/web/workflow.py +++ b/api/controllers/web/workflow.py @@ -3,7 +3,7 @@ import logging from werkzeug.exceptions import InternalServerError from controllers.common.controller_schemas import WorkflowRunPayload -from controllers.common.fields import SimpleResultResponse +from controllers.common.fields import GeneratedAppResponse, SimpleResultResponse from controllers.common.schema import register_response_schema_models, register_schema_models from controllers.web import web_ns from controllers.web.error import ( @@ -33,7 +33,7 @@ from services.errors.llm import InvokeRateLimitError logger = logging.getLogger(__name__) register_schema_models(web_ns, WorkflowRunPayload) -register_response_schema_models(web_ns, SimpleResultResponse) +register_response_schema_models(web_ns, GeneratedAppResponse, SimpleResultResponse) @web_ns.route("/workflows/run") @@ -51,6 +51,7 @@ class WorkflowRunApi(WebApiResource): 500: "Internal Server Error", } ) + @web_ns.response(200, "Success", web_ns.models[GeneratedAppResponse.__name__]) def post(self, app_model: App, end_user: EndUser): """ Run workflow diff --git a/api/controllers/web/workflow_events.py b/api/controllers/web/workflow_events.py index b513ade58a..48eba33f04 100644 --- a/api/controllers/web/workflow_events.py +++ b/api/controllers/web/workflow_events.py @@ -9,7 +9,9 @@ from flask import Response, request from sqlalchemy.orm import sessionmaker from controllers.common.errors import InvalidArgumentError, NotFoundError -from controllers.web import api +from controllers.common.fields import EventStreamResponse +from controllers.common.schema import register_response_schema_model +from controllers.web import api, web_ns from controllers.web.wraps import WebApiResource from core.app.apps.advanced_chat.app_generator import AdvancedChatAppGenerator from core.app.apps.base_app_generator import BaseAppGenerator @@ -22,10 +24,13 @@ from models.model import App, AppMode, EndUser from repositories.factory import DifyAPIRepositoryFactory from services.workflow_event_snapshot_service import build_workflow_event_stream +register_response_schema_model(web_ns, EventStreamResponse) + class WorkflowEventsApi(WebApiResource): """API for getting workflow execution events after resume.""" + @web_ns.response(200, "SSE event stream", web_ns.models[EventStreamResponse.__name__]) def get(self, app_model: App, end_user: EndUser, task_id: str): """ Get workflow execution events stream after resume. diff --git a/api/core/entities/model_entities.py b/api/core/entities/model_entities.py index e99a131500..3b50ab0d48 100644 --- a/api/core/entities/model_entities.py +++ b/api/core/entities/model_entities.py @@ -1,10 +1,11 @@ from collections.abc import Sequence from enum import StrEnum, auto +from typing import Any from pydantic import BaseModel, ConfigDict from graphon.model_runtime.entities.common_entities import I18nObject -from graphon.model_runtime.entities.model_entities import ModelType, ProviderModel +from graphon.model_runtime.entities.model_entities import ModelPropertyKey, ModelType, ProviderModel from graphon.model_runtime.entities.provider_entities import ProviderEntity @@ -52,6 +53,7 @@ class ProviderModelWithStatusEntity(ProviderModel): Model class for model response. """ + model_properties: dict[ModelPropertyKey, Any] status: ModelStatus load_balancing_enabled: bool = False has_invalid_load_balancing_configs: bool = False diff --git a/api/core/entities/provider_entities.py b/api/core/entities/provider_entities.py index 72b29c2277..ad9a1f4a02 100644 --- a/api/core/entities/provider_entities.py +++ b/api/core/entities/provider_entities.py @@ -88,7 +88,7 @@ class SystemConfiguration(BaseModel): enabled: bool current_quota_type: ProviderQuotaType | None = None quota_configurations: list[QuotaConfiguration] = [] - credentials: dict[str, Any] | None = None + credentials: dict[str, Any] | None = Field(default=None) class CustomProviderConfiguration(BaseModel): diff --git a/api/core/llm_generator/entities.py b/api/core/llm_generator/entities.py index 3bb8d2c899..81aa9f0698 100644 --- a/api/core/llm_generator/entities.py +++ b/api/core/llm_generator/entities.py @@ -7,7 +7,11 @@ from core.app.app_config.entities import ModelConfig class RuleGeneratePayload(BaseModel): instruction: str = Field(..., description="Rule generation instruction") - model_config_data: ModelConfig = Field(..., alias="model_config", description="Model configuration") + model_config_data: ModelConfig = Field( + ..., + alias="model_config", + description="Model configuration", + ) no_variable: bool = Field(default=False, description="Whether to exclude variables") @@ -17,4 +21,8 @@ class RuleCodeGeneratePayload(RuleGeneratePayload): class RuleStructuredOutputPayload(BaseModel): instruction: str = Field(..., description="Structured output generation instruction") - model_config_data: ModelConfig = Field(..., alias="model_config", description="Model configuration") + model_config_data: ModelConfig = Field( + ..., + alias="model_config", + description="Model configuration", + ) diff --git a/api/fields/app_fields.py b/api/fields/app_fields.py index d1a8f0c959..9b197da443 100644 --- a/api/fields/app_fields.py +++ b/api/fields/app_fields.py @@ -18,6 +18,24 @@ class JsonStringField(fields.Raw): return value +class OpaqueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "object"} + + +class StringListRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "array", "items": {"type": "string"}} + + +class ObjectListRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "array", "items": {"type": "object"}} + + app_detail_kernel_fields = { "id": fields.String, "name": fields.String, @@ -36,25 +54,25 @@ related_app_list = { model_config_fields = { "opening_statement": fields.String, - "suggested_questions": fields.Raw(attribute="suggested_questions_list"), - "suggested_questions_after_answer": fields.Raw(attribute="suggested_questions_after_answer_dict"), - "speech_to_text": fields.Raw(attribute="speech_to_text_dict"), - "text_to_speech": fields.Raw(attribute="text_to_speech_dict"), - "retriever_resource": fields.Raw(attribute="retriever_resource_dict"), - "annotation_reply": fields.Raw(attribute="annotation_reply_dict"), - "more_like_this": fields.Raw(attribute="more_like_this_dict"), - "sensitive_word_avoidance": fields.Raw(attribute="sensitive_word_avoidance_dict"), - "external_data_tools": fields.Raw(attribute="external_data_tools_list"), - "model": fields.Raw(attribute="model_dict"), - "user_input_form": fields.Raw(attribute="user_input_form_list"), + "suggested_questions": StringListRawField(attribute="suggested_questions_list"), + "suggested_questions_after_answer": OpaqueRawField(attribute="suggested_questions_after_answer_dict"), + "speech_to_text": OpaqueRawField(attribute="speech_to_text_dict"), + "text_to_speech": OpaqueRawField(attribute="text_to_speech_dict"), + "retriever_resource": OpaqueRawField(attribute="retriever_resource_dict"), + "annotation_reply": OpaqueRawField(attribute="annotation_reply_dict"), + "more_like_this": OpaqueRawField(attribute="more_like_this_dict"), + "sensitive_word_avoidance": OpaqueRawField(attribute="sensitive_word_avoidance_dict"), + "external_data_tools": ObjectListRawField(attribute="external_data_tools_list"), + "model": OpaqueRawField(attribute="model_dict"), + "user_input_form": ObjectListRawField(attribute="user_input_form_list"), "dataset_query_variable": fields.String, "pre_prompt": fields.String, - "agent_mode": fields.Raw(attribute="agent_mode_dict"), + "agent_mode": OpaqueRawField(attribute="agent_mode_dict"), "prompt_type": fields.String, - "chat_prompt_config": fields.Raw(attribute="chat_prompt_config_dict"), - "completion_prompt_config": fields.Raw(attribute="completion_prompt_config_dict"), - "dataset_configs": fields.Raw(attribute="dataset_configs_dict"), - "file_upload": fields.Raw(attribute="file_upload_dict"), + "chat_prompt_config": OpaqueRawField(attribute="chat_prompt_config_dict"), + "completion_prompt_config": OpaqueRawField(attribute="completion_prompt_config_dict"), + "dataset_configs": OpaqueRawField(attribute="dataset_configs_dict"), + "file_upload": OpaqueRawField(attribute="file_upload_dict"), "created_by": fields.String, "created_at": TimestampField, "updated_by": fields.String, @@ -74,7 +92,7 @@ app_detail_fields = { "enable_api": fields.Boolean, "model_config": fields.Nested(model_config_fields, attribute="app_model_config", allow_null=True), "workflow": fields.Nested(workflow_partial_fields, allow_null=True), - "tracing": fields.Raw, + "tracing": OpaqueRawField, "use_icon_as_answer_icon": fields.Boolean, "created_by": fields.String, "created_at": TimestampField, @@ -89,7 +107,7 @@ prompt_config_fields = { } model_config_partial_fields = { - "model": fields.Raw(attribute="model_dict"), + "model": OpaqueRawField(attribute="model_dict"), "pre_prompt": fields.String, "created_by": fields.String, "created_at": TimestampField, @@ -100,7 +118,7 @@ model_config_partial_fields = { app_partial_fields = { "id": fields.String, "name": fields.String, - "max_active_requests": fields.Raw(), + "max_active_requests": OpaqueRawField(), "description": fields.String(attribute="desc_or_prompt"), "mode": fields.String(attribute="mode_compatible_with_agent"), "icon_type": fields.String, @@ -222,7 +240,7 @@ app_site_fields = { "use_icon_as_answer_icon": fields.Boolean, } -leaked_dependency_fields = {"type": fields.String, "value": fields.Raw, "current_identifier": fields.String} +leaked_dependency_fields = {"type": fields.String, "value": OpaqueRawField, "current_identifier": fields.String} app_import_fields = { "id": fields.String, diff --git a/api/fields/conversation_fields.py b/api/fields/conversation_fields.py index eb49577d59..d256ad96cf 100644 --- a/api/fields/conversation_fields.py +++ b/api/fields/conversation_fields.py @@ -179,15 +179,18 @@ class StatusCount(ResponseModel): class ModelConfig(ResponseModel): opening_statement: str | None = None - suggested_questions: JSONValue | None = None - model: JSONValue | None = None - user_input_form: JSONValue | None = None + suggested_questions: JSONValue | None = Field(default=None) + model: JSONValue | None = Field(default=None) + user_input_form: JSONValue | None = Field(default=None) pre_prompt: str | None = None - agent_mode: JSONValue | None = None + agent_mode: JSONValue | None = Field(default=None) class SimpleModelConfig(ResponseModel): - model: JSONValue | None = Field(default=None, validation_alias="model_dict") + model: JSONValue | None = Field( + default=None, + validation_alias="model_dict", + ) pre_prompt: str | None = None diff --git a/api/fields/message_fields.py b/api/fields/message_fields.py index e0d37dd701..3f9c5bf052 100644 --- a/api/fields/message_fields.py +++ b/api/fields/message_fields.py @@ -71,7 +71,10 @@ class MessageListItem(ResponseModel): class WebMessageListItem(MessageListItem): - metadata: JSONValueType | None = Field(default=None, validation_alias="message_metadata_dict") + metadata: JSONValueType | None = Field( + default=None, + validation_alias="message_metadata_dict", + ) class MessageInfiniteScrollPagination(ResponseModel): diff --git a/api/fields/snippet_fields.py b/api/fields/snippet_fields.py index ec0821fc85..699a3687ac 100644 --- a/api/fields/snippet_fields.py +++ b/api/fields/snippet_fields.py @@ -1,8 +1,17 @@ +from typing import override + from flask_restx import fields from fields.member_fields import simple_account_fields from libs.helper import TimestampField + +class OpaqueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "object"} + + tag_fields = {"id": fields.String, "name": fields.String, "type": fields.String} # Snippet list item fields (lightweight for list display) @@ -14,7 +23,7 @@ snippet_list_fields = { "version": fields.Integer, "use_count": fields.Integer, "is_published": fields.Boolean, - "icon_info": fields.Raw, + "icon_info": OpaqueRawField, "tags": fields.List(fields.Nested(tag_fields)), "created_by": fields.String, "author_name": fields.String, @@ -32,9 +41,9 @@ snippet_fields = { "version": fields.Integer, "use_count": fields.Integer, "is_published": fields.Boolean, - "icon_info": fields.Raw, - "graph": fields.Raw(attribute="graph_dict"), - "input_fields": fields.Raw(attribute="input_fields_list"), + "icon_info": OpaqueRawField, + "graph": OpaqueRawField(attribute="graph_dict"), + "input_fields": OpaqueRawField(attribute="input_fields_list"), "tags": fields.List(fields.Nested(tag_fields)), "created_by": fields.Nested(simple_account_fields, attribute="created_by_account", allow_null=True), "created_at": TimestampField, diff --git a/api/fields/workflow_fields.py b/api/fields/workflow_fields.py index 49b7a8be25..2d0d8f9f54 100644 --- a/api/fields/workflow_fields.py +++ b/api/fields/workflow_fields.py @@ -12,7 +12,33 @@ from ._value_type_serializer import serialize_value_type ENVIRONMENT_VARIABLE_SUPPORTED_TYPES = (SegmentType.STRING, SegmentType.NUMBER, SegmentType.SECRET) +class OpaqueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "object"} + + +class JsonValueRawField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return { + "anyOf": [ + {"type": "string"}, + {"type": "integer"}, + {"type": "number"}, + {"type": "boolean"}, + {"type": "object", "additionalProperties": True}, + {"type": "array", "items": {}}, + {"type": "null"}, + ] + } + + class EnvironmentVariableField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "object"} + @override def format(self, value): # Mask secret variables values in environment_variables @@ -48,7 +74,7 @@ conversation_variable_fields = { "id": fields.String, "name": fields.String, "value_type": fields.String(attribute=serialize_value_type), - "value": fields.Raw, + "value": JsonValueRawField, "description": fields.String, } @@ -60,7 +86,7 @@ pipeline_variable_fields = { "max_length": fields.Integer, "required": fields.Boolean, "unit": fields.String, - "default_value": fields.Raw, + "default_value": JsonValueRawField, "options": fields.List(fields.String), "placeholder": fields.String, "tooltips": fields.String, @@ -71,8 +97,8 @@ pipeline_variable_fields = { workflow_fields = { "id": fields.String, - "graph": fields.Raw(attribute="graph_dict"), - "features": fields.Raw(attribute="features_dict"), + "graph": OpaqueRawField(attribute="graph_dict"), + "features": OpaqueRawField(attribute="features_dict"), "hash": fields.String(attribute="unique_hash"), "version": fields.String, "marked_name": fields.String, diff --git a/api/libs/helper.py b/api/libs/helper.py index 3f27eac516..ac85e88ef7 100644 --- a/api/libs/helper.py +++ b/api/libs/helper.py @@ -128,6 +128,10 @@ def run(script): class AppIconUrlField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "string", "nullable": True} + @override def output(self, key, obj, **kwargs): if obj is None: @@ -177,12 +181,20 @@ class AvatarUrlField(fields.Raw): class TimestampField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "integer", "format": "int64"} + @override def format(self, value) -> int: return int(value.timestamp()) class OptionalTimestampField(fields.Raw): + @override + def schema(self) -> dict[str, object]: + return {"type": "integer", "format": "int64", "nullable": True} + @override def format(self, value) -> int | None: if value is None: diff --git a/api/models/agent_config_entities.py b/api/models/agent_config_entities.py index 7d80ce30fb..6b99b1baab 100644 --- a/api/models/agent_config_entities.py +++ b/api/models/agent_config_entities.py @@ -76,7 +76,7 @@ RuntimeParameterValue = JsonPrimitive | list[str] | list[int] | list[float] | li class AgentFlexibleConfig(BaseModel): - model_config = ConfigDict(extra="allow", json_schema_extra={"x-dify-opaque": True}) + model_config = ConfigDict(extra="allow") def get(self, key: str, default: Any = None) -> Any: return self.model_dump(mode="python").get(key, default) @@ -162,7 +162,7 @@ class AgentCliToolConfig(AgentFlexibleConfig): install_command: str | None = None install: str | None = None setup_command: str | None = None - invoke_metadata: dict[str, Any] = Field(default_factory=dict, json_schema_extra={"x-dify-opaque": True}) + invoke_metadata: dict[str, Any] = Field(default_factory=dict) env: AgentCliToolEnvConfig = Field(default_factory=AgentCliToolEnvConfig) pre_authorized: bool | None = None authorization_status: AgentCliToolAuthorizationStatus | None = None @@ -295,7 +295,7 @@ class WorkflowNodeJobMetadata(BaseModel): model_config = ConfigDict(extra="ignore") file_refs: list[AgentFileRefConfig] | None = None - agent_soul: dict[str, Any] | None = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + agent_soul: dict[str, Any] | None = Field(default=None) class AgentSoulPromptConfig(BaseModel): @@ -447,7 +447,7 @@ class AppVariableConfig(BaseModel): name: str = Field(min_length=1, max_length=255) type: str = Field(min_length=1, max_length=64) required: bool = False - default: Any = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + default: Any = Field(default=None) class AgentSoulConfig(BaseModel): @@ -546,7 +546,7 @@ class DeclaredOutputFailureStrategy(BaseModel): # When ``on_failure == DEFAULT_VALUE`` this value replaces the failed output. The # value's shape must match the owning ``DeclaredOutputConfig.type``; that match is # enforced at ``DeclaredOutputConfig`` level so the strategy stays type-agnostic. - default_value: Any = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + default_value: Any = Field(default=None) @model_validator(mode="after") def _require_default_value_when_default_strategy(self) -> DeclaredOutputFailureStrategy: diff --git a/api/openapi/markdown/console-openapi.md b/api/openapi/markdown/console-openapi.md index cada682d09..838b479bd9 100644 --- a/api/openapi/markdown/console-openapi.md +++ b/api/openapi/markdown/console-openapi.md @@ -142,9 +142,9 @@ Get account avatar url #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [EducationActivateResponse](#educationactivateresponse)
| ### [GET] /account/education/autocomplete #### Parameters @@ -419,9 +419,9 @@ Check if activation token is valid #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [WorkspaceListResponse](#workspacelistresponse)
| ### [GET] /api-based-extension Get all API-based extensions for current tenant @@ -514,9 +514,9 @@ Update API-based extension #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [DELETE] /api-key-auth/data-source/{binding_id} #### Parameters @@ -558,7 +558,7 @@ Get advanced prompt templates based on app mode and model configuration | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Prompt templates retrieved successfully | **application/json**: [ object ]
| +| 200 | Prompt templates retrieved successfully | **application/json**: [AdvancedPromptTemplateResponse](#advancedprompttemplateresponse)
| | 400 | Invalid request parameters | | ### [GET] /apps @@ -779,9 +779,9 @@ Get human input form preview for advanced chat workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Human input form preview | **application/json**: [HumanInputFormPreviewResponse](#humaninputformpreviewresponse)
| ### [POST] /apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/form/run **Submit human input form preview** @@ -803,9 +803,9 @@ Submit human input form preview for advanced chat workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Human input form submission result | **application/json**: [HumanInputFormSubmitResponse](#humaninputformsubmitresponse)
| ### [POST] /apps/{app_id}/advanced-chat/workflows/draft/iteration/nodes/{node_id}/run **Run draft workflow iteration node** @@ -827,11 +827,11 @@ Run draft workflow iteration node for advanced chat #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Iteration node run started successfully | -| 403 | Permission denied | -| 404 | Node not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Iteration node run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 404 | Node not found | | ### [POST] /apps/{app_id}/advanced-chat/workflows/draft/loop/nodes/{node_id}/run **Run draft workflow loop node** @@ -853,11 +853,11 @@ Run draft workflow loop node for advanced chat #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Loop node run started successfully | -| 403 | Permission denied | -| 404 | Node not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Loop node run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 404 | Node not found | | ### [POST] /apps/{app_id}/advanced-chat/workflows/draft/run **Run draft workflow** @@ -878,11 +878,11 @@ Run draft workflow for advanced chat application #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow run started successfully | -| 400 | Invalid request parameters | -| 403 | Permission denied | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Invalid request parameters | | +| 403 | Permission denied | | ### [GET] /apps/{app_id}/agent-composer #### Parameters @@ -1059,7 +1059,7 @@ Get agent execution logs for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Agent logs retrieved successfully | **application/json**: [ object ]
| +| 200 | Agent logs retrieved successfully | **application/json**: [AgentLogResponse](#agentlogresponse)
| | 400 | Invalid request parameters | | ### [POST] /apps/{app_id}/agent/skills/standardize @@ -1075,10 +1075,10 @@ Validate + standardize a Skill into the agent drive (ENG-594) #### Responses -| Code | Description | -| ---- | ----------- | -| 201 | Skill standardized into drive | -| 400 | Invalid skill package or no bound agent | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Skill standardized into drive | **application/json**: [AgentSkillStandardizeResponse](#agentskillstandardizeresponse)
| +| 400 | Invalid skill package or no bound agent | | ### [POST] /apps/{app_id}/agent/skills/upload **Validate an uploaded Skill package and persist the archive** @@ -1095,10 +1095,10 @@ plus its manifest. Standardizing into the agent drive is ENG-594. #### Responses -| Code | Description | -| ---- | ----------- | -| 201 | Skill validated | -| 400 | Invalid skill package | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Skill validated | **application/json**: [AgentSkillUploadResponse](#agentskilluploadresponse)
| +| 400 | Invalid skill package | | ### [POST] /apps/{app_id}/annotation-reply/{action} Enable or disable annotation reply for an app @@ -1118,10 +1118,10 @@ Enable or disable annotation reply for an app #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Action completed successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Action completed successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 403 | Insufficient permissions | | ### [GET] /apps/{app_id}/annotation-reply/{action}/status/{job_id} Get status of annotation reply action job @@ -1136,10 +1136,10 @@ Get status of annotation reply action job #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Job status retrieved successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Job status retrieved successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 403 | Insufficient permissions | | ### [GET] /apps/{app_id}/annotation-setting Get annotation settings for an app @@ -1152,10 +1152,10 @@ Get annotation settings for an app #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Annotation settings retrieved successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Annotation settings retrieved successfully | **application/json**: [AnnotationSettingResponse](#annotationsettingresponse)
| +| 403 | Insufficient permissions | | ### [POST] /apps/{app_id}/annotation-settings/{annotation_setting_id} Update annotation settings for an app @@ -1175,10 +1175,10 @@ Update annotation settings for an app #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Settings updated successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Settings updated successfully | **application/json**: [AnnotationSettingResponse](#annotationsettingresponse)
| +| 403 | Insufficient permissions | | ### [DELETE] /apps/{app_id}/annotations #### Parameters @@ -1191,7 +1191,7 @@ Update annotation settings for an app | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Annotations deleted successfully | ### [GET] /apps/{app_id}/annotations Get annotations for an app with pagination @@ -1207,10 +1207,10 @@ Get annotations for an app with pagination #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Annotations retrieved successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Annotations retrieved successfully | **application/json**: [AnnotationList](#annotationlist)
| +| 403 | Insufficient permissions | | ### [POST] /apps/{app_id}/annotations Create a new annotation for an app @@ -1245,13 +1245,13 @@ Batch import annotations from CSV file with rate limiting and security checks #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Batch import started successfully | -| 400 | No file uploaded or too many files | -| 403 | Insufficient permissions | -| 413 | File too large | -| 429 | Too many requests or concurrent imports | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Batch import started successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 400 | No file uploaded or too many files | | +| 403 | Insufficient permissions | | +| 413 | File too large | | +| 429 | Too many requests or concurrent imports | | ### [GET] /apps/{app_id}/annotations/batch-import-status/{job_id} Get status of batch import job @@ -1265,10 +1265,10 @@ Get status of batch import job #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Job status retrieved successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Job status retrieved successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 403 | Insufficient permissions | | ### [GET] /apps/{app_id}/annotations/count Get count of message annotations for the app @@ -1313,7 +1313,7 @@ Export all annotations for an app with CSV injection protection | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Annotation deleted successfully | ### [POST] /apps/{app_id}/annotations/{annotation_id} Update or delete an annotation @@ -1583,11 +1583,11 @@ Generate completion message for debugging #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Completion generated successfully | -| 400 | Invalid request parameters | -| 404 | App not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Completion generated successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Invalid request parameters | | +| 404 | App not found | | ### [POST] /apps/{app_id}/completion-messages/{task_id}/stop Stop a running completion message generation @@ -1732,11 +1732,11 @@ Export user feedback data for Google Sheets #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Feedback data exported successfully | -| 400 | Invalid parameters | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Feedback data exported successfully | **application/json**: [TextFileResponse](#textfileresponse)
| +| 400 | Invalid parameters | | +| 500 | Internal server error | | ### [POST] /apps/{app_id}/icon Update application icon @@ -1755,10 +1755,10 @@ Update application icon #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Icon updated successfully | -| 403 | Insufficient permissions | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Icon updated successfully | **application/json**: [AppDetail](#appdetail)
| +| 403 | Insufficient permissions | | ### [GET] /apps/{app_id}/messages/{message_id} Get message details by ID @@ -1796,11 +1796,11 @@ Update application model configuration #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Model configuration updated successfully | -| 400 | Invalid configuration | -| 404 | App not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Model configuration updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| +| 400 | Invalid configuration | | +| 404 | App not found | | ### [POST] /apps/{app_id}/name Check if app name is available @@ -1975,7 +1975,7 @@ Get average response time statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Average response time statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Average response time statistics retrieved successfully | **application/json**: [AverageResponseTimeStatisticResponse](#averageresponsetimestatisticresponse)
| ### [GET] /apps/{app_id}/statistics/average-session-interactions Get average session interaction statistics for an application @@ -1992,7 +1992,7 @@ Get average session interaction statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Average session interaction statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Average session interaction statistics retrieved successfully | **application/json**: [AverageSessionInteractionStatisticResponse](#averagesessioninteractionstatisticresponse)
| ### [GET] /apps/{app_id}/statistics/daily-conversations Get daily conversation statistics for an application @@ -2009,7 +2009,7 @@ Get daily conversation statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Daily conversation statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Daily conversation statistics retrieved successfully | **application/json**: [DailyConversationStatisticResponse](#dailyconversationstatisticresponse)
| ### [GET] /apps/{app_id}/statistics/daily-end-users Get daily terminal/end-user statistics for an application @@ -2026,7 +2026,7 @@ Get daily terminal/end-user statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Daily terminal statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Daily terminal statistics retrieved successfully | **application/json**: [DailyTerminalStatisticResponse](#dailyterminalstatisticresponse)
| ### [GET] /apps/{app_id}/statistics/daily-messages Get daily message statistics for an application @@ -2043,7 +2043,7 @@ Get daily message statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Daily message statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Daily message statistics retrieved successfully | **application/json**: [DailyMessageStatisticResponse](#dailymessagestatisticresponse)
| ### [GET] /apps/{app_id}/statistics/token-costs Get daily token cost statistics for an application @@ -2060,7 +2060,7 @@ Get daily token cost statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Daily token cost statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Daily token cost statistics retrieved successfully | **application/json**: [DailyTokenCostStatisticResponse](#dailytokencoststatisticresponse)
| ### [GET] /apps/{app_id}/statistics/tokens-per-second Get tokens per second statistics for an application @@ -2077,7 +2077,7 @@ Get tokens per second statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Tokens per second statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | Tokens per second statistics retrieved successfully | **application/json**: [TokensPerSecondStatisticResponse](#tokenspersecondstatisticresponse)
| ### [GET] /apps/{app_id}/statistics/user-satisfaction-rate Get user satisfaction rate statistics for an application @@ -2094,7 +2094,7 @@ Get user satisfaction rate statistics for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | User satisfaction rate statistics retrieved successfully | **application/json**: [ object ]
| +| 200 | User satisfaction rate statistics retrieved successfully | **application/json**: [UserSatisfactionRateStatisticResponse](#usersatisfactionratestatisticresponse)
| ### [POST] /apps/{app_id}/text-to-audio Convert text to speech for chat messages @@ -2113,10 +2113,10 @@ Convert text to speech for chat messages #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Text to speech conversion successful | -| 400 | Bad request - Invalid parameters | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Text to speech conversion successful | **application/json**: [AudioBinaryResponse](#audiobinaryresponse)
| +| 400 | Bad request - Invalid parameters | | ### [GET] /apps/{app_id}/text-to-audio/voices Get available TTS voices for a specific language @@ -2132,7 +2132,7 @@ Get available TTS voices for a specific language | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | TTS voices retrieved successfully | **application/json**: [ object ]
| +| 200 | TTS voices retrieved successfully | **application/json**: [TextToSpeechVoiceListResponse](#texttospeechvoicelistresponse)
| | 400 | Invalid language parameter | | ### [GET] /apps/{app_id}/trace @@ -2148,9 +2148,9 @@ Get app tracing configuration #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Trace configuration retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Trace configuration retrieved successfully | **application/json**: [AppTraceResponse](#apptraceresponse)
| ### [POST] /apps/{app_id}/trace Update app tracing configuration @@ -2184,12 +2184,7 @@ Delete an existing tracing configuration for an application | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | app_id | path | Application ID | Yes | string | - -#### Request Body - -| Required | Schema | -| -------- | ------ | -| Yes | **application/json**: [TraceProviderQuery](#traceproviderquery)
| +| tracing_provider | query | Tracing provider name | Yes | string | #### Responses @@ -2212,7 +2207,7 @@ Get tracing configuration for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Tracing configuration retrieved successfully | **application/json**: object
| +| 200 | Tracing configuration retrieved successfully | **application/json**: [TraceAppConfigResponse](#traceappconfigresponse)
| | 400 | Invalid request parameters | | ### [PATCH] /apps/{app_id}/trace-config @@ -2236,7 +2231,7 @@ Update an existing tracing configuration for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Tracing configuration updated successfully | **application/json**: object
| +| 200 | Tracing configuration updated successfully | **application/json**: [TraceAppConfigResponse](#traceappconfigresponse)
| | 400 | Invalid request parameters or configuration not found | | ### [POST] /apps/{app_id}/trace-config @@ -2260,7 +2255,7 @@ Create a new tracing configuration for an application | Code | Description | Schema | | ---- | ----------- | ------ | -| 201 | Tracing configuration created successfully | **application/json**: object
| +| 201 | Tracing configuration created successfully | **application/json**: [TraceAppConfigResponse](#traceappconfigresponse)
| | 400 | Invalid request parameters or configuration already exists | | ### [POST] /apps/{app_id}/trigger-enable @@ -2715,9 +2710,9 @@ Get workflow average app interaction statistics #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Average app interaction statistics retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Average app interaction statistics retrieved successfully | **application/json**: [WorkflowAverageAppInteractionStatisticResponse](#workflowaverageappinteractionstatisticresponse)
| ### [GET] /apps/{app_id}/workflow/statistics/daily-conversations Get workflow daily runs statistics @@ -2732,9 +2727,9 @@ Get workflow daily runs statistics #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Daily runs statistics retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Daily runs statistics retrieved successfully | **application/json**: [WorkflowDailyRunsStatisticResponse](#workflowdailyrunsstatisticresponse)
| ### [GET] /apps/{app_id}/workflow/statistics/daily-terminals Get workflow daily terminals statistics @@ -2749,9 +2744,9 @@ Get workflow daily terminals statistics #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Daily terminals statistics retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Daily terminals statistics retrieved successfully | **application/json**: [WorkflowDailyTerminalsStatisticResponse](#workflowdailyterminalsstatisticresponse)
| ### [GET] /apps/{app_id}/workflow/statistics/token-costs Get workflow daily token cost statistics @@ -2766,9 +2761,9 @@ Get workflow daily token cost statistics #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Daily token cost statistics retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Daily token cost statistics retrieved successfully | **application/json**: [WorkflowDailyTokenCostStatisticResponse](#workflowdailytokencoststatisticresponse)
| ### [GET] /apps/{app_id}/workflows **Get published workflows** @@ -2804,9 +2799,9 @@ Get default block configurations for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Default block configurations retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Default block configurations retrieved successfully | **application/json**: [DefaultBlockConfigsResponse](#defaultblockconfigsresponse)
| ### [GET] /apps/{app_id}/workflows/default-workflow-block-configs/{block_type} **Get default block config** @@ -2823,10 +2818,10 @@ Get default block configuration by type #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Default block configuration retrieved successfully | -| 404 | Block type not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Default block configuration retrieved successfully | **application/json**: [DefaultBlockConfigResponse](#defaultblockconfigresponse)
| +| 404 | Block type not found | | ### [GET] /apps/{app_id}/workflows/draft **Get draft workflow** @@ -2904,9 +2899,9 @@ Update conversation variables for workflow draft #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Conversation variables updated successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Conversation variables updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /apps/{app_id}/workflows/draft/environment-variables **Get draft workflow** @@ -2921,10 +2916,10 @@ Get environment variables for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Environment variables retrieved successfully | -| 404 | Draft workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Environment variables retrieved successfully | **application/json**: [EnvironmentVariableListResponse](#environmentvariablelistresponse)
| +| 404 | Draft workflow not found | | ### [POST] /apps/{app_id}/workflows/draft/environment-variables Update environment variables for workflow draft @@ -2943,9 +2938,9 @@ Update environment variables for workflow draft #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Environment variables updated successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Environment variables updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /apps/{app_id}/workflows/draft/features Update draft workflow features @@ -2988,9 +2983,9 @@ Test human input delivery for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Human input delivery test result | **application/json**: [EmptyObjectResponse](#emptyobjectresponse)
| ### [POST] /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/preview **Preview human input form content and placeholders** @@ -3012,9 +3007,9 @@ Get human input form preview for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Human input form preview | **application/json**: [HumanInputFormPreviewResponse](#humaninputformpreviewresponse)
| ### [POST] /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/run **Submit human input form preview** @@ -3036,9 +3031,9 @@ Submit human input form preview for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Human input form submission result | **application/json**: [HumanInputFormSubmitResponse](#humaninputformsubmitresponse)
| ### [POST] /apps/{app_id}/workflows/draft/iteration/nodes/{node_id}/run **Run draft workflow iteration node** @@ -3058,11 +3053,11 @@ Submit human input form preview for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow iteration node run started successfully | -| 403 | Permission denied | -| 404 | Node not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow iteration node run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 404 | Node not found | | ### [POST] /apps/{app_id}/workflows/draft/loop/nodes/{node_id}/run **Run draft workflow loop node** @@ -3082,11 +3077,11 @@ Submit human input form preview for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow loop node run started successfully | -| 403 | Permission denied | -| 404 | Node not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow loop node run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 404 | Node not found | | ### [GET] /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer #### Parameters @@ -3250,11 +3245,11 @@ Get last run result for draft workflow node #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Trigger event received and node executed successfully | -| 403 | Permission denied | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Trigger event received and node executed successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 500 | Internal server error | | ### [DELETE] /apps/{app_id}/workflows/draft/nodes/{node_id}/variables Delete all variables for a specific node @@ -3305,10 +3300,10 @@ Get variables for a specific node #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Draft workflow run started successfully | -| 403 | Permission denied | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Draft workflow run started successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | ### [GET] /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs Snapshot of every node's declared outputs for a draft workflow run. @@ -3339,10 +3334,10 @@ Server-Sent Events stream of inspector deltas for a draft workflow run. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow run node output event stream | -| 404 | Workflow run not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow run node output event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| +| 404 | Workflow run not found | | ### [GET] /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/{node_id} One node's declared outputs for a draft workflow run. @@ -3413,11 +3408,11 @@ Get system variables for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Trigger event received and workflow executed successfully | -| 403 | Permission denied | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Trigger event received and workflow executed successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 500 | Internal server error | | ### [POST] /apps/{app_id}/workflows/draft/trigger/run-all **Full workflow debug when the start node is a trigger** @@ -3436,11 +3431,11 @@ Get system variables for workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow executed successfully | -| 403 | Permission denied | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow executed successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 403 | Permission denied | | +| 500 | Internal server error | | ### [DELETE] /apps/{app_id}/workflows/draft/variables Delete all draft workflow variables @@ -3585,9 +3580,9 @@ Get published workflow for an application #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow published successfully | **application/json**: [WorkflowPublishResponse](#workflowpublishresponse)
| ### [GET] /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs Snapshot of every node's declared outputs for a published workflow run. @@ -3618,10 +3613,10 @@ Server-Sent Events stream of inspector deltas for a published workflow run. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow run node output event stream | -| 404 | Workflow run not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow run node output event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| +| 404 | Workflow run not found | | ### [GET] /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/{node_id} One node's declared outputs for a published workflow run. @@ -3690,7 +3685,7 @@ Full value for one declared output of a published run. | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Workflow deleted successfully | ### [PATCH] /apps/{app_id}/workflows/{workflow_id} **Update workflow attributes** @@ -3730,11 +3725,11 @@ Restore a published workflow version into the draft workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow restored successfully | -| 400 | Source workflow must be published | -| 404 | Workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow restored successfully | **application/json**: [WorkflowRestoreResponse](#workflowrestoreresponse)
| +| 400 | Source workflow must be published | | +| 404 | Workflow not found | | ### [GET] /apps/{resource_id}/api-keys **Get all API keys for an app** @@ -3803,16 +3798,16 @@ Refresh MCP server configuration and regenerate server code ### [GET] /auth/plugin/datasource/default-list #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [DatasourceCredentialsResponse](#datasourcecredentialsresponse)
| ### [GET] /auth/plugin/datasource/list #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [DatasourceCredentialsResponse](#datasourcecredentialsresponse)
| ### [GET] /auth/plugin/datasource/{provider_id} #### Parameters @@ -3823,9 +3818,9 @@ Refresh MCP server configuration and regenerate server code #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [DatasourceCredentialsResponse](#datasourcecredentialsresponse)
| ### [POST] /auth/plugin/datasource/{provider_id} #### Parameters @@ -3842,9 +3837,9 @@ Refresh MCP server configuration and regenerate server code #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [DELETE] /auth/plugin/datasource/{provider_id}/custom-client #### Parameters @@ -3874,9 +3869,9 @@ Refresh MCP server configuration and regenerate server code #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /auth/plugin/datasource/{provider_id}/default #### Parameters @@ -3931,9 +3926,9 @@ Refresh MCP server configuration and regenerate server code #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /auth/plugin/datasource/{provider_id}/update-name #### Parameters @@ -3957,9 +3952,9 @@ Refresh MCP server configuration and regenerate server code ### [GET] /billing/invoices #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BillingResponse](#billingresponse)
| ### [PUT] /billing/partners/{partner_key}/tenants Sync partner tenants bindings @@ -3978,17 +3973,24 @@ Sync partner tenants bindings #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Tenants synced to partner successfully | -| 400 | Invalid partner information | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Tenants synced to partner successfully | **application/json**: [BillingResponse](#billingresponse)
| +| 400 | Invalid partner information | | ### [GET] /billing/subscription +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| interval | query | Billing interval | Yes | string,
**Available values:** "month", "year" | +| plan | query | Subscription plan | Yes | string,
**Available values:** "professional", "team" | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BillingResponse](#billingresponse)
| ### [GET] /code-based-extension Get code-based extension data by module name @@ -3997,7 +3999,7 @@ Get code-based extension data by module name | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| module | query | Extension module name | No | string | +| module | query | | Yes | string | #### Responses @@ -4016,9 +4018,9 @@ Get compliance document download link #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ComplianceDownloadResponse](#compliancedownloadresponse)
| ### [GET] /data-source/integrates #### Responses @@ -4196,14 +4198,14 @@ Get external knowledge API templates | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | keyword | query | Search keyword | No | string | -| limit | query | Number of items per page (default: 20) | No | string | -| page | query | Page number (default: 1) | No | string | +| limit | query | Number of items per page | No | integer,
**Default:** 20 | +| page | query | Page number | No | integer,
**Default:** 1 | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | External API templates retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | External API templates retrieved successfully | **application/json**: [ExternalKnowledgeApiListResponse](#externalknowledgeapilistresponse)
| ### [POST] /datasets/external-knowledge-api #### Request Body @@ -4214,9 +4216,9 @@ Get external knowledge API templates #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | External API template created successfully | **application/json**: [ExternalKnowledgeApiResponse](#externalknowledgeapiresponse)
| ### [DELETE] /datasets/external-knowledge-api/{external_knowledge_api_id} #### Parameters @@ -4242,10 +4244,10 @@ Get external knowledge API template details #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | External API template retrieved successfully | -| 404 | Template not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | External API template retrieved successfully | **application/json**: [ExternalKnowledgeApiResponse](#externalknowledgeapiresponse)
| +| 404 | Template not found | | ### [PATCH] /datasets/external-knowledge-api/{external_knowledge_api_id} #### Parameters @@ -4262,9 +4264,9 @@ Get external knowledge API template details #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | External API template updated successfully | **application/json**: [ExternalKnowledgeApiResponse](#externalknowledgeapiresponse)
| ### [GET] /datasets/external-knowledge-api/{external_knowledge_api_id}/use-check Check if external knowledge API is being used @@ -4343,9 +4345,9 @@ Get dataset document processing rules #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Process rules retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Process rules retrieved successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| ### [GET] /datasets/retrieval-setting Get dataset retrieval settings @@ -4464,9 +4466,9 @@ Get dataset auto disable logs #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Batch indexing estimate calculated successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| ### [GET] /datasets/{dataset_id}/batch/{batch}/indexing-status #### Parameters @@ -4554,9 +4556,9 @@ Download selected dataset documents as a single ZIP archive (upload-file only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | ZIP archive generated successfully | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| ### [POST] /datasets/{dataset_id}/documents/generate-summary **Generate summary index for specified documents** @@ -4647,10 +4649,10 @@ Get document details #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Document retrieved successfully | -| 404 | Document not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Document retrieved successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| +| 404 | Document not found | | ### [GET] /datasets/{dataset_id}/documents/{document_id}/download Get a signed download URL for a dataset document's original uploaded file @@ -4680,11 +4682,11 @@ Estimate document indexing cost #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Indexing estimate calculated successfully | -| 400 | Document already finished | -| 404 | Document not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Indexing estimate calculated successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| +| 400 | Document already finished | | +| 404 | Document not found | | ### [GET] /datasets/{dataset_id}/documents/{document_id}/indexing-status Get document indexing status @@ -4751,9 +4753,9 @@ Update document metadata #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Document pipeline execution log retrieved successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| ### [PATCH] /datasets/{dataset_id}/documents/{document_id}/processing/pause **pause document** @@ -5087,10 +5089,10 @@ Returns: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Summary status retrieved successfully | -| 404 | Document not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Summary status retrieved successfully | **application/json**: [OpaqueObjectResponse](#opaqueobjectresponse)
| +| 404 | Document not found | | ### [GET] /datasets/{dataset_id}/documents/{document_id}/website-sync **sync website document** @@ -5141,11 +5143,11 @@ Test external knowledge retrieval for dataset #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | External hit testing completed successfully | -| 400 | Invalid parameters | -| 404 | Dataset not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | External hit testing completed successfully | **application/json**: [ExternalRetrievalTestResponse](#externalretrievaltestresponse)
| +| 400 | Invalid parameters | | +| 404 | Dataset not found | | ### [POST] /datasets/{dataset_id}/hit-testing Test dataset knowledge retrieval @@ -5435,13 +5437,25 @@ Check if dataset is in use | 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /email-register +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [EmailRegisterResetPayload](#emailregisterresetpayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [EmailRegisterResetResponse](#emailregisterresetresponse)
| ### [POST] /email-register/send-email +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [EmailRegisterSendPayload](#emailregistersendpayload)
| + #### Responses | Code | Description | Schema | @@ -5449,6 +5463,12 @@ Check if dataset is in use | 200 | Success | **application/json**: [SimpleResultDataResponse](#simpleresultdataresponse)
| ### [POST] /email-register/validity +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [EmailRegisterValidityPayload](#emailregistervaliditypayload)
| + #### Responses | Code | Description | Schema | @@ -5477,9 +5497,9 @@ Check if dataset is in use #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RecommendedAppDetailResponse](#recommendedappdetailresponse)
| ### [GET] /features **Get feature configuration for current tenant** @@ -5594,9 +5614,9 @@ GET /console/api/form/human_input/ #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ConsoleHumanInputFormDefinitionResponse](#consolehumaninputformdefinitionresponse)
| ### [POST] /form/human_input/{form_token} **Submit human input form by form token** @@ -5625,9 +5645,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ConsoleHumanInputFormSubmitResponse](#consolehumaninputformsubmitresponse)
| ### [POST] /info #### Responses @@ -5637,6 +5657,12 @@ Request body: | 200 | Success | **application/json**: [TenantInfoResponse](#tenantinforesponse)
| ### [GET] /installed-apps +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| app_id | query | App ID to filter by | No | string | + #### Responses | Code | Description | Schema | @@ -5644,6 +5670,12 @@ Request body: | 200 | Success | **application/json**: [InstalledAppListResponse](#installedapplistresponse)
| ### [POST] /installed-apps +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [InstalledAppCreatePayload](#installedappcreatepayload)
| + #### Responses | Code | Description | Schema | @@ -5670,6 +5702,12 @@ Request body: | ---- | ---------- | ----------- | -------- | ------ | | installed_app_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [InstalledAppUpdatePayload](#installedappupdatepayload)
| + #### Responses | Code | Description | Schema | @@ -5685,9 +5723,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioTranscriptResponse](#audiotranscriptresponse)
| ### [POST] /installed-apps/{installed_app_id}/chat-messages #### Parameters @@ -5704,9 +5742,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [POST] /installed-apps/{installed_app_id}/chat-messages/{task_id}/stop #### Parameters @@ -5737,9 +5775,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [POST] /installed-apps/{installed_app_id}/completion-messages/{task_id}/stop #### Parameters @@ -5767,9 +5805,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ConversationInfiniteScrollPagination](#conversationinfinitescrollpagination)
| ### [DELETE] /installed-apps/{installed_app_id}/conversations/{c_id} #### Parameters @@ -5801,9 +5839,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Conversation renamed successfully | **application/json**: [SimpleConversation](#simpleconversation)
| ### [PATCH] /installed-apps/{installed_app_id}/conversations/{c_id}/pin #### Parameters @@ -5845,9 +5883,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [MessageInfiniteScrollPagination](#messageinfinitescrollpagination)
| ### [POST] /installed-apps/{installed_app_id}/messages/{message_id}/feedbacks #### Parameters @@ -5880,9 +5918,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [GET] /installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions #### Parameters @@ -5909,9 +5947,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ExploreAppMetaResponse](#exploreappmetaresponse)
| ### [GET] /installed-apps/{installed_app_id}/parameters **Retrieve app parameters** @@ -5924,9 +5962,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [Parameters](#parameters)
| ### [GET] /installed-apps/{installed_app_id}/saved-messages #### Parameters @@ -5939,9 +5977,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SavedMessageInfiniteScrollPagination](#savedmessageinfinitescrollpagination)
| ### [POST] /installed-apps/{installed_app_id}/saved-messages #### Parameters @@ -5991,9 +6029,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioBinaryResponse](#audiobinaryresponse)
| ### [POST] /installed-apps/{installed_app_id}/workflows/run **Run workflow** @@ -6012,9 +6050,9 @@ Request body: #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [POST] /installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop **Stop workflow task** @@ -6043,11 +6081,11 @@ Generate instruction for workflow nodes or general use #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Instruction generated successfully | -| 400 | Invalid request parameters or flow/workflow not found | -| 402 | Provider quota exceeded | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Instruction generated successfully | **application/json**: [GeneratorResponse](#generatorresponse)
| +| 400 | Invalid request parameters or flow/workflow not found | | +| 402 | Provider quota exceeded | | ### [POST] /instruction-generate/template Get instruction generation template @@ -6060,10 +6098,10 @@ Get instruction generation template #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Template retrieved successfully | -| 400 | Invalid request parameters | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Template retrieved successfully | **application/json**: [SimpleDataResponse](#simpledataresponse)
| +| 400 | Invalid request parameters | | ### [POST] /login **Authenticate user and login** @@ -6088,25 +6126,38 @@ Get instruction generation template | 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /mcp/oauth/callback +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| code | query | | Yes | string | +| state | query | | Yes | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console OAuth callback page | **application/json**: [RedirectResponse](#redirectresponse)
| ### [GET] /notification 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. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success — inspect should_show to decide whether to render the modal | -| 401 | Unauthorized | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success — inspect should_show to decide whether to render the modal | **application/json**: [NotificationResponse](#notificationresponse)
| +| 401 | Unauthorized | | ### [POST] /notification/dismiss Mark a notification as dismissed for the current user. +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [DismissNotificationPayload](#dismissnotificationpayload)
| + #### Responses | Code | Description | Schema | @@ -6151,15 +6202,15 @@ Handle OAuth callback and complete login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | provider | path | OAuth provider name (github/google) | Yes | string | -| code | query | Authorization code from OAuth provider | No | string | -| state | query | Optional state parameter (used for invite token) | No | string | +| code | query | Authorization code from OAuth provider | Yes | string | +| state | query | OAuth state parameter | No | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 302 | Redirect to console with access token | -| 400 | OAuth process failed | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console with access token | **application/json**: [RedirectResponse](#redirectresponse)
| +| 400 | OAuth process failed | | ### [GET] /oauth/data-source/binding/{provider} Bind OAuth data source with authorization code @@ -6169,7 +6220,7 @@ Bind OAuth data source with authorization code | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | provider | path | Data source provider name (notion) | Yes | string | -| code | query | Authorization code from OAuth provider | No | string | +| code | query | Authorization code from OAuth provider | Yes | string | #### Responses @@ -6191,10 +6242,10 @@ Handle OAuth callback from data source provider #### Responses -| Code | Description | -| ---- | ----------- | -| 302 | Redirect to console with result | -| 400 | Invalid provider | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console with result | **application/json**: [RedirectResponse](#redirectresponse)
| +| 400 | Invalid provider | | ### [GET] /oauth/data-source/{provider} Get OAuth authorization URL for data source provider @@ -6239,39 +6290,46 @@ Initiate OAuth login process | ---- | ---------- | ----------- | -------- | ------ | | provider | path | OAuth provider name (github/google) | Yes | string | | invite_token | query | Optional invitation token | No | string | +| language | query | Preferred interface language | No | string | +| timezone | query | Preferred timezone | No | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 302 | Redirect to OAuth authorization URL | -| 400 | Invalid provider | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to OAuth authorization URL | **application/json**: [RedirectResponse](#redirectresponse)
| +| 400 | Invalid provider | | ### [GET] /oauth/plugin/{provider_id}/datasource/callback #### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| code | query | Authorization code from OAuth provider | No | string | +| context_id | query | OAuth proxy context ID | No | string | +| error | query | Error message from OAuth provider | No | string | +| state | query | OAuth state parameter | No | string | | provider_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console OAuth callback page | **application/json**: [RedirectResponse](#redirectresponse)
| ### [GET] /oauth/plugin/{provider_id}/datasource/get-authorization-url #### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| credential_id | query | Credential ID to reauthorize | No | string | | provider_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Authorization URL retrieved successfully | **application/json**: [PluginOAuthAuthorizationUrlResponse](#pluginoauthauthorizationurlresponse)
| ### [GET] /oauth/plugin/{provider}/tool/authorization-url #### Parameters @@ -6282,9 +6340,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Authorization URL retrieved successfully | **application/json**: [PluginOAuthAuthorizationUrlResponse](#pluginoauthauthorizationurlresponse)
| ### [GET] /oauth/plugin/{provider}/tool/callback #### Parameters @@ -6295,9 +6353,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console OAuth callback page | **application/json**: [RedirectResponse](#redirectresponse)
| ### [GET] /oauth/plugin/{provider}/trigger/callback **Handle OAuth callback for trigger provider** @@ -6310,37 +6368,61 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 302 | Redirect to console OAuth callback page | **application/json**: [RedirectResponse](#redirectresponse)
| ### [POST] /oauth/provider +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [OAuthProviderRequest](#oauthproviderrequest)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [OAuthProviderAppResponse](#oauthproviderappresponse)
| ### [POST] /oauth/provider/account +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [OAuthClientPayload](#oauthclientpayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [OAuthProviderAccountResponse](#oauthprovideraccountresponse)
| ### [POST] /oauth/provider/authorize +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [OAuthClientPayload](#oauthclientpayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [OAuthProviderAuthorizeResponse](#oauthproviderauthorizeresponse)
| ### [POST] /oauth/provider/token +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [OAuthTokenRequest](#oauthtokenrequest)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [OAuthProviderTokenResponse](#oauthprovidertokenresponse)
| ### [DELETE] /rag/pipeline/customized/templates/{template_id} #### Parameters @@ -6438,9 +6520,9 @@ Initiate OAuth login process ### [GET] /rag/pipelines/datasource-plugins #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [POST] /rag/pipelines/imports #### Request Body @@ -6485,11 +6567,17 @@ Initiate OAuth login process | 200 | Dependencies checked | **application/json**: [RagPipelineImportCheckDependenciesResponse](#ragpipelineimportcheckdependenciesresponse)
| ### [GET] /rag/pipelines/recommended-plugins +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| type | query | | No | string,
**Default:** all | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [POST] /rag/pipelines/transform/datasets/{dataset_id} #### Parameters @@ -6500,9 +6588,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/customized/publish #### Parameters @@ -6544,6 +6632,8 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| last_id | query | | No | string | +| limit | query | | No | integer,
**Default:** 20 | | pipeline_id | path | | Yes | string | #### Responses @@ -6607,6 +6697,10 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| limit | query | | No | integer,
**Default:** 10 | +| named_only | query | | No | boolean | +| page | query | | No | integer,
**Default:** 1 | +| user_id | query | | No | string | | pipeline_id | path | | Yes | string | #### Responses @@ -6627,9 +6721,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Default block configs retrieved successfully | **application/json**: [DefaultBlockConfigsResponse](#defaultblockconfigsresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs/{block_type} **Get default block config** @@ -6638,14 +6732,15 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| q | query | | No | string | | block_type | path | | Yes | string | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Default block config retrieved successfully | **application/json**: [DefaultBlockConfigResponse](#defaultblockconfigresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft **Get draft rag pipeline's workflow** @@ -6672,6 +6767,12 @@ Initiate OAuth login process | ---- | ---------- | ----------- | -------- | ------ | | pipeline_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [DraftWorkflowSyncPayload](#draftworkflowsyncpayload)
| + #### Responses | Code | Description | Schema | @@ -6696,9 +6797,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/draft/datasource/variables-inspect **Set datasource variables** @@ -6732,9 +6833,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Environment variables retrieved successfully | **application/json**: [EnvironmentVariableListResponse](#environmentvariablelistresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/draft/iteration/nodes/{node_id}/run **Run draft workflow iteration node** @@ -6754,9 +6855,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/draft/loop/nodes/{node_id}/run **Run draft workflow loop node** @@ -6776,9 +6877,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/last-run #### Parameters @@ -6828,7 +6929,7 @@ Initiate OAuth login process | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Node variables deleted successfully | ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables #### Parameters @@ -6840,9 +6941,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Node variables retrieved successfully | **application/json**: [WorkflowDraftVariableList](#workflowdraftvariablelist)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/pre-processing/parameters **Get first step parameters of rag pipeline** @@ -6851,13 +6952,14 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| node_id | query | | Yes | string | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineStepParametersResponse](#ragpipelinestepparametersresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/processing/parameters **Get second step parameters of rag pipeline** @@ -6866,13 +6968,14 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| node_id | query | | Yes | string | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineStepParametersResponse](#ragpipelinestepparametersresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/draft/run **Run draft workflow** @@ -6891,9 +6994,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/system-variables #### Parameters @@ -6904,9 +7007,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | System variables retrieved successfully | **application/json**: [WorkflowDraftVariableList](#workflowdraftvariablelist)
| ### [DELETE] /rag/pipelines/{pipeline_id}/workflows/draft/variables #### Parameters @@ -6919,7 +7022,7 @@ Initiate OAuth login process | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Workflow variables deleted successfully | ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/variables **Get draft workflow** @@ -6928,13 +7031,15 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| limit | query | | No | integer,
**Default:** 20 | +| page | query | | No | integer,
**Default:** 1 | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow variables retrieved successfully | **application/json**: [WorkflowDraftVariableListWithoutValue](#workflowdraftvariablelistwithoutvalue)
| ### [DELETE] /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id} #### Parameters @@ -6948,7 +7053,7 @@ Initiate OAuth login process | Code | Description | | ---- | ----------- | -| 200 | Success | +| 204 | Variable deleted successfully | ### [GET] /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id} #### Parameters @@ -6960,9 +7065,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Variable retrieved successfully | **application/json**: [WorkflowDraftVariable](#workflowdraftvariable)
| ### [PATCH] /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id} #### Parameters @@ -6980,9 +7085,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Variable updated successfully | **application/json**: [WorkflowDraftVariable](#workflowdraftvariable)
| ### [PUT] /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}/reset #### Parameters @@ -6994,9 +7099,10 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Variable reset successfully | **application/json**: [WorkflowDraftVariable](#workflowdraftvariable)
| +| 204 | Variable reset (no content) | | ### [GET] /rag/pipelines/{pipeline_id}/workflows/publish **Get published pipeline** @@ -7046,9 +7152,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [DataSourceContentPreviewResponse](#datasourcecontentpreviewresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/run **Run rag pipeline datasource** @@ -7068,9 +7174,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/published/pre-processing/parameters **Get first step parameters of rag pipeline** @@ -7079,13 +7185,14 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| node_id | query | | Yes | string | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineStepParametersResponse](#ragpipelinestepparametersresponse)
| ### [GET] /rag/pipelines/{pipeline_id}/workflows/published/processing/parameters **Get second step parameters of rag pipeline** @@ -7094,13 +7201,14 @@ Initiate OAuth login process | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| node_id | query | | Yes | string | | pipeline_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineStepParametersResponse](#ragpipelinestepparametersresponse)
| ### [POST] /rag/pipelines/{pipeline_id}/workflows/published/run **Run published workflow** @@ -7119,9 +7227,9 @@ Initiate OAuth login process #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [RagPipelineOpaqueResponse](#ragpipelineopaqueresponse)
| ### [DELETE] /rag/pipelines/{pipeline_id}/workflows/{workflow_id} **Delete a published workflow version that is not currently active on the pipeline** @@ -7149,6 +7257,12 @@ Initiate OAuth login process | pipeline_id | path | | Yes | string | | workflow_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [WorkflowUpdatePayload](#workflowupdatepayload)
| + #### Responses | Code | Description | Schema | @@ -7229,11 +7343,11 @@ Generate code rules using LLM #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Code rules generated successfully | -| 400 | Invalid request parameters | -| 402 | Provider quota exceeded | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Code rules generated successfully | **application/json**: [GeneratorResponse](#generatorresponse)
| +| 400 | Invalid request parameters | | +| 402 | Provider quota exceeded | | ### [POST] /rule-generate Generate rule configuration using LLM @@ -7246,11 +7360,11 @@ Generate rule configuration using LLM #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Rule configuration generated successfully | -| 400 | Invalid request parameters | -| 402 | Provider quota exceeded | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Rule configuration generated successfully | **application/json**: [GeneratorResponse](#generatorresponse)
| +| 400 | Invalid request parameters | | +| 402 | Provider quota exceeded | | ### [POST] /rule-structured-output-generate Generate structured output rules using LLM @@ -7263,11 +7377,11 @@ Generate structured output rules using LLM #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Structured output generated successfully | -| 400 | Invalid request parameters | -| 402 | Provider quota exceeded | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Structured output generated successfully | **application/json**: [GeneratorResponse](#generatorresponse)
| +| 400 | Invalid request parameters | | +| 402 | Provider quota exceeded | | ### [GET] /snippets/{snippet_id}/workflow-runs **List workflow runs for snippet** @@ -7276,6 +7390,8 @@ Generate structured output rules using LLM | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| last_id | query | | No | string | +| limit | query | | No | integer,
**Default:** 20 | | snippet_id | path | | Yes | string | #### Responses @@ -7299,10 +7415,10 @@ command channel for backward compatibility. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Task stopped successfully | -| 404 | Snippet not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Task stopped successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| +| 404 | Snippet not found | | ### [GET] /snippets/{snippet_id}/workflow-runs/{run_id} **Get workflow run detail for snippet** @@ -7367,9 +7483,9 @@ Get all published workflows for a snippet #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Default block configs retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Default block configs retrieved successfully | **application/json**: [DefaultBlockConfigsResponse](#defaultblockconfigsresponse)
| ### [GET] /snippets/{snippet_id}/workflows/draft **Get draft workflow for snippet** @@ -7404,10 +7520,10 @@ Get all published workflows for a snippet #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Draft workflow synced successfully | -| 400 | Hash mismatch | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Draft workflow synced successfully | **application/json**: [WorkflowRestoreResponse](#workflowrestoreresponse)
| +| 400 | Hash mismatch | | ### [GET] /snippets/{snippet_id}/workflows/draft/config **Get snippet draft workflow configuration limits** @@ -7420,9 +7536,9 @@ Get all published workflows for a snippet #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Draft config retrieved successfully | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Draft config retrieved successfully | **application/json**: [SnippetDraftConfigResponse](#snippetdraftconfigresponse)
| ### [GET] /snippets/{snippet_id}/workflows/draft/conversation-variables Conversation variables are not used in snippet workflows; returns an empty list for API parity @@ -7450,10 +7566,10 @@ Get environment variables from snippet draft workflow graph #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Environment variables retrieved successfully | -| 404 | Draft workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Environment variables retrieved successfully | **application/json**: [EnvironmentVariableListResponse](#environmentvariablelistresponse)
| +| 404 | Draft workflow not found | | ### [POST] /snippets/{snippet_id}/workflows/draft/iteration/nodes/{node_id}/run **Run a draft workflow iteration node for snippet** @@ -7477,10 +7593,10 @@ Returns an SSE event stream with iteration progress and results. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Iteration node run started successfully (SSE stream) | -| 404 | Snippet or draft workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Iteration node run started successfully (SSE stream) | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 404 | Snippet or draft workflow not found | | ### [POST] /snippets/{snippet_id}/workflows/draft/loop/nodes/{node_id}/run **Run a draft workflow loop node for snippet** @@ -7504,10 +7620,10 @@ Returns an SSE event stream with loop progress and results. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Loop node run started successfully (SSE stream) | -| 404 | Snippet or draft workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Loop node run started successfully (SSE stream) | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 404 | Snippet or draft workflow not found | | ### [GET] /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/last-run **Get the last run result for a specific node in snippet draft workflow** @@ -7609,10 +7725,10 @@ and returns an SSE event stream with execution progress and results. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Draft workflow run started successfully (SSE stream) | -| 404 | Snippet or draft workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Draft workflow run started successfully (SSE stream) | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 404 | Snippet or draft workflow not found | | ### [GET] /snippets/{snippet_id}/workflows/draft/system-variables System variables are not used in snippet workflows; returns an empty list for API parity @@ -7769,10 +7885,10 @@ Reset a draft workflow variable to its default value (snippet scope) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow published successfully | -| 400 | No draft workflow found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow published successfully | **application/json**: [WorkflowPublishResponse](#workflowpublishresponse)
| +| 400 | No draft workflow found | | ### [POST] /snippets/{snippet_id}/workflows/{workflow_id}/restore **Restore a published snippet workflow version into the draft workflow** @@ -7786,11 +7902,11 @@ Reset a draft workflow variable to its default value (snippet scope) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow restored successfully | -| 400 | Source workflow must be published | -| 404 | Workflow not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow restored successfully | **application/json**: [WorkflowRestoreResponse](#workflowrestoreresponse)
| +| 400 | Source workflow must be published | | +| 404 | Workflow not found | | ### [GET] /spec/schema-definitions **Get system JSON Schema definitions specification** @@ -7799,9 +7915,9 @@ Used for frontend component type mapping #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SchemaDefinitionsResponse](#schemadefinitionsresponse)
| ### [GET] /system-features **Get system-wide feature configuration** @@ -7853,8 +7969,8 @@ Remove one or more tag bindings from a target. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| keyword | query | Search keyword for tag name. | No | string | -| type | query | Tag type filter. Can be "knowledge", "app", or "snippet". | No | string | +| keyword | query | Search keyword | No | string | +| type | query | Tag type filter | No | string,
**Available values:** "", "app", "knowledge", "snippet" | #### Responses @@ -7918,9 +8034,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Bedrock retrieval test completed | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Bedrock retrieval test completed | **application/json**: [ExternalRetrievalTestResponse](#externalretrievaltestresponse)
| ### [GET] /trial-apps/{app_id} **Get app detail** @@ -7933,9 +8049,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TrialAppDetailWithSite](#trialappdetailwithsite)
| ### [POST] /trial-apps/{app_id}/audio-to-text #### Parameters @@ -7946,9 +8062,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioTranscriptResponse](#audiotranscriptresponse)
| ### [POST] /trial-apps/{app_id}/chat-messages #### Parameters @@ -7965,9 +8081,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [POST] /trial-apps/{app_id}/completion-messages #### Parameters @@ -7984,22 +8100,25 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [GET] /trial-apps/{app_id}/datasets #### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| ids | query | Dataset IDs | No | [ string ] | +| limit | query | Number of items per page | No | integer,
**Default:** 20 | +| page | query | Page number | No | integer,
**Default:** 1 | | app_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TrialDatasetList](#trialdatasetlist)
| ### [GET] /trial-apps/{app_id}/messages/{message_id}/suggested-questions #### Parameters @@ -8011,9 +8130,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SuggestedQuestionsResponse](#suggestedquestionsresponse)
| ### [GET] /trial-apps/{app_id}/parameters **Retrieve app parameters** @@ -8026,9 +8145,9 @@ Bedrock retrieval test (internal use only) #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [Parameters](#parameters)
| ### [GET] /trial-apps/{app_id}/site **Retrieve app site info** @@ -8043,9 +8162,9 @@ Returns the site configuration for the application including theme, icons, and t #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [Site](#site)
| ### [POST] /trial-apps/{app_id}/text-to-audio #### Parameters @@ -8062,9 +8181,9 @@ Returns the site configuration for the application including theme, icons, and t #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioBinaryResponse](#audiobinaryresponse)
| ### [GET] /trial-apps/{app_id}/workflows **Get workflow detail** @@ -8077,9 +8196,9 @@ Returns the site configuration for the application including theme, icons, and t #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TrialWorkflow](#trialworkflow)
| ### [POST] /trial-apps/{app_id}/workflows/run **Run workflow** @@ -8098,9 +8217,9 @@ Returns the site configuration for the application including theme, icons, and t #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| ### [POST] /trial-apps/{app_id}/workflows/tasks/{task_id}/stop **Stop workflow task** @@ -8114,9 +8233,9 @@ Returns the site configuration for the application including theme, icons, and t #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /trial-models **Get hosted trial model provider configuration for model-provider pages** @@ -8140,10 +8259,10 @@ Crawl website content #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Website crawl initiated successfully | -| 400 | Invalid crawl parameters | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Website crawl initiated successfully | **application/json**: [WebsiteCrawlResponse](#websitecrawlresponse)
| +| 400 | Invalid crawl parameters | | ### [GET] /website/crawl/status/{job_id} Get website crawl status @@ -8157,11 +8276,11 @@ Get website crawl status #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Crawl status retrieved successfully | -| 400 | Invalid provider | -| 404 | Crawl job not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Crawl status retrieved successfully | **application/json**: [WebsiteCrawlResponse](#websitecrawlresponse)
| +| 400 | Invalid provider | | +| 404 | Crawl job not found | | ### [POST] /workflow-generate Generate a Dify workflow graph from natural language @@ -8174,11 +8293,11 @@ Generate a Dify workflow graph from natural language #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow graph generated successfully | -| 400 | Invalid request parameters | -| 402 | Provider quota exceeded | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow graph generated successfully | **application/json**: [GeneratorResponse](#generatorresponse)
| +| 400 | Invalid request parameters | | +| 402 | Provider quota exceeded | | ### [GET] /workflow/{workflow_run_id}/events **Get workflow execution events stream after resume** @@ -8195,9 +8314,9 @@ Returns Server-Sent Events stream. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | SSE event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| ### [GET] /workflow/{workflow_run_id}/pause-details **Get workflow pause details** @@ -8223,9 +8342,9 @@ Returns information about why and where the workflow is paused. ### [GET] /workspaces #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TenantListResponse](#tenantlistresponse)
| ### [POST] /workspaces/current #### Responses @@ -8247,7 +8366,7 @@ Get specific agent provider details | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: object
| +| 200 | Success | **application/json**: [AgentProviderResponse](#agentproviderresponse)
| ### [GET] /workspaces/current/agent-providers Get list of available agent providers @@ -8256,7 +8375,7 @@ Get list of available agent providers | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [ object ]
| +| 200 | Success | **application/json**: [AgentProviderListResponse](#agentproviderlistresponse)
| ### [GET] /workspaces/current/customized-snippets **List customized snippets with pagination and search** @@ -8305,11 +8424,11 @@ Get list of available agent providers #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Snippet imported successfully | -| 202 | Import pending confirmation | -| 400 | Import failed | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Snippet imported successfully | **application/json**: [SnippetImportResponse](#snippetimportresponse)
| +| 202 | Import pending confirmation | **application/json**: [SnippetImportResponse](#snippetimportresponse)
| +| 400 | Import failed | | ### [POST] /workspaces/current/customized-snippets/imports/{import_id}/confirm **Confirm a pending snippet import** @@ -8322,10 +8441,10 @@ Get list of available agent providers #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Import confirmed successfully | -| 400 | Import failed | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Import confirmed successfully | **application/json**: [SnippetImportResponse](#snippetimportresponse)
| +| 400 | Import failed | | ### [DELETE] /workspaces/current/customized-snippets/{snippet_id} **Delete customized snippet** @@ -8393,10 +8512,10 @@ Get list of available agent providers #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Dependencies checked successfully | -| 404 | Snippet not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Dependencies checked successfully | **application/json**: [SnippetDependencyCheckResponse](#snippetdependencycheckresponse)
| +| 404 | Snippet not found | | ### [GET] /workspaces/current/customized-snippets/{snippet_id}/export **Export snippet as DSL** @@ -8408,13 +8527,14 @@ Export snippet configuration as DSL | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | snippet_id | path | Snippet ID to export | Yes | string | +| include_secret | query | Whether to include secret variables | No | string,
**Default:** false | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Snippet exported successfully | -| 404 | Snippet not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Snippet exported successfully | **application/json**: [TextFileResponse](#textfileresponse)
| +| 404 | Snippet not found | | ### [POST] /workspaces/current/customized-snippets/{snippet_id}/use-count/increment **Increment snippet use count when it is inserted into a workflow** @@ -8429,10 +8549,10 @@ Increment snippet use count by 1 #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Use count incremented successfully | -| 404 | Snippet not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Use count incremented successfully | **application/json**: [SnippetUseCountResponse](#snippetusecountresponse)
| +| 404 | Snippet not found | | ### [GET] /workspaces/current/dataset-operators #### Responses @@ -8450,9 +8570,9 @@ Increment snippet use count by 1 #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [DefaultModelDataResponse](#defaultmodeldataresponse)
| ### [POST] /workspaces/current/default-model #### Request Body @@ -8659,9 +8779,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Success | **application/json**: [MemberInviteResponse](#memberinviteresponse)
| ### [POST] /workspaces/current/members/owner-transfer-check #### Request Body @@ -8698,9 +8818,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [MemberActionTenantResponse](#memberactiontenantresponse)
| ### [POST] /workspaces/current/members/{member_id}/owner-transfer #### Parameters @@ -8717,9 +8837,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [PUT] /workspaces/current/members/{member_id}/update-role #### Parameters @@ -8736,9 +8856,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /workspaces/current/model-providers #### Parameters @@ -8749,9 +8869,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ModelProviderListResponse](#modelproviderlistresponse)
| ### [GET] /workspaces/current/model-providers/{provider}/checkout-url #### Parameters @@ -8762,9 +8882,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ModelProviderPaymentCheckoutUrlResponse](#modelproviderpaymentcheckouturlresponse)
| ### [DELETE] /workspaces/current/model-providers/{provider}/credentials #### Parameters @@ -8795,9 +8915,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ProviderCredentialResponse](#providercredentialresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/credentials #### Parameters @@ -8814,9 +8934,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Credential created successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [PUT] /workspaces/current/model-providers/{provider}/credentials #### Parameters @@ -8833,9 +8953,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/credentials/switch #### Parameters @@ -8871,9 +8991,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential validation result | **application/json**: [ProviderCredentialValidateResponse](#providercredentialvalidateresponse)
| ### [DELETE] /workspaces/current/model-providers/{provider}/models #### Parameters @@ -8903,9 +9023,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ModelWithProviderListResponse](#modelwithproviderlistresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/models #### Parameters @@ -8922,9 +9042,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [DELETE] /workspaces/current/model-providers/{provider}/models/credentials #### Parameters @@ -8958,9 +9078,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ModelCredentialResponse](#modelcredentialresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/models/credentials #### Parameters @@ -8977,9 +9097,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Credential created successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [PUT] /workspaces/current/model-providers/{provider}/models/credentials #### Parameters @@ -8996,9 +9116,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/models/credentials/switch #### Parameters @@ -9034,9 +9154,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential validation result | **application/json**: [ModelCredentialValidateResponse](#modelcredentialvalidateresponse)
| ### [PATCH] /workspaces/current/model-providers/{provider}/models/disable #### Parameters @@ -9091,9 +9211,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential validation result | **application/json**: [LoadBalancingCredentialValidateResponse](#loadbalancingcredentialvalidateresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/models/load-balancing-configs/{config_id}/credentials-validate #### Parameters @@ -9111,9 +9231,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Credential validation result | **application/json**: [LoadBalancingCredentialValidateResponse](#loadbalancingcredentialvalidateresponse)
| ### [GET] /workspaces/current/model-providers/{provider}/models/parameter-rules #### Parameters @@ -9125,9 +9245,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ModelParameterRulesResponse](#modelparameterrulesresponse)
| ### [POST] /workspaces/current/model-providers/{provider}/preferred-provider-type #### Parameters @@ -9157,9 +9277,9 @@ Update a plugin endpoint #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ProviderWithModelsDataResponse](#providerwithmodelsdataresponse)
| ### [GET] /workspaces/current/permission **Get workspace permission settings** @@ -9182,9 +9302,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| ### [GET] /workspaces/current/plugin/debugging-key #### Responses @@ -9202,9 +9322,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginManifestResponse](#pluginmanifestresponse)
| ### [GET] /workspaces/current/plugin/icon #### Parameters @@ -9216,9 +9336,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| ### [POST] /workspaces/current/plugin/install/github #### Request Body @@ -9229,9 +9349,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/install/marketplace #### Request Body @@ -9242,9 +9362,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/install/pkg #### Request Body @@ -9255,9 +9375,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [GET] /workspaces/current/plugin/list #### Parameters @@ -9269,9 +9389,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginListResponse](#pluginlistresponse)
| ### [POST] /workspaces/current/plugin/list/installations/ids #### Request Body @@ -9282,9 +9402,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginInstallationsResponse](#plugininstallationsresponse)
| ### [POST] /workspaces/current/plugin/list/latest-versions #### Request Body @@ -9295,9 +9415,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginVersionsResponse](#pluginversionsresponse)
| ### [GET] /workspaces/current/plugin/marketplace/pkg #### Parameters @@ -9308,9 +9428,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginManifestResponse](#pluginmanifestresponse)
| ### [GET] /workspaces/current/plugin/parameters/dynamic-options #### Parameters @@ -9326,9 +9446,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDynamicOptionsResponse](#plugindynamicoptionsresponse)
| ### [POST] /workspaces/current/plugin/parameters/dynamic-options-with-credentials **Fetch dynamic options using credentials directly (for edit mode)** @@ -9341,9 +9461,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDynamicOptionsResponse](#plugindynamicoptionsresponse)
| ### [POST] /workspaces/current/plugin/permission/change #### Request Body @@ -9361,9 +9481,9 @@ Returns permission flags that control workspace features like member invitations ### [GET] /workspaces/current/plugin/permission/fetch #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginPermissionResponse](#pluginpermissionresponse)
| ### [POST] /workspaces/current/plugin/preferences/autoupgrade/exclude #### Request Body @@ -9374,9 +9494,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginOperationSuccessResponse](#pluginoperationsuccessresponse)
| ### [POST] /workspaces/current/plugin/preferences/change #### Request Body @@ -9387,16 +9507,16 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginOperationSuccessResponse](#pluginoperationsuccessresponse)
| ### [GET] /workspaces/current/plugin/preferences/fetch #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginPreferencesResponse](#pluginpreferencesresponse)
| ### [GET] /workspaces/current/plugin/readme #### Parameters @@ -9408,9 +9528,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginReadmeResponse](#pluginreadmeresponse)
| ### [GET] /workspaces/current/plugin/tasks #### Parameters @@ -9422,9 +9542,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginTasksResponse](#plugintasksresponse)
| ### [POST] /workspaces/current/plugin/tasks/delete_all #### Responses @@ -9442,9 +9562,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginTaskResponse](#plugintaskresponse)
| ### [POST] /workspaces/current/plugin/tasks/{task_id}/delete #### Parameters @@ -9495,9 +9615,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/upgrade/marketplace #### Request Body @@ -9508,16 +9628,16 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/upload/bundle #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/upload/github #### Request Body @@ -9528,23 +9648,23 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [POST] /workspaces/current/plugin/upload/pkg #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [PluginDaemonOperationResponse](#plugindaemonoperationresponse)
| ### [GET] /workspaces/current/tool-labels #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/api/add #### Request Body @@ -9555,9 +9675,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/api/delete #### Request Body @@ -9568,23 +9688,35 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/api/get +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| provider | query | | Yes | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/api/remote +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| url | query | | Yes | string (uri) | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/api/schema #### Request Body @@ -9595,9 +9727,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/api/test/pre #### Request Body @@ -9608,16 +9740,22 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/api/tools +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| provider | query | | Yes | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/api/update #### Request Body @@ -9628,9 +9766,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/builtin/{provider}/add #### Parameters @@ -9647,22 +9785,23 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/credential/info #### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| include_credential_ids | query | Credential IDs to include even if visibility would hide them | No | [ string ] | | provider | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/credential/schema/{credential_type} #### Parameters @@ -9674,22 +9813,23 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/credentials #### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| include_credential_ids | query | Credential IDs to include even if visibility would hide them | No | [ string ] | | provider | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/builtin/{provider}/default-credential #### Parameters @@ -9706,9 +9846,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/builtin/{provider}/delete #### Parameters @@ -9725,9 +9865,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/icon #### Parameters @@ -9738,9 +9878,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/info #### Parameters @@ -9751,9 +9891,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/oauth/client-schema #### Parameters @@ -9764,9 +9904,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolOAuthClientSchemaResponse](#tooloauthclientschemaresponse)
| ### [DELETE] /workspaces/current/tool-provider/builtin/{provider}/oauth/custom-client #### Parameters @@ -9777,9 +9917,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/oauth/custom-client #### Parameters @@ -9790,9 +9930,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolOAuthCustomClientResponse](#tooloauthcustomclientresponse)
| ### [POST] /workspaces/current/tool-provider/builtin/{provider}/oauth/custom-client #### Parameters @@ -9809,9 +9949,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /workspaces/current/tool-provider/builtin/{provider}/tools #### Parameters @@ -9822,9 +9962,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/builtin/{provider}/update #### Parameters @@ -9841,9 +9981,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [DELETE] /workspaces/current/tool-provider/mcp #### Request Body @@ -9867,9 +10007,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [PUT] /workspaces/current/tool-provider/mcp #### Request Body @@ -9880,9 +10020,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /workspaces/current/tool-provider/mcp/auth #### Request Body @@ -9893,9 +10033,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/mcp/tools/{provider_id} #### Parameters @@ -9906,9 +10046,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/mcp/update/{provider_id} #### Parameters @@ -9919,9 +10059,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/workflow/create #### Request Body @@ -9932,9 +10072,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/workflow/delete #### Request Body @@ -9945,23 +10085,36 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/workflow/get +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| workflow_app_id | query | | No | string | +| workflow_tool_id | query | | No | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-provider/workflow/tools +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| workflow_tool_id | query | | Yes | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [POST] /workspaces/current/tool-provider/workflow/update #### Request Body @@ -9972,44 +10125,50 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tool-providers +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| type | query | | No | string,
**Available values:** "api", "builtin", "mcp", "model", "workflow" | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tools/api #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tools/builtin #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tools/mcp #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/tools/workflow #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ToolProviderOpaqueResponse](#toolprovideropaqueresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/icon #### Parameters @@ -10020,9 +10179,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/info **Get info for a trigger provider** @@ -10035,9 +10194,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [DELETE] /workspaces/current/trigger-provider/{provider}/oauth/client **Remove custom OAuth client configuration** @@ -10050,9 +10209,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/oauth/client **Get OAuth client configuration for a provider** @@ -10065,9 +10224,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerOAuthClientResponse](#triggeroauthclientresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/oauth/client **Configure custom OAuth client for a provider** @@ -10086,9 +10245,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SimpleResultResponse](#simpleresultresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/build/{subscription_builder_id} **Build a subscription instance for a trigger provider** @@ -10108,9 +10267,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/create **Add a new subscription instance for a trigger provider** @@ -10129,9 +10288,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/logs/{subscription_builder_id} **Get the request logs for a subscription instance for a trigger provider** @@ -10145,9 +10304,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/update/{subscription_builder_id} **Update a subscription instance for a trigger provider** @@ -10167,9 +10326,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/verify-and-update/{subscription_builder_id} **Verify and update a subscription instance for a trigger provider** @@ -10189,9 +10348,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/{subscription_builder_id} **Get a subscription instance for a trigger provider** @@ -10205,9 +10364,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/list **List all trigger subscriptions for the current tenant's provider** @@ -10220,9 +10379,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/oauth/authorize **Initiate OAuth authorization flow for a trigger provider** @@ -10235,9 +10394,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Authorization URL retrieved successfully | **application/json**: [TriggerOAuthAuthorizeResponse](#triggeroauthauthorizeresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/verify/{subscription_id} **Verify credentials for an existing subscription (edit mode only)** @@ -10257,9 +10416,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [POST] /workspaces/current/trigger-provider/{subscription_id}/subscriptions/delete **Delete a subscription instance** @@ -10293,18 +10452,18 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [GET] /workspaces/current/triggers **List all trigger providers for the current tenant** #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| ### [POST] /workspaces/custom-config #### Request Body @@ -10315,16 +10474,16 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [WorkspaceMutationResponse](#workspacemutationresponse)
| ### [POST] /workspaces/custom-config/webapp-logo/upload #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | Logo uploaded | **application/json**: [WorkspaceLogoUploadResponse](#workspacelogouploadresponse)
| ### [POST] /workspaces/info #### Request Body @@ -10335,9 +10494,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [WorkspaceMutationResponse](#workspacemutationresponse)
| ### [POST] /workspaces/switch #### Request Body @@ -10348,9 +10507,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SwitchWorkspaceResponse](#switchworkspaceresponse)
| ### [GET] /workspaces/{tenant_id}/model-providers/{provider}/{icon_type}/{lang} #### Parameters @@ -10364,9 +10523,9 @@ Returns permission flags that control workspace features like member invitations #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| --- ## default @@ -10375,15 +10534,35 @@ Default namespace ### [GET] /explore/banners **Get banner list** +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| language | query | Banner language | No | string,
**Default:** en-US | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [BannerListResponse](#bannerlistresponse)
| --- ### Schemas +#### AIModelEntityResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| deprecated | boolean | | No | +| features | [ [ModelFeature](#modelfeature) ] | | No | +| fetch_from | [FetchFrom](#fetchfrom) | | Yes | +| label | [I18nObject](#i18nobject) | | Yes | +| model | string | | Yes | +| model_properties | object | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| parameter_rules | [ [ParameterRule](#parameterrule) ],
**Default:** | | No | +| pricing | [PriceConfigResponse](#priceconfigresponse) | | No | + #### APIBasedExtensionListResponse | Name | Type | Description | Required | @@ -10611,6 +10790,13 @@ Default namespace | model_mode | string | Model mode | Yes | | model_name | string | Model name | Yes | +#### AdvancedPromptTemplateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| chat_prompt_config | object | | No | +| completion_prompt_config | object | | No | + #### AgentAppComposerResponse | Name | Type | Description | Required | @@ -10994,6 +11180,17 @@ Supported icon storage formats for Agent roster entries. | page | integer | | Yes | | total | integer | | Yes | +#### AgentIterationLogResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | string | | Yes | +| files | [ ] | | No | +| thought | string | | No | +| tokens | integer | | Yes | +| tool_calls | [ [AgentToolCallResponse](#agenttoolcallresponse) ] | | Yes | +| tool_raw | object | | Yes | + #### AgentKind Agent implementation family. @@ -11028,6 +11225,18 @@ the current roster/workflow APIs scoped to Dify Agent. | ---- | ---- | ----------- | -------- | | AgentKnowledgeQueryMode | string | | | +#### AgentLogMetaResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| agent_mode | string | | Yes | +| elapsed_time | number | | No | +| executor | string | | Yes | +| iterations | integer | | Yes | +| start_time | string | | Yes | +| status | string | | Yes | +| total_tokens | integer | | Yes | + #### AgentLogQuery | Name | Type | Description | Required | @@ -11035,6 +11244,14 @@ the current roster/workflow APIs scoped to Dify Agent. | conversation_id | string | Conversation UUID | Yes | | message_id | string | Message UUID | Yes | +#### AgentLogResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| files | [ ] | | No | +| iterations | [ [AgentIterationLogResponse](#agentiterationlogresponse) ] | | Yes | +| meta | [AgentLogMetaResponse](#agentlogmetaresponse) | | Yes | + #### AgentMemoryArtifactConfig | Name | Type | Description | Required | @@ -11074,6 +11291,18 @@ the current roster/workflow APIs scoped to Dify Agent. | state | string | | No | | status | string | | No | +#### AgentProviderListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AgentProviderListResponse | array | | | + +#### AgentProviderResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AgentProviderResponse | object | | | + #### AgentPublishedReferenceResponse | Name | Type | Description | Required | @@ -11200,6 +11429,18 @@ Visibility and lifecycle scope of an Agent record. | name | string | | No | | path | string | | No | +#### AgentSkillStandardizeResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AgentSkillStandardizeResponse | object | | | + +#### AgentSkillUploadResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AgentSkillUploadResponse | object | | | + #### AgentSoulAppFeaturesConfig | Name | Type | Description | Required | @@ -11408,6 +11649,20 @@ Soft lifecycle state for Agent records. | tool_input | string | | No | | tool_labels | [JSONValue](#jsonvalue) | | Yes | +#### AgentToolCallResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error | string | | No | +| status | string | | Yes | +| time_cost | number
integer | | Yes | +| tool_icon | | | No | +| tool_input | object | | Yes | +| tool_label | string | | Yes | +| tool_name | string | | Yes | +| tool_output | object | | Yes | +| tool_parameters | object | | Yes | + #### AllowedExtensionsResponse | Name | Type | Description | Required | @@ -11418,7 +11673,7 @@ Soft lifecycle state for Agent records. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| content | string | | No | +| answer | string | | No | | created_at | integer | | No | | hit_count | integer | | No | | id | string | | Yes | @@ -11430,6 +11685,13 @@ Soft lifecycle state for Agent records. | ---- | ---- | ----------- | -------- | | count | integer | Number of annotations | Yes | +#### AnnotationEmbeddingModelResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| embedding_model_name | string | | No | +| embedding_provider_name | string | | No | + #### AnnotationExportList | Name | Type | Description | Required | @@ -11446,11 +11708,11 @@ Soft lifecycle state for Agent records. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| annotation_content | string | | No | -| annotation_question | string | | No | | created_at | integer | | No | | id | string | | Yes | +| match | string | | No | | question | string | | No | +| response | string | | No | | score | number | | No | | source | string | | No | @@ -11471,6 +11733,15 @@ Soft lifecycle state for Agent records. | limit | integer,
**Default:** 20 | Page size | No | | page | integer,
**Default:** 1 | Page number | No | +#### AnnotationJobStatusResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error_msg | string | | No | +| job_id | string | | No | +| job_status | string | | No | +| record_count | integer | | No | + #### AnnotationList | Name | Type | Description | Required | @@ -11503,6 +11774,15 @@ Soft lifecycle state for Agent records. | ---- | ---- | ----------- | -------- | | action | string,
**Available values:** "disable", "enable" | *Enum:* `"disable"`, `"enable"` | Yes | +#### AnnotationSettingResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| embedding_model | [AnnotationEmbeddingModelResponse](#annotationembeddingmodelresponse) | | No | +| enabled | boolean | | Yes | +| id | string | | No | +| score_threshold | number | | No | + #### AnnotationSettingUpdatePayload | Name | Type | Description | Required | @@ -11841,6 +12121,13 @@ AppMCPServer Status Enum | enabled | boolean | Enable or disable tracing | Yes | | tracing_provider | string | Tracing provider | No | +#### AppTraceResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| enabled | boolean | | Yes | +| tracing_provider | string | | No | + #### AppVariableConfig | Name | Type | Description | Required | @@ -11850,11 +12137,17 @@ AppMCPServer Status Enum | required | boolean | | No | | type | string | | Yes | +#### AudioBinaryResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AudioBinaryResponse | string | | | + #### AudioTranscriptResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| text | string | Transcribed text from audio | Yes | +| text | string | | Yes | #### AutoDisableLogsResponse @@ -11869,6 +12162,49 @@ AppMCPServer Status Enum | ---- | ---- | ----------- | -------- | | avatar_url | string | | Yes | +#### AverageResponseTimeStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| latency | number | | Yes | + +#### AverageResponseTimeStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [AverageResponseTimeStatisticItem](#averageresponsetimestatisticitem) ] | | Yes | + +#### AverageSessionInteractionStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| interactions | number | | Yes | + +#### AverageSessionInteractionStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [AverageSessionInteractionStatisticItem](#averagesessioninteractionstatisticitem) ] | | Yes | + +#### BannerListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| BannerListResponse | array | | | + +#### BannerResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| content | | | Yes | +| created_at | string | | No | +| id | string | | Yes | +| link | string | | No | +| sort | integer | | Yes | +| status | string | | Yes | + #### BatchImportPayload | Name | Type | Description | Required | @@ -11899,6 +12235,18 @@ Retrieval settings for Amazon Bedrock knowledge base queries. | enabled | boolean | | Yes | | subscription | [SubscriptionModel](#subscriptionmodel) | | Yes | +#### BillingResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| BillingResponse | object | | | + +#### BinaryFileResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| BinaryFileResponse | string | | | + #### BrandingModel | Name | Type | Description | Required | @@ -11909,6 +12257,12 @@ Retrieval settings for Amazon Bedrock knowledge base queries. | login_page_logo | string | | Yes | | workspace_logo | string | | Yes | +#### BuiltinCredentialListQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| include_credential_ids | [ string ] | Credential IDs to include even if visibility would hide them | No | + #### BuiltinProviderDefaultCredentialPayload | Name | Type | Description | Required | @@ -12103,6 +12457,12 @@ Button styles for user actions. | ---- | ---- | ----------- | -------- | | content | string | | Yes | +#### CodeBasedExtensionQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| module | string | | Yes | + #### CodeBasedExtensionResponse | Name | Type | Description | Required | @@ -12158,6 +12518,12 @@ Button styles for user actions. | ---- | ---- | ----------- | -------- | | doc_name | string | Compliance document name | Yes | +#### ComplianceDownloadResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ComplianceDownloadResponse | object | | | + #### ComposerBindingPayload | Name | Type | Description | Required | @@ -12240,6 +12606,14 @@ Condition detail | name | string | | Yes | | value | string
[ string ]
integer
number | | No | +#### ConfigurateMethod + +Enum class for configurate method of provider model. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ConfigurateMethod | string | Enum class for configurate method of provider model. | | + #### ConsoleDatasetListQuery | Name | Type | Description | Required | @@ -12251,6 +12625,18 @@ Condition detail | page | integer,
**Default:** 1 | Page number | No | | tag_ids | [ string ] | Filter by tag IDs | No | +#### ConsoleHumanInputFormDefinitionResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ConsoleHumanInputFormDefinitionResponse | object | | | + +#### ConsoleHumanInputFormSubmitResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ConsoleHumanInputFormSubmitResponse | object | | | + #### ConsoleSegmentListResponse | Name | Type | Description | Required | @@ -12317,6 +12703,14 @@ Condition detail | updated_at | integer | | No | | user_feedback_stats | [FeedbackStat](#feedbackstat) | | No | +#### ConversationInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [SimpleConversation](#simpleconversation) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + #### ConversationListQuery | Name | Type | Description | Required | @@ -12465,12 +12859,72 @@ Payload for creating a new snippet. | name | string | | Yes | | type | string,
**Available values:** "group", "node",
**Default:** node | *Enum:* `"group"`, `"node"` | No | +#### CredentialConfiguration + +Model class for credential configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_id | string | | Yes | +| credential_name | string | | Yes | + +#### CredentialFormSchema + +Model class for credential form schema. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| default | string | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| max_length | integer | | No | +| options | [ [FormOption](#formoption) ] | | No | +| placeholder | [I18nObject](#i18nobject) | | No | +| required | boolean,
**Default:** true | | No | +| show_on | [ [FormShowOnObject](#formshowonobject) ],
**Default:** | | No | +| type | [FormType](#formtype) | | Yes | +| variable | string | | Yes | + #### CredentialType | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | CredentialType | string | | | +#### CustomConfigurationResponse + +Model class for provider custom configuration response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| available_credentials | [ [CredentialConfiguration](#credentialconfiguration) ] | | No | +| can_added_models | [ [UnaddedModelConfiguration](#unaddedmodelconfiguration) ] | | No | +| current_credential_id | string | | No | +| current_credential_name | string | | No | +| custom_models | [ [CustomModelConfiguration](#custommodelconfiguration) ] | | No | +| status | [CustomConfigurationStatus](#customconfigurationstatus) | | Yes | + +#### CustomConfigurationStatus + +Enum class for custom configuration status. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| CustomConfigurationStatus | string | Enum class for custom configuration status. | | + +#### CustomModelConfiguration + +Model class for provider custom model configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| available_model_credentials | [ [CredentialConfiguration](#credentialconfiguration) ],
**Default:** | | No | +| credentials | object | | Yes | +| current_credential_id | string | | No | +| current_credential_name | string | | No | +| model | string | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| unadded_to_model_list | boolean | | No | + #### CustomizedPipelineTemplatePayload | Name | Type | Description | Required | @@ -12479,12 +12933,72 @@ Payload for creating a new snippet. | icon_info | object | | No | | name | string | | Yes | +#### DailyConversationStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| conversation_count | integer | | Yes | +| date | string | | Yes | + +#### DailyConversationStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [DailyConversationStatisticItem](#dailyconversationstatisticitem) ] | | Yes | + +#### DailyMessageStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| message_count | integer | | Yes | + +#### DailyMessageStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [DailyMessageStatisticItem](#dailymessagestatisticitem) ] | | Yes | + +#### DailyTerminalStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| terminal_count | integer | | Yes | + +#### DailyTerminalStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [DailyTerminalStatisticItem](#dailyterminalstatisticitem) ] | | Yes | + +#### DailyTokenCostStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| currency | string | | Yes | +| date | string | | Yes | +| token_count | integer | | Yes | +| total_price | string
number | | Yes | + +#### DailyTokenCostStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [DailyTokenCostStatisticItem](#dailytokencoststatisticitem) ] | | Yes | + #### DataSource | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | info_list | [InfoList](#infolist) | | Yes | +#### DataSourceContentPreviewResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| DataSourceContentPreviewResponse | | | | + #### DataSourceIntegrateIconResponse | Name | Type | Description | Required | @@ -12559,7 +13073,7 @@ Payload for creating a new snippet. | author_name | string | | No | | built_in_field_enabled | boolean | | No | | chunk_structure | string | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | data_source_type | string | | No | | description | string | | No | @@ -12587,7 +13101,7 @@ Payload for creating a new snippet. | tags | [ [Tag](#tag) ] | | No | | total_available_documents | integer | | No | | total_documents | integer | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | | word_count | integer | | No | @@ -13006,6 +13520,12 @@ Payload for creating a new snippet. | credentials | object | | No | | name | string | | No | +#### DatasourceCredentialsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| result | | | Yes | + #### DatasourceCustomClientPayload | Name | Type | Description | Required | @@ -13027,6 +13547,21 @@ Payload for creating a new snippet. | datasource_type | string | | Yes | | inputs | object | | Yes | +#### DatasourceOAuthAuthorizationQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_id | string | Credential ID to reauthorize | No | + +#### DatasourceOAuthCallbackQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | Authorization code from OAuth provider | No | +| context_id | string | OAuth proxy context ID | No | +| error | string | Error message from OAuth provider | No | +| state | string | OAuth state parameter | No | + #### DatasourceUpdateNamePayload | Name | Type | Description | Required | @@ -13139,6 +13674,34 @@ Per-output retry configuration that mirrors ``graphon.RetryConfig`` shape. | ---- | ---- | ----------- | -------- | | q | string | | No | +#### DefaultBlockConfigResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| DefaultBlockConfigResponse | object | | | + +#### DefaultBlockConfigsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| DefaultBlockConfigsResponse | array | | | + +#### DefaultModelDataResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [DefaultModelResponse](#defaultmodelresponse) | | No | + +#### DefaultModelResponse + +Default model entity. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| model | string | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| provider | [SimpleProviderEntityResponse](#simpleproviderentityresponse) | | Yes | + #### DeletedTool | Name | Type | Description | Required | @@ -13147,6 +13710,12 @@ Per-output retry configuration that mirrors ``graphon.RetryConfig`` shape. | tool_name | string | | Yes | | type | string | | Yes | +#### DismissNotificationPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| notification_id | string | | Yes | + #### DocumentBatchDownloadZipPayload Request payload for bulk downloading documents as a zip archive. @@ -13339,6 +13908,12 @@ Request payload for bulk downloading documents as a zip archive. | role | string | | Yes | | token | string | | Yes | +#### EducationActivateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EducationActivateResponse | object | | | + #### EducationAutocompleteQuery | Name | Type | Description | Required | @@ -13404,6 +13979,13 @@ Request payload for bulk downloading documents as a zip archive. | timezone | string | | No | | token | string | | Yes | +#### EmailRegisterResetResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [EmailRegisterTokenPairResponse](#emailregistertokenpairresponse) | | Yes | +| result | string | | Yes | + #### EmailRegisterSendPayload | Name | Type | Description | Required | @@ -13411,6 +13993,14 @@ Request payload for bulk downloading documents as a zip archive. | email | string | Email address | Yes | | language | string | Language code | No | +#### EmailRegisterTokenPairResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| access_token | string | | Yes | +| csrf_token | string | | Yes | +| refresh_token | string | | Yes | + #### EmailRegisterValidityPayload | Name | Type | Description | Required | @@ -13419,6 +14009,12 @@ Request payload for bulk downloading documents as a zip archive. | email | string | | Yes | | token | string | | Yes | +#### EmptyObjectResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EmptyObjectResponse | object | | | + #### EndpointCreatePayload | Name | Type | Description | Required | @@ -13491,6 +14087,27 @@ Request payload for bulk downloading documents as a zip archive. | ---- | ---- | ----------- | -------- | | success | boolean | Operation success | Yes | +#### EnvironmentVariableItemResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | string | | No | +| editable | boolean | | Yes | +| edited | boolean | | Yes | +| id | string | | Yes | +| name | string | | Yes | +| selector | [ string ] | | Yes | +| type | string | | Yes | +| value | | | Yes | +| value_type | string | | Yes | +| visible | boolean | | Yes | + +#### EnvironmentVariableListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| items | [ [EnvironmentVariableItemResponse](#environmentvariableitemresponse) ] | | Yes | + #### EnvironmentVariableUpdatePayload | Name | Type | Description | Required | @@ -13504,12 +14121,24 @@ Request payload for bulk downloading documents as a zip archive. | data | [ [DocumentStatusResponse](#documentstatusresponse) ] | | Yes | | total | integer | | Yes | +#### EventStreamResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EventStreamResponse | string | | | + #### ExecutionContentType | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | ExecutionContentType | string | | | +#### ExploreAppMetaResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| tool_icons | object | | No | + #### ExternalApiTemplateListQuery | Name | Type | Description | Required | @@ -13536,6 +14165,16 @@ Request payload for bulk downloading documents as a zip archive. | metadata_filtering_conditions | object | | No | | query | string | | Yes | +#### ExternalKnowledgeApiListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ExternalKnowledgeApiResponse](#externalknowledgeapiresponse) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | +| page | integer | | Yes | +| total | integer | | Yes | + #### ExternalKnowledgeApiPayload | Name | Type | Description | Required | @@ -13543,6 +14182,26 @@ Request payload for bulk downloading documents as a zip archive. | name | string | | Yes | | settings | object | | Yes | +#### ExternalKnowledgeApiResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | string | | Yes | +| created_by | string | | Yes | +| dataset_bindings | [ [ExternalKnowledgeDatasetBindingResponse](#externalknowledgedatasetbindingresponse) ] | | No | +| description | string | | Yes | +| id | string | | Yes | +| name | string | | Yes | +| settings | object | | No | +| tenant_id | string | | Yes | + +#### ExternalKnowledgeDatasetBindingResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| id | string | | Yes | +| name | string | | Yes | + #### ExternalKnowledgeInfo | Name | Type | Description | Required | @@ -13560,6 +14219,12 @@ Request payload for bulk downloading documents as a zip archive. | score_threshold_enabled | boolean | | No | | top_k | integer | | No | +#### ExternalRetrievalTestResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ExternalRetrievalTestResponse | object
[ object ] | | | + #### FeatureModel | Name | Type | Description | Required | @@ -13613,6 +14278,21 @@ Request payload for bulk downloading documents as a zip archive. | dislike | integer | | Yes | | like | integer | | Yes | +#### FetchFrom + +Enum class for fetch from. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FetchFrom | string | Enum class for fetch from. | | + +#### FieldModelSchema + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| label | [I18nObject](#i18nobject) | | Yes | +| placeholder | [I18nObject](#i18nobject) | | No | + #### FileInfo | Name | Type | Description | Required | @@ -13736,12 +14416,51 @@ Request payload for bulk downloading documents as a zip archive. | ---- | ---- | ----------- | -------- | | FormInputConfig | [ParagraphInputConfig](#paragraphinputconfig)
[SelectInputConfig](#selectinputconfig)
[FileInputConfig](#fileinputconfig)
[FileListInputConfig](#filelistinputconfig) | | | +#### FormOption + +Model class for form option. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| label | [I18nObject](#i18nobject) | | Yes | +| show_on | [ [FormShowOnObject](#formshowonobject) ],
**Default:** | | No | +| value | string | | Yes | + +#### FormShowOnObject + +Model class for form show on. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| value | string | | Yes | +| variable | string | | Yes | + +#### FormType + +Enum class for form type. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FormType | string | Enum class for form type. | | + #### GenerateSummaryPayload | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | document_list | [ string ] | | Yes | +#### GeneratedAppResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| GeneratedAppResponse | | | | + +#### GeneratorResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| GeneratorResponse | | | | + #### Github | Name | Type | Description | Required | @@ -13880,6 +14599,21 @@ Request payload for bulk downloading documents as a zip archive. | ---- | ---- | ----------- | -------- | | inputs | object | Values used to fill missing upstream variables referenced in form_content | No | +#### HumanInputFormPreviewResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| actions | [ object ] | | No | +| display_in_ui | boolean | | No | +| expiration_time | integer | | No | +| form_content | string | | Yes | +| form_id | string | | Yes | +| form_token | string | | No | +| inputs | [ object ] | | No | +| node_id | string | | Yes | +| node_title | string | | Yes | +| resolved_default_values | object | | No | + #### HumanInputFormSubmissionData | Name | Type | Description | Required | @@ -13899,6 +14633,12 @@ Request payload for bulk downloading documents as a zip archive. | form_inputs | object | Values the user provides for the form's own fields | Yes | | inputs | object | Values used to fill missing upstream variables referenced in form_content | Yes | +#### HumanInputFormSubmitResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| HumanInputFormSubmitResponse | object | | | + #### HumanInputPauseTypeResponse | Name | Type | Description | Required | @@ -13907,6 +14647,15 @@ Request payload for bulk downloading documents as a zip archive. | form_id | string | | Yes | | type | string | | Yes | +#### I18nObject + +Model class for i18n object. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| en_US | string | | Yes | +| zh_Hans | string | | No | + #### IconInfo Icon information model. @@ -14110,11 +14859,23 @@ Input field definition for snippet parameters. | ---- | ---- | ----------- | -------- | | inputs | object | | No | +#### JSONObject + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONObject | object | | | + #### JSONValue | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| JSONValue | | | | +| JSONValue | string
integer
number
boolean
object
[ object ] | | | + +#### JSONValueType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONValueType | | | | #### JsonValue @@ -14203,6 +14964,13 @@ Enum class for large language model mode. | model | string | | Yes | | model_type | [ModelType](#modeltype) | | Yes | +#### LoadBalancingCredentialValidateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error | string | | No | +| result | string | | Yes | + #### LoadBalancingPayload | Name | Type | Description | Required | @@ -14232,6 +15000,13 @@ Enum class for large language model mode. | authorization_code | string | | No | | provider_id | string | | Yes | +#### MCPCallbackQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | | Yes | +| state | string | | Yes | + #### MCPProviderCreatePayload | Name | Type | Description | Required | @@ -14292,6 +15067,13 @@ Enum class for large language model mode. | marketplace_plugin_unique_identifier | string | | Yes | | version | string | | No | +#### MemberActionTenantResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| result | string | | Yes | +| tenant_id | string | | Yes | + #### MemberInvitePayload | Name | Type | Description | Required | @@ -14300,6 +15082,23 @@ Enum class for large language model mode. | language | string | | No | | role | [TenantAccountRole](#tenantaccountrole) | | Yes | +#### MemberInviteResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| invitation_results | [ [MemberInviteResultResponse](#memberinviteresultresponse) ] | | Yes | +| result | string | | Yes | +| tenant_id | string | | Yes | + +#### MemberInviteResultResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| email | string | | Yes | +| message | string | | No | +| status | string | | Yes | +| url | string | | No | + #### MemberRoleUpdatePayload | Name | Type | Description | Required | @@ -14385,6 +15184,14 @@ Enum class for large language model mode. | upload_file_id | string | | No | | url | string | | No | +#### MessageInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [MessageListItem](#messagelistitem) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + #### MessageInfiniteScrollPaginationResponse | Name | Type | Description | Required | @@ -14393,6 +15200,25 @@ Enum class for large language model mode. | has_more | boolean | | Yes | | limit | integer | | Yes | +#### MessageListItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| agent_thoughts | [ [AgentThought](#agentthought) ] | | Yes | +| answer | string | | Yes | +| conversation_id | string | | Yes | +| created_at | integer | | No | +| error | string | | No | +| extra_contents | [ [HumanInputContent](#humaninputcontent) ] | | Yes | +| feedback | [SimpleFeedback](#simplefeedback) | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| message_files | [ [MessageFile](#messagefile) ] | | Yes | +| parent_message_id | string | | No | +| query | string | | Yes | +| retriever_resources | [ [RetrieverResource](#retrieverresource) ] | | Yes | +| status | string | | Yes | + #### MessageListQuery | Name | Type | Description | Required | @@ -14476,6 +15302,81 @@ Metadata operation data | text_to_speech | object | Text to speech configuration | No | | tools | [ object ] | Available tools | No | +#### ModelCredentialLoadBalancingResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| configs | [ object ] | | No | +| enabled | boolean | | Yes | + +#### ModelCredentialResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| available_credentials | [ [CredentialConfiguration](#credentialconfiguration) ] | | Yes | +| credentials | object | | No | +| current_credential_id | string | | No | +| current_credential_name | string | | No | +| load_balancing | [ModelCredentialLoadBalancingResponse](#modelcredentialloadbalancingresponse) | | Yes | + +#### ModelCredentialSchema + +Model class for model credential schema. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_form_schemas | [ [CredentialFormSchema](#credentialformschema) ] | | Yes | +| model | [FieldModelSchema](#fieldmodelschema) | | Yes | + +#### ModelCredentialValidateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error | string | | No | +| result | string | | Yes | + +#### ModelFeature + +Enum class for llm feature. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelFeature | string | Enum class for llm feature. | | + +#### ModelParameterRulesResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ParameterRule](#parameterrule) ] | | Yes | + +#### ModelPropertyKey + +Enum class for model property key. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelPropertyKey | string | Enum class for model property key. | | + +#### ModelProviderListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ProviderResponse](#providerresponse) ] | | Yes | + +#### ModelProviderPaymentCheckoutUrlResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| payment_link | string | | Yes | + +#### ModelStatus + +Enum class for model status. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelStatus | string | Enum class for model status. | | + #### ModelType Enum class for model type. @@ -14484,6 +15385,30 @@ Enum class for model type. | ---- | ---- | ----------- | -------- | | ModelType | string | Enum class for model type. | | +#### ModelWithProviderEntityResponse + +Model with provider entity. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| deprecated | boolean | | No | +| features | [ [ModelFeature](#modelfeature) ] | | No | +| fetch_from | [FetchFrom](#fetchfrom) | | Yes | +| has_invalid_load_balancing_configs | boolean | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| load_balancing_enabled | boolean | | No | +| model | string | | Yes | +| model_properties | object | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| provider | [SimpleProviderEntityResponse](#simpleproviderentityresponse) | | Yes | +| status | [ModelStatus](#modelstatus) | | Yes | + +#### ModelWithProviderListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ModelWithProviderEntityResponse](#modelwithproviderentityresponse) ] | | Yes | + #### MoreLikeThisQuery | Name | Type | Description | Required | @@ -14554,6 +15479,25 @@ Coarse node-level status used by Inspector to pick a banner. | ---- | ---- | ----------- | -------- | | NodeStatus | string | Coarse node-level status used by Inspector to pick a banner. | | +#### NotificationItemResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| body | string | | Yes | +| frequency | string | | No | +| lang | string | | Yes | +| notification_id | string | | No | +| subtitle | string | | Yes | +| title | string | | Yes | +| title_pic_url | string | | Yes | + +#### NotificationResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| notifications | [ [NotificationItemResponse](#notificationitemresponse) ] | | Yes | +| should_show | boolean | | Yes | + #### NotionEstimatePayload | Name | Type | Description | Required | @@ -14614,12 +15558,38 @@ Coarse node-level status used by Inspector to pick a banner. | page_name | string | | Yes | | type | string | | Yes | +#### OAuthCallbackQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | Authorization code from OAuth provider | Yes | +| state | string | OAuth state parameter | No | + +#### OAuthClientPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| client_id | string | | Yes | + +#### OAuthDataSourceBindingQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | Authorization code from OAuth provider | Yes | + #### OAuthDataSourceBindingResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | result | string | Operation result | Yes | +#### OAuthDataSourceCallbackQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | Authorization code from OAuth provider | No | +| error | string | Error message from OAuth provider | No | + #### OAuthDataSourceResponse | Name | Type | Description | Required | @@ -14632,6 +15602,71 @@ Coarse node-level status used by Inspector to pick a banner. | ---- | ---- | ----------- | -------- | | result | string | Operation result | Yes | +#### OAuthLoginQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| invite_token | string | Optional invitation token | No | +| language | string | Preferred interface language | No | +| timezone | string | Preferred timezone | No | + +#### OAuthProviderAccountResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| avatar | string | | No | +| email | string | | Yes | +| interface_language | string | | Yes | +| name | string | | Yes | +| timezone | string | | Yes | + +#### OAuthProviderAppResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_icon | string | | Yes | +| app_label | object | | Yes | +| scope | string | | Yes | + +#### OAuthProviderAuthorizeResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| code | string | | Yes | + +#### OAuthProviderRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| client_id | string | | Yes | +| redirect_uri | string | | Yes | + +#### OAuthProviderTokenResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| access_token | string | | Yes | +| expires_in | integer | | Yes | +| refresh_token | string | | Yes | +| token_type | string | | Yes | + +#### OAuthTokenRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| client_id | string | | Yes | +| client_secret | string | | No | +| code | string | | No | +| grant_type | string | | Yes | +| redirect_uri | string | | No | +| refresh_token | string | | No | + +#### OpaqueObjectResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| OpaqueObjectResponse | object | | | + #### OutputErrorStrategy Per-output failure handling strategy. @@ -14690,6 +15725,13 @@ output check fails and any configured retry attempts have been exhausted. | page | integer | | Yes | | total | integer | | Yes | +#### PaginationQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| limit | integer,
**Default:** 20 | | No | +| page | integer,
**Default:** 1 | | No | + #### ParagraphInputConfig Form input definition. @@ -14700,6 +15742,49 @@ Form input definition. | output_variable_name | string | | Yes | | type | string | | No | +#### ParameterRule + +Model class for parameter rule. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| default | | | No | +| help | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| max | number | | No | +| min | number | | No | +| name | string | | Yes | +| options | [ string ],
**Default:** | | No | +| precision | integer | | No | +| required | boolean | | No | +| type | [ParameterType](#parametertype) | | Yes | +| use_template | string | | No | + +#### ParameterType + +Enum class for parameter type. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ParameterType | string | Enum class for parameter type. | | + +#### Parameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| annotation_reply | [JSONObject](#jsonobject) | | Yes | +| file_upload | [JSONObject](#jsonobject) | | Yes | +| more_like_this | [JSONObject](#jsonobject) | | Yes | +| opening_statement | | | No | +| retriever_resource | [JSONObject](#jsonobject) | | Yes | +| sensitive_word_avoidance | [JSONObject](#jsonobject) | | Yes | +| speech_to_text | [JSONObject](#jsonobject) | | Yes | +| suggested_questions | [ string ] | | Yes | +| suggested_questions_after_answer | [JSONObject](#jsonobject) | | Yes | +| system_parameters | [SystemParameters](#systemparameters) | | Yes | +| text_to_speech | [JSONObject](#jsonobject) | | Yes | +| user_input_form | [ [JSONObject](#jsonobject) ] | | Yes | + #### Parser | Name | Type | Description | Required | @@ -15069,7 +16154,7 @@ Shared permission levels for resources (datasets, credentials, etc.) | allowed_file_types | [ string ] | | No | | allowed_file_upload_methods | [ string ] | | No | | belong_to_node_id | string | | Yes | -| default_value | object | | No | +| default_value | | | No | | label | string | | Yes | | max_length | integer | | No | | options | [ string ] | | No | @@ -15090,6 +16175,12 @@ Shared permission levels for resources (datasets, credentials, etc.) | upgrade_mode | [UpgradeMode](#upgrademode) | | No | | upgrade_time_of_day | integer | | No | +#### PluginDaemonOperationResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| PluginDaemonOperationResponse | | | | + #### PluginDebuggingKeyResponse | Name | Type | Description | Required | @@ -15106,6 +16197,12 @@ Shared permission levels for resources (datasets, credentials, etc.) | type | [Type](#type) | | Yes | | value | [Github](#github)
[Marketplace](#marketplace)
[Package](#package) | | Yes | +#### PluginDynamicOptionsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| options | | | Yes | + #### PluginEndpointListResponse | Name | Type | Description | Required | @@ -15125,12 +16222,51 @@ Shared permission levels for resources (datasets, credentials, etc.) | ---- | ---- | ----------- | -------- | | PluginInstallationScope | string | | | +#### PluginInstallationsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| plugins | | | Yes | + +#### PluginListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| plugins | | | Yes | +| total | integer | | Yes | + #### PluginManagerModel | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | enabled | boolean | | Yes | +#### PluginManifestResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| manifest | | | Yes | + +#### PluginOAuthAuthorizationUrlResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| authorization_url | string | The URL of the authorization. | Yes | + +#### PluginOperationSuccessResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| message | string | | No | +| success | boolean | | Yes | + +#### PluginPermissionResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| debug_permission | [DebugPermission](#debugpermission) | | Yes | +| install_permission | [InstallPermission](#installpermission) | | Yes | + #### PluginPermissionSettingsPayload | Name | Type | Description | Required | @@ -15138,6 +16274,37 @@ Shared permission levels for resources (datasets, credentials, etc.) | debug_permission | [DebugPermission](#debugpermission) | | No | | install_permission | [InstallPermission](#installpermission) | | No | +#### PluginPreferencesResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| auto_upgrade | [PluginAutoUpgradeSettingsPayload](#pluginautoupgradesettingspayload) | | Yes | +| permission | [PluginPermissionSettingsPayload](#pluginpermissionsettingspayload) | | Yes | + +#### PluginReadmeResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| readme | string | | Yes | + +#### PluginTaskResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| task | | | Yes | + +#### PluginTasksResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| tasks | | | Yes | + +#### PluginVersionsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| versions | | | Yes | + #### PreProcessingRule | Name | Type | Description | Required | @@ -15153,6 +16320,17 @@ Shared permission levels for resources (datasets, credentials, etc.) | content | string | | Yes | | summary | string | | No | +#### PriceConfigResponse + +Serialized pricing info with codegen-safe decimal string patterns. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| currency | string | | Yes | +| input | string | | Yes | +| output | string | | No | +| unit | string | | Yes | + #### ProcessRule | Name | Type | Description | Required | @@ -15168,6 +16346,113 @@ Dataset Process Rule Mode | ---- | ---- | ----------- | -------- | | ProcessRuleMode | string | Dataset Process Rule Mode | | +#### ProviderCredentialResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credentials | object | | No | + +#### ProviderCredentialSchema + +Model class for provider credential schema. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_form_schemas | [ [CredentialFormSchema](#credentialformschema) ] | | Yes | + +#### ProviderCredentialValidateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error | string | | No | +| result | string,
**Available values:** "error", "success" | *Enum:* `"error"`, `"success"` | Yes | + +#### ProviderHelpEntity + +Model class for provider help. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| title | [I18nObject](#i18nobject) | | Yes | +| url | [I18nObject](#i18nobject) | | Yes | + +#### ProviderModelWithStatusEntity + +Model class for model response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| deprecated | boolean | | No | +| features | [ [ModelFeature](#modelfeature) ] | | No | +| fetch_from | [FetchFrom](#fetchfrom) | | Yes | +| has_invalid_load_balancing_configs | boolean | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| load_balancing_enabled | boolean | | No | +| model | string | | Yes | +| model_properties | object | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| status | [ModelStatus](#modelstatus) | | Yes | + +#### ProviderQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| provider | string | | Yes | + +#### ProviderQuotaType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ProviderQuotaType | string | | | + +#### ProviderResponse + +Model class for provider response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| background | string | | No | +| configurate_methods | [ [ConfigurateMethod](#configuratemethod) ] | | Yes | +| custom_configuration | [CustomConfigurationResponse](#customconfigurationresponse) | | Yes | +| description | [I18nObject](#i18nobject) | | No | +| help | [ProviderHelpEntity](#providerhelpentity) | | No | +| icon_small | [I18nObject](#i18nobject) | | No | +| icon_small_dark | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| model_credential_schema | [ModelCredentialSchema](#modelcredentialschema) | | No | +| preferred_provider_type | [ProviderType](#providertype) | | Yes | +| provider | string | | Yes | +| provider_credential_schema | [ProviderCredentialSchema](#providercredentialschema) | | No | +| supported_model_types | [ [ModelType](#modeltype) ] | | Yes | +| system_configuration | [SystemConfigurationResponse](#systemconfigurationresponse) | | Yes | +| tenant_id | string | | Yes | + +#### ProviderType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ProviderType | string | | | + +#### ProviderWithModelsDataResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ProviderWithModelsResponse](#providerwithmodelsresponse) ] | | Yes | + +#### ProviderWithModelsResponse + +Model class for provider with models response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| icon_small | [I18nObject](#i18nobject) | | No | +| icon_small_dark | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| models | [ [ProviderModelWithStatusEntity](#providermodelwithstatusentity) ] | | Yes | +| provider | string | | Yes | +| status | [CustomConfigurationStatus](#customconfigurationstatus) | | Yes | +| tenant_id | string | | Yes | + #### PublishWorkflowPayload Payload for publishing snippet workflow. @@ -15203,6 +16488,25 @@ Payload for publishing snippet workflow. | reset_date | integer,
**Default:** -1 | | Yes | | usage | integer | | Yes | +#### QuotaConfiguration + +Model class for provider quota configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| is_valid | boolean | | Yes | +| quota_limit | integer | | Yes | +| quota_type | [ProviderQuotaType](#providerquotatype) | | Yes | +| quota_unit | [QuotaUnit](#quotaunit) | | Yes | +| quota_used | integer | | Yes | +| restrict_models | [ [RestrictModel](#restrictmodel) ],
**Default:** | | No | + +#### QuotaUnit + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| QuotaUnit | string | | | + #### RagPipelineDatasetImportPayload | Name | Type | Description | Required | @@ -15241,12 +16545,24 @@ Payload for publishing snippet workflow. | pipeline_id | string | | No | | status | [ImportStatus](#importstatus) | | Yes | +#### RagPipelineOpaqueResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| RagPipelineOpaqueResponse | | | | + #### RagPipelineRecommendedPluginQuery | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | type | string,
**Default:** all | | No | +#### RagPipelineStepParametersResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| variables | | | Yes | + #### RagPipelineWorkflowPublishResponse | Name | Type | Description | Required | @@ -15262,6 +16578,12 @@ Payload for publishing snippet workflow. | result | string | | Yes | | updated_at | integer | | Yes | +#### RecommendedAppDetailResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| RecommendedAppDetailResponse | object | | | + #### RecommendedAppInfoResponse | Name | Type | Description | Required | @@ -15301,6 +16623,12 @@ Payload for publishing snippet workflow. | ---- | ---- | ----------- | -------- | | language | string | Language code for recommended app localization | No | +#### RedirectResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| RedirectResponse | string | | | + #### RedirectUrlResponse | Name | Type | Description | Required | @@ -15347,6 +16675,14 @@ Payload for publishing snippet workflow. | reranking_model_name | string | | No | | reranking_provider_name | string | | No | +#### RestrictModel + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| base_model_name | string | | No | +| model | string | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | + #### ResultResponse | Name | Type | Description | Required | @@ -15379,6 +16715,28 @@ Payload for publishing snippet workflow. | ---- | ---- | ----------- | -------- | | retrieval_method | [ string ] | | Yes | +#### RetrieverResource + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| content | string | | No | +| created_at | integer | | No | +| data_source_type | string | | No | +| dataset_id | string | | No | +| dataset_name | string | | No | +| document_id | string | | No | +| document_name | string | | No | +| hit_count | integer | | No | +| id | string | | No | +| index_node_hash | string | | No | +| message_id | string | | No | +| position | integer | | Yes | +| score | number | | No | +| segment_id | string | | No | +| segment_position | integer | | No | +| summary | string | | No | +| word_count | integer | | No | + #### RosterAgentCreatePayload | Name | Type | Description | Required | @@ -15491,6 +16849,26 @@ Payload for publishing snippet workflow. | ---- | ---- | ----------- | -------- | | message_id | string | | Yes | +#### SavedMessageInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [SavedMessageItem](#savedmessageitem) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + +#### SavedMessageItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| answer | string | | Yes | +| created_at | integer | | No | +| feedback | [SimpleFeedback](#simplefeedback) | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| message_files | [ [MessageFile](#messagefile) ] | | Yes | +| query | string | | Yes | + #### SavedMessageListQuery | Name | Type | Description | Required | @@ -15498,6 +16876,12 @@ Payload for publishing snippet workflow. | last_id | string | | No | | limit | integer,
**Default:** 20 | | No | +#### SchemaDefinitionsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| SchemaDefinitionsResponse | | | | + #### SegmentAttachmentResponse | Name | Type | Description | Required | @@ -15617,6 +17001,18 @@ Payload for publishing snippet workflow. | id | string | | Yes | | name | string | | Yes | +#### SimpleConversation + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| introduction | string | | No | +| name | string | | Yes | +| status | string | | Yes | +| updated_at | integer | | No | + #### SimpleDataResponse | Name | Type | Description | Required | @@ -15632,6 +17028,12 @@ Payload for publishing snippet workflow. | session_id | string | | No | | type | string | | Yes | +#### SimpleFeedback + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| rating | string | | No | + #### SimpleMessageDetail | Name | Type | Description | Required | @@ -15654,6 +17056,21 @@ Payload for publishing snippet workflow. | model_dict | [JSONValue](#jsonvalue) | | No | | pre_prompt | string | | No | +#### SimpleProviderEntityResponse + +Simple provider entity response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| icon_small | [I18nObject](#i18nobject) | | No | +| icon_small_dark | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| models | [ [AIModelEntityResponse](#aimodelentityresponse) ],
**Default:** | | No | +| provider | string | | Yes | +| provider_name | string | | No | +| supported_model_types | [ [ModelType](#modeltype) ] | | Yes | +| tenant_id | string | | Yes | + #### SimpleResultDataResponse | Name | Type | Description | Required | @@ -15685,34 +17102,26 @@ Payload for publishing snippet workflow. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| app_base_url | string | | No | | chat_color_theme | string | | No | -| chat_color_theme_inverted | boolean | | No | -| code | string | | No | +| chat_color_theme_inverted | boolean | | Yes | | copyright | string | | No | -| created_at | integer | | No | -| created_by | string | | No | | custom_disclaimer | string | | No | -| customize_domain | string | | No | -| customize_token_strategy | string | | No | -| default_language | string | | No | +| default_language | string | | Yes | | description | string | | No | | icon | string | | No | | icon_background | string | | No | -| icon_type | string
[IconType](#icontype) | | No | +| icon_type | string | | No | +| icon_url | string | | Yes | | privacy_policy | string | | No | -| prompt_public | boolean | | No | -| show_workflow_steps | boolean | | No | -| title | string | | No | -| updated_at | integer | | No | -| updated_by | string | | No | -| use_icon_as_answer_icon | boolean | | No | +| show_workflow_steps | boolean | | Yes | +| title | string | | Yes | +| use_icon_as_answer_icon | boolean | | Yes | #### Snippet | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| created_at | object | | No | +| created_at | long | | No | | created_by | [_AnonymousInlineModel_b0fd3f86d9d5](#_anonymousinlinemodel_b0fd3f86d9d5) | | No | | description | string | | No | | graph | object | | No | @@ -15723,11 +17132,23 @@ Payload for publishing snippet workflow. | name | string | | No | | tags | [ [_AnonymousInlineModel_7b8b49ca164e](#_anonymousinlinemodel_7b8b49ca164e) ] | | No | | type | string | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | [_AnonymousInlineModel_b0fd3f86d9d5](#_anonymousinlinemodel_b0fd3f86d9d5) | | No | | use_count | integer | | No | | version | integer | | No | +#### SnippetDependencyCheckResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| SnippetDependencyCheckResponse | object | | | + +#### SnippetDraftConfigResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| parallel_depth_limit | integer | | Yes | + #### SnippetDraftNodeRunPayload Payload for running a single node in snippet draft workflow. @@ -15771,6 +17192,12 @@ Payload for importing snippet from DSL. | yaml_content | string | YAML content (required for yaml-content mode) | No | | yaml_url | string | YAML URL (required for yaml-url mode) | No | +#### SnippetImportResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| SnippetImportResponse | object | | | + #### SnippetIterationNodeRunPayload Payload for running an iteration node in snippet draft workflow. @@ -15784,7 +17211,7 @@ Payload for running an iteration node in snippet draft workflow. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | author_name | string | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | description | string | | No | | icon_info | object | | No | @@ -15793,7 +17220,7 @@ Payload for running an iteration node in snippet draft workflow. | name | string | | No | | tags | [ [_AnonymousInlineModel_7b8b49ca164e](#_anonymousinlinemodel_7b8b49ca164e) ] | | No | | type | string | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | | use_count | integer | | No | | version | integer | | No | @@ -15823,12 +17250,19 @@ Payload for running a loop node in snippet draft workflow. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| data | [ [_AnonymousInlineModel_7b67ac8a4db8](#_anonymousinlinemodel_7b67ac8a4db8) ] | | No | +| data | [ [_AnonymousInlineModel_efd591151ea9](#_anonymousinlinemodel_efd591151ea9) ] | | No | | has_more | boolean | | No | | limit | integer | | No | | page | integer | | No | | total | integer | | No | +#### SnippetUseCountResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| result | string | | Yes | +| use_count | integer | | Yes | + #### SnippetWorkflowListQuery Query parameters for listing snippet published workflows. @@ -15923,7 +17357,7 @@ Default configuration for form inputs. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| data | [ string ] | Suggested question | Yes | +| data | [ string ] | | Yes | #### SwitchWorkspacePayload @@ -15931,6 +17365,13 @@ Default configuration for form inputs. | ---- | ---- | ----------- | -------- | | tenant_id | string | | Yes | +#### SwitchWorkspaceResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| new_tenant | [TenantInfoResponse](#tenantinforesponse) | | Yes | +| result | string | | Yes | + #### SyncDraftWorkflowPayload | Name | Type | Description | Required | @@ -15949,6 +17390,16 @@ Default configuration for form inputs. | result | string | | No | | updated_at | string | | No | +#### SystemConfigurationResponse + +Model class for provider system configuration response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| current_quota_type | [ProviderQuotaType](#providerquotatype) | | No | +| enabled | boolean | | Yes | +| quota_configurations | [ [QuotaConfiguration](#quotaconfiguration) ],
**Default:** | | No | + #### SystemFeatureModel | Name | Type | Description | Required | @@ -15974,6 +17425,16 @@ Default configuration for form inputs. | sso_enforced_for_signin_protocol | string | | Yes | | webapp_auth | [WebAppAuthModel](#webappauthmodel) | | Yes | +#### SystemParameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| audio_file_size_limit | integer | | Yes | +| file_size_limit | integer | | Yes | +| image_file_size_limit | integer | | Yes | +| video_file_size_limit | integer | | Yes | +| workflow_file_upload_limit | integer | | Yes | + #### Tag | Name | Type | Description | Required | @@ -16058,12 +17519,35 @@ Tag type | trial_credits_used | integer | | No | | trial_end_reason | string | | No | +#### TenantListItemResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | No | +| current | boolean | | Yes | +| id | string | | Yes | +| name | string | | No | +| plan | string | | No | +| status | string | | No | + +#### TenantListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| workspaces | [ [TenantListItemResponse](#tenantlistitemresponse) ] | | Yes | + #### TextContentResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | content | string | | Yes | +#### TextFileResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TextFileResponse | string | | | + #### TextToAudioPayload | Name | Type | Description | Required | @@ -16091,12 +17575,37 @@ Tag type | text | string | | No | | voice | string | | No | +#### TextToSpeechVoiceListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TextToSpeechVoiceListResponse | array | | | + #### TextToSpeechVoiceQuery | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | language | string | Language code | Yes | +#### TokensPerSecondStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| tps | number | | Yes | + +#### TokensPerSecondStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [TokensPerSecondStatisticItem](#tokenspersecondstatisticitem) ] | | Yes | + +#### ToolOAuthClientSchemaResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ToolOAuthClientSchemaResponse | array | | | + #### ToolOAuthCustomClientPayload | Name | Type | Description | Required | @@ -16104,12 +17613,45 @@ Tag type | client_params | object | | No | | enable_oauth_custom_client | boolean | | No | +#### ToolOAuthCustomClientResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ToolOAuthCustomClientResponse | object | | | + #### ToolParameterForm | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | ToolParameterForm | string | | | +#### ToolProviderListQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| type | string | | No | + +#### ToolProviderOpaqueResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ToolProviderOpaqueResponse | | | | + +#### TraceAppConfigResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_id | string | | No | +| created_at | string | | No | +| error | string | | No | +| has_not_configured | boolean | | No | +| id | string | | No | +| is_active | boolean | | No | +| result | string | | No | +| tracing_config | object | | No | +| tracing_provider | string | | No | +| updated_at | string | | No | + #### TraceConfigPayload | Name | Type | Description | Required | @@ -16129,7 +17671,7 @@ Tag type | ---- | ---- | ----------- | -------- | | access_mode | string | | No | | api_base_url | string | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | deleted_tools | [ [TrialDeletedTool](#trialdeletedtool) ] | | No | | description | string | | No | @@ -16138,7 +17680,7 @@ Tag type | icon | string | | No | | icon_background | string | | No | | icon_type | string | | No | -| icon_url | object | | No | +| icon_url | string | | No | | id | string | | No | | max_active_requests | integer | | No | | mode | string | | No | @@ -16146,7 +17688,7 @@ Tag type | name | string | | No | | site | [TrialSite](#trialsite) | | No | | tags | [ [TrialTag](#trialtag) ] | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | | use_icon_as_answer_icon | boolean | | No | | workflow | [TrialWorkflowPartial](#trialworkflowpartial) | | No | @@ -16159,11 +17701,11 @@ Tag type | annotation_reply | object | | No | | chat_prompt_config | object | | No | | completion_prompt_config | object | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | dataset_configs | object | | No | | dataset_query_variable | string | | No | -| external_data_tools | object | | No | +| external_data_tools | [ object ] | | No | | file_upload | object | | No | | model | object | | No | | more_like_this | object | | No | @@ -16173,12 +17715,12 @@ Tag type | retriever_resource | object | | No | | sensitive_word_avoidance | object | | No | | speech_to_text | object | | No | -| suggested_questions | object | | No | +| suggested_questions | [ string ] | | No | | suggested_questions_after_answer | object | | No | | text_to_speech | object | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | -| user_input_form | object | | No | +| user_input_form | [ object ] | | No | #### TrialConversationVariable @@ -16187,9 +17729,40 @@ Tag type | description | string | | No | | id | string | | No | | name | string | | No | -| value | object | | No | +| value | string
integer
number
boolean
object
[ object ] | | No | | value_type | string | | No | +#### TrialDataset + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | long | | No | +| created_by | string | | No | +| data_source_type | string | | No | +| description | string | | No | +| id | string | | No | +| indexing_technique | string | | No | +| name | string | | No | +| permission | string | | No | + +#### TrialDatasetList + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [TrialDataset](#trialdataset) ] | | No | +| has_more | boolean | | No | +| limit | integer | | No | +| page | integer | | No | +| total | integer | | No | + +#### TrialDatasetListQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ids | [ string ] | Dataset IDs | No | +| limit | integer,
**Default:** 20 | Number of items per page | No | +| page | integer,
**Default:** 1 | Page number | No | + #### TrialDeletedTool | Name | Type | Description | Required | @@ -16212,7 +17785,7 @@ Tag type | allow_file_upload_methods | [ string ] | | No | | allowed_file_types | [ string ] | | No | | belong_to_node_id | string | | No | -| default_value | object | | No | +| default_value | string
integer
number
boolean
object
[ object ] | | No | | label | string | | No | | max_length | integer | | No | | options | [ string ] | | No | @@ -16241,7 +17814,7 @@ Tag type | chat_color_theme_inverted | boolean | | No | | code | string | | No | | copyright | string | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | custom_disclaimer | string | | No | | customize_domain | string | | No | @@ -16251,12 +17824,12 @@ Tag type | icon | string | | No | | icon_background | string | | No | | icon_type | string | | No | -| icon_url | object | | No | +| icon_url | string | | No | | privacy_policy | string | | No | | prompt_public | boolean | | No | | show_workflow_steps | boolean | | No | | title | string | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | | use_icon_as_answer_icon | boolean | | No | @@ -16273,7 +17846,7 @@ Tag type | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | conversation_variables | [ [TrialConversationVariable](#trialconversationvariable) ] | | No | -| created_at | object | | No | +| created_at | long | | No | | created_by | [TrialSimpleAccount](#trialsimpleaccount) | | No | | environment_variables | [ object ] | | No | | features | object | | No | @@ -16284,7 +17857,7 @@ Tag type | marked_name | string | | No | | rag_pipeline_variables | [ [TrialPipelineVariable](#trialpipelinevariable) ] | | No | | tool_published | boolean | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | [TrialSimpleAccount](#trialsimpleaccount) | | No | | version | string | | No | @@ -16292,12 +17865,20 @@ Tag type | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| created_at | object | | No | +| created_at | long | | No | | created_by | string | | No | | id | string | | No | -| updated_at | object | | No | +| updated_at | long | | No | | updated_by | string | | No | +#### TriggerOAuthAuthorizeResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| authorization_url | string | | Yes | +| subscription_builder | | | Yes | +| subscription_builder_id | string | | Yes | + #### TriggerOAuthClientPayload | Name | Type | Description | Required | @@ -16305,6 +17886,24 @@ Tag type | client_params | object | | No | | enabled | boolean | | No | +#### TriggerOAuthClientResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| configured | boolean | | Yes | +| custom_configured | boolean | | Yes | +| custom_enabled | boolean | | Yes | +| oauth_client_schema | | | Yes | +| params | object | | Yes | +| redirect_uri | string | | Yes | +| system_configured | boolean | | Yes | + +#### TriggerProviderOpaqueResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TriggerProviderOpaqueResponse | | | | + #### TriggerSubscriptionBuilderCreatePayload | Name | Type | Description | Required | @@ -16332,6 +17931,15 @@ Tag type | ---- | ---- | ----------- | -------- | | Type | string | | | +#### UnaddedModelConfiguration + +Model class for provider unadded model configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| model | string | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | + #### UpdateAnnotationPayload | Name | Type | Description | Required | @@ -16384,6 +17992,12 @@ Payload for updating a snippet. | video_file_size_limit | integer | | Yes | | workflow_file_upload_limit | integer | | Yes | +#### UrlQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| url | string (uri) | | Yes | + #### UrlResponse | Name | Type | Description | Required | @@ -16413,6 +18027,19 @@ User action configuration. | id | string | | Yes | | title | string | | Yes | +#### UserSatisfactionRateStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| rate | number | | Yes | + +#### UserSatisfactionRateStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [UserSatisfactionRateStatisticItem](#usersatisfactionratestatisticitem) ] | | Yes | + #### ValueSourceType ValueSourceType records whether the value comes from a static setting @@ -16465,6 +18092,12 @@ in form definiton, or a variable while the workflow is running. | provider | string,
**Available values:** "firecrawl", "jinareader", "watercrawl" | *Enum:* `"firecrawl"`, `"jinareader"`, `"watercrawl"` | Yes | | url | string | | Yes | +#### WebsiteCrawlResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| WebsiteCrawlResponse | object | | | + #### WebsiteCrawlStatusQuery | Name | Type | Description | Required | @@ -16594,6 +18227,19 @@ How a workflow node is bound to an Agent. | trigger_metadata | | | No | | workflow_run | [WorkflowRunForArchivedLogResponse](#workflowrunforarchivedlogresponse) | | No | +#### WorkflowAverageAppInteractionStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| interactions | number | | Yes | + +#### WorkflowAverageAppInteractionStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WorkflowAverageAppInteractionStatisticItem](#workflowaverageappinteractionstatisticitem) ] | | Yes | + #### WorkflowCommentAccount | Name | Type | Description | Required | @@ -16741,9 +18387,48 @@ How a workflow node is bound to an Agent. | description | string | | Yes | | id | string | | Yes | | name | string | | Yes | -| value | object | | Yes | +| value | | | Yes | | value_type | string | | Yes | +#### WorkflowDailyRunsStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| runs | integer | | Yes | + +#### WorkflowDailyRunsStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WorkflowDailyRunsStatisticItem](#workflowdailyrunsstatisticitem) ] | | Yes | + +#### WorkflowDailyTerminalsStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| terminal_count | integer | | Yes | + +#### WorkflowDailyTerminalsStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WorkflowDailyTerminalsStatisticItem](#workflowdailyterminalsstatisticitem) ] | | Yes | + +#### WorkflowDailyTokenCostStatisticItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| date | string | | Yes | +| token_count | integer | | Yes | + +#### WorkflowDailyTokenCostStatisticResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WorkflowDailyTokenCostStatisticItem](#workflowdailytokencoststatisticitem) ] | | Yes | + #### WorkflowDraftEnvVariable | Name | Type | Description | Required | @@ -16775,7 +18460,7 @@ How a workflow node is bound to an Agent. | name | string | | No | | selector | [ string ] | | No | | type | string | | No | -| value | object | | No | +| value | string
integer
number
boolean
object
[ object ] | | No | | value_type | string | | No | | visible | boolean | | No | @@ -16797,7 +18482,7 @@ How a workflow node is bound to an Agent. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | items | [ [WorkflowDraftVariableWithoutValue](#workflowdraftvariablewithoutvalue) ] | | No | -| total | object | | No | +| total | integer | | No | #### WorkflowDraftVariablePatchPayload @@ -16834,7 +18519,7 @@ How a workflow node is bound to an Agent. | description | string | | Yes | | id | string | | Yes | | name | string | | Yes | -| value | object | | Yes | +| value | | | Yes | | value_type | string | | Yes | #### WorkflowExecutionStatus @@ -16965,6 +18650,13 @@ can reuse its existing handler. | variable | string | | No | | variable_selector | [ string
integer
number
boolean ] | | No | +#### WorkflowPublishResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | Yes | +| result | string | | Yes | + #### WorkflowResponse | Name | Type | Description | Required | @@ -16985,6 +18677,14 @@ can reuse its existing handler. | updated_by | [SimpleAccount](#simpleaccount) | | No | | version | string | | Yes | +#### WorkflowRestoreResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| hash | string | | Yes | +| result | string | | Yes | +| updated_at | integer | | Yes | + #### WorkflowRunCountQuery | Name | Type | Description | Required | @@ -17182,6 +18882,19 @@ Query parameters for workflow runs. | ---- | ---- | ----------- | -------- | | workflow_tool_id | string | | Yes | +#### WorkflowToolGetQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| workflow_app_id | string | | No | +| workflow_tool_id | string | | No | + +#### WorkflowToolListQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| workflow_tool_id | string | | Yes | + #### WorkflowToolParameterConfiguration Workflow tool configuration @@ -17252,6 +18965,15 @@ Workflow tool configuration | ---- | ---- | ----------- | -------- | | name | string | | Yes | +#### WorkspaceListItemResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | No | +| id | string | | Yes | +| name | string | | No | +| status | string | | No | + #### WorkspaceListQuery | Name | Type | Description | Required | @@ -17259,6 +18981,29 @@ Workflow tool configuration | limit | integer,
**Default:** 20 | | No | | page | integer,
**Default:** 1 | | No | +#### WorkspaceListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WorkspaceListItemResponse](#workspacelistitemresponse) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | +| page | integer | | Yes | +| total | integer | | Yes | + +#### WorkspaceLogoUploadResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| id | string | | Yes | + +#### WorkspaceMutationResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| result | string | | Yes | +| tenant | [TenantInfoResponse](#tenantinforesponse) | | Yes | + #### WorkspacePermissionResponse | Name | Type | Description | Required | @@ -17267,25 +19012,6 @@ Workflow tool configuration | allow_owner_transfer | boolean | | Yes | | workspace_id | string | | Yes | -#### _AnonymousInlineModel_7b67ac8a4db8 - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| author_name | string | | No | -| created_at | object | | No | -| created_by | string | | No | -| description | string | | No | -| icon_info | object | | No | -| id | string | | No | -| is_published | boolean | | No | -| name | string | | No | -| tags | [ [_AnonymousInlineModel_7b8b49ca164e](#_anonymousinlinemodel_7b8b49ca164e) ] | | No | -| type | string | | No | -| updated_at | object | | No | -| updated_by | string | | No | -| use_count | integer | | No | -| version | integer | | No | - #### _AnonymousInlineModel_7b8b49ca164e | Name | Type | Description | Required | @@ -17311,6 +19037,25 @@ Workflow tool configuration | model_provider_name | string | | No | | summary_prompt | string | | No | +#### _AnonymousInlineModel_efd591151ea9 + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| author_name | string | | No | +| created_at | long | | No | +| created_by | string | | No | +| description | string | | No | +| icon_info | object | | No | +| id | string | | No | +| is_published | boolean | | No | +| name | string | | No | +| tags | [ [_AnonymousInlineModel_7b8b49ca164e](#_anonymousinlinemodel_7b8b49ca164e) ] | | No | +| type | string | | No | +| updated_at | long | | No | +| updated_by | string | | No | +| use_count | integer | | No | +| version | integer | | No | + ## FastOpenAPI Preview (OpenAPI 3.1) ### Dify API (FastOpenAPI PoC) diff --git a/api/openapi/markdown/openapi-openapi.md b/api/openapi/markdown/openapi-openapi.md index 625699c061..d203eaa4c9 100644 --- a/api/openapi/markdown/openapi-openapi.md +++ b/api/openapi/markdown/openapi-openapi.md @@ -172,9 +172,9 @@ Upload a file to use as an input variable when running the app #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Form definition | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Form definition | **application/json**: [HumanInputFormDefinitionResponse](#humaninputformdefinitionresponse)
| ### [POST] /apps/{app_id}/form/human_input/{form_token} #### Parameters @@ -215,7 +215,7 @@ Upload a file to use as an input variable when running the app | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Run result (SSE stream) | | +| 200 | Run result (SSE stream) | **application/json**: [EventStreamResponse](#eventstreamresponse)
| | 422 | Validation error | **application/json**: [ErrorBody](#errorbody)
| ### [GET] /apps/{app_id}/tasks/{task_id}/events @@ -223,14 +223,16 @@ Upload a file to use as an input variable when running the app | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| continue_on_pause | query | Whether to keep the event stream open on pause | No | boolean | +| include_state_snapshot | query | Whether to include workflow state snapshots | No | boolean | | app_id | path | | Yes | string | | task_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | SSE event stream | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | SSE event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| ### [POST] /apps/{app_id}/tasks/{task_id}/stop #### Parameters @@ -308,9 +310,9 @@ Upload a file to use as an input variable when running the app #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Device token | **application/json**: [DeviceTokenResponse](#devicetokenresponse)
| ### [GET] /permitted-external-apps #### Parameters @@ -689,6 +691,20 @@ mode is a closed enum. | client_id | string | | Yes | | device_code | string | | Yes | +#### DeviceTokenResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| account | [AccountPayload](#accountpayload) | | No | +| default_workspace_id | string | | No | +| expires_at | string | | Yes | +| subject_email | string | | No | +| subject_issuer | string | | No | +| subject_type | string,
**Available values:** "account", "external_sso" | *Enum:* `"account"`, `"external_sso"` | Yes | +| token | string | | Yes | +| token_id | string | | Yes | +| workspaces | [ [WorkspacePayload](#workspacepayload) ],
**Default:** | | No | + #### ErrorBody Canonical non-2xx body. ``code`` is typed ``str`` (not the enum) so the @@ -711,6 +727,12 @@ future server adds a code. Formatter tests pin emitted values to the enum. | msg | string | | Yes | | type | string | | Yes | +#### EventStreamResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EventStreamResponse | string | | | + #### FileResponse | Name | Type | Description | Required | @@ -757,6 +779,16 @@ Liveness payload for `GET /openapi/v1/_health` — no auth required. | ---- | ---- | ----------- | -------- | | ok | boolean | | Yes | +#### HumanInputFormDefinitionResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| expiration_time | integer | | No | +| form_content | string | | Yes | +| inputs | [ object ] | | No | +| resolved_default_values | object | | Yes | +| user_actions | [ object ] | | No | + #### HumanInputFormSubmitPayload | Name | Type | Description | Required | diff --git a/api/openapi/markdown/service-openapi.md b/api/openapi/markdown/service-openapi.md index 5c0738062d..5a0a128b4f 100644 --- a/api/openapi/markdown/service-openapi.md +++ b/api/openapi/markdown/service-openapi.md @@ -35,10 +35,10 @@ Returns paginated list of all feedback submitted for messages in this app. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Feedbacks retrieved successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Feedbacks retrieved successfully | **application/json**: [AppFeedbackListResponse](#appfeedbacklistresponse)
| +| 401 | Unauthorized - invalid API token | | ### [POST] /apps/annotation-reply/{action} **Enable or disable annotation reply feature** @@ -57,10 +57,10 @@ Returns paginated list of all feedback submitted for messages in this app. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Action completed successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Action completed successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 401 | Unauthorized - invalid API token | | ### [GET] /apps/annotation-reply/{action}/status/{job_id} **Get the status of an annotation reply action job** @@ -74,11 +74,11 @@ Returns paginated list of all feedback submitted for messages in this app. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Job status retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Job not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Job status retrieved successfully | **application/json**: [AnnotationJobStatusResponse](#annotationjobstatusresponse)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Job not found | | ### [GET] /apps/annotations **List annotations for the application** @@ -164,14 +164,14 @@ Accepts an audio file upload and returns the transcribed text. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Audio successfully transcribed | -| 400 | Bad request - no audio or invalid audio | -| 401 | Unauthorized - invalid API token | -| 413 | Audio file too large | -| 415 | Unsupported audio type | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Audio successfully transcribed | **application/json**: [AudioTranscriptResponse](#audiotranscriptresponse)
| +| 400 | Bad request - no audio or invalid audio | | +| 401 | Unauthorized - invalid API token | | +| 413 | Audio file too large | | +| 415 | Unsupported audio type | | +| 500 | Internal server error | | ### [POST] /chat-messages **Send a message in a chat conversation** @@ -188,14 +188,14 @@ Supports conversation management and both blocking and streaming response modes. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Message sent successfully | -| 400 | Bad request - invalid parameters or workflow issues | -| 401 | Unauthorized - invalid API token | -| 404 | Conversation or workflow not found | -| 429 | Rate limit exceeded | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Message sent successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad request - invalid parameters or workflow issues | | +| 401 | Unauthorized - invalid API token | | +| 404 | Conversation or workflow not found | | +| 429 | Rate limit exceeded | | +| 500 | Internal server error | | ### [POST] /chat-messages/{task_id}/stop **Stop a running chat message generation** @@ -229,13 +229,13 @@ Supports both blocking and streaming response modes. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Completion created successfully | -| 400 | Bad request - invalid parameters | -| 401 | Unauthorized - invalid API token | -| 404 | Conversation not found | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Completion created successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad request - invalid parameters | | +| 401 | Unauthorized - invalid API token | | +| 404 | Conversation not found | | +| 500 | Internal server error | | ### [POST] /completion-messages/{task_id}/stop **Stop a running completion task** @@ -270,11 +270,11 @@ Supports pagination using last_id and limit parameters. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Conversations retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Last conversation not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Conversations retrieved successfully | **application/json**: [ConversationInfiniteScrollPagination](#conversationinfinitescrollpagination)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Last conversation not found | | ### [DELETE] /conversations/{c_id} **Delete a specific conversation** @@ -310,11 +310,11 @@ Supports pagination using last_id and limit parameters. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Conversation renamed successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Conversation not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Conversation renamed successfully | **application/json**: [SimpleConversation](#simpleconversation)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Conversation not found | | ### [GET] /conversations/{c_id}/variables **List all variables for a conversation** @@ -417,13 +417,13 @@ Accepts a single file upload via multipart/form-data. #### Responses -| Code | Description | -| ---- | ----------- | -| 201 | File uploaded successfully | -| 400 | Bad request - no file or invalid file | -| 401 | Unauthorized - invalid API token | -| 413 | File too large | -| 415 | Unsupported file type | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 201 | File uploaded successfully | **application/json**: [PipelineUploadFileResponse](#pipelineuploadfileresponse)
| +| 400 | Bad request - no file or invalid file | | +| 401 | Unauthorized - invalid API token | | +| 413 | File too large | | +| 415 | Unsupported file type | | ### [DELETE] /datasets/tags **Delete a knowledge type tag** @@ -726,12 +726,12 @@ Download selected uploaded documents as a single ZIP archive #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | ZIP archive generated successfully | -| 401 | Unauthorized - invalid API token | -| 403 | Forbidden - insufficient permissions | -| 404 | Document or dataset not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | ZIP archive generated successfully | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| +| 401 | Unauthorized - invalid API token | | +| 403 | Forbidden - insufficient permissions | | +| 404 | Document or dataset not found | | ### [POST] /datasets/{dataset_id}/documents/metadata **Update metadata for multiple documents** @@ -781,6 +781,12 @@ Raises: | action | path | Action to perform: 'enable', 'disable', 'archive', or 'un_archive' | Yes | string | | dataset_id | path | Dataset ID | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [DocumentStatusPayload](#documentstatuspayload)
| + #### Responses | Code | Description | Schema | @@ -839,15 +845,16 @@ Get a specific document by ID | ---- | ---------- | ----------- | -------- | ------ | | dataset_id | path | Dataset ID | Yes | string | | document_id | path | Document ID | Yes | string | +| metadata | query | Metadata response mode | No | string,
**Available values:** "all", "only", "without",
**Default:** all | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Document retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 403 | Forbidden - insufficient permissions | -| 404 | Document not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Document retrieved successfully | **application/json**: [DocumentDetailResponse](#documentdetailresponse)
| +| 401 | Unauthorized - invalid API token | | +| 403 | Forbidden - insufficient permissions | | +| 404 | Document not found | | ### [PATCH] /datasets/{dataset_id}/documents/{document_id} Update an existing document by uploading a file @@ -1351,15 +1358,15 @@ List all datasource plugins for a rag pipeline | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| is_published | query | Whether to get published or draft datasource plugins (true for published, false for draft, default: true) | No | string | +| is_published | query | | No | boolean,
**Default:** true | | dataset_id | path | | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Datasource plugins retrieved successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Datasource plugins retrieved successfully | **application/json**: [DatasourcePluginListResponse](#datasourcepluginlistresponse)
| +| 401 | Unauthorized - invalid API token | | ### [POST] /datasets/{dataset_id}/pipeline/datasource/nodes/{node_id}/run **Resource for getting datasource plugins** @@ -1373,12 +1380,18 @@ Run a datasource node for a rag pipeline | dataset_id | path | | Yes | string | | node_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [DatasourceNodeRunPayload](#datasourcenoderunpayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Datasource node run successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Datasource node run successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 401 | Unauthorized - invalid API token | | ### [POST] /datasets/{dataset_id}/pipeline/run **Resource for running a rag pipeline** @@ -1391,12 +1404,18 @@ Run a datasource node for a rag pipeline | ---- | ---------- | ----------- | -------- | ------ | | dataset_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [PipelineRunApiEntity](#pipelinerunapientity)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Pipeline run successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Pipeline run successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 401 | Unauthorized - invalid API token | | ### [POST] /datasets/{dataset_id}/retrieve **Perform hit testing on a dataset** @@ -1495,12 +1514,12 @@ Files can only be accessed if they belong to messages within the requesting app' #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | File retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 403 | Forbidden - file access denied | -| 404 | File not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | File retrieved successfully | **application/json**: [BinaryFileResponse](#binaryfileresponse)
| +| 401 | Unauthorized - invalid API token | | +| 403 | Forbidden - file access denied | | +| 404 | File not found | | ### [GET] /form/human_input/{form_token} Get a paused human input form by token @@ -1513,12 +1532,12 @@ Get a paused human input form by token #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Form retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Form not found | -| 412 | Form already submitted or expired | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Form retrieved successfully | **application/json**: [HumanInputFormDefinitionResponse](#humaninputformdefinitionresponse)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Form not found | | +| 412 | Form already submitted or expired | | ### [POST] /form/human_input/{form_token} Submit a paused human input form by token @@ -1537,13 +1556,13 @@ Submit a paused human input form by token #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Form submitted successfully | -| 400 | Bad request - invalid submission data | -| 401 | Unauthorized - invalid API token | -| 404 | Form not found | -| 412 | Form already submitted or expired | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Form submitted successfully | **application/json**: [HumanInputFormSubmitResponse](#humaninputformsubmitresponse)
| +| 400 | Bad request - invalid submission data | | +| 401 | Unauthorized - invalid API token | | +| 404 | Form not found | | +| 412 | Form already submitted or expired | | ### [GET] /info **Get app information** @@ -1575,11 +1594,11 @@ Retrieves messages with pagination support using first_id. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Messages retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Conversation or first message not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Messages retrieved successfully | **application/json**: [MessageInfiniteScrollPagination](#messageinfinitescrollpagination)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Conversation or first message not found | | ### [POST] /messages/{message_id}/feedbacks **Submit feedback for a message** @@ -1637,11 +1656,11 @@ Returns metadata about the application including configuration and settings. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Metadata retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Application not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Metadata retrieved successfully | **application/json**: [AppMetaResponse](#appmetaresponse)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Application not found | | ### [GET] /parameters **Retrieve app parameters** @@ -1651,11 +1670,11 @@ Returns the input form parameters and configuration for the application. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Parameters retrieved successfully | -| 401 | Unauthorized - invalid API token | -| 404 | Application not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Parameters retrieved successfully | **application/json**: [Parameters](#parameters)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Application not found | | ### [GET] /site **Retrieve app site info** @@ -1685,12 +1704,12 @@ Converts the provided text to audio using the specified voice. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Text successfully converted to audio | -| 400 | Bad request - invalid parameters | -| 401 | Unauthorized - invalid API token | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Text successfully converted to audio | **application/json**: [AudioBinaryResponse](#audiobinaryresponse)
| +| 400 | Bad request - invalid parameters | | +| 401 | Unauthorized - invalid API token | | +| 500 | Internal server error | | ### [GET] /workflow/{task_id}/events Get workflow execution events stream after resume @@ -1700,17 +1719,17 @@ Get workflow execution events stream after resume | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | task_id | path | Workflow run ID | Yes | string | -| continue_on_pause | query | Whether to keep the stream open across workflow_paused events,specify `"true"` to keep the stream open for `workflow_paused` events. | No | string | -| include_state_snapshot | query | Whether to replay from persisted state snapshot, specify `"true"` to include a status snapshot of executed nodes | No | string | -| user | query | End user identifier (query param) | No | string | +| continue_on_pause | query | Keep the stream open across workflow_paused events | No | boolean | +| include_state_snapshot | query | Replay from persisted state snapshot | No | boolean | +| user | query | End user identifier | Yes | string | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | SSE event stream | -| 401 | Unauthorized - invalid API token | -| 404 | Workflow run not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | SSE event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| +| 401 | Unauthorized - invalid API token | | +| 404 | Workflow run not found | | ### [GET] /workflows/logs **Get workflow app logs** @@ -1753,14 +1772,14 @@ Supports both blocking and streaming response modes. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow executed successfully | -| 400 | Bad request - invalid parameters or workflow issues | -| 401 | Unauthorized - invalid API token | -| 404 | Workflow not found | -| 429 | Rate limit exceeded | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow executed successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad request - invalid parameters or workflow issues | | +| 401 | Unauthorized - invalid API token | | +| 404 | Workflow not found | | +| 429 | Rate limit exceeded | | +| 500 | Internal server error | | ### [GET] /workflows/run/{workflow_run_id} **Get a workflow task running detail** @@ -1819,14 +1838,14 @@ Executes a specific workflow version identified by its ID. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Workflow executed successfully | -| 400 | Bad request - invalid parameters or workflow issues | -| 401 | Unauthorized - invalid API token | -| 404 | Workflow not found | -| 429 | Rate limit exceeded | -| 500 | Internal server error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Workflow executed successfully | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad request - invalid parameters or workflow issues | | +| 401 | Unauthorized - invalid API token | | +| 404 | Workflow not found | | +| 429 | Rate limit exceeded | | +| 500 | Internal server error | | ### [GET] /workspaces/current/models/model-types/{model_type} **Get available models by model type** @@ -1842,14 +1861,30 @@ Returns a list of available models for the specified model type. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Models retrieved successfully | -| 401 | Unauthorized - invalid API token | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Models retrieved successfully | **application/json**: [ProviderWithModelsListResponse](#providerwithmodelslistresponse)
| +| 401 | Unauthorized - invalid API token | | --- ### Schemas +#### AgentThought + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| chain_id | string | | No | +| created_at | integer | | No | +| files | [ string ] | | Yes | +| id | string | | Yes | +| message_id | string | | Yes | +| observation | string | | No | +| position | integer | | Yes | +| thought | string | | No | +| tool | string | | No | +| tool_input | string | | No | +| tool_labels | [JSONValue](#jsonvalue) | | Yes | + #### Annotation | Name | Type | Description | Required | @@ -1867,6 +1902,14 @@ Returns a list of available models for the specified model type. | answer | string | Annotation answer | Yes | | question | string | Annotation question | Yes | +#### AnnotationJobStatusResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| error_msg | string | | No | +| job_id | string | | Yes | +| job_status | string | | Yes | + #### AnnotationList | Name | Type | Description | Required | @@ -1893,6 +1936,28 @@ Returns a list of available models for the specified model type. | embedding_provider_name | string | Embedding provider name | Yes | | score_threshold | number | Score threshold for annotation matching | Yes | +#### AppFeedbackListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [AppFeedbackResponse](#appfeedbackresponse) ] | | Yes | + +#### AppFeedbackResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_id | string | | Yes | +| content | string | | No | +| conversation_id | string | | Yes | +| created_at | string | | Yes | +| from_account_id | string | | No | +| from_end_user_id | string | | No | +| from_source | string | | Yes | +| id | string | | Yes | +| message_id | string | | Yes | +| rating | string | | Yes | +| updated_at | string | | Yes | + #### AppInfoResponse | Name | Type | Description | Required | @@ -1903,6 +1968,38 @@ Returns a list of available models for the specified model type. | name | string | | Yes | | tags | [ string ] | | Yes | +#### AppMetaResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| tool_icons | object | | No | + +#### AudioBinaryResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AudioBinaryResponse | string | | | + +#### AudioTranscriptResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| text | string | | Yes | + +#### BinaryFileResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| BinaryFileResponse | string | | | + +#### ButtonStyle + +Button styles for user actions. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ButtonStyle | string | Button styles for user actions. | | + #### ChatRequestPayload | Name | Type | Description | Required | @@ -1987,6 +2084,14 @@ Condition detail | name | string | | Yes | | value | string
[ string ]
integer
number | | No | +#### ConversationInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [SimpleConversation](#simpleconversation) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + #### ConversationListQuery | Name | Type | Description | Required | @@ -2036,6 +2141,14 @@ Condition detail | limit | integer,
**Default:** 20 | Number of variables to return | No | | variable_name | string | Filter variables by name | No | +#### CustomConfigurationStatus + +Enum class for custom configuration status. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| CustomConfigurationStatus | string | Enum class for custom configuration status. | | + #### DatasetBoundTagListResponse | Name | Type | Description | Required | @@ -2319,6 +2432,15 @@ Condition detail | vector_setting | [DatasetVectorSettingResponse](#datasetvectorsettingresponse) | | No | | weight_type | string | | No | +#### DatasourceCredentialInfoResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| id | string | | No | +| is_default | boolean | | No | +| name | string | | No | +| type | string | | No | + #### DatasourceNodeRunPayload | Name | Type | Description | Required | @@ -2328,6 +2450,30 @@ Condition detail | inputs | object | | Yes | | is_published | boolean | | Yes | +#### DatasourcePluginListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| DatasourcePluginListResponse | array | | | + +#### DatasourcePluginResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credentials | [ [DatasourceCredentialInfoResponse](#datasourcecredentialinforesponse) ] | | Yes | +| datasource_type | string | | No | +| node_id | string | | No | +| plugin_id | string | | No | +| provider_name | string | | No | +| title | string | | No | +| user_input_variables | [ object ] | | No | + +#### DatasourcePluginsQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| is_published | boolean,
**Default:** true | | No | + #### DocumentAndBatchResponse | Name | Type | Description | Required | @@ -2343,6 +2489,48 @@ Request payload for bulk downloading documents as a zip archive. | ---- | ---- | ----------- | -------- | | document_ids | [ string (uuid) ] | | Yes | +#### DocumentDetailResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| archived | boolean | | No | +| average_segment_length | number | | No | +| completed_at | integer | | No | +| created_at | integer | | No | +| created_by | string | | No | +| created_from | string | | No | +| data_source_info | object | | No | +| data_source_type | string | | No | +| dataset_process_rule | object | | No | +| dataset_process_rule_id | string | | No | +| disabled_at | integer | | No | +| disabled_by | string | | No | +| display_status | string | | No | +| doc_form | string | | No | +| doc_language | string | | No | +| doc_metadata | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No | +| doc_type | string | | No | +| document_process_rule | object | | No | +| enabled | boolean | | No | +| error | string | | No | +| hit_count | integer | | No | +| id | string | | Yes | +| indexing_latency | number | | No | +| indexing_status | string | | No | +| name | string | | No | +| need_summary | boolean | | No | +| position | integer | | No | +| segment_count | integer | | No | +| summary_index_status | string | | No | +| tokens | integer | | No | +| updated_at | integer | | No | + +#### DocumentGetQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| metadata | string,
**Available values:** "all", "only", "without",
**Default:** all | Metadata response mode
*Enum:* `"all"`, `"only"`, `"without"` | No | + #### DocumentListQuery | Name | Type | Description | Required | @@ -2414,6 +2602,12 @@ Request payload for bulk downloading documents as a zip archive. | ---- | ---- | ----------- | -------- | | data | [ [DocumentStatusResponse](#documentstatusresponse) ] | | Yes | +#### DocumentStatusPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| document_ids | [ string ] | Document IDs to update | No | + #### DocumentStatusResponse | Name | Type | Description | Required | @@ -2478,6 +2672,18 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | type | string | | Yes | | updated_at | dateTime | | Yes | +#### EventStreamResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EventStreamResponse | string | | | + +#### ExecutionContentType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ExecutionContentType | string | | | + #### FeedbackListQuery | Name | Type | Description | Required | @@ -2485,6 +2691,35 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | limit | integer,
**Default:** 20 | Number of feedbacks per page | No | | page | integer,
**Default:** 1 | Page number | No | +#### FetchFrom + +Enum class for fetch from. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FetchFrom | string | Enum class for fetch from. | | + +#### FileInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| allowed_file_extensions | [ string ] | | No | +| allowed_file_types | [ [FileType](#filetype) ] | | No | +| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + +#### FileListInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| allowed_file_extensions | [ string ] | | No | +| allowed_file_types | [ [FileType](#filetype) ] | | No | +| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No | +| number_limits | integer | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + #### FilePreviewQuery | Name | Type | Description | Required | @@ -2511,6 +2746,30 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | tenant_id | string | | No | | user_id | string | | No | +#### FileTransferMethod + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FileTransferMethod | string | | | + +#### FileType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FileType | string | | | + +#### FormInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FormInputConfig | [ParagraphInputConfig](#paragraphinputconfig)
[SelectInputConfig](#selectinputconfig)
[FileInputConfig](#fileinputconfig)
[FileListInputConfig](#filelistinputconfig) | | | + +#### GeneratedAppResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| GeneratedAppResponse | | | | + #### HitTestingChildChunk | Name | Type | Description | Required | @@ -2602,6 +2861,52 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | tokens | integer | | Yes | | word_count | integer | | Yes | +#### HumanInputContent + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| form_definition | [HumanInputFormDefinition](#humaninputformdefinition) | | No | +| form_submission_data | [HumanInputFormSubmissionData](#humaninputformsubmissiondata) | | No | +| submitted | boolean | | Yes | +| type | [ExecutionContentType](#executioncontenttype) | | No | +| workflow_run_id | string | | Yes | + +#### HumanInputFormDefinition + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| actions | [ [UserActionConfig](#useractionconfig) ] | | No | +| display_in_ui | boolean | | No | +| expiration_time | integer | | Yes | +| form_content | string | | Yes | +| form_id | string | | Yes | +| form_token | string | | No | +| inputs | [ [FormInputConfig](#forminputconfig) ] | | No | +| node_id | string | | Yes | +| node_title | string | | Yes | +| resolved_default_values | object | | No | + +#### HumanInputFormDefinitionResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| expiration_time | integer | | No | +| form_content | string | | Yes | +| inputs | [ object ] | | No | +| resolved_default_values | object | | Yes | +| user_actions | [ object ] | | No | + +#### HumanInputFormSubmissionData + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| action_id | string | | Yes | +| action_text | string | | Yes | +| node_id | string | | Yes | +| node_title | string | | Yes | +| rendered_content | string | | Yes | +| submitted_data | object | | No | + #### HumanInputFormSubmitPayload | Name | Type | Description | Required | @@ -2609,6 +2914,20 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | action | string | | Yes | | inputs | object | Submitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use `transfer_method=local_file` with `upload_file_id`; remote file mappings use `transfer_method=remote_url` with `url` or `remote_url`. | Yes | +#### HumanInputFormSubmitResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | + +#### I18nObject + +Model class for i18n object. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| en_US | string | | Yes | +| zh_Hans | string | | No | + #### IndexInfoResponse | Name | Type | Description | Required | @@ -2617,6 +2936,24 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | server_version | string | | Yes | | welcome | string | | Yes | +#### JSONObject + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONObject | object | | | + +#### JSONValue + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONValue | string
integer
number
boolean
object
[ object ] | | | + +#### JSONValueType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONValueType | | | | + #### JsonValue | Name | Type | Description | Required | @@ -2645,6 +2982,47 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se | content | string | | No | | rating | string | | No | +#### MessageFile + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| belongs_to | string | | No | +| filename | string | | Yes | +| id | string | | Yes | +| mime_type | string | | No | +| size | integer | | No | +| transfer_method | string | | Yes | +| type | string | | Yes | +| upload_file_id | string | | No | +| url | string | | No | + +#### MessageInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [MessageListItem](#messagelistitem) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + +#### MessageListItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| agent_thoughts | [ [AgentThought](#agentthought) ] | | Yes | +| answer | string | | Yes | +| conversation_id | string | | Yes | +| created_at | integer | | No | +| error | string | | No | +| extra_contents | [ [HumanInputContent](#humaninputcontent) ] | | Yes | +| feedback | [SimpleFeedback](#simplefeedback) | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| message_files | [ [MessageFile](#messagefile) ] | | Yes | +| parent_message_id | string | | No | +| query | string | | Yes | +| retriever_resources | [ [RetrieverResource](#retrieverresource) ] | | Yes | +| status | string | | Yes | + #### MessageListQuery | Name | Type | Description | Required | @@ -2691,6 +3069,65 @@ Metadata operation data | ---- | ---- | ----------- | -------- | | name | string | | Yes | +#### ModelFeature + +Enum class for llm feature. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelFeature | string | Enum class for llm feature. | | + +#### ModelPropertyKey + +Enum class for model property key. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelPropertyKey | string | Enum class for model property key. | | + +#### ModelStatus + +Enum class for model status. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelStatus | string | Enum class for model status. | | + +#### ModelType + +Enum class for model type. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelType | string | Enum class for model type. | | + +#### ParagraphInputConfig + +Form input definition. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| default | [StringSource](#stringsource) | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + +#### Parameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| annotation_reply | [JSONObject](#jsonobject) | | Yes | +| file_upload | [JSONObject](#jsonobject) | | Yes | +| more_like_this | [JSONObject](#jsonobject) | | Yes | +| opening_statement | | | No | +| retriever_resource | [JSONObject](#jsonobject) | | Yes | +| sensitive_word_avoidance | [JSONObject](#jsonobject) | | Yes | +| speech_to_text | [JSONObject](#jsonobject) | | Yes | +| suggested_questions | [ string ] | | Yes | +| suggested_questions_after_answer | [JSONObject](#jsonobject) | | Yes | +| system_parameters | [SystemParameters](#systemparameters) | | Yes | +| text_to_speech | [JSONObject](#jsonobject) | | Yes | +| user_input_form | [ [JSONObject](#jsonobject) ] | | Yes | + #### PermissionEnum Shared permission levels for resources (datasets, credentials, etc.) @@ -2710,6 +3147,18 @@ Shared permission levels for resources (datasets, credentials, etc.) | response_mode | string | | Yes | | start_node_id | string | | Yes | +#### PipelineUploadFileResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | string | | No | +| created_by | string | | Yes | +| extension | string | | Yes | +| id | string | | Yes | +| mime_type | string | | No | +| name | string | | Yes | +| size | integer | | Yes | + #### PreProcessingRule | Name | Type | Description | Required | @@ -2732,6 +3181,43 @@ Dataset Process Rule Mode | ---- | ---- | ----------- | -------- | | ProcessRuleMode | string | Dataset Process Rule Mode | | +#### ProviderModelWithStatusEntity + +Model class for model response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| deprecated | boolean | | No | +| features | [ [ModelFeature](#modelfeature) ] | | No | +| fetch_from | [FetchFrom](#fetchfrom) | | Yes | +| has_invalid_load_balancing_configs | boolean | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| load_balancing_enabled | boolean | | No | +| model | string | | Yes | +| model_properties | object | | Yes | +| model_type | [ModelType](#modeltype) | | Yes | +| status | [ModelStatus](#modelstatus) | | Yes | + +#### ProviderWithModelsListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [ProviderWithModelsResponse](#providerwithmodelsresponse) ] | | Yes | + +#### ProviderWithModelsResponse + +Model class for provider with models response. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| icon_small | [I18nObject](#i18nobject) | | No | +| icon_small_dark | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | Yes | +| models | [ [ProviderModelWithStatusEntity](#providermodelwithstatusentity) ] | | Yes | +| provider | string | | Yes | +| status | [CustomConfigurationStatus](#customconfigurationstatus) | | Yes | +| tenant_id | string | | Yes | + #### RerankingModel | Name | Type | Description | Required | @@ -2765,6 +3251,28 @@ Dataset Process Rule Mode | top_k | integer | | Yes | | weights | [WeightModel](#weightmodel) | | No | +#### RetrieverResource + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| content | string | | No | +| created_at | integer | | No | +| data_source_type | string | | No | +| dataset_id | string | | No | +| dataset_name | string | | No | +| document_id | string | | No | +| document_name | string | | No | +| hit_count | integer | | No | +| id | string | | No | +| index_node_hash | string | | No | +| message_id | string | | No | +| position | integer | | Yes | +| score | number | | No | +| segment_id | string | | No | +| segment_position | integer | | No | +| summary | string | | No | +| word_count | integer | | No | + #### Rule | Name | Type | Description | Required | @@ -2893,6 +3401,14 @@ Dataset Process Rule Mode | separator | string,
**Default:** | | No | +#### SelectInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| option_source | [StringListSource](#stringlistsource) | | Yes | +| output_variable_name | string | | Yes | +| type | string | | No | + #### SimpleAccount | Name | Type | Description | Required | @@ -2901,6 +3417,18 @@ Dataset Process Rule Mode | id | string | | Yes | | name | string | | Yes | +#### SimpleConversation + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| introduction | string | | No | +| name | string | | Yes | +| status | string | | Yes | +| updated_at | integer | | No | + #### SimpleEndUser | Name | Type | Description | Required | @@ -2910,6 +3438,12 @@ Dataset Process Rule Mode | session_id | string | | No | | type | string | | Yes | +#### SimpleFeedback + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| rating | string | | No | + #### SimpleResultResponse | Name | Type | Description | Required | @@ -2942,6 +3476,34 @@ Dataset Process Rule Mode | title | string | | Yes | | use_icon_as_answer_icon | boolean | | Yes | +#### StringListSource + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| selector | [ string ] | | No | +| type | [ValueSourceType](#valuesourcetype) | | Yes | +| value | [ string ] | | No | + +#### StringSource + +Default configuration for form inputs. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| selector | [ string ] | | No | +| type | [ValueSourceType](#valuesourcetype) | | Yes | +| value | string | | No | + +#### SystemParameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| audio_file_size_limit | integer | | Yes | +| file_size_limit | integer | | Yes | +| image_file_size_limit | integer | | Yes | +| video_file_size_limit | integer | | Yes | +| workflow_file_upload_limit | integer | | Yes | + #### TagBindingPayload | Name | Type | Description | Required | @@ -2993,6 +3555,25 @@ Accept the legacy single-tag Service API payload while exposing a normalized tag | ---- | ---- | ----------- | -------- | | url | string | | Yes | +#### UserActionConfig + +User action configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| button_style | [ButtonStyle](#buttonstyle) | | No | +| id | string | | Yes | +| title | string | | Yes | + +#### ValueSourceType + +ValueSourceType records whether the value comes from a static setting +in form definiton, or a variable while the workflow is running. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ValueSourceType | string | ValueSourceType records whether the value comes from a static setting in form definiton, or a variable while the workflow is running. | | + #### WeightKeywordSetting | Name | Type | Description | Required | @@ -3038,6 +3619,14 @@ Accept the legacy single-tag Service API payload while exposing a normalized tag | id | string | | Yes | | workflow_run | [WorkflowRunForLogResponse](#workflowrunforlogresponse) | | No | +#### WorkflowEventsQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| continue_on_pause | boolean | Keep the stream open across workflow_paused events | No | +| include_state_snapshot | boolean | Replay from persisted state snapshot | No | +| user | string | End user identifier | Yes | + #### WorkflowLogQuery | Name | Type | Description | Required | diff --git a/api/openapi/markdown/web-openapi.md b/api/openapi/markdown/web-openapi.md index 5903d56b19..302c2a55e4 100644 --- a/api/openapi/markdown/web-openapi.md +++ b/api/openapi/markdown/web-openapi.md @@ -20,15 +20,15 @@ Convert audio file to text using speech-to-text service. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 413 | Audio file too large | -| 415 | Unsupported audio type | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioTranscriptResponse](#audiotranscriptresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 413 | Audio file too large | | +| 415 | Unsupported audio type | | +| 500 | Internal Server Error | | ### [POST] /chat-messages Create a chat message for conversational applications. @@ -41,14 +41,14 @@ Create a chat message for conversational applications. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [POST] /chat-messages/{task_id}/stop Stop a running chat message task. @@ -81,14 +81,14 @@ Create a completion message for text generation applications. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [POST] /completion-messages/{task_id}/stop Stop a running completion message task. @@ -117,21 +117,21 @@ Retrieve paginated list of conversations for a chat application. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| last_id | query | Last conversation ID for pagination | No | string | -| limit | query | Number of conversations to return (1-100) | No | integer,
**Default:** 20 | -| pinned | query | Filter by pinned status | No | string,
**Available values:** "false", "true" | -| sort_by | query | Sort order | No | string,
**Available values:** "-created_at", "-updated_at", "created_at", "updated_at",
**Default:** -updated_at | +| last_id | query | | No | string | +| limit | query | | No | integer,
**Default:** 20 | +| pinned | query | | No | boolean | +| sort_by | query | | No | string,
**Available values:** "-created_at", "-updated_at", "created_at", "updated_at",
**Default:** -updated_at | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found or Not a Chat App | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [ConversationInfiniteScrollPagination](#conversationinfinitescrollpagination)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found or Not a Chat App | | +| 500 | Internal Server Error | | ### [DELETE] /conversations/{c_id} Delete a specific conversation. @@ -164,16 +164,22 @@ Rename a specific conversation with a custom name or auto-generate one. | auto_generate | query | Auto-generate conversation name | No | boolean | | name | query | New conversation name | No | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [ConversationRenamePayload](#conversationrenamepayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Conversation renamed successfully | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | Conversation Not Found or Not a Chat App | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Conversation renamed successfully | **application/json**: [SimpleConversation](#simpleconversation)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | Conversation Not Found or Not a Chat App | | +| 500 | Internal Server Error | | ### [PATCH] /conversations/{c_id}/pin Pin a specific conversation to keep it at the top of the list. @@ -351,9 +357,9 @@ GET /api/form/human_input/ #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [HumanInputFormDefinitionResponse](#humaninputformdefinitionresponse)
| ### [POST] /form/human_input/{form_token} **Submit human input form by token** @@ -374,11 +380,17 @@ Request body: | ---- | ---------- | ----------- | -------- | ------ | | form_token | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [HumanInputFormSubmitPayload](#humaninputformsubmitpayload)
| + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [HumanInputFormSubmitResponse](#humaninputformsubmitresponse)
| ### [POST] /form/human_input/{form_token}/upload-token **Issue an upload token for a human input form** @@ -393,9 +405,9 @@ POST /api/form/human_input//upload-token #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [HumanInputUploadTokenResponse](#humaninputuploadtokenresponse)
| ### [POST] /human-input-forms/files **Upload one local file or remote URL file for a HITL human input form** @@ -430,6 +442,13 @@ Authenticate user for web application access ### [GET] /login/status Check login status +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| app_code | query | Web app code | No | string | +| user_id | query | End user session ID | No | string | + #### Responses | Code | Description | Schema | @@ -459,14 +478,14 @@ Retrieve paginated list of messages from a conversation in a chat application. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | Conversation Not Found or Not a Chat App | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [WebMessageInfiniteScrollPagination](#webmessageinfinitescrollpagination)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | Conversation Not Found or Not a Chat App | | +| 500 | Internal Server Error | | ### [POST] /messages/{message_id}/feedbacks Submit feedback (like/dislike) for a specific message. @@ -479,6 +498,12 @@ Submit feedback (like/dislike) for a specific message. | content | query | Feedback content | No | string | | rating | query | Feedback rating | No | string,
**Available values:** "dislike", "like" | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [MessageFeedbackPayload](#messagefeedbackpayload)
| + #### Responses | Code | Description | Schema | @@ -502,14 +527,14 @@ Generate a new completion similar to an existing message (completion apps only). #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request - Not a completion app or feature disabled | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | Message Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad Request - Not a completion app or feature disabled | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | Message Not Found | | +| 500 | Internal Server Error | | ### [GET] /messages/{message_id}/suggested-questions Get suggested follow-up questions after a message (chat apps only). @@ -538,14 +563,14 @@ Retrieve the metadata for a specific app. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AppMetaResponse](#appmetaresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [GET] /parameters **Retrieve app parameters** @@ -554,25 +579,31 @@ Retrieve the parameters for a specific app. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [Parameters](#parameters)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [GET] /passport Get authentication passport for web application access +#### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| user_id | query | End user session ID | No | string | + #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Passport retrieved successfully | -| 401 | Unauthorized - missing app code or invalid authentication | -| 404 | Application or user not found | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Passport retrieved successfully | **application/json**: [AccessTokenData](#accesstokendata)
| +| 401 | Unauthorized - missing app code or invalid authentication | | +| 404 | Application or user not found | | ### [POST] /remote-files/upload **Upload a file from a remote URL** @@ -597,6 +628,12 @@ Raises: FileTooLargeError: File exceeds size limit UnsupportedFileTypeError: File type not supported +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [RemoteFileUploadPayload](#remotefileuploadpayload)
| + #### Responses | Code | Description | Schema | @@ -647,19 +684,19 @@ Retrieve paginated list of saved messages for a completion application. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| last_id | query | Last message ID for pagination | No | string | -| limit | query | Number of messages to return (1-100) | No | integer,
**Default:** 20 | +| last_id | query | | No | string | +| limit | query | | No | integer,
**Default:** 20 | #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request - Not a completion app | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [SavedMessageInfiniteScrollPagination](#savedmessageinfinitescrollpagination)
| +| 400 | Bad Request - Not a completion app | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [POST] /saved-messages Save a specific message for later reference. @@ -670,6 +707,12 @@ Save a specific message for later reference. | ---- | ---------- | ----------- | -------- | ------ | | message_id | query | Message UUID to save | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [SavedMessageCreatePayload](#savedmessagecreatepayload)
| + #### Responses | Code | Description | Schema | @@ -708,14 +751,14 @@ Retrieve app site information and configuration. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AppSiteInfoResponse](#appsiteinforesponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [GET] /system-features **Get system feature flags and configuration** @@ -757,13 +800,13 @@ Convert text to audio using text-to-speech service. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [AudioBinaryResponse](#audiobinaryresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 500 | Internal Server Error | | ### [GET] /webapp/access-mode Retrieve the access mode for a web application (public or restricted). @@ -814,14 +857,14 @@ Execute a workflow with provided inputs and files. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 401 | Unauthorized | -| 403 | Forbidden | -| 404 | App Not Found | -| 500 | Internal Server Error | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | Success | **application/json**: [GeneratedAppResponse](#generatedappresponse)
| +| 400 | Bad Request | | +| 401 | Unauthorized | | +| 403 | Forbidden | | +| 404 | App Not Found | | +| 500 | Internal Server Error | | ### [POST] /workflows/tasks/{task_id}/stop **Stop workflow task** @@ -864,9 +907,9 @@ Returns Server-Sent Events stream. #### Responses -| Code | Description | -| ---- | ----------- | -| 200 | Success | +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | SSE event stream | **application/json**: [EventStreamResponse](#eventstreamresponse)
| --- ### Schemas @@ -890,6 +933,22 @@ Returns Server-Sent Events stream. | data | [AccessTokenData](#accesstokendata) | | Yes | | result | string | | Yes | +#### AgentThought + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| chain_id | string | | No | +| created_at | integer | | No | +| files | [ string ] | | Yes | +| id | string | | Yes | +| message_id | string | | Yes | +| observation | string | | No | +| position | integer | | Yes | +| thought | string | | No | +| tool | string | | No | +| tool_input | string | | No | +| tool_labels | [JSONValue](#jsonvalue) | | Yes | + #### AppAccessModeQuery | Name | Type | Description | Required | @@ -897,6 +956,75 @@ Returns Server-Sent Events stream. | appCode | string | Application code | No | | appId | string | Application ID | No | +#### AppMetaResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| tool_icons | object | Tool icon metadata keyed by tool name | No | + +#### AppPermissionQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| appId | string | Application ID | Yes | + +#### AppSiteInfoResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_id | string | | Yes | +| can_replace_logo | boolean | | Yes | +| custom_config | object | | No | +| enable_site | boolean | | Yes | +| end_user_id | string | | No | +| model_config | [AppSiteModelConfigResponse](#appsitemodelconfigresponse) | | No | +| plan | string | | No | +| site | [AppSiteResponse](#appsiteresponse) | | Yes | + +#### AppSiteModelConfigResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| model | | | Yes | +| more_like_this | | | Yes | +| opening_statement | string | | No | +| pre_prompt | string | | No | +| suggested_questions | | | Yes | +| suggested_questions_after_answer | | | Yes | +| user_input_form | | | Yes | + +#### AppSiteResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| chat_color_theme | string | | No | +| chat_color_theme_inverted | boolean | | No | +| copyright | string | | No | +| custom_disclaimer | string | | No | +| default_language | string | | No | +| description | string | | No | +| icon | string | | No | +| icon_background | string | | No | +| icon_type | string | | No | +| icon_url | string | | No | +| privacy_policy | string | | No | +| prompt_public | boolean | | No | +| show_workflow_steps | boolean | | No | +| title | string | | No | +| use_icon_as_answer_icon | boolean | | No | + +#### AudioBinaryResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AudioBinaryResponse | string | | | + +#### AudioTranscriptResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| text | string | | Yes | + #### BooleanResultResponse | Name | Type | Description | Required | @@ -913,6 +1041,14 @@ Returns Server-Sent Events stream. | login_page_logo | string | | Yes | | workspace_logo | string | | Yes | +#### ButtonStyle + +Button styles for user actions. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ButtonStyle | string | Button styles for user actions. | | + #### ChatMessagePayload | Name | Type | Description | Required | @@ -935,6 +1071,14 @@ Returns Server-Sent Events stream. | response_mode | string | Response mode: blocking or streaming | No | | retriever_from | string,
**Default:** web_app | Source of retriever | No | +#### ConversationInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [SimpleConversation](#simpleconversation) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + #### ConversationListQuery | Name | Type | Description | Required | @@ -966,6 +1110,39 @@ Returns Server-Sent Events stream. | email | string | | Yes | | token | string | | Yes | +#### EventStreamResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EventStreamResponse | string | | | + +#### ExecutionContentType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ExecutionContentType | string | | | + +#### FileInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| allowed_file_extensions | [ string ] | | No | +| allowed_file_types | [ [FileType](#filetype) ] | | No | +| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + +#### FileListInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| allowed_file_extensions | [ string ] | | No | +| allowed_file_types | [ [FileType](#filetype) ] | | No | +| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No | +| number_limits | integer | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + #### FileResponse | Name | Type | Description | Required | @@ -986,6 +1163,18 @@ Returns Server-Sent Events stream. | tenant_id | string | | No | | user_id | string | | No | +#### FileTransferMethod + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FileTransferMethod | string | | | + +#### FileType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FileType | string | | | + #### FileWithSignedUrl | Name | Type | Description | Required | @@ -1022,6 +1211,28 @@ Returns Server-Sent Events stream. | email | string | | Yes | | language | string | | No | +#### FormInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| FormInputConfig | [ParagraphInputConfig](#paragraphinputconfig)
[SelectInputConfig](#selectinputconfig)
[FileInputConfig](#fileinputconfig)
[FileListInputConfig](#filelistinputconfig) | | | + +#### GeneratedAppResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| GeneratedAppResponse | | | | + +#### HumanInputContent + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| form_definition | [HumanInputFormDefinition](#humaninputformdefinition) | | No | +| form_submission_data | [HumanInputFormSubmissionData](#humaninputformsubmissiondata) | | No | +| submitted | boolean | | Yes | +| type | [ExecutionContentType](#executioncontenttype) | | No | +| workflow_run_id | string | | Yes | + #### HumanInputFileUploadFormPayload Parsed multipart form fields for HITL uploads. @@ -1030,6 +1241,55 @@ Parsed multipart form fields for HITL uploads. | ---- | ---- | ----------- | -------- | | url | string | Remote file URL | No | +#### HumanInputFormDefinition + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| actions | [ [UserActionConfig](#useractionconfig) ] | | No | +| display_in_ui | boolean | | No | +| expiration_time | integer | | Yes | +| form_content | string | | Yes | +| form_id | string | | Yes | +| form_token | string | | No | +| inputs | [ [FormInputConfig](#forminputconfig) ] | | No | +| node_id | string | | Yes | +| node_title | string | | Yes | +| resolved_default_values | object | | No | + +#### HumanInputFormDefinitionResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| expiration_time | integer | | Yes | +| form_content | | | Yes | +| inputs | | | Yes | +| resolved_default_values | object | | Yes | +| site | object | | No | +| user_actions | | | Yes | + +#### HumanInputFormSubmissionData + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| action_id | string | | Yes | +| action_text | string | | Yes | +| node_id | string | | Yes | +| node_title | string | | Yes | +| rendered_content | string | | Yes | +| submitted_data | object | | No | + +#### HumanInputFormSubmitPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| action | string | | Yes | +| inputs | object | Submitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use `transfer_method=local_file` with `upload_file_id`; remote file mappings use `transfer_method=remote_url` with `url` or `remote_url`. | Yes | + +#### HumanInputFormSubmitResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | + #### HumanInputUploadTokenResponse | Name | Type | Description | Required | @@ -1037,6 +1297,30 @@ Parsed multipart form fields for HITL uploads. | expires_at | integer | | Yes | | upload_token | string | | Yes | +#### JSONObject + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONObject | object | | | + +#### JSONValue + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONValue | string
integer
number
boolean
object
[ object ] | | | + +#### JSONValueType + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JSONValueType | | | | + +#### JsonValue + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| JsonValue | | | | + #### LicenseLimitationModel - enabled: whether this limit is enforced @@ -1070,6 +1354,13 @@ Parsed multipart form fields for HITL uploads. | email | string | | Yes | | password | string | | Yes | +#### LoginStatusQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| app_code | string | Web app code | No | +| user_id | string | End user session ID | No | + #### LoginStatusResponse | Name | Type | Description | Required | @@ -1084,6 +1375,20 @@ Parsed multipart form fields for HITL uploads. | content | string | | No | | rating | string | | No | +#### MessageFile + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| belongs_to | string | | No | +| filename | string | | Yes | +| id | string | | Yes | +| mime_type | string | | No | +| size | integer | | No | +| transfer_method | string | | Yes | +| type | string | | Yes | +| upload_file_id | string | | No | +| url | string | | No | + #### MessageListQuery | Name | Type | Description | Required | @@ -1098,6 +1403,39 @@ Parsed multipart form fields for HITL uploads. | ---- | ---- | ----------- | -------- | | response_mode | string,
**Available values:** "blocking", "streaming" | Response mode
*Enum:* `"blocking"`, `"streaming"` | Yes | +#### ParagraphInputConfig + +Form input definition. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| default | [StringSource](#stringsource) | | No | +| output_variable_name | string | | Yes | +| type | string | | No | + +#### Parameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| annotation_reply | [JSONObject](#jsonobject) | | Yes | +| file_upload | [JSONObject](#jsonobject) | | Yes | +| more_like_this | [JSONObject](#jsonobject) | | Yes | +| opening_statement | | | No | +| retriever_resource | [JSONObject](#jsonobject) | | Yes | +| sensitive_word_avoidance | [JSONObject](#jsonobject) | | Yes | +| speech_to_text | [JSONObject](#jsonobject) | | Yes | +| suggested_questions | [ string ] | | Yes | +| suggested_questions_after_answer | [JSONObject](#jsonobject) | | Yes | +| system_parameters | [SystemParameters](#systemparameters) | | Yes | +| text_to_speech | [JSONObject](#jsonobject) | | Yes | +| user_input_form | [ [JSONObject](#jsonobject) ] | | Yes | + +#### PassportQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| user_id | string | End user session ID | No | + #### PluginInstallationPermissionModel | Name | Type | Description | Required | @@ -1136,12 +1474,54 @@ Parsed multipart form fields for HITL uploads. | ---- | ---- | ----------- | -------- | | result | string | | Yes | +#### RetrieverResource + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| content | string | | No | +| created_at | integer | | No | +| data_source_type | string | | No | +| dataset_id | string | | No | +| dataset_name | string | | No | +| document_id | string | | No | +| document_name | string | | No | +| hit_count | integer | | No | +| id | string | | No | +| index_node_hash | string | | No | +| message_id | string | | No | +| position | integer | | Yes | +| score | number | | No | +| segment_id | string | | No | +| segment_position | integer | | No | +| summary | string | | No | +| word_count | integer | | No | + #### SavedMessageCreatePayload | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | message_id | string | | Yes | +#### SavedMessageInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [SavedMessageItem](#savedmessageitem) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + +#### SavedMessageItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| answer | string | | Yes | +| created_at | integer | | No | +| feedback | [SimpleFeedback](#simplefeedback) | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| message_files | [ [MessageFile](#messagefile) ] | | Yes | +| query | string | | Yes | + #### SavedMessageListQuery | Name | Type | Description | Required | @@ -1149,6 +1529,32 @@ Parsed multipart form fields for HITL uploads. | last_id | string | | No | | limit | integer,
**Default:** 20 | | No | +#### SelectInputConfig + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| option_source | [StringListSource](#stringlistsource) | | Yes | +| output_variable_name | string | | Yes | +| type | string | | No | + +#### SimpleConversation + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | integer | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| introduction | string | | No | +| name | string | | Yes | +| status | string | | Yes | +| updated_at | integer | | No | + +#### SimpleFeedback + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| rating | string | | No | + #### SimpleResultDataResponse | Name | Type | Description | Required | @@ -1162,6 +1568,24 @@ Parsed multipart form fields for HITL uploads. | ---- | ---- | ----------- | -------- | | result | string | | Yes | +#### StringListSource + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| selector | [ string ] | | No | +| type | [ValueSourceType](#valuesourcetype) | | Yes | +| value | [ string ] | | No | + +#### StringSource + +Default configuration for form inputs. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| selector | [ string ] | | No | +| type | [ValueSourceType](#valuesourcetype) | | Yes | +| value | string | | No | + #### SuggestedQuestionsResponse | Name | Type | Description | Required | @@ -1193,6 +1617,16 @@ Parsed multipart form fields for HITL uploads. | sso_enforced_for_signin_protocol | string | | Yes | | webapp_auth | [WebAppAuthModel](#webappauthmodel) | | Yes | +#### SystemParameters + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| audio_file_size_limit | integer | | Yes | +| file_size_limit | integer | | Yes | +| image_file_size_limit | integer | | Yes | +| video_file_size_limit | integer | | Yes | +| workflow_file_upload_limit | integer | | Yes | + #### TextToAudioPayload | Name | Type | Description | Required | @@ -1202,6 +1636,25 @@ Parsed multipart form fields for HITL uploads. | text | string | Text to convert to audio | No | | voice | string | Voice to use for TTS | No | +#### UserActionConfig + +User action configuration. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| button_style | [ButtonStyle](#buttonstyle) | | No | +| id | string | | Yes | +| title | string | | Yes | + +#### ValueSourceType + +ValueSourceType records whether the value comes from a static setting +in form definiton, or a variable while the workflow is running. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ValueSourceType | string | ValueSourceType records whether the value comes from a static setting in form definiton, or a variable while the workflow is running. | | + #### VerificationTokenResponse | Name | Type | Description | Required | @@ -1226,6 +1679,34 @@ Parsed multipart form fields for HITL uploads. | ---- | ---- | ----------- | -------- | | protocol | string | | Yes | +#### WebMessageInfiniteScrollPagination + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| data | [ [WebMessageListItem](#webmessagelistitem) ] | | Yes | +| has_more | boolean | | Yes | +| limit | integer | | Yes | + +#### WebMessageListItem + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| agent_thoughts | [ [AgentThought](#agentthought) ] | | Yes | +| answer | string | | Yes | +| conversation_id | string | | Yes | +| created_at | integer | | No | +| error | string | | No | +| extra_contents | [ [HumanInputContent](#humaninputcontent) ] | | Yes | +| feedback | [SimpleFeedback](#simplefeedback) | | No | +| id | string | | Yes | +| inputs | object | | Yes | +| message_files | [ [MessageFile](#messagefile) ] | | Yes | +| metadata | [JSONValueType](#jsonvaluetype) | | No | +| parent_message_id | string | | No | +| query | string | | Yes | +| retriever_resources | [ [RetrieverResource](#retrieverresource) ] | | Yes | +| status | string | | Yes | + #### WorkflowRunPayload | Name | Type | Description | Required | diff --git a/api/services/entities/knowledge_entities/knowledge_entities.py b/api/services/entities/knowledge_entities/knowledge_entities.py index 4040b03cc4..1b23307692 100644 --- a/api/services/entities/knowledge_entities/knowledge_entities.py +++ b/api/services/entities/knowledge_entities/knowledge_entities.py @@ -1,6 +1,6 @@ from typing import Any, Literal -from pydantic import BaseModel, field_validator +from pydantic import BaseModel, Field, field_validator from core.rag.entities import Rule from core.rag.entities.metadata_entities import MetadataFilteringCondition @@ -100,7 +100,7 @@ class KnowledgeConfig(BaseModel): data_source: DataSource | None = None process_rule: ProcessRule | None = None retrieval_model: RetrievalModel | None = None - summary_index_setting: dict[str, Any] | None = None + summary_index_setting: dict[str, Any] | None = Field(default=None) doc_form: str = "text_model" doc_language: str = "English" embedding_model: str | None = None diff --git a/api/services/entities/model_provider_entities.py b/api/services/entities/model_provider_entities.py index 6679c08ebd..7499ebbc18 100644 --- a/api/services/entities/model_provider_entities.py +++ b/api/services/entities/model_provider_entities.py @@ -1,7 +1,9 @@ from collections.abc import Sequence +from decimal import Decimal from enum import StrEnum +from typing import Annotated, Any -from pydantic import BaseModel, ConfigDict, model_validator +from pydantic import BaseModel, ConfigDict, Field, model_validator from configs import dify_config from core.entities.model_entities import ( @@ -16,16 +18,24 @@ from core.entities.provider_entities import ( UnaddedModelConfiguration, ) from graphon.model_runtime.entities.common_entities import I18nObject -from graphon.model_runtime.entities.model_entities import ModelType +from graphon.model_runtime.entities.model_entities import ( + FetchFrom, + ModelFeature, + ModelPropertyKey, + ModelType, + ParameterRule, +) from graphon.model_runtime.entities.provider_entities import ( ConfigurateMethod, ModelCredentialSchema, ProviderCredentialSchema, ProviderHelpEntity, - SimpleProviderEntity, ) from models.provider import ProviderType +_DECIMAL_STRING_PATTERN = r"^(?![-+.]*$)[+-]?0*\d*\.?\d*$" +CodegenSafeDecimal = Annotated[Decimal, Field(json_schema_extra={"pattern": _DECIMAL_STRING_PATTERN})] + class CustomConfigurationStatus(StrEnum): """ @@ -130,12 +140,40 @@ class ProviderWithModelsResponse(BaseModel): return self -class SimpleProviderEntityResponse(SimpleProviderEntity): +class PriceConfigResponse(BaseModel): + """Serialized pricing info with codegen-safe decimal string patterns.""" + + input: CodegenSafeDecimal + output: CodegenSafeDecimal | None = None + unit: CodegenSafeDecimal + currency: str + + +class AIModelEntityResponse(BaseModel): + model: str + label: I18nObject + model_type: ModelType + features: list[ModelFeature] | None = None + fetch_from: FetchFrom + model_properties: dict[ModelPropertyKey, Any] + deprecated: bool = False + parameter_rules: list[ParameterRule] = [] + pricing: PriceConfigResponse | None = None + + +class SimpleProviderEntityResponse(BaseModel): """ Simple provider entity response. """ + provider: str + provider_name: str = "" + label: I18nObject + icon_small: I18nObject | None = None + icon_small_dark: I18nObject | None = None + supported_model_types: Sequence[ModelType] tenant_id: str + models: list[AIModelEntityResponse] = [] @model_validator(mode="after") def _(self): diff --git a/api/services/workflow/node_output_inspector_service.py b/api/services/workflow/node_output_inspector_service.py index 3bed0d8c71..66dcfec591 100644 --- a/api/services/workflow/node_output_inspector_service.py +++ b/api/services/workflow/node_output_inspector_service.py @@ -117,7 +117,7 @@ class NodeOutputView(BaseModel): name: str type: DeclaredOutputType | None = None status: NodeOutputStatus - value_preview: Any = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + value_preview: Any = Field(default=None) type_check: CheckResultView | None = None output_check: CheckResultView | None = None retried: int = 0 @@ -150,7 +150,7 @@ class OutputPreviewView(BaseModel): output_name: str type: DeclaredOutputType | None = None status: NodeOutputStatus - value: Any = Field(default=None, json_schema_extra={"x-dify-opaque": True}) + value: Any = Field(default=None) class NodeOutputInspectorError(Exception): diff --git a/packages/contracts/generated/api/console/account/orpc.gen.ts b/packages/contracts/generated/api/console/account/orpc.gen.ts index e963f9cd3c..a926103667 100644 --- a/packages/contracts/generated/api/console/account/orpc.gen.ts +++ b/packages/contracts/generated/api/console/account/orpc.gen.ts @@ -222,16 +222,8 @@ 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', diff --git a/packages/contracts/generated/api/console/account/types.gen.ts b/packages/contracts/generated/api/console/account/types.gen.ts index 059f86ca35..cdd45925fb 100644 --- a/packages/contracts/generated/api/console/account/types.gen.ts +++ b/packages/contracts/generated/api/console/account/types.gen.ts @@ -87,6 +87,10 @@ export type EducationActivatePayload = { token: string } +export type EducationActivateResponse = { + [key: string]: unknown +} + export type EducationAutocompleteResponse = { curr_page?: number | null data?: Array @@ -297,9 +301,7 @@ export type PostAccountEducationData = { } export type PostAccountEducationResponses = { - 200: { - [key: string]: unknown - } + 200: EducationActivateResponse } export type PostAccountEducationResponse diff --git a/packages/contracts/generated/api/console/account/zod.gen.ts b/packages/contracts/generated/api/console/account/zod.gen.ts index a75e3a285f..9951efc8d9 100644 --- a/packages/contracts/generated/api/console/account/zod.gen.ts +++ b/packages/contracts/generated/api/console/account/zod.gen.ts @@ -127,6 +127,11 @@ export const zEducationActivatePayload = z.object({ token: z.string(), }) +/** + * EducationActivateResponse + */ +export const zEducationActivateResponse = z.record(z.string(), z.unknown()) + /** * EducationAutocompleteResponse */ @@ -296,7 +301,7 @@ export const zPostAccountEducationBody = zEducationActivatePayload /** * Success */ -export const zPostAccountEducationResponse = z.record(z.string(), z.unknown()) +export const zPostAccountEducationResponse = zEducationActivateResponse export const zGetAccountEducationAutocompleteQuery = z.object({ keywords: z.string(), diff --git a/packages/contracts/generated/api/console/activate/types.gen.ts b/packages/contracts/generated/api/console/activate/types.gen.ts index aff306f321..92370b5a75 100644 --- a/packages/contracts/generated/api/console/activate/types.gen.ts +++ b/packages/contracts/generated/api/console/activate/types.gen.ts @@ -36,13 +36,9 @@ export type PostActivateData = { } export type PostActivateErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostActivateError = PostActivateErrors[keyof PostActivateErrors] - export type PostActivateResponses = { 200: ActivationResponse } 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 52ee85667e..91ccdbc408 100644 --- a/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts +++ b/packages/contracts/generated/api/console/all-workspaces/orpc.gen.ts @@ -5,16 +5,8 @@ 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/all-workspaces/types.gen.ts b/packages/contracts/generated/api/console/all-workspaces/types.gen.ts index 2c30287835..4683b2d992 100644 --- a/packages/contracts/generated/api/console/all-workspaces/types.gen.ts +++ b/packages/contracts/generated/api/console/all-workspaces/types.gen.ts @@ -4,6 +4,21 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type WorkspaceListResponse = { + data: Array + has_more: boolean + limit: number + page: number + total: number +} + +export type WorkspaceListItemResponse = { + created_at?: number | null + id: string + name?: string | null + status?: string | null +} + export type GetAllWorkspacesData = { body?: never path?: never @@ -15,9 +30,7 @@ export type GetAllWorkspacesData = { } export type GetAllWorkspacesResponses = { - 200: { - [key: string]: unknown - } + 200: WorkspaceListResponse } export type GetAllWorkspacesResponse = GetAllWorkspacesResponses[keyof GetAllWorkspacesResponses] diff --git a/packages/contracts/generated/api/console/all-workspaces/zod.gen.ts b/packages/contracts/generated/api/console/all-workspaces/zod.gen.ts index bdb5f0d132..f63bd0e396 100644 --- a/packages/contracts/generated/api/console/all-workspaces/zod.gen.ts +++ b/packages/contracts/generated/api/console/all-workspaces/zod.gen.ts @@ -2,6 +2,27 @@ import * as z from 'zod' +/** + * WorkspaceListItemResponse + */ +export const zWorkspaceListItemResponse = z.object({ + created_at: z.int().nullish(), + id: z.string(), + name: z.string().nullish(), + status: z.string().nullish(), +}) + +/** + * WorkspaceListResponse + */ +export const zWorkspaceListResponse = z.object({ + data: z.array(zWorkspaceListItemResponse), + has_more: z.boolean(), + limit: z.int(), + page: z.int(), + total: z.int(), +}) + export const zGetAllWorkspacesQuery = z.object({ limit: z.int().gte(1).lte(100).optional().default(20), page: z.int().gte(1).lte(99999).optional().default(1), @@ -10,4 +31,4 @@ export const zGetAllWorkspacesQuery = z.object({ /** * Success */ -export const zGetAllWorkspacesResponse = z.record(z.string(), z.unknown()) +export const zGetAllWorkspacesResponse = zWorkspaceListResponse 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 38714ef745..75ed149fae 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,16 +11,8 @@ 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', diff --git a/packages/contracts/generated/api/console/api-key-auth/types.gen.ts b/packages/contracts/generated/api/console/api-key-auth/types.gen.ts index 60e4634ca0..baa517f186 100644 --- a/packages/contracts/generated/api/console/api-key-auth/types.gen.ts +++ b/packages/contracts/generated/api/console/api-key-auth/types.gen.ts @@ -16,6 +16,10 @@ export type ApiKeyAuthBindingPayload = { provider: string } +export type SimpleResultResponse = { + result: string +} + export type ApiKeyAuthDataSourceItem = { category: string created_at: number @@ -47,9 +51,7 @@ export type PostApiKeyAuthDataSourceBindingData = { } export type PostApiKeyAuthDataSourceBindingResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostApiKeyAuthDataSourceBindingResponse diff --git a/packages/contracts/generated/api/console/api-key-auth/zod.gen.ts b/packages/contracts/generated/api/console/api-key-auth/zod.gen.ts index acdb585173..0ebff4365b 100644 --- a/packages/contracts/generated/api/console/api-key-auth/zod.gen.ts +++ b/packages/contracts/generated/api/console/api-key-auth/zod.gen.ts @@ -11,6 +11,13 @@ export const zApiKeyAuthBindingPayload = z.object({ provider: z.string(), }) +/** + * SimpleResultResponse + */ +export const zSimpleResultResponse = z.object({ + result: z.string(), +}) + /** * ApiKeyAuthDataSourceItem */ @@ -40,7 +47,7 @@ export const zPostApiKeyAuthDataSourceBindingBody = zApiKeyAuthBindingPayload /** * Success */ -export const zPostApiKeyAuthDataSourceBindingResponse = z.record(z.string(), z.unknown()) +export const zPostApiKeyAuthDataSourceBindingResponse = zSimpleResultResponse export const zDeleteApiKeyAuthDataSourceByBindingIdPath = z.object({ binding_id: z.string(), diff --git a/packages/contracts/generated/api/console/app/orpc.gen.ts b/packages/contracts/generated/api/console/app/orpc.gen.ts index 1a2a10f23c..7ccb933866 100644 --- a/packages/contracts/generated/api/console/app/orpc.gen.ts +++ b/packages/contracts/generated/api/console/app/orpc.gen.ts @@ -7,16 +7,10 @@ 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({ - 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.', + description: 'Get advanced prompt templates based on app mode and model configuration', inputStructure: 'detailed', method: 'GET', operationId: 'getAppPromptTemplates', diff --git a/packages/contracts/generated/api/console/app/types.gen.ts b/packages/contracts/generated/api/console/app/types.gen.ts index ad8334ad6d..450e0acd86 100644 --- a/packages/contracts/generated/api/console/app/types.gen.ts +++ b/packages/contracts/generated/api/console/app/types.gen.ts @@ -4,6 +4,15 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type AdvancedPromptTemplateResponse = { + chat_prompt_config?: { + [key: string]: unknown + } | null + completion_prompt_config?: { + [key: string]: unknown + } | null +} + export type GetAppPromptTemplatesData = { body?: never path?: never @@ -17,18 +26,11 @@ export type GetAppPromptTemplatesData = { } export type GetAppPromptTemplatesErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetAppPromptTemplatesError - = GetAppPromptTemplatesErrors[keyof GetAppPromptTemplatesErrors] - export type GetAppPromptTemplatesResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: AdvancedPromptTemplateResponse } export type GetAppPromptTemplatesResponse diff --git a/packages/contracts/generated/api/console/app/zod.gen.ts b/packages/contracts/generated/api/console/app/zod.gen.ts index df13f62825..ad91eca9bb 100644 --- a/packages/contracts/generated/api/console/app/zod.gen.ts +++ b/packages/contracts/generated/api/console/app/zod.gen.ts @@ -2,6 +2,14 @@ import * as z from 'zod' +/** + * AdvancedPromptTemplateResponse + */ +export const zAdvancedPromptTemplateResponse = z.object({ + chat_prompt_config: z.record(z.string(), z.unknown()).nullish(), + completion_prompt_config: z.record(z.string(), z.unknown()).nullish(), +}) + export const zGetAppPromptTemplatesQuery = z.object({ app_mode: z.string(), has_context: z.string().optional().default('true'), @@ -12,4 +20,4 @@ export const zGetAppPromptTemplatesQuery = z.object({ /** * Prompt templates retrieved successfully */ -export const zGetAppPromptTemplatesResponse = z.array(z.record(z.string(), z.unknown())) +export const zGetAppPromptTemplatesResponse = zAdvancedPromptTemplateResponse diff --git a/packages/contracts/generated/api/console/apps/orpc.gen.ts b/packages/contracts/generated/api/console/apps/orpc.gen.ts index f6b44fa8f7..fec93596c7 100644 --- a/packages/contracts/generated/api/console/apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/apps/orpc.gen.ts @@ -14,8 +14,8 @@ import { zDeleteAppsByAppIdCompletionConversationsByConversationIdResponse, zDeleteAppsByAppIdPath, zDeleteAppsByAppIdResponse, - zDeleteAppsByAppIdTraceConfigBody, zDeleteAppsByAppIdTraceConfigPath, + zDeleteAppsByAppIdTraceConfigQuery, zDeleteAppsByAppIdTraceConfigResponse, zDeleteAppsByAppIdWorkflowCommentsByCommentIdPath, zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath, @@ -575,16 +575,10 @@ 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({ - 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.', + description: 'Get human input form preview for advanced chat workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreview', @@ -608,16 +602,10 @@ 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({ - 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.', + description: 'Submit human input form preview for advanced chat workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRun', @@ -658,16 +646,10 @@ 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({ - 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.', + description: 'Run draft workflow iteration node for advanced chat', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRun', @@ -703,16 +685,10 @@ 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({ - 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.', + description: 'Run draft workflow loop node for advanced chat', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRun', @@ -748,16 +724,10 @@ 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({ - 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.', + description: 'Run draft workflow for advanced chat application', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftRun', @@ -984,16 +954,10 @@ export const agentSandbox = { * 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 get9 = oc .route({ - 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.', + description: 'Get agent execution logs for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAgentLogs', @@ -1012,16 +976,10 @@ export const logs = { * Upload a Skill, validate it, and standardize it into the app agent's drive * * Validate + standardize a Skill into the agent drive (ENG-594) - * - * Generated 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: - 'Validate + standardize a Skill into the agent drive (ENG-594)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Validate + standardize a Skill into the agent drive (ENG-594)', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAgentSkillsStandardize', @@ -1043,16 +1001,11 @@ export const standardize = { * Upload + validate a Skill package (.zip/.skill) and extract its manifest * Returns a validated skill ref (to bind into the Agent soul config on save) * plus its manifest. Standardizing into the agent drive is ENG-594. - * - * Generated 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: - 'Upload + validate a Skill package (.zip/.skill) and extract its manifest\nReturns a validated skill ref (to bind into the Agent soul config on save)\nplus its manifest. Standardizing into the agent drive is ENG-594.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Upload + validate a Skill package (.zip/.skill) and extract its manifest\nReturns a validated skill ref (to bind into the Agent soul config on save)\nplus its manifest. Standardizing into the agent drive is ENG-594.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAgentSkillsUpload', @@ -1080,16 +1033,10 @@ 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 get10 = oc .route({ - 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.', + description: 'Get status of annotation reply action job', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationReplyByActionStatusByJobId', @@ -1109,16 +1056,10 @@ 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 post14 = oc .route({ - 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.', + description: 'Enable or disable annotation reply for an app', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationReplyByAction', @@ -1144,16 +1085,10 @@ 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 get11 = oc .route({ - 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.', + description: 'Get annotation settings for an app', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationSetting', @@ -1169,16 +1104,10 @@ 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 post15 = oc .route({ - 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.', + description: 'Update annotation settings for an app', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationSettingsByAnnotationSettingId', @@ -1203,16 +1132,10 @@ 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 post16 = oc .route({ - 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.', + description: 'Batch import annotations from CSV file with rate limiting and security checks', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationsBatchImport', @@ -1228,16 +1151,10 @@ 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 get12 = oc .route({ - 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.', + description: 'Get status of batch import job', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotationsBatchImportStatusByJobId', @@ -1317,20 +1234,13 @@ export const hitHistories = { 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 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', path: '/apps/{app_id}/annotations/{annotation_id}', + successStatus: 204, tags: ['console'], }) .input(z.object({ params: zDeleteAppsByAppIdAnnotationsByAnnotationIdPath })) @@ -1338,16 +1248,10 @@ 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 post17 = oc .route({ - 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.', + description: 'Update or delete an annotation', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotationsByAnnotationId', @@ -1368,20 +1272,13 @@ 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', path: '/apps/{app_id}/annotations', + successStatus: 204, tags: ['console'], }) .input(z.object({ params: zDeleteAppsByAppIdAnnotationsPath })) @@ -1389,16 +1286,10 @@ 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 get16 = oc .route({ - 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.', + description: 'Get annotations for an app with pagination', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdAnnotations', @@ -1415,16 +1306,10 @@ export const get16 = 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 post18 = oc .route({ - 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.', + description: 'Create a new annotation for an app', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdAnnotations', @@ -1702,16 +1587,10 @@ 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 post23 = oc .route({ - 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.', + description: 'Generate completion message for debugging', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdCompletionMessages', @@ -1834,16 +1713,10 @@ 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 get25 = oc .route({ - 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.', + description: 'Export user feedback data for Google Sheets', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdFeedbacksExport', @@ -1884,16 +1757,10 @@ 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 post27 = oc .route({ - 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.', + description: 'Update application icon', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdIcon', @@ -1934,16 +1801,10 @@ 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 post28 = oc .route({ - 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.', + description: 'Update application model configuration', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdModelConfig', @@ -2000,16 +1861,10 @@ 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 get27 = oc .route({ - 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.', + description: 'Get MCP server configuration for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdServer', @@ -2021,16 +1876,10 @@ export const get27 = 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 post31 = oc .route({ - 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.', + description: 'Create MCP server configuration for an application', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdServer', @@ -2043,16 +1892,10 @@ export const post31 = 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 put2 = oc .route({ - 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.', + description: 'Update MCP server configuration for an application', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsByAppIdServer', @@ -2128,16 +1971,10 @@ 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 get28 = oc .route({ - 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.', + description: 'Get average response time statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsAverageResponseTime', @@ -2158,16 +1995,10 @@ 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 get29 = oc .route({ - 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.', + description: 'Get average session interaction statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsAverageSessionInteractions', @@ -2188,16 +2019,10 @@ 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 get30 = oc .route({ - 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.', + description: 'Get daily conversation statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyConversations', @@ -2218,16 +2043,10 @@ 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 get31 = oc .route({ - 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.', + description: 'Get daily terminal/end-user statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyEndUsers', @@ -2248,16 +2067,10 @@ 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 get32 = oc .route({ - 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.', + description: 'Get daily message statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsDailyMessages', @@ -2278,16 +2091,10 @@ 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 get33 = oc .route({ - 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.', + description: 'Get daily token cost statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsTokenCosts', @@ -2308,16 +2115,10 @@ 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 get34 = oc .route({ - 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.', + description: 'Get tokens per second statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsTokensPerSecond', @@ -2338,16 +2139,10 @@ 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 get35 = oc .route({ - 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.', + description: 'Get user satisfaction rate statistics for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdStatisticsUserSatisfactionRate', @@ -2379,16 +2174,10 @@ 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 get36 = oc .route({ - 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.', + description: 'Get available TTS voices for a specific language', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTextToAudioVoices', @@ -2409,16 +2198,10 @@ 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 post35 = oc .route({ - 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.', + description: 'Convert text to speech for chat messages', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdTextToAudio', @@ -2439,16 +2222,10 @@ 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 get37 = oc .route({ - 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.', + description: 'Get app tracing configuration', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTrace', @@ -2497,24 +2274,18 @@ export const delete5 = oc }) .input( z.object({ - body: zDeleteAppsByAppIdTraceConfigBody, params: zDeleteAppsByAppIdTraceConfigPath, + query: zDeleteAppsByAppIdTraceConfigQuery, }), ) .output(zDeleteAppsByAppIdTraceConfigResponse) /** * 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 get38 = oc .route({ - 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.', + description: 'Get tracing configuration for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdTraceConfig', @@ -2530,16 +2301,10 @@ export const get38 = 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({ - 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.', + description: 'Update an existing tracing configuration for an application', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdTraceConfig', @@ -2556,16 +2321,10 @@ 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 post37 = oc .route({ - 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.', + description: 'Create a new tracing configuration for an application', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdTraceConfig', @@ -3166,16 +2925,10 @@ 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 get52 = oc .route({ - 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.', + description: 'Get workflow average app interaction statistics', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsAverageAppInteractions', @@ -3196,16 +2949,10 @@ 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 get53 = oc .route({ - 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.', + description: 'Get workflow daily runs statistics', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsDailyConversations', @@ -3226,16 +2973,10 @@ 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 get54 = oc .route({ - 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.', + description: 'Get workflow daily terminals statistics', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsDailyTerminals', @@ -3256,16 +2997,10 @@ 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 get55 = oc .route({ - 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.', + description: 'Get workflow daily token cost statistics', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowStatisticsTokenCosts', @@ -3300,16 +3035,10 @@ 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 get56 = oc .route({ - 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.', + description: 'Get default block configuration by type', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockType', @@ -3333,16 +3062,10 @@ 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 get57 = oc .route({ - 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.', + description: 'Get default block configurations for workflow', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigs', @@ -3360,16 +3083,10 @@ 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 get58 = oc .route({ - 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.', + description: 'Get conversation variables for workflow', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftConversationVariables', @@ -3381,16 +3098,10 @@ export const get58 = 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 post44 = oc .route({ - 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.', + description: 'Update conversation variables for workflow draft', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftConversationVariables', @@ -3414,16 +3125,10 @@ 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 get59 = oc .route({ - 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.', + description: 'Get environment variables for workflow', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftEnvironmentVariables', @@ -3436,16 +3141,10 @@ export const get59 = 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 post45 = oc .route({ - 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.', + description: 'Update environment variables for workflow draft', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftEnvironmentVariables', @@ -3467,16 +3166,10 @@ 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 post46 = oc .route({ - 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.', + description: 'Update draft workflow features', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftFeatures', @@ -3499,16 +3192,10 @@ 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 post47 = oc .route({ - 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.', + description: 'Test human input delivery for workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTest', @@ -3532,16 +3219,10 @@ 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 post48 = oc .route({ - 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.', + description: 'Get human input form preview for workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreview', @@ -3565,16 +3246,10 @@ 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 post49 = oc .route({ - 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.', + description: 'Submit human input form preview for workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRun', @@ -3616,16 +3291,10 @@ 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 post50 = oc .route({ - 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.', + description: 'Run draft workflow iteration node', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRun', @@ -3661,16 +3330,10 @@ 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 post51 = oc .route({ - 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.', + description: 'Run draft workflow loop node', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRun', @@ -3838,16 +3501,10 @@ 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 post55 = oc .route({ - 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.', + description: 'Run draft workflow node', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdRun', @@ -3871,16 +3528,10 @@ 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 post56 = oc .route({ - 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.', + description: 'Poll for trigger events and execute single node when event arrives', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRun', @@ -3917,16 +3568,10 @@ 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 get63 = oc .route({ - 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.', + description: 'Get variables for a specific node', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdVariables', @@ -3957,16 +3602,10 @@ 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 post57 = oc .route({ - 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.', + description: 'Run draft workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftRun', @@ -3988,16 +3627,10 @@ export const run10 = { /** * Server-Sent Events stream of inspector deltas for a draft 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 get64 = oc .route({ - deprecated: true, - description: - 'Server-Sent Events stream of inspector deltas for a draft 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.', + description: 'Server-Sent Events stream of inspector deltas for a draft workflow run.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEvents', @@ -4089,16 +3722,10 @@ export const runs = { /** * 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 get68 = oc .route({ - 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.', + description: 'Get system variables for workflow', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftSystemVariables', @@ -4116,16 +3743,10 @@ 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 post58 = oc .route({ - 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.', + description: 'Poll for trigger events and execute full workflow when event arrives', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftTriggerRun', @@ -4149,16 +3770,10 @@ 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 post59 = oc .route({ - 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.', + description: 'Full workflow debug when the start node is a trigger', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraftTriggerRunAll', @@ -4185,16 +3800,10 @@ 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 put6 = oc .route({ - 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.', + description: 'Reset a workflow variable to its default value', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsByAppIdWorkflowsDraftVariablesByVariableIdReset', @@ -4226,16 +3835,10 @@ 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 get69 = oc .route({ - 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.', + description: 'Get a specific workflow variable', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftVariablesByVariableId', @@ -4247,16 +3850,10 @@ export const get69 = 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({ - 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.', + description: 'Update a workflow variable', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdWorkflowsDraftVariablesByVariableId', @@ -4298,16 +3895,10 @@ 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 get70 = oc .route({ - 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.', + description: 'Get draft workflow variables', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraftVariables', @@ -4333,16 +3924,10 @@ 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 get71 = oc .route({ - 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.', + description: 'Get draft workflow for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsDraft', @@ -4357,16 +3942,10 @@ export const get71 = 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 post60 = oc .route({ - 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.', + description: 'Sync draft workflow configuration', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsDraft', @@ -4403,16 +3982,10 @@ 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 get72 = oc .route({ - 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.', + description: 'Get published workflow for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsPublish', @@ -4425,16 +3998,9 @@ export const get72 = 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 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: 'postAppsByAppIdWorkflowsPublish', @@ -4457,16 +4023,10 @@ export const publish = { /** * Server-Sent Events stream of inspector deltas for a published 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 get73 = oc .route({ - deprecated: true, - description: - 'Server-Sent Events stream of inspector deltas for a published 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.', + description: 'Server-Sent Events stream of inspector deltas for a published workflow run.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEvents', @@ -4594,16 +4154,10 @@ 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 post62 = oc .route({ - 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.', + description: 'Restore a published workflow version into the draft workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsByAppIdWorkflowsByWorkflowIdRestore', @@ -4619,20 +4173,14 @@ 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', path: '/apps/{app_id}/workflows/{workflow_id}', + successStatus: 204, summary: 'Delete workflow', tags: ['console'], }) @@ -4643,16 +4191,10 @@ 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({ - 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.', + description: 'Update workflow by ID', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchAppsByAppIdWorkflowsByWorkflowId', @@ -4678,16 +4220,10 @@ 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 get78 = oc .route({ - 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.', + description: 'Get all published workflows for an application', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByAppIdWorkflows', @@ -4886,16 +4422,10 @@ 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 get81 = oc .route({ - 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.', + description: 'Refresh MCP server configuration and regenerate server code', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsByServerIdServerRefresh', diff --git a/packages/contracts/generated/api/console/apps/types.gen.ts b/packages/contracts/generated/api/console/apps/types.gen.ts index 08cb46ef32..3e9a51822c 100644 --- a/packages/contracts/generated/api/console/apps/types.gen.ts +++ b/packages/contracts/generated/api/console/apps/types.gen.ts @@ -134,6 +134,25 @@ export type HumanInputFormPreviewPayload = { } } +export type HumanInputFormPreviewResponse = { + actions?: Array<{ + [key: string]: unknown + }> + display_in_ui?: boolean | null + expiration_time?: number | null + form_content: string + form_id: string + form_token?: string | null + inputs?: Array<{ + [key: string]: unknown + }> + node_id: string + node_title: string + resolved_default_values?: { + [key: string]: unknown + } +} + export type HumanInputFormSubmitPayload = { action: string form_inputs: { @@ -144,12 +163,18 @@ export type HumanInputFormSubmitPayload = { } } +export type HumanInputFormSubmitResponse = { + [key: string]: unknown +} + export type IterationNodeRunPayload = { inputs?: { [key: string]: unknown } | null } +export type GeneratedAppResponse = JsonValue + export type LoopNodeRunPayload = { inputs?: { [key: string]: unknown @@ -247,16 +272,52 @@ export type SandboxUploadResponse = { path: string } +export type AgentLogResponse = { + files?: Array + iterations: Array + meta: AgentLogMetaResponse +} + +export type AgentSkillStandardizeResponse = { + [key: string]: unknown +} + +export type AgentSkillUploadResponse = { + [key: string]: unknown +} + export type AnnotationReplyPayload = { embedding_model_name: string embedding_provider_name: string score_threshold: number } +export type AnnotationJobStatusResponse = { + error_msg?: string | null + job_id?: string | null + job_status?: string | null + record_count?: number | null +} + +export type AnnotationSettingResponse = { + embedding_model?: AnnotationEmbeddingModelResponse | null + enabled: boolean + id?: string | null + score_threshold?: number | null +} + export type AnnotationSettingUpdatePayload = { score_threshold: number } +export type AnnotationList = { + data: Array + has_more: boolean + limit: number + page: number + total: number +} + export type CreateAnnotationPayload = { annotation_reply?: { [key: string]: unknown @@ -268,7 +329,7 @@ export type CreateAnnotationPayload = { } export type Annotation = { - content?: string | null + answer?: string | null created_at?: number | null hit_count?: number | null id: string @@ -411,6 +472,8 @@ export type MessageFeedbackPayload = { rating?: 'dislike' | 'like' | null } +export type TextFileResponse = string + export type AppIconPayload = { icon?: string | null icon_background?: string | null @@ -558,6 +621,38 @@ export type AppSiteStatusPayload = { enable_site: boolean } +export type AverageResponseTimeStatisticResponse = { + data: Array +} + +export type AverageSessionInteractionStatisticResponse = { + data: Array +} + +export type DailyConversationStatisticResponse = { + data: Array +} + +export type DailyTerminalStatisticResponse = { + data: Array +} + +export type DailyMessageStatisticResponse = { + data: Array +} + +export type DailyTokenCostStatisticResponse = { + data: Array +} + +export type TokensPerSecondStatisticResponse = { + data: Array +} + +export type UserSatisfactionRateStatisticResponse = { + data: Array +} + export type TextToSpeechPayload = { message_id?: string | null streaming?: boolean | null @@ -565,13 +660,35 @@ export type TextToSpeechPayload = { voice?: string | null } +export type AudioBinaryResponse = Blob | File + +export type TextToSpeechVoiceListResponse = Array<{ + [key: string]: unknown +}> + +export type AppTraceResponse = { + enabled: boolean + tracing_provider?: string | null +} + export type AppTracePayload = { enabled: boolean tracing_provider?: string | null } -export type TraceProviderQuery = { - tracing_provider: string +export type TraceAppConfigResponse = { + app_id?: string | null + created_at?: string | null + error?: string | null + has_not_configured?: boolean | null + id?: string | null + is_active?: boolean | null + result?: string | null + tracing_config?: { + [key: string]: unknown + } | null + tracing_provider?: string | null + updated_at?: string | null } export type TraceConfigPayload = { @@ -729,6 +846,22 @@ export type WorkflowCommentResolve = { resolved_by?: string | null } +export type WorkflowAverageAppInteractionStatisticResponse = { + data: Array +} + +export type WorkflowDailyRunsStatisticResponse = { + data: Array +} + +export type WorkflowDailyTerminalsStatisticResponse = { + data: Array +} + +export type WorkflowDailyTokenCostStatisticResponse = { + data: Array +} + export type WorkflowPaginationResponse = { has_more: boolean items: Array @@ -736,6 +869,14 @@ export type WorkflowPaginationResponse = { page: number } +export type DefaultBlockConfigsResponse = Array<{ + [key: string]: unknown +}> + +export type DefaultBlockConfigResponse = { + [key: string]: unknown +} + export type WorkflowResponse = { conversation_variables: Array created_at: number @@ -790,6 +931,10 @@ export type ConversationVariableUpdatePayload = { }> } +export type EnvironmentVariableListResponse = { + items: Array +} + export type EnvironmentVariableUpdatePayload = { environment_variables: Array<{ [key: string]: unknown @@ -809,6 +954,10 @@ export type HumanInputDeliveryTestPayload = { } } +export type EmptyObjectResponse = { + [key: string]: unknown +} + export type WorkflowAgentComposerResponse = { active_config_snapshot?: AgentConfigSnapshotSummaryResponse | null agent?: AgentComposerAgentResponse | null @@ -884,6 +1033,8 @@ export type WorkflowRunSnapshotView = { workflow_run_status: WorkflowExecutionStatus } +export type EventStreamResponse = string + export type NodeOutputsView = { node_completed_at?: string | null node_display_name: string @@ -912,9 +1063,7 @@ export type DraftWorkflowTriggerRunAllPayload = { export type WorkflowDraftVariableListWithoutValue = { items?: Array - total?: { - [key: string]: unknown - } + total?: number } export type WorkflowDraftVariable = { @@ -928,9 +1077,16 @@ export type WorkflowDraftVariable = { name?: string selector?: Array type?: string - value?: { - [key: string]: unknown - } + value?: + | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null value_type?: string visible?: boolean } @@ -946,6 +1102,11 @@ export type PublishWorkflowPayload = { } | null } +export type WorkflowPublishResponse = { + created_at: number + result: string +} + export type WebhookTriggerResponse = { created_at?: string | null id: string @@ -960,6 +1121,12 @@ export type WorkflowUpdatePayload = { marked_name?: string | null } +export type WorkflowRestoreResponse = { + hash: string + result: string + updated_at: number +} + export type ApiKeyList = { data: Array } @@ -1012,7 +1179,16 @@ export type Tag = { type: string } -export type JsonValue = unknown +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null export type WorkflowPartial = { created_at?: number | null @@ -1042,28 +1218,20 @@ export type DeletedTool = { } export type Site = { - app_base_url?: string | null chat_color_theme?: string | null - chat_color_theme_inverted?: boolean | null - code?: string | null + chat_color_theme_inverted: boolean copyright?: string | null - created_at?: number | null - created_by?: string | null custom_disclaimer?: string | null - customize_domain?: string | null - customize_token_strategy?: string | null - default_language?: string | null + default_language: string description?: string | null icon?: string | null icon_background?: string | null - icon_type?: string | IconType | null + icon_type?: string | null + readonly icon_url: string | null privacy_policy?: string | null - prompt_public?: boolean | null - show_workflow_steps?: boolean | null - title?: string | null - updated_at?: number | null - updated_by?: string | null - use_icon_as_answer_icon?: boolean | null + show_workflow_steps: boolean + title: string + use_icon_as_answer_icon: boolean } export type AdvancedChatWorkflowRunForListResponse = { @@ -1237,12 +1405,38 @@ export type SandboxToolFileResponse = { transfer_method?: 'tool_file' } +export type AgentIterationLogResponse = { + created_at: string + files?: Array + thought?: string | null + tokens: number + tool_calls: Array + tool_raw: { + [key: string]: unknown + } +} + +export type AgentLogMetaResponse = { + agent_mode: string + elapsed_time?: number | null + executor: string + iterations: number + start_time: string + status: string + total_tokens: number +} + +export type AnnotationEmbeddingModelResponse = { + embedding_model_name?: string | null + embedding_provider_name?: string | null +} + export type AnnotationHitHistory = { - annotation_content?: string | null - annotation_question?: string | null created_at?: number | null id: string + match?: string | null question?: string | null + response?: string | null score?: number | null source?: string | null } @@ -1388,6 +1582,48 @@ export type MessageFile = { export type AppMcpServerStatus = 'active' | 'inactive' | 'normal' +export type AverageResponseTimeStatisticItem = { + date: string + latency: number +} + +export type AverageSessionInteractionStatisticItem = { + date: string + interactions: number +} + +export type DailyConversationStatisticItem = { + conversation_count: number + date: string +} + +export type DailyTerminalStatisticItem = { + date: string + terminal_count: number +} + +export type DailyMessageStatisticItem = { + date: string + message_count: number +} + +export type DailyTokenCostStatisticItem = { + currency: string + date: string + token_count: number + total_price: string | number +} + +export type TokensPerSecondStatisticItem = { + date: string + tps: number +} + +export type UserSatisfactionRateStatisticItem = { + date: string + rate: number +} + export type WorkflowAppLogPartialResponse = { created_at?: number | null created_by_account?: SimpleAccount | null @@ -1486,13 +1722,31 @@ export type WorkflowCommentReply = { id: string } +export type WorkflowAverageAppInteractionStatisticItem = { + date: string + interactions: number +} + +export type WorkflowDailyRunsStatisticItem = { + date: string + runs: number +} + +export type WorkflowDailyTerminalsStatisticItem = { + date: string + terminal_count: number +} + +export type WorkflowDailyTokenCostStatisticItem = { + date: string + token_count: number +} + export type WorkflowConversationVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -1500,9 +1754,7 @@ export type WorkflowEnvironmentVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -1511,9 +1763,7 @@ export type PipelineVariableResponse = { allowed_file_types?: Array | null allowed_file_upload_methods?: Array | null belong_to_node_id: string - default_value?: { - [key: string]: unknown - } + default_value?: unknown label: string max_length?: number | null options?: Array | null @@ -1525,6 +1775,19 @@ export type PipelineVariableResponse = { variable: string } +export type EnvironmentVariableItemResponse = { + description?: string | null + editable: boolean + edited: boolean + id: string + name: string + selector: Array + type: string + value: unknown + value_type: string + visible: boolean +} + export type AgentComposerBindingResponse = { agent_id?: string | null binding_type: WorkflowAgentBindingType @@ -1824,6 +2087,24 @@ export type AgentModerationProviderConfig = { [key: string]: unknown } +export type AgentToolCallResponse = { + error?: string | null + status: string + time_cost: number | number + tool_icon?: unknown + tool_input: { + [key: string]: unknown + } + tool_label: string + tool_name: string + tool_output: { + [key: string]: unknown + } + tool_parameters: { + [key: string]: unknown + } +} + export type SimpleModelConfig = { model_dict?: JsonValue | null pre_prompt?: string | null @@ -2187,6 +2468,35 @@ export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' export type ValueSourceType = 'constant' | 'variable' +export type AppDetailWithSiteWritable = { + access_mode?: string | null + api_base_url?: string | null + app_model_config?: ModelConfig | null + bound_agent_id?: string | null + created_at?: number | null + created_by?: string | null + deleted_tools?: Array + description?: string | null + enable_api: boolean + enable_site: boolean + icon?: string | null + icon_background?: string | null + icon_type?: string | null + id: string + max_active_requests?: number | null + mode_compatible_with_agent: string + name: string + site?: SiteWritable | null + tags?: Array + tracing?: JsonValue | null + updated_at?: number | null + updated_by?: string | null + use_icon_as_answer_icon?: boolean | null + workflow?: WorkflowPartial | null +} + +export type GeneratedAppResponseWritable = JsonValue + export type WorkflowCommentBasicListWritable = { data: Array } @@ -2208,6 +2518,22 @@ export type WorkflowCommentDetailWritable = { updated_at?: number | null } +export type SiteWritable = { + chat_color_theme?: string | null + chat_color_theme_inverted: boolean + copyright?: string | null + custom_disclaimer?: string | null + default_language: string + description?: string | null + icon?: string | null + icon_background?: string | null + icon_type?: string | null + privacy_policy?: string | null + show_workflow_steps: boolean + title: string + use_icon_as_answer_icon: boolean +} + export type WorkflowCommentBasicWritable = { content: string created_at?: number | null @@ -2283,16 +2609,10 @@ export type PostAppsData = { } export type PostAppsErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PostAppsError = PostAppsErrors[keyof PostAppsErrors] - export type PostAppsResponses = { 201: AppDetail } @@ -2382,13 +2702,9 @@ export type DeleteAppsByAppIdData = { } export type DeleteAppsByAppIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type DeleteAppsByAppIdError = DeleteAppsByAppIdErrors[keyof DeleteAppsByAppIdErrors] - export type DeleteAppsByAppIdResponses = { 204: void } @@ -2420,16 +2736,10 @@ export type PutAppsByAppIdData = { } export type PutAppsByAppIdErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PutAppsByAppIdError = PutAppsByAppIdErrors[keyof PutAppsByAppIdErrors] - export type PutAppsByAppIdResponses = { 200: AppDetailWithSite } @@ -2488,9 +2798,7 @@ export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdForm } export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormPreviewResponse } export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse @@ -2507,9 +2815,7 @@ export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdForm } export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormSubmitResponse } export type PostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse @@ -2526,21 +2832,12 @@ export type PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunDa } export type PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunError - = PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunErrors[keyof PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunErrors] - export type PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponse @@ -2557,21 +2854,12 @@ export type PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunData = } export type PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunError - = PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunErrors[keyof PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunErrors] - export type PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponse @@ -2587,21 +2875,12 @@ export type PostAppsByAppIdAdvancedChatWorkflowsDraftRunData = { } export type PostAppsByAppIdAdvancedChatWorkflowsDraftRunErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PostAppsByAppIdAdvancedChatWorkflowsDraftRunError - = PostAppsByAppIdAdvancedChatWorkflowsDraftRunErrors[keyof PostAppsByAppIdAdvancedChatWorkflowsDraftRunErrors] - export type PostAppsByAppIdAdvancedChatWorkflowsDraftRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdAdvancedChatWorkflowsDraftRunResponse @@ -2681,17 +2960,10 @@ export type PostAppsByAppIdAgentFeaturesData = { } export type PostAppsByAppIdAgentFeaturesErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostAppsByAppIdAgentFeaturesError - = PostAppsByAppIdAgentFeaturesErrors[keyof PostAppsByAppIdAgentFeaturesErrors] - export type PostAppsByAppIdAgentFeaturesResponses = { 200: SimpleResultResponse } @@ -2709,14 +2981,9 @@ export type GetAppsByAppIdAgentReferencingWorkflowsData = { } export type GetAppsByAppIdAgentReferencingWorkflowsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdAgentReferencingWorkflowsError - = GetAppsByAppIdAgentReferencingWorkflowsErrors[keyof GetAppsByAppIdAgentReferencingWorkflowsErrors] - export type GetAppsByAppIdAgentReferencingWorkflowsResponses = { 200: AgentReferencingWorkflowsResponse } @@ -2791,18 +3058,11 @@ export type GetAppsByAppIdAgentLogsData = { } export type GetAppsByAppIdAgentLogsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetAppsByAppIdAgentLogsError - = GetAppsByAppIdAgentLogsErrors[keyof GetAppsByAppIdAgentLogsErrors] - export type GetAppsByAppIdAgentLogsResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: AgentLogResponse } export type GetAppsByAppIdAgentLogsResponse @@ -2818,18 +3078,11 @@ export type PostAppsByAppIdAgentSkillsStandardizeData = { } export type PostAppsByAppIdAgentSkillsStandardizeErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostAppsByAppIdAgentSkillsStandardizeError - = PostAppsByAppIdAgentSkillsStandardizeErrors[keyof PostAppsByAppIdAgentSkillsStandardizeErrors] - export type PostAppsByAppIdAgentSkillsStandardizeResponses = { - 201: { - [key: string]: unknown - } + 201: AgentSkillStandardizeResponse } export type PostAppsByAppIdAgentSkillsStandardizeResponse @@ -2845,18 +3098,11 @@ export type PostAppsByAppIdAgentSkillsUploadData = { } export type PostAppsByAppIdAgentSkillsUploadErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostAppsByAppIdAgentSkillsUploadError - = PostAppsByAppIdAgentSkillsUploadErrors[keyof PostAppsByAppIdAgentSkillsUploadErrors] - export type PostAppsByAppIdAgentSkillsUploadResponses = { - 201: { - [key: string]: unknown - } + 201: AgentSkillUploadResponse } export type PostAppsByAppIdAgentSkillsUploadResponse @@ -2873,18 +3119,11 @@ export type PostAppsByAppIdAnnotationReplyByActionData = { } export type PostAppsByAppIdAnnotationReplyByActionErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdAnnotationReplyByActionError - = PostAppsByAppIdAnnotationReplyByActionErrors[keyof PostAppsByAppIdAnnotationReplyByActionErrors] - export type PostAppsByAppIdAnnotationReplyByActionResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type PostAppsByAppIdAnnotationReplyByActionResponse @@ -2902,18 +3141,11 @@ export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdData = { } export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdError - = GetAppsByAppIdAnnotationReplyByActionStatusByJobIdErrors[keyof GetAppsByAppIdAnnotationReplyByActionStatusByJobIdErrors] - export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponse @@ -2929,18 +3161,11 @@ export type GetAppsByAppIdAnnotationSettingData = { } export type GetAppsByAppIdAnnotationSettingErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationSettingError - = GetAppsByAppIdAnnotationSettingErrors[keyof GetAppsByAppIdAnnotationSettingErrors] - export type GetAppsByAppIdAnnotationSettingResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationSettingResponse } export type GetAppsByAppIdAnnotationSettingResponse @@ -2957,18 +3182,11 @@ export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdData = { } export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdError - = PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdErrors[keyof PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdErrors] - export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationSettingResponse } export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponse @@ -2984,9 +3202,7 @@ export type DeleteAppsByAppIdAnnotationsData = { } export type DeleteAppsByAppIdAnnotationsResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteAppsByAppIdAnnotationsResponse @@ -3006,18 +3222,11 @@ export type GetAppsByAppIdAnnotationsData = { } export type GetAppsByAppIdAnnotationsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationsError - = GetAppsByAppIdAnnotationsErrors[keyof GetAppsByAppIdAnnotationsErrors] - export type GetAppsByAppIdAnnotationsResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationList } export type GetAppsByAppIdAnnotationsResponse @@ -3033,14 +3242,9 @@ export type PostAppsByAppIdAnnotationsData = { } export type PostAppsByAppIdAnnotationsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdAnnotationsError - = PostAppsByAppIdAnnotationsErrors[keyof PostAppsByAppIdAnnotationsErrors] - export type PostAppsByAppIdAnnotationsResponses = { 201: Annotation } @@ -3058,27 +3262,14 @@ export type PostAppsByAppIdAnnotationsBatchImportData = { } export type PostAppsByAppIdAnnotationsBatchImportErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 429: { - [key: string]: unknown - } + 400: unknown + 403: unknown + 413: unknown + 429: unknown } -export type PostAppsByAppIdAnnotationsBatchImportError - = PostAppsByAppIdAnnotationsBatchImportErrors[keyof PostAppsByAppIdAnnotationsBatchImportErrors] - export type PostAppsByAppIdAnnotationsBatchImportResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type PostAppsByAppIdAnnotationsBatchImportResponse @@ -3095,18 +3286,11 @@ export type GetAppsByAppIdAnnotationsBatchImportStatusByJobIdData = { } export type GetAppsByAppIdAnnotationsBatchImportStatusByJobIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationsBatchImportStatusByJobIdError - = GetAppsByAppIdAnnotationsBatchImportStatusByJobIdErrors[keyof GetAppsByAppIdAnnotationsBatchImportStatusByJobIdErrors] - export type GetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type GetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponse @@ -3138,14 +3322,9 @@ export type GetAppsByAppIdAnnotationsExportData = { } export type GetAppsByAppIdAnnotationsExportErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationsExportError - = GetAppsByAppIdAnnotationsExportErrors[keyof GetAppsByAppIdAnnotationsExportErrors] - export type GetAppsByAppIdAnnotationsExportResponses = { 200: AnnotationExportList } @@ -3164,9 +3343,7 @@ export type DeleteAppsByAppIdAnnotationsByAnnotationIdData = { } export type DeleteAppsByAppIdAnnotationsByAnnotationIdResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteAppsByAppIdAnnotationsByAnnotationIdResponse @@ -3183,14 +3360,9 @@ export type PostAppsByAppIdAnnotationsByAnnotationIdData = { } export type PostAppsByAppIdAnnotationsByAnnotationIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdAnnotationsByAnnotationIdError - = PostAppsByAppIdAnnotationsByAnnotationIdErrors[keyof PostAppsByAppIdAnnotationsByAnnotationIdErrors] - export type PostAppsByAppIdAnnotationsByAnnotationIdResponses = { 200: Annotation 204: void @@ -3213,14 +3385,9 @@ export type GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesData = { } export type GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesError - = GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesErrors[keyof GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesErrors] - export type GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesResponses = { 200: AnnotationHitHistoryList } @@ -3238,14 +3405,9 @@ export type PostAppsByAppIdApiEnableData = { } export type PostAppsByAppIdApiEnableErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdApiEnableError - = PostAppsByAppIdApiEnableErrors[keyof PostAppsByAppIdApiEnableErrors] - export type PostAppsByAppIdApiEnableResponses = { 200: AppDetail } @@ -3263,17 +3425,10 @@ export type PostAppsByAppIdAudioToTextData = { } export type PostAppsByAppIdAudioToTextErrors = { - 400: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } + 400: unknown + 413: unknown } -export type PostAppsByAppIdAudioToTextError - = PostAppsByAppIdAudioToTextErrors[keyof PostAppsByAppIdAudioToTextErrors] - export type PostAppsByAppIdAudioToTextResponses = { 200: AudioTranscriptResponse } @@ -3299,14 +3454,9 @@ export type GetAppsByAppIdChatConversationsData = { } export type GetAppsByAppIdChatConversationsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdChatConversationsError - = GetAppsByAppIdChatConversationsErrors[keyof GetAppsByAppIdChatConversationsErrors] - export type GetAppsByAppIdChatConversationsResponses = { 200: ConversationWithSummaryPagination } @@ -3325,17 +3475,10 @@ export type DeleteAppsByAppIdChatConversationsByConversationIdData = { } export type DeleteAppsByAppIdChatConversationsByConversationIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type DeleteAppsByAppIdChatConversationsByConversationIdError - = DeleteAppsByAppIdChatConversationsByConversationIdErrors[keyof DeleteAppsByAppIdChatConversationsByConversationIdErrors] - export type DeleteAppsByAppIdChatConversationsByConversationIdResponses = { 204: void } @@ -3354,17 +3497,10 @@ export type GetAppsByAppIdChatConversationsByConversationIdData = { } export type GetAppsByAppIdChatConversationsByConversationIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetAppsByAppIdChatConversationsByConversationIdError - = GetAppsByAppIdChatConversationsByConversationIdErrors[keyof GetAppsByAppIdChatConversationsByConversationIdErrors] - export type GetAppsByAppIdChatConversationsByConversationIdResponses = { 200: ConversationDetail } @@ -3386,14 +3522,9 @@ export type GetAppsByAppIdChatMessagesData = { } export type GetAppsByAppIdChatMessagesErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdChatMessagesError - = GetAppsByAppIdChatMessagesErrors[keyof GetAppsByAppIdChatMessagesErrors] - export type GetAppsByAppIdChatMessagesResponses = { 200: MessageInfiniteScrollPaginationResponse } @@ -3412,14 +3543,9 @@ export type GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsData = { } export type GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsError - = GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsErrors[keyof GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsErrors] - export type GetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsResponses = { 200: SuggestedQuestionsResponse } @@ -3461,14 +3587,9 @@ export type GetAppsByAppIdCompletionConversationsData = { } export type GetAppsByAppIdCompletionConversationsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdCompletionConversationsError - = GetAppsByAppIdCompletionConversationsErrors[keyof GetAppsByAppIdCompletionConversationsErrors] - export type GetAppsByAppIdCompletionConversationsResponses = { 200: ConversationPagination } @@ -3487,17 +3608,10 @@ export type DeleteAppsByAppIdCompletionConversationsByConversationIdData = { } export type DeleteAppsByAppIdCompletionConversationsByConversationIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type DeleteAppsByAppIdCompletionConversationsByConversationIdError - = DeleteAppsByAppIdCompletionConversationsByConversationIdErrors[keyof DeleteAppsByAppIdCompletionConversationsByConversationIdErrors] - export type DeleteAppsByAppIdCompletionConversationsByConversationIdResponses = { 204: void } @@ -3516,17 +3630,10 @@ export type GetAppsByAppIdCompletionConversationsByConversationIdData = { } export type GetAppsByAppIdCompletionConversationsByConversationIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetAppsByAppIdCompletionConversationsByConversationIdError - = GetAppsByAppIdCompletionConversationsByConversationIdErrors[keyof GetAppsByAppIdCompletionConversationsByConversationIdErrors] - export type GetAppsByAppIdCompletionConversationsByConversationIdResponses = { 200: ConversationMessageDetail } @@ -3544,21 +3651,12 @@ export type PostAppsByAppIdCompletionMessagesData = { } export type PostAppsByAppIdCompletionMessagesErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostAppsByAppIdCompletionMessagesError - = PostAppsByAppIdCompletionMessagesErrors[keyof PostAppsByAppIdCompletionMessagesErrors] - export type PostAppsByAppIdCompletionMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdCompletionMessagesResponse @@ -3609,17 +3707,10 @@ export type PostAppsByAppIdConvertToWorkflowData = { } export type PostAppsByAppIdConvertToWorkflowErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PostAppsByAppIdConvertToWorkflowError - = PostAppsByAppIdConvertToWorkflowErrors[keyof PostAppsByAppIdConvertToWorkflowErrors] - export type PostAppsByAppIdConvertToWorkflowResponses = { 200: NewAppResponse } @@ -3637,13 +3728,9 @@ export type PostAppsByAppIdCopyData = { } export type PostAppsByAppIdCopyErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdCopyError = PostAppsByAppIdCopyErrors[keyof PostAppsByAppIdCopyErrors] - export type PostAppsByAppIdCopyResponses = { 201: AppDetailWithSite } @@ -3664,13 +3751,9 @@ export type GetAppsByAppIdExportData = { } export type GetAppsByAppIdExportErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetAppsByAppIdExportError = GetAppsByAppIdExportErrors[keyof GetAppsByAppIdExportErrors] - export type GetAppsByAppIdExportResponses = { 200: AppExportResponse } @@ -3688,17 +3771,10 @@ export type PostAppsByAppIdFeedbacksData = { } export type PostAppsByAppIdFeedbacksErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdFeedbacksError - = PostAppsByAppIdFeedbacksErrors[keyof PostAppsByAppIdFeedbacksErrors] - export type PostAppsByAppIdFeedbacksResponses = { 200: SimpleResultResponse } @@ -3723,21 +3799,12 @@ export type GetAppsByAppIdFeedbacksExportData = { } export type GetAppsByAppIdFeedbacksExportErrors = { - 400: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 500: unknown } -export type GetAppsByAppIdFeedbacksExportError - = GetAppsByAppIdFeedbacksExportErrors[keyof GetAppsByAppIdFeedbacksExportErrors] - export type GetAppsByAppIdFeedbacksExportResponses = { - 200: { - [key: string]: unknown - } + 200: TextFileResponse } export type GetAppsByAppIdFeedbacksExportResponse @@ -3753,17 +3820,11 @@ export type PostAppsByAppIdIconData = { } export type PostAppsByAppIdIconErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdIconError = PostAppsByAppIdIconErrors[keyof PostAppsByAppIdIconErrors] - export type PostAppsByAppIdIconResponses = { - 200: { - [key: string]: unknown - } + 200: AppDetail } export type PostAppsByAppIdIconResponse @@ -3780,14 +3841,9 @@ export type GetAppsByAppIdMessagesByMessageIdData = { } export type GetAppsByAppIdMessagesByMessageIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdMessagesByMessageIdError - = GetAppsByAppIdMessagesByMessageIdErrors[keyof GetAppsByAppIdMessagesByMessageIdErrors] - export type GetAppsByAppIdMessagesByMessageIdResponses = { 200: MessageDetailResponse } @@ -3805,21 +3861,12 @@ export type PostAppsByAppIdModelConfigData = { } export type PostAppsByAppIdModelConfigErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostAppsByAppIdModelConfigError - = PostAppsByAppIdModelConfigErrors[keyof PostAppsByAppIdModelConfigErrors] - export type PostAppsByAppIdModelConfigResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostAppsByAppIdModelConfigResponse @@ -3883,14 +3930,9 @@ export type PostAppsByAppIdServerData = { } export type PostAppsByAppIdServerErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdServerError - = PostAppsByAppIdServerErrors[keyof PostAppsByAppIdServerErrors] - export type PostAppsByAppIdServerResponses = { 201: AppMcpServerResponse } @@ -3908,16 +3950,10 @@ export type PutAppsByAppIdServerData = { } export type PutAppsByAppIdServerErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PutAppsByAppIdServerError = PutAppsByAppIdServerErrors[keyof PutAppsByAppIdServerErrors] - export type PutAppsByAppIdServerResponses = { 200: AppMcpServerResponse } @@ -3935,16 +3971,10 @@ export type PostAppsByAppIdSiteData = { } export type PostAppsByAppIdSiteErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdSiteError = PostAppsByAppIdSiteErrors[keyof PostAppsByAppIdSiteErrors] - export type PostAppsByAppIdSiteResponses = { 200: AppSiteResponse } @@ -3962,14 +3992,9 @@ export type PostAppsByAppIdSiteEnableData = { } export type PostAppsByAppIdSiteEnableErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdSiteEnableError - = PostAppsByAppIdSiteEnableErrors[keyof PostAppsByAppIdSiteEnableErrors] - export type PostAppsByAppIdSiteEnableResponses = { 200: AppDetail } @@ -3987,17 +4012,10 @@ export type PostAppsByAppIdSiteAccessTokenResetData = { } export type PostAppsByAppIdSiteAccessTokenResetErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdSiteAccessTokenResetError - = PostAppsByAppIdSiteAccessTokenResetErrors[keyof PostAppsByAppIdSiteAccessTokenResetErrors] - export type PostAppsByAppIdSiteAccessTokenResetResponses = { 200: AppSiteResponse } @@ -4018,9 +4036,7 @@ export type GetAppsByAppIdStatisticsAverageResponseTimeData = { } export type GetAppsByAppIdStatisticsAverageResponseTimeResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: AverageResponseTimeStatisticResponse } export type GetAppsByAppIdStatisticsAverageResponseTimeResponse @@ -4039,9 +4055,7 @@ export type GetAppsByAppIdStatisticsAverageSessionInteractionsData = { } export type GetAppsByAppIdStatisticsAverageSessionInteractionsResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: AverageSessionInteractionStatisticResponse } export type GetAppsByAppIdStatisticsAverageSessionInteractionsResponse @@ -4060,9 +4074,7 @@ export type GetAppsByAppIdStatisticsDailyConversationsData = { } export type GetAppsByAppIdStatisticsDailyConversationsResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: DailyConversationStatisticResponse } export type GetAppsByAppIdStatisticsDailyConversationsResponse @@ -4081,9 +4093,7 @@ export type GetAppsByAppIdStatisticsDailyEndUsersData = { } export type GetAppsByAppIdStatisticsDailyEndUsersResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: DailyTerminalStatisticResponse } export type GetAppsByAppIdStatisticsDailyEndUsersResponse @@ -4102,9 +4112,7 @@ export type GetAppsByAppIdStatisticsDailyMessagesData = { } export type GetAppsByAppIdStatisticsDailyMessagesResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: DailyMessageStatisticResponse } export type GetAppsByAppIdStatisticsDailyMessagesResponse @@ -4123,9 +4131,7 @@ export type GetAppsByAppIdStatisticsTokenCostsData = { } export type GetAppsByAppIdStatisticsTokenCostsResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: DailyTokenCostStatisticResponse } export type GetAppsByAppIdStatisticsTokenCostsResponse @@ -4144,9 +4150,7 @@ export type GetAppsByAppIdStatisticsTokensPerSecondData = { } export type GetAppsByAppIdStatisticsTokensPerSecondResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: TokensPerSecondStatisticResponse } export type GetAppsByAppIdStatisticsTokensPerSecondResponse @@ -4165,9 +4169,7 @@ export type GetAppsByAppIdStatisticsUserSatisfactionRateData = { } export type GetAppsByAppIdStatisticsUserSatisfactionRateResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: UserSatisfactionRateStatisticResponse } export type GetAppsByAppIdStatisticsUserSatisfactionRateResponse @@ -4183,18 +4185,11 @@ export type PostAppsByAppIdTextToAudioData = { } export type PostAppsByAppIdTextToAudioErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostAppsByAppIdTextToAudioError - = PostAppsByAppIdTextToAudioErrors[keyof PostAppsByAppIdTextToAudioErrors] - export type PostAppsByAppIdTextToAudioResponses = { - 200: { - [key: string]: unknown - } + 200: AudioBinaryResponse } export type PostAppsByAppIdTextToAudioResponse @@ -4212,18 +4207,11 @@ export type GetAppsByAppIdTextToAudioVoicesData = { } export type GetAppsByAppIdTextToAudioVoicesErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetAppsByAppIdTextToAudioVoicesError - = GetAppsByAppIdTextToAudioVoicesErrors[keyof GetAppsByAppIdTextToAudioVoicesErrors] - export type GetAppsByAppIdTextToAudioVoicesResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: TextToSpeechVoiceListResponse } export type GetAppsByAppIdTextToAudioVoicesResponse @@ -4239,9 +4227,7 @@ export type GetAppsByAppIdTraceData = { } export type GetAppsByAppIdTraceResponses = { - 200: { - [key: string]: unknown - } + 200: AppTraceResponse } export type GetAppsByAppIdTraceResponse @@ -4257,13 +4243,9 @@ export type PostAppsByAppIdTraceData = { } export type PostAppsByAppIdTraceErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdTraceError = PostAppsByAppIdTraceErrors[keyof PostAppsByAppIdTraceErrors] - export type PostAppsByAppIdTraceResponses = { 200: SimpleResultResponse } @@ -4272,23 +4254,20 @@ export type PostAppsByAppIdTraceResponse = PostAppsByAppIdTraceResponses[keyof PostAppsByAppIdTraceResponses] export type DeleteAppsByAppIdTraceConfigData = { - body: TraceProviderQuery + body?: never path: { app_id: string } - query?: never + query: { + tracing_provider: string + } url: '/apps/{app_id}/trace-config' } export type DeleteAppsByAppIdTraceConfigErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type DeleteAppsByAppIdTraceConfigError - = DeleteAppsByAppIdTraceConfigErrors[keyof DeleteAppsByAppIdTraceConfigErrors] - export type DeleteAppsByAppIdTraceConfigResponses = { 204: void } @@ -4308,18 +4287,11 @@ export type GetAppsByAppIdTraceConfigData = { } export type GetAppsByAppIdTraceConfigErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetAppsByAppIdTraceConfigError - = GetAppsByAppIdTraceConfigErrors[keyof GetAppsByAppIdTraceConfigErrors] - export type GetAppsByAppIdTraceConfigResponses = { - 200: { - [key: string]: unknown - } + 200: TraceAppConfigResponse } export type GetAppsByAppIdTraceConfigResponse @@ -4335,18 +4307,11 @@ export type PatchAppsByAppIdTraceConfigData = { } export type PatchAppsByAppIdTraceConfigErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PatchAppsByAppIdTraceConfigError - = PatchAppsByAppIdTraceConfigErrors[keyof PatchAppsByAppIdTraceConfigErrors] - export type PatchAppsByAppIdTraceConfigResponses = { - 200: { - [key: string]: unknown - } + 200: TraceAppConfigResponse } export type PatchAppsByAppIdTraceConfigResponse @@ -4362,18 +4327,11 @@ export type PostAppsByAppIdTraceConfigData = { } export type PostAppsByAppIdTraceConfigErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostAppsByAppIdTraceConfigError - = PostAppsByAppIdTraceConfigErrors[keyof PostAppsByAppIdTraceConfigErrors] - export type PostAppsByAppIdTraceConfigResponses = { - 201: { - [key: string]: unknown - } + 201: TraceAppConfigResponse } export type PostAppsByAppIdTraceConfigResponse @@ -4529,17 +4487,10 @@ export type PostAppsByAppIdWorkflowRunsTasksByTaskIdStopData = { } export type PostAppsByAppIdWorkflowRunsTasksByTaskIdStopErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdWorkflowRunsTasksByTaskIdStopError - = PostAppsByAppIdWorkflowRunsTasksByTaskIdStopErrors[keyof PostAppsByAppIdWorkflowRunsTasksByTaskIdStopErrors] - export type PostAppsByAppIdWorkflowRunsTasksByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -4558,14 +4509,9 @@ export type GetAppsByAppIdWorkflowRunsByRunIdData = { } export type GetAppsByAppIdWorkflowRunsByRunIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowRunsByRunIdError - = GetAppsByAppIdWorkflowRunsByRunIdErrors[keyof GetAppsByAppIdWorkflowRunsByRunIdErrors] - export type GetAppsByAppIdWorkflowRunsByRunIdResponses = { 200: WorkflowRunDetailResponse } @@ -4601,14 +4547,9 @@ export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsData = { } export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsError - = GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsErrors[keyof GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsErrors] - export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsResponses = { 200: WorkflowRunNodeExecutionListResponse } @@ -4859,9 +4800,7 @@ export type GetAppsByAppIdWorkflowStatisticsAverageAppInteractionsData = { } export type GetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowAverageAppInteractionStatisticResponse } export type GetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponse @@ -4880,9 +4819,7 @@ export type GetAppsByAppIdWorkflowStatisticsDailyConversationsData = { } export type GetAppsByAppIdWorkflowStatisticsDailyConversationsResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDailyRunsStatisticResponse } export type GetAppsByAppIdWorkflowStatisticsDailyConversationsResponse @@ -4901,9 +4838,7 @@ export type GetAppsByAppIdWorkflowStatisticsDailyTerminalsData = { } export type GetAppsByAppIdWorkflowStatisticsDailyTerminalsResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDailyTerminalsStatisticResponse } export type GetAppsByAppIdWorkflowStatisticsDailyTerminalsResponse @@ -4922,9 +4857,7 @@ export type GetAppsByAppIdWorkflowStatisticsTokenCostsData = { } export type GetAppsByAppIdWorkflowStatisticsTokenCostsResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDailyTokenCostStatisticResponse } export type GetAppsByAppIdWorkflowStatisticsTokenCostsResponse @@ -4961,9 +4894,7 @@ export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsData = { } export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultBlockConfigsResponse } export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponse @@ -4982,18 +4913,11 @@ export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeData = } export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeError - = GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeErrors[keyof GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeErrors] - export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultBlockConfigResponse } export type GetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse @@ -5009,14 +4933,9 @@ export type GetAppsByAppIdWorkflowsDraftData = { } export type GetAppsByAppIdWorkflowsDraftErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftError - = GetAppsByAppIdWorkflowsDraftErrors[keyof GetAppsByAppIdWorkflowsDraftErrors] - export type GetAppsByAppIdWorkflowsDraftResponses = { 200: WorkflowResponse } @@ -5034,17 +4953,10 @@ export type PostAppsByAppIdWorkflowsDraftData = { } export type PostAppsByAppIdWorkflowsDraftErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PostAppsByAppIdWorkflowsDraftError - = PostAppsByAppIdWorkflowsDraftErrors[keyof PostAppsByAppIdWorkflowsDraftErrors] - export type PostAppsByAppIdWorkflowsDraftResponses = { 200: SyncDraftWorkflowResponse } @@ -5062,14 +4974,9 @@ export type GetAppsByAppIdWorkflowsDraftConversationVariablesData = { } export type GetAppsByAppIdWorkflowsDraftConversationVariablesErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftConversationVariablesError - = GetAppsByAppIdWorkflowsDraftConversationVariablesErrors[keyof GetAppsByAppIdWorkflowsDraftConversationVariablesErrors] - export type GetAppsByAppIdWorkflowsDraftConversationVariablesResponses = { 200: WorkflowDraftVariableList } @@ -5087,9 +4994,7 @@ export type PostAppsByAppIdWorkflowsDraftConversationVariablesData = { } export type PostAppsByAppIdWorkflowsDraftConversationVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostAppsByAppIdWorkflowsDraftConversationVariablesResponse @@ -5105,18 +5010,11 @@ export type GetAppsByAppIdWorkflowsDraftEnvironmentVariablesData = { } export type GetAppsByAppIdWorkflowsDraftEnvironmentVariablesErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftEnvironmentVariablesError - = GetAppsByAppIdWorkflowsDraftEnvironmentVariablesErrors[keyof GetAppsByAppIdWorkflowsDraftEnvironmentVariablesErrors] - export type GetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: EnvironmentVariableListResponse } export type GetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse @@ -5132,9 +5030,7 @@ export type PostAppsByAppIdWorkflowsDraftEnvironmentVariablesData = { } export type PostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse @@ -5167,9 +5063,7 @@ export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestData } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponses = { - 200: { - [key: string]: unknown - } + 200: EmptyObjectResponse } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponse @@ -5186,9 +5080,7 @@ export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewData } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormPreviewResponse } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse @@ -5205,9 +5097,7 @@ export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunData = { } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormSubmitResponse } export type PostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse @@ -5224,21 +5114,12 @@ export type PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunData = { } export type PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunError - = PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunErrors[keyof PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunErrors] - export type PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponse @@ -5255,21 +5136,12 @@ export type PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunData = { } export type PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunError - = PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunErrors[keyof PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunErrors] - export type PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponse @@ -5388,17 +5260,10 @@ export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunData = { } export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunError - = GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunErrors[keyof GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunErrors] - export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunResponses = { 200: WorkflowRunNodeExecutionResponse } @@ -5417,17 +5282,10 @@ export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunData = { } export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunError - = PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunErrors[keyof PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunErrors] - export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunResponses = { 200: WorkflowRunNodeExecutionResponse } @@ -5446,21 +5304,12 @@ export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunData = { } export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunErrors = { - 403: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 403: unknown + 500: unknown } -export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunError - = PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunErrors[keyof PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunErrors] - export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse @@ -5510,18 +5359,11 @@ export type PostAppsByAppIdWorkflowsDraftRunData = { } export type PostAppsByAppIdWorkflowsDraftRunErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostAppsByAppIdWorkflowsDraftRunError - = PostAppsByAppIdWorkflowsDraftRunErrors[keyof PostAppsByAppIdWorkflowsDraftRunErrors] - export type PostAppsByAppIdWorkflowsDraftRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftRunResponse @@ -5538,14 +5380,9 @@ export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsData = { } export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsError - = GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsErrors[keyof GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsErrors] - export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsResponses = { 200: WorkflowRunSnapshotView } @@ -5564,18 +5401,11 @@ export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsData = { } export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsError - = GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsErrors[keyof GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsErrors] - export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponse @@ -5593,14 +5423,9 @@ export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdData = { } export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdError - = GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdErrors[keyof GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdErrors] - export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdResponses = { 200: NodeOutputsView } @@ -5621,14 +5446,9 @@ export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNa } export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewError - = GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors[keyof GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors] - export type GetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponses = { 200: OutputPreviewView @@ -5663,21 +5483,12 @@ export type PostAppsByAppIdWorkflowsDraftTriggerRunData = { } export type PostAppsByAppIdWorkflowsDraftTriggerRunErrors = { - 403: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 403: unknown + 500: unknown } -export type PostAppsByAppIdWorkflowsDraftTriggerRunError - = PostAppsByAppIdWorkflowsDraftTriggerRunErrors[keyof PostAppsByAppIdWorkflowsDraftTriggerRunErrors] - export type PostAppsByAppIdWorkflowsDraftTriggerRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftTriggerRunResponse @@ -5693,21 +5504,12 @@ export type PostAppsByAppIdWorkflowsDraftTriggerRunAllData = { } export type PostAppsByAppIdWorkflowsDraftTriggerRunAllErrors = { - 403: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 403: unknown + 500: unknown } -export type PostAppsByAppIdWorkflowsDraftTriggerRunAllError - = PostAppsByAppIdWorkflowsDraftTriggerRunAllErrors[keyof PostAppsByAppIdWorkflowsDraftTriggerRunAllErrors] - export type PostAppsByAppIdWorkflowsDraftTriggerRunAllResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostAppsByAppIdWorkflowsDraftTriggerRunAllResponse @@ -5759,14 +5561,9 @@ export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdData = { } export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdError - = DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors[keyof DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors] - export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdResponses = { 204: void } @@ -5785,14 +5582,9 @@ export type GetAppsByAppIdWorkflowsDraftVariablesByVariableIdData = { } export type GetAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsDraftVariablesByVariableIdError - = GetAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors[keyof GetAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors] - export type GetAppsByAppIdWorkflowsDraftVariablesByVariableIdResponses = { 200: WorkflowDraftVariable } @@ -5811,14 +5603,9 @@ export type PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdData = { } export type PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdError - = PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors[keyof PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdErrors] - export type PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdResponses = { 200: WorkflowDraftVariable } @@ -5837,14 +5624,9 @@ export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetData = { } export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetError - = PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetErrors[keyof PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetErrors] - export type PutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetResponses = { 200: WorkflowDraftVariable 204: void @@ -5879,9 +5661,7 @@ export type PostAppsByAppIdWorkflowsPublishData = { } export type PostAppsByAppIdWorkflowsPublishResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowPublishResponse } export type PostAppsByAppIdWorkflowsPublishResponse @@ -5898,14 +5678,9 @@ export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsData = { } export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsError - = GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsErrors[keyof GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsErrors] - export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsResponses = { 200: WorkflowRunSnapshotView } @@ -5924,18 +5699,11 @@ export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsData = { } export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsError - = GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsErrors[keyof GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsErrors] - export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponse @@ -5953,14 +5721,9 @@ export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdData = } export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdError - = GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdErrors[keyof GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdErrors] - export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdResponses = { 200: NodeOutputsView } @@ -5983,14 +5746,9 @@ export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutp export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewError - = GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors[keyof GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewErrors] - export type GetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponses = { 200: OutputPreviewView @@ -6028,9 +5786,7 @@ export type DeleteAppsByAppIdWorkflowsByWorkflowIdData = { } export type DeleteAppsByAppIdWorkflowsByWorkflowIdResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteAppsByAppIdWorkflowsByWorkflowIdResponse @@ -6047,17 +5803,10 @@ export type PatchAppsByAppIdWorkflowsByWorkflowIdData = { } export type PatchAppsByAppIdWorkflowsByWorkflowIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PatchAppsByAppIdWorkflowsByWorkflowIdError - = PatchAppsByAppIdWorkflowsByWorkflowIdErrors[keyof PatchAppsByAppIdWorkflowsByWorkflowIdErrors] - export type PatchAppsByAppIdWorkflowsByWorkflowIdResponses = { 200: WorkflowResponse } @@ -6076,21 +5825,12 @@ export type PostAppsByAppIdWorkflowsByWorkflowIdRestoreData = { } export type PostAppsByAppIdWorkflowsByWorkflowIdRestoreErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostAppsByAppIdWorkflowsByWorkflowIdRestoreError - = PostAppsByAppIdWorkflowsByWorkflowIdRestoreErrors[keyof PostAppsByAppIdWorkflowsByWorkflowIdRestoreErrors] - export type PostAppsByAppIdWorkflowsByWorkflowIdRestoreResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowRestoreResponse } export type PostAppsByAppIdWorkflowsByWorkflowIdRestoreResponse @@ -6122,14 +5862,9 @@ export type PostAppsByResourceIdApiKeysData = { } export type PostAppsByResourceIdApiKeysErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostAppsByResourceIdApiKeysError - = PostAppsByResourceIdApiKeysErrors[keyof PostAppsByResourceIdApiKeysErrors] - export type PostAppsByResourceIdApiKeysResponses = { 201: ApiKeyItem } @@ -6164,17 +5899,10 @@ export type GetAppsByServerIdServerRefreshData = { } export type GetAppsByServerIdServerRefreshErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetAppsByServerIdServerRefreshError - = GetAppsByServerIdServerRefreshErrors[keyof GetAppsByServerIdServerRefreshErrors] - export type GetAppsByServerIdServerRefreshResponses = { 200: AppMcpServerResponse } diff --git a/packages/contracts/generated/api/console/apps/zod.gen.ts b/packages/contracts/generated/api/console/apps/zod.gen.ts index 12d9dab3c7..be612550ad 100644 --- a/packages/contracts/generated/api/console/apps/zod.gen.ts +++ b/packages/contracts/generated/api/console/apps/zod.gen.ts @@ -43,6 +43,22 @@ export const zHumanInputFormPreviewPayload = z.object({ inputs: z.record(z.string(), z.unknown()).optional(), }) +/** + * HumanInputFormPreviewResponse + */ +export const zHumanInputFormPreviewResponse = z.object({ + actions: z.array(z.record(z.string(), z.unknown())).optional(), + display_in_ui: z.boolean().nullish(), + expiration_time: z.int().nullish(), + form_content: z.string(), + form_id: z.string(), + form_token: z.string().nullish(), + inputs: z.array(z.record(z.string(), z.unknown())).optional(), + node_id: z.string(), + node_title: z.string(), + resolved_default_values: z.record(z.string(), z.unknown()).optional(), +}) + /** * HumanInputFormSubmitPayload */ @@ -52,6 +68,11 @@ export const zHumanInputFormSubmitPayload = z.object({ inputs: z.record(z.string(), z.unknown()), }) +/** + * HumanInputFormSubmitResponse + */ +export const zHumanInputFormSubmitResponse = z.record(z.string(), z.unknown()) + /** * IterationNodeRunPayload */ @@ -103,6 +124,16 @@ export const zAgentSandboxUploadPayload = z.object({ path: z.string().min(1), }) +/** + * AgentSkillStandardizeResponse + */ +export const zAgentSkillStandardizeResponse = z.record(z.string(), z.unknown()) + +/** + * AgentSkillUploadResponse + */ +export const zAgentSkillUploadResponse = z.record(z.string(), z.unknown()) + /** * AnnotationReplyPayload */ @@ -112,6 +143,16 @@ export const zAnnotationReplyPayload = z.object({ score_threshold: z.number(), }) +/** + * AnnotationJobStatusResponse + */ +export const zAnnotationJobStatusResponse = z.object({ + error_msg: z.string().nullish(), + job_id: z.string().nullish(), + job_status: z.string().nullish(), + record_count: z.int().nullish(), +}) + /** * AnnotationSettingUpdatePayload */ @@ -134,13 +175,24 @@ export const zCreateAnnotationPayload = z.object({ * Annotation */ export const zAnnotation = z.object({ - content: z.string().nullish(), + answer: z.string().nullish(), created_at: z.int().nullish(), hit_count: z.int().nullish(), id: z.string(), question: z.string().nullish(), }) +/** + * AnnotationList + */ +export const zAnnotationList = z.object({ + data: z.array(zAnnotation), + has_more: z.boolean(), + limit: z.int(), + page: z.int(), + total: z.int(), +}) + /** * AnnotationCountResponse */ @@ -231,6 +283,11 @@ export const zMessageFeedbackPayload = z.object({ rating: z.enum(['dislike', 'like']).nullish(), }) +/** + * TextFileResponse + */ +export const zTextFileResponse = z.string() + /** * ModelConfigRequest */ @@ -341,6 +398,24 @@ export const zTextToSpeechPayload = z.object({ voice: z.string().nullish(), }) +/** + * AudioBinaryResponse + */ +export const zAudioBinaryResponse = z.custom() + +/** + * TextToSpeechVoiceListResponse + */ +export const zTextToSpeechVoiceListResponse = z.array(z.record(z.string(), z.unknown())) + +/** + * AppTraceResponse + */ +export const zAppTraceResponse = z.object({ + enabled: z.boolean(), + tracing_provider: z.string().nullish(), +}) + /** * AppTracePayload */ @@ -350,10 +425,19 @@ export const zAppTracePayload = z.object({ }) /** - * TraceProviderQuery + * TraceAppConfigResponse */ -export const zTraceProviderQuery = z.object({ - tracing_provider: z.string(), +export const zTraceAppConfigResponse = z.object({ + app_id: z.string().nullish(), + created_at: z.string().nullish(), + error: z.string().nullish(), + has_not_configured: z.boolean().nullish(), + id: z.string().nullish(), + is_active: z.boolean().nullish(), + result: z.string().nullish(), + tracing_config: z.record(z.string(), z.unknown()).nullish(), + tracing_provider: z.string().nullish(), + updated_at: z.string().nullish(), }) /** @@ -481,6 +565,16 @@ export const zWorkflowCommentResolve = z.object({ resolved_by: z.string().nullish(), }) +/** + * DefaultBlockConfigsResponse + */ +export const zDefaultBlockConfigsResponse = z.array(z.record(z.string(), z.unknown())) + +/** + * DefaultBlockConfigResponse + */ +export const zDefaultBlockConfigResponse = z.record(z.string(), z.unknown()) + /** * SyncDraftWorkflowPayload */ @@ -527,6 +621,11 @@ export const zHumanInputDeliveryTestPayload = z.object({ inputs: z.record(z.string(), z.unknown()).optional(), }) +/** + * EmptyObjectResponse + */ +export const zEmptyObjectResponse = z.record(z.string(), z.unknown()) + /** * DraftWorkflowNodeRunPayload */ @@ -546,6 +645,11 @@ export const zDraftWorkflowRunPayload = z.object({ start_node_id: z.string(), }) +/** + * EventStreamResponse + */ +export const zEventStreamResponse = z.string() + export const zDraftWorkflowTriggerRunRequest = z.object({ node_id: z.string(), }) @@ -566,7 +670,16 @@ export const zWorkflowDraftVariable = z.object({ name: z.string().optional(), selector: z.array(z.string()).optional(), type: z.string().optional(), - value: z.record(z.string(), z.unknown()).optional(), + value: z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullish(), value_type: z.string().optional(), visible: z.boolean().optional(), }) @@ -592,6 +705,14 @@ export const zPublishWorkflowPayload = z.object({ knowledge_base_setting: z.record(z.string(), z.unknown()).nullish(), }) +/** + * WorkflowPublishResponse + */ +export const zWorkflowPublishResponse = z.object({ + created_at: z.int(), + result: z.string(), +}) + /** * WebhookTriggerResponse */ @@ -612,6 +733,15 @@ export const zWorkflowUpdatePayload = z.object({ marked_name: z.string().max(20).nullish(), }) +/** + * WorkflowRestoreResponse + */ +export const zWorkflowRestoreResponse = z.object({ + hash: z.string(), + result: z.string(), + updated_at: z.int(), +}) + /** * ApiKeyItem */ @@ -689,7 +819,21 @@ export const zTag = z.object({ type: z.string(), }) -export const zJsonValue = z.unknown() +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue /** * WorkflowPartial @@ -733,28 +877,20 @@ export const zDeletedTool = z.object({ * Site */ export const zSite = z.object({ - app_base_url: z.string().nullish(), chat_color_theme: z.string().nullish(), - chat_color_theme_inverted: z.boolean().nullish(), - code: z.string().nullish(), + chat_color_theme_inverted: z.boolean(), copyright: z.string().nullish(), - created_at: z.int().nullish(), - created_by: z.string().nullish(), custom_disclaimer: z.string().nullish(), - customize_domain: z.string().nullish(), - customize_token_strategy: z.string().nullish(), - default_language: z.string().nullish(), + default_language: z.string(), description: z.string().nullish(), icon: z.string().nullish(), icon_background: z.string().nullish(), - icon_type: z.union([z.string(), zIconType]).nullish(), + icon_type: z.string().nullish(), + icon_url: z.string().nullable(), privacy_policy: z.string().nullish(), - prompt_public: z.boolean().nullish(), - show_workflow_steps: z.boolean().nullish(), - title: z.string().nullish(), - updated_at: z.int().nullish(), - updated_by: z.string().nullish(), - use_icon_as_answer_icon: z.boolean().nullish(), + show_workflow_steps: z.boolean(), + title: z.string(), + use_icon_as_answer_icon: z.boolean(), }) /** @@ -917,15 +1053,46 @@ export const zSandboxUploadResponse = z.object({ path: z.string(), }) +/** + * AgentLogMetaResponse + */ +export const zAgentLogMetaResponse = z.object({ + agent_mode: z.string(), + elapsed_time: z.number().nullish(), + executor: z.string(), + iterations: z.int(), + start_time: z.string(), + status: z.string(), + total_tokens: z.int(), +}) + +/** + * AnnotationEmbeddingModelResponse + */ +export const zAnnotationEmbeddingModelResponse = z.object({ + embedding_model_name: z.string().nullish(), + embedding_provider_name: z.string().nullish(), +}) + +/** + * AnnotationSettingResponse + */ +export const zAnnotationSettingResponse = z.object({ + embedding_model: zAnnotationEmbeddingModelResponse.nullish(), + enabled: z.boolean(), + id: z.string().nullish(), + score_threshold: z.number().nullish(), +}) + /** * AnnotationHitHistory */ export const zAnnotationHitHistory = z.object({ - annotation_content: z.string().nullish(), - annotation_question: z.string().nullish(), created_at: z.int().nullish(), id: z.string(), + match: z.string().nullish(), question: z.string().nullish(), + response: z.string().nullish(), score: z.number().nullish(), source: z.string().nullish(), }) @@ -1027,6 +1194,128 @@ export const zAppMcpServerResponse = z.object({ updated_at: z.int().nullish(), }) +/** + * AverageResponseTimeStatisticItem + */ +export const zAverageResponseTimeStatisticItem = z.object({ + date: z.string(), + latency: z.number(), +}) + +/** + * AverageResponseTimeStatisticResponse + */ +export const zAverageResponseTimeStatisticResponse = z.object({ + data: z.array(zAverageResponseTimeStatisticItem), +}) + +/** + * AverageSessionInteractionStatisticItem + */ +export const zAverageSessionInteractionStatisticItem = z.object({ + date: z.string(), + interactions: z.number(), +}) + +/** + * AverageSessionInteractionStatisticResponse + */ +export const zAverageSessionInteractionStatisticResponse = z.object({ + data: z.array(zAverageSessionInteractionStatisticItem), +}) + +/** + * DailyConversationStatisticItem + */ +export const zDailyConversationStatisticItem = z.object({ + conversation_count: z.int(), + date: z.string(), +}) + +/** + * DailyConversationStatisticResponse + */ +export const zDailyConversationStatisticResponse = z.object({ + data: z.array(zDailyConversationStatisticItem), +}) + +/** + * DailyTerminalStatisticItem + */ +export const zDailyTerminalStatisticItem = z.object({ + date: z.string(), + terminal_count: z.int(), +}) + +/** + * DailyTerminalStatisticResponse + */ +export const zDailyTerminalStatisticResponse = z.object({ + data: z.array(zDailyTerminalStatisticItem), +}) + +/** + * DailyMessageStatisticItem + */ +export const zDailyMessageStatisticItem = z.object({ + date: z.string(), + message_count: z.int(), +}) + +/** + * DailyMessageStatisticResponse + */ +export const zDailyMessageStatisticResponse = z.object({ + data: z.array(zDailyMessageStatisticItem), +}) + +/** + * DailyTokenCostStatisticItem + */ +export const zDailyTokenCostStatisticItem = z.object({ + currency: z.string(), + date: z.string(), + token_count: z.int(), + total_price: z.union([z.string(), z.number()]), +}) + +/** + * DailyTokenCostStatisticResponse + */ +export const zDailyTokenCostStatisticResponse = z.object({ + data: z.array(zDailyTokenCostStatisticItem), +}) + +/** + * TokensPerSecondStatisticItem + */ +export const zTokensPerSecondStatisticItem = z.object({ + date: z.string(), + tps: z.number(), +}) + +/** + * TokensPerSecondStatisticResponse + */ +export const zTokensPerSecondStatisticResponse = z.object({ + data: z.array(zTokensPerSecondStatisticItem), +}) + +/** + * UserSatisfactionRateStatisticItem + */ +export const zUserSatisfactionRateStatisticItem = z.object({ + date: z.string(), + rate: z.number(), +}) + +/** + * UserSatisfactionRateStatisticResponse + */ +export const zUserSatisfactionRateStatisticResponse = z.object({ + data: z.array(zUserSatisfactionRateStatisticItem), +}) + /** * SimpleAccount */ @@ -1317,6 +1606,66 @@ export const zWorkflowCommentDetail = z.object({ updated_at: z.int().nullish(), }) +/** + * WorkflowAverageAppInteractionStatisticItem + */ +export const zWorkflowAverageAppInteractionStatisticItem = z.object({ + date: z.string(), + interactions: z.number(), +}) + +/** + * WorkflowAverageAppInteractionStatisticResponse + */ +export const zWorkflowAverageAppInteractionStatisticResponse = z.object({ + data: z.array(zWorkflowAverageAppInteractionStatisticItem), +}) + +/** + * WorkflowDailyRunsStatisticItem + */ +export const zWorkflowDailyRunsStatisticItem = z.object({ + date: z.string(), + runs: z.int(), +}) + +/** + * WorkflowDailyRunsStatisticResponse + */ +export const zWorkflowDailyRunsStatisticResponse = z.object({ + data: z.array(zWorkflowDailyRunsStatisticItem), +}) + +/** + * WorkflowDailyTerminalsStatisticItem + */ +export const zWorkflowDailyTerminalsStatisticItem = z.object({ + date: z.string(), + terminal_count: z.int(), +}) + +/** + * WorkflowDailyTerminalsStatisticResponse + */ +export const zWorkflowDailyTerminalsStatisticResponse = z.object({ + data: z.array(zWorkflowDailyTerminalsStatisticItem), +}) + +/** + * WorkflowDailyTokenCostStatisticItem + */ +export const zWorkflowDailyTokenCostStatisticItem = z.object({ + date: z.string(), + token_count: z.int(), +}) + +/** + * WorkflowDailyTokenCostStatisticResponse + */ +export const zWorkflowDailyTokenCostStatisticResponse = z.object({ + data: z.array(zWorkflowDailyTokenCostStatisticItem), +}) + /** * WorkflowConversationVariableResponse */ @@ -1324,7 +1673,7 @@ export const zWorkflowConversationVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -1335,7 +1684,7 @@ export const zWorkflowEnvironmentVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -1347,7 +1696,7 @@ export const zPipelineVariableResponse = z.object({ 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(), + default_value: z.unknown().optional(), label: z.string(), max_length: z.int().nullish(), options: z.array(z.string()).nullish(), @@ -1390,6 +1739,29 @@ export const zWorkflowPaginationResponse = z.object({ page: z.int(), }) +/** + * EnvironmentVariableItemResponse + */ +export const zEnvironmentVariableItemResponse = z.object({ + description: z.string().nullish(), + editable: z.boolean(), + edited: z.boolean(), + id: z.string(), + name: z.string(), + selector: z.array(z.string()), + type: z.string(), + value: z.unknown(), + value_type: z.string(), + visible: z.boolean(), +}) + +/** + * EnvironmentVariableListResponse + */ +export const zEnvironmentVariableListResponse = z.object({ + items: z.array(zEnvironmentVariableItemResponse), +}) + /** * AgentComposerSoulLockResponse */ @@ -1489,7 +1861,7 @@ export const zWorkflowDraftVariableWithoutValue = z.object({ export const zWorkflowDraftVariableListWithoutValue = z.object({ items: z.array(zWorkflowDraftVariableWithoutValue).optional(), - total: z.record(z.string(), z.unknown()).optional(), + total: z.int().optional(), }) /** @@ -1858,6 +2230,42 @@ export const zAgentComposerFileCandidateResponse = z.object({ url: z.string().nullish(), }) +/** + * AgentToolCallResponse + */ +export const zAgentToolCallResponse = z.object({ + error: z.string().nullish(), + status: z.string(), + time_cost: z.union([z.number(), z.int()]), + tool_icon: z.unknown().optional(), + tool_input: z.record(z.string(), z.unknown()), + tool_label: z.string(), + tool_name: z.string(), + tool_output: z.record(z.string(), z.unknown()), + tool_parameters: z.record(z.string(), z.unknown()), +}) + +/** + * AgentIterationLogResponse + */ +export const zAgentIterationLogResponse = z.object({ + created_at: z.string(), + files: z.array(z.unknown()).optional(), + thought: z.string().nullish(), + tokens: z.int(), + tool_calls: z.array(zAgentToolCallResponse), + tool_raw: z.record(z.string(), z.unknown()), +}) + +/** + * AgentLogResponse + */ +export const zAgentLogResponse = z.object({ + files: z.array(z.unknown()).optional(), + iterations: z.array(zAgentIterationLogResponse), + meta: zAgentLogMetaResponse, +}) + /** * SimpleModelConfig */ @@ -2932,6 +3340,60 @@ export const zMessageInfiniteScrollPaginationResponse = z.object({ limit: z.int(), }) +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponseWritable = zJsonValue + +/** + * Site + */ +export const zSiteWritable = z.object({ + chat_color_theme: z.string().nullish(), + chat_color_theme_inverted: z.boolean(), + copyright: z.string().nullish(), + custom_disclaimer: z.string().nullish(), + default_language: z.string(), + description: z.string().nullish(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + icon_type: z.string().nullish(), + privacy_policy: z.string().nullish(), + show_workflow_steps: z.boolean(), + title: z.string(), + use_icon_as_answer_icon: z.boolean(), +}) + +/** + * AppDetailWithSite + */ +export const zAppDetailWithSiteWritable = z.object({ + access_mode: z.string().nullish(), + api_base_url: z.string().nullish(), + app_model_config: zModelConfig.nullish(), + bound_agent_id: z.string().nullish(), + created_at: z.int().nullish(), + created_by: z.string().nullish(), + deleted_tools: z.array(zDeletedTool).optional(), + description: z.string().nullish(), + enable_api: z.boolean(), + enable_site: z.boolean(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + icon_type: z.string().nullish(), + id: z.string(), + max_active_requests: z.int().nullish(), + mode_compatible_with_agent: z.string(), + name: z.string(), + site: zSiteWritable.nullish(), + tags: z.array(zTag).optional(), + tracing: zJsonValue.nullish(), + updated_at: z.int().nullish(), + updated_by: z.string().nullish(), + use_icon_as_answer_icon: z.boolean().nullish(), + workflow: zWorkflowPartial.nullish(), +}) + /** * WorkflowCommentAccount */ @@ -3146,10 +3608,10 @@ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFo }) /** - * Success + * Human input form preview */ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse - = z.record(z.string(), z.unknown()) + = zHumanInputFormPreviewResponse export const zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunBody = zHumanInputFormSubmitPayload @@ -3161,10 +3623,10 @@ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFo }) /** - * Success + * Human input form submission result */ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse - = z.record(z.string(), z.unknown()) + = zHumanInputFormSubmitResponse export const zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunBody = zIterationNodeRunPayload @@ -3177,10 +3639,8 @@ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRun /** * Iteration node run started successfully */ -export const zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponse + = zGeneratedAppResponse export const zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunBody = zLoopNodeRunPayload @@ -3193,10 +3653,8 @@ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunPath /** * Loop node run started successfully */ -export const zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponse + = zGeneratedAppResponse export const zPostAppsByAppIdAdvancedChatWorkflowsDraftRunBody = zAdvancedChatWorkflowRunPayload @@ -3207,10 +3665,7 @@ export const zPostAppsByAppIdAdvancedChatWorkflowsDraftRunPath = z.object({ /** * Workflow run started successfully */ -export const zPostAppsByAppIdAdvancedChatWorkflowsDraftRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdAdvancedChatWorkflowsDraftRunResponse = zGeneratedAppResponse export const zGetAppsByAppIdAgentComposerPath = z.object({ app_id: z.string(), @@ -3323,7 +3778,7 @@ export const zGetAppsByAppIdAgentLogsQuery = z.object({ /** * Agent logs retrieved successfully */ -export const zGetAppsByAppIdAgentLogsResponse = z.array(z.record(z.string(), z.unknown())) +export const zGetAppsByAppIdAgentLogsResponse = zAgentLogResponse export const zPostAppsByAppIdAgentSkillsStandardizePath = z.object({ app_id: z.string(), @@ -3332,7 +3787,7 @@ export const zPostAppsByAppIdAgentSkillsStandardizePath = z.object({ /** * Skill standardized into drive */ -export const zPostAppsByAppIdAgentSkillsStandardizeResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdAgentSkillsStandardizeResponse = zAgentSkillStandardizeResponse export const zPostAppsByAppIdAgentSkillsUploadPath = z.object({ app_id: z.string(), @@ -3341,7 +3796,7 @@ export const zPostAppsByAppIdAgentSkillsUploadPath = z.object({ /** * Skill validated */ -export const zPostAppsByAppIdAgentSkillsUploadResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdAgentSkillsUploadResponse = zAgentSkillUploadResponse export const zPostAppsByAppIdAnnotationReplyByActionBody = zAnnotationReplyPayload @@ -3353,7 +3808,7 @@ export const zPostAppsByAppIdAnnotationReplyByActionPath = z.object({ /** * Action completed successfully */ -export const zPostAppsByAppIdAnnotationReplyByActionResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdAnnotationReplyByActionResponse = zAnnotationJobStatusResponse export const zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdPath = z.object({ action: z.string(), @@ -3364,10 +3819,8 @@ export const zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdPath = z.object( /** * Job status retrieved successfully */ -export const zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponse + = zAnnotationJobStatusResponse export const zGetAppsByAppIdAnnotationSettingPath = z.object({ app_id: z.string(), @@ -3376,7 +3829,7 @@ export const zGetAppsByAppIdAnnotationSettingPath = z.object({ /** * Annotation settings retrieved successfully */ -export const zGetAppsByAppIdAnnotationSettingResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdAnnotationSettingResponse = zAnnotationSettingResponse export const zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdBody = zAnnotationSettingUpdatePayload @@ -3389,19 +3842,17 @@ export const zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdPath = z.obj /** * Settings updated successfully */ -export const zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponse + = zAnnotationSettingResponse export const zDeleteAppsByAppIdAnnotationsPath = z.object({ app_id: z.string(), }) /** - * Success + * Annotations deleted successfully */ -export const zDeleteAppsByAppIdAnnotationsResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdAnnotationsResponse = z.void() export const zGetAppsByAppIdAnnotationsPath = z.object({ app_id: z.string(), @@ -3416,7 +3867,7 @@ export const zGetAppsByAppIdAnnotationsQuery = z.object({ /** * Annotations retrieved successfully */ -export const zGetAppsByAppIdAnnotationsResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdAnnotationsResponse = zAnnotationList export const zPostAppsByAppIdAnnotationsBody = zCreateAnnotationPayload @@ -3436,7 +3887,7 @@ export const zPostAppsByAppIdAnnotationsBatchImportPath = z.object({ /** * Batch import started successfully */ -export const zPostAppsByAppIdAnnotationsBatchImportResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdAnnotationsBatchImportResponse = zAnnotationJobStatusResponse export const zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdPath = z.object({ app_id: z.string(), @@ -3446,10 +3897,8 @@ export const zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdPath = z.object({ /** * Job status retrieved successfully */ -export const zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponse + = zAnnotationJobStatusResponse export const zGetAppsByAppIdAnnotationsCountPath = z.object({ app_id: z.string(), @@ -3475,9 +3924,9 @@ export const zDeleteAppsByAppIdAnnotationsByAnnotationIdPath = z.object({ }) /** - * Success + * Annotation deleted successfully */ -export const zDeleteAppsByAppIdAnnotationsByAnnotationIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdAnnotationsByAnnotationIdResponse = z.void() export const zPostAppsByAppIdAnnotationsByAnnotationIdBody = zUpdateAnnotationPayload @@ -3650,7 +4099,7 @@ export const zPostAppsByAppIdCompletionMessagesPath = z.object({ /** * Completion generated successfully */ -export const zPostAppsByAppIdCompletionMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdCompletionMessagesResponse = zGeneratedAppResponse export const zPostAppsByAppIdCompletionMessagesByTaskIdStopPath = z.object({ app_id: z.string(), @@ -3738,7 +4187,7 @@ export const zGetAppsByAppIdFeedbacksExportQuery = z.object({ /** * Feedback data exported successfully */ -export const zGetAppsByAppIdFeedbacksExportResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdFeedbacksExportResponse = zTextFileResponse export const zPostAppsByAppIdIconBody = zAppIconPayload @@ -3749,7 +4198,7 @@ export const zPostAppsByAppIdIconPath = z.object({ /** * Icon updated successfully */ -export const zPostAppsByAppIdIconResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdIconResponse = zAppDetail export const zGetAppsByAppIdMessagesByMessageIdPath = z.object({ app_id: z.string(), @@ -3770,7 +4219,7 @@ export const zPostAppsByAppIdModelConfigPath = z.object({ /** * Model configuration updated successfully */ -export const zPostAppsByAppIdModelConfigResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdModelConfigResponse = zSimpleResultResponse export const zPostAppsByAppIdNameBody = zAppNamePayload @@ -3866,9 +4315,8 @@ export const zGetAppsByAppIdStatisticsAverageResponseTimeQuery = z.object({ /** * Average response time statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsAverageResponseTimeResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsAverageResponseTimeResponse + = zAverageResponseTimeStatisticResponse export const zGetAppsByAppIdStatisticsAverageSessionInteractionsPath = z.object({ app_id: z.string(), @@ -3882,9 +4330,8 @@ export const zGetAppsByAppIdStatisticsAverageSessionInteractionsQuery = z.object /** * Average session interaction statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsAverageSessionInteractionsResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsAverageSessionInteractionsResponse + = zAverageSessionInteractionStatisticResponse export const zGetAppsByAppIdStatisticsDailyConversationsPath = z.object({ app_id: z.string(), @@ -3898,9 +4345,8 @@ export const zGetAppsByAppIdStatisticsDailyConversationsQuery = z.object({ /** * Daily conversation statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsDailyConversationsResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsDailyConversationsResponse + = zDailyConversationStatisticResponse export const zGetAppsByAppIdStatisticsDailyEndUsersPath = z.object({ app_id: z.string(), @@ -3914,9 +4360,7 @@ export const zGetAppsByAppIdStatisticsDailyEndUsersQuery = z.object({ /** * Daily terminal statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsDailyEndUsersResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsDailyEndUsersResponse = zDailyTerminalStatisticResponse export const zGetAppsByAppIdStatisticsDailyMessagesPath = z.object({ app_id: z.string(), @@ -3930,9 +4374,7 @@ export const zGetAppsByAppIdStatisticsDailyMessagesQuery = z.object({ /** * Daily message statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsDailyMessagesResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsDailyMessagesResponse = zDailyMessageStatisticResponse export const zGetAppsByAppIdStatisticsTokenCostsPath = z.object({ app_id: z.string(), @@ -3946,9 +4388,7 @@ export const zGetAppsByAppIdStatisticsTokenCostsQuery = z.object({ /** * Daily token cost statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsTokenCostsResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsTokenCostsResponse = zDailyTokenCostStatisticResponse export const zGetAppsByAppIdStatisticsTokensPerSecondPath = z.object({ app_id: z.string(), @@ -3962,9 +4402,7 @@ export const zGetAppsByAppIdStatisticsTokensPerSecondQuery = z.object({ /** * Tokens per second statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsTokensPerSecondResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsTokensPerSecondResponse = zTokensPerSecondStatisticResponse export const zGetAppsByAppIdStatisticsUserSatisfactionRatePath = z.object({ app_id: z.string(), @@ -3978,9 +4416,8 @@ export const zGetAppsByAppIdStatisticsUserSatisfactionRateQuery = z.object({ /** * User satisfaction rate statistics retrieved successfully */ -export const zGetAppsByAppIdStatisticsUserSatisfactionRateResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetAppsByAppIdStatisticsUserSatisfactionRateResponse + = zUserSatisfactionRateStatisticResponse export const zPostAppsByAppIdTextToAudioBody = zTextToSpeechPayload @@ -3991,7 +4428,7 @@ export const zPostAppsByAppIdTextToAudioPath = z.object({ /** * Text to speech conversion successful */ -export const zPostAppsByAppIdTextToAudioResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdTextToAudioResponse = zAudioBinaryResponse export const zGetAppsByAppIdTextToAudioVoicesPath = z.object({ app_id: z.string(), @@ -4004,7 +4441,7 @@ export const zGetAppsByAppIdTextToAudioVoicesQuery = z.object({ /** * TTS voices retrieved successfully */ -export const zGetAppsByAppIdTextToAudioVoicesResponse = z.array(z.record(z.string(), z.unknown())) +export const zGetAppsByAppIdTextToAudioVoicesResponse = zTextToSpeechVoiceListResponse export const zGetAppsByAppIdTracePath = z.object({ app_id: z.string(), @@ -4013,7 +4450,7 @@ export const zGetAppsByAppIdTracePath = z.object({ /** * Trace configuration retrieved successfully */ -export const zGetAppsByAppIdTraceResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdTraceResponse = zAppTraceResponse export const zPostAppsByAppIdTraceBody = zAppTracePayload @@ -4026,12 +4463,14 @@ export const zPostAppsByAppIdTracePath = z.object({ */ export const zPostAppsByAppIdTraceResponse = zSimpleResultResponse -export const zDeleteAppsByAppIdTraceConfigBody = zTraceProviderQuery - export const zDeleteAppsByAppIdTraceConfigPath = z.object({ app_id: z.string(), }) +export const zDeleteAppsByAppIdTraceConfigQuery = z.object({ + tracing_provider: z.string(), +}) + /** * Tracing configuration deleted successfully */ @@ -4046,9 +4485,9 @@ export const zGetAppsByAppIdTraceConfigQuery = z.object({ }) /** - * Tracing configuration data + * Tracing configuration retrieved successfully */ -export const zGetAppsByAppIdTraceConfigResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdTraceConfigResponse = zTraceAppConfigResponse export const zPatchAppsByAppIdTraceConfigBody = zTraceConfigPayload @@ -4057,9 +4496,9 @@ export const zPatchAppsByAppIdTraceConfigPath = z.object({ }) /** - * Success response + * Tracing configuration updated successfully */ -export const zPatchAppsByAppIdTraceConfigResponse = z.record(z.string(), z.unknown()) +export const zPatchAppsByAppIdTraceConfigResponse = zTraceAppConfigResponse export const zPostAppsByAppIdTraceConfigBody = zTraceConfigPayload @@ -4068,9 +4507,9 @@ export const zPostAppsByAppIdTraceConfigPath = z.object({ }) /** - * Created configuration data + * Tracing configuration created successfully */ -export const zPostAppsByAppIdTraceConfigResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdTraceConfigResponse = zTraceAppConfigResponse export const zPostAppsByAppIdTriggerEnableBody = zParserEnable @@ -4387,10 +4826,8 @@ export const zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsQuery = z.ob /** * Average app interaction statistics retrieved successfully */ -export const zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponse + = zWorkflowAverageAppInteractionStatisticResponse export const zGetAppsByAppIdWorkflowStatisticsDailyConversationsPath = z.object({ app_id: z.string(), @@ -4404,10 +4841,8 @@ export const zGetAppsByAppIdWorkflowStatisticsDailyConversationsQuery = z.object /** * Daily runs statistics retrieved successfully */ -export const zGetAppsByAppIdWorkflowStatisticsDailyConversationsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowStatisticsDailyConversationsResponse + = zWorkflowDailyRunsStatisticResponse export const zGetAppsByAppIdWorkflowStatisticsDailyTerminalsPath = z.object({ app_id: z.string(), @@ -4421,10 +4856,8 @@ export const zGetAppsByAppIdWorkflowStatisticsDailyTerminalsQuery = z.object({ /** * Daily terminals statistics retrieved successfully */ -export const zGetAppsByAppIdWorkflowStatisticsDailyTerminalsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowStatisticsDailyTerminalsResponse + = zWorkflowDailyTerminalsStatisticResponse export const zGetAppsByAppIdWorkflowStatisticsTokenCostsPath = z.object({ app_id: z.string(), @@ -4438,7 +4871,8 @@ export const zGetAppsByAppIdWorkflowStatisticsTokenCostsQuery = z.object({ /** * Daily token cost statistics retrieved successfully */ -export const zGetAppsByAppIdWorkflowStatisticsTokenCostsResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdWorkflowStatisticsTokenCostsResponse + = zWorkflowDailyTokenCostStatisticResponse export const zGetAppsByAppIdWorkflowsPath = z.object({ app_id: z.string(), @@ -4463,10 +4897,8 @@ export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsPath = z.object( /** * Default block configurations retrieved successfully */ -export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponse + = zDefaultBlockConfigsResponse export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath = z.object({ app_id: z.string(), @@ -4480,10 +4912,8 @@ export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery /** * Default block configuration retrieved successfully */ -export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse + = zDefaultBlockConfigResponse export const zGetAppsByAppIdWorkflowsDraftPath = z.object({ app_id: z.string(), @@ -4524,10 +4954,7 @@ export const zPostAppsByAppIdWorkflowsDraftConversationVariablesPath = z.object( /** * Conversation variables updated successfully */ -export const zPostAppsByAppIdWorkflowsDraftConversationVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftConversationVariablesResponse = zSimpleResultResponse export const zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesPath = z.object({ app_id: z.string(), @@ -4536,10 +4963,8 @@ export const zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesPath = z.object({ /** * Environment variables retrieved successfully */ -export const zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse + = zEnvironmentVariableListResponse export const zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesBody = zEnvironmentVariableUpdatePayload @@ -4551,10 +4976,7 @@ export const zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesPath = z.object({ /** * Environment variables updated successfully */ -export const zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse = zSimpleResultResponse export const zPostAppsByAppIdWorkflowsDraftFeaturesBody = zWorkflowFeaturesPayload @@ -4576,12 +4998,10 @@ export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestPa }) /** - * Success + * Human input delivery test result */ -export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponse + = zEmptyObjectResponse export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewBody = zHumanInputFormPreviewPayload @@ -4592,12 +5012,10 @@ export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewPat }) /** - * Success + * Human input form preview */ -export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse + = zHumanInputFormPreviewResponse export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunBody = zHumanInputFormSubmitPayload @@ -4608,12 +5026,10 @@ export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunPath = }) /** - * Success + * Human input form submission result */ -export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse + = zHumanInputFormSubmitResponse export const zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunBody = zIterationNodeRunPayload @@ -4625,10 +5041,7 @@ export const zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunPath = z.obj /** * Workflow iteration node run started successfully */ -export const zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponse = zGeneratedAppResponse export const zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunBody = zLoopNodeRunPayload @@ -4640,10 +5053,7 @@ export const zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunPath = z.object({ /** * Workflow loop node run started successfully */ -export const zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponse = zGeneratedAppResponse export const zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerPath = z.object({ app_id: z.string(), @@ -4754,10 +5164,7 @@ export const zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunPath = z.objec /** * Trigger event received and node executed successfully */ -export const zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse = zGeneratedAppResponse export const zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath = z.object({ app_id: z.string(), @@ -4789,7 +5196,7 @@ export const zPostAppsByAppIdWorkflowsDraftRunPath = z.object({ /** * Draft workflow run started successfully */ -export const zPostAppsByAppIdWorkflowsDraftRunResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdWorkflowsDraftRunResponse = zGeneratedAppResponse export const zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsPath = z.object({ app_id: z.string(), @@ -4809,10 +5216,8 @@ export const zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsPath = z.o /** * Workflow run node output event stream */ -export const zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponse + = zEventStreamResponse export const zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdPath = z.object({ app_id: z.string(), @@ -4857,7 +5262,7 @@ export const zPostAppsByAppIdWorkflowsDraftTriggerRunPath = z.object({ /** * Trigger event received and workflow executed successfully */ -export const zPostAppsByAppIdWorkflowsDraftTriggerRunResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdWorkflowsDraftTriggerRunResponse = zGeneratedAppResponse export const zPostAppsByAppIdWorkflowsDraftTriggerRunAllBody = zDraftWorkflowTriggerRunAllPayload @@ -4868,7 +5273,7 @@ export const zPostAppsByAppIdWorkflowsDraftTriggerRunAllPath = z.object({ /** * Workflow executed successfully */ -export const zPostAppsByAppIdWorkflowsDraftTriggerRunAllResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdWorkflowsDraftTriggerRunAllResponse = zGeneratedAppResponse export const zDeleteAppsByAppIdWorkflowsDraftVariablesPath = z.object({ app_id: z.string(), @@ -4952,9 +5357,9 @@ export const zPostAppsByAppIdWorkflowsPublishPath = z.object({ }) /** - * Success + * Workflow published successfully */ -export const zPostAppsByAppIdWorkflowsPublishResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdWorkflowsPublishResponse = zWorkflowPublishResponse export const zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsPath = z.object({ app_id: z.string(), @@ -4975,10 +5380,8 @@ export const zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsPath = /** * Workflow run node output event stream */ -export const zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponse + = zEventStreamResponse export const zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdPath = z.object({ app_id: z.string(), @@ -5025,9 +5428,9 @@ export const zDeleteAppsByAppIdWorkflowsByWorkflowIdPath = z.object({ }) /** - * Success + * Workflow deleted successfully */ -export const zDeleteAppsByAppIdWorkflowsByWorkflowIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteAppsByAppIdWorkflowsByWorkflowIdResponse = z.void() export const zPatchAppsByAppIdWorkflowsByWorkflowIdBody = zWorkflowUpdatePayload @@ -5049,10 +5452,7 @@ export const zPostAppsByAppIdWorkflowsByWorkflowIdRestorePath = z.object({ /** * Workflow restored successfully */ -export const zPostAppsByAppIdWorkflowsByWorkflowIdRestoreResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAppsByAppIdWorkflowsByWorkflowIdRestoreResponse = zWorkflowRestoreResponse export const zGetAppsByResourceIdApiKeysPath = z.object({ resource_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 bc2f9fc410..7acf024d4e 100644 --- a/packages/contracts/generated/api/console/auth/orpc.gen.ts +++ b/packages/contracts/generated/api/console/auth/orpc.gen.ts @@ -30,16 +30,8 @@ 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', @@ -52,16 +44,8 @@ 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', @@ -85,16 +69,8 @@ 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', @@ -154,20 +130,13 @@ 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', path: '/auth/plugin/datasource/{provider_id}/update', + successStatus: 201, tags: ['console'], }) .input( @@ -202,16 +171,8 @@ 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', @@ -221,16 +182,8 @@ 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/auth/types.gen.ts b/packages/contracts/generated/api/console/auth/types.gen.ts index 73b5064fa9..99a06128e1 100644 --- a/packages/contracts/generated/api/console/auth/types.gen.ts +++ b/packages/contracts/generated/api/console/auth/types.gen.ts @@ -4,6 +4,10 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type DatasourceCredentialsResponse = { + result: unknown +} + export type DatasourceCredentialPayload = { credentials: { [key: string]: unknown @@ -51,9 +55,7 @@ export type GetAuthPluginDatasourceDefaultListData = { } export type GetAuthPluginDatasourceDefaultListResponses = { - 200: { - [key: string]: unknown - } + 200: DatasourceCredentialsResponse } export type GetAuthPluginDatasourceDefaultListResponse @@ -67,9 +69,7 @@ export type GetAuthPluginDatasourceListData = { } export type GetAuthPluginDatasourceListResponses = { - 200: { - [key: string]: unknown - } + 200: DatasourceCredentialsResponse } export type GetAuthPluginDatasourceListResponse @@ -85,9 +85,7 @@ export type GetAuthPluginDatasourceByProviderIdData = { } export type GetAuthPluginDatasourceByProviderIdResponses = { - 200: { - [key: string]: unknown - } + 200: DatasourceCredentialsResponse } export type GetAuthPluginDatasourceByProviderIdResponse @@ -103,9 +101,7 @@ export type PostAuthPluginDatasourceByProviderIdData = { } export type PostAuthPluginDatasourceByProviderIdResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostAuthPluginDatasourceByProviderIdResponse @@ -137,9 +133,7 @@ export type PostAuthPluginDatasourceByProviderIdCustomClientData = { } export type PostAuthPluginDatasourceByProviderIdCustomClientResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostAuthPluginDatasourceByProviderIdCustomClientResponse @@ -187,9 +181,7 @@ export type PostAuthPluginDatasourceByProviderIdUpdateData = { } export type PostAuthPluginDatasourceByProviderIdUpdateResponses = { - 200: { - [key: string]: unknown - } + 201: SimpleResultResponse } export type PostAuthPluginDatasourceByProviderIdUpdateResponse diff --git a/packages/contracts/generated/api/console/auth/zod.gen.ts b/packages/contracts/generated/api/console/auth/zod.gen.ts index 8248a9d858..3a0d3f38ff 100644 --- a/packages/contracts/generated/api/console/auth/zod.gen.ts +++ b/packages/contracts/generated/api/console/auth/zod.gen.ts @@ -2,6 +2,13 @@ import * as z from 'zod' +/** + * DatasourceCredentialsResponse + */ +export const zDatasourceCredentialsResponse = z.object({ + result: z.unknown(), +}) + /** * DatasourceCredentialPayload */ @@ -59,12 +66,12 @@ export const zDatasourceUpdateNamePayload = z.object({ /** * Success */ -export const zGetAuthPluginDatasourceDefaultListResponse = z.record(z.string(), z.unknown()) +export const zGetAuthPluginDatasourceDefaultListResponse = zDatasourceCredentialsResponse /** * Success */ -export const zGetAuthPluginDatasourceListResponse = z.record(z.string(), z.unknown()) +export const zGetAuthPluginDatasourceListResponse = zDatasourceCredentialsResponse export const zGetAuthPluginDatasourceByProviderIdPath = z.object({ provider_id: z.string(), @@ -73,7 +80,7 @@ export const zGetAuthPluginDatasourceByProviderIdPath = z.object({ /** * Success */ -export const zGetAuthPluginDatasourceByProviderIdResponse = z.record(z.string(), z.unknown()) +export const zGetAuthPluginDatasourceByProviderIdResponse = zDatasourceCredentialsResponse export const zPostAuthPluginDatasourceByProviderIdBody = zDatasourceCredentialPayload @@ -84,7 +91,7 @@ export const zPostAuthPluginDatasourceByProviderIdPath = z.object({ /** * Success */ -export const zPostAuthPluginDatasourceByProviderIdResponse = z.record(z.string(), z.unknown()) +export const zPostAuthPluginDatasourceByProviderIdResponse = zSimpleResultResponse export const zDeleteAuthPluginDatasourceByProviderIdCustomClientPath = z.object({ provider_id: z.string(), @@ -104,10 +111,7 @@ export const zPostAuthPluginDatasourceByProviderIdCustomClientPath = z.object({ /** * Success */ -export const zPostAuthPluginDatasourceByProviderIdCustomClientResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostAuthPluginDatasourceByProviderIdCustomClientResponse = zSimpleResultResponse export const zPostAuthPluginDatasourceByProviderIdDefaultBody = zDatasourceDefaultPayload @@ -140,7 +144,7 @@ export const zPostAuthPluginDatasourceByProviderIdUpdatePath = z.object({ /** * Success */ -export const zPostAuthPluginDatasourceByProviderIdUpdateResponse = z.record(z.string(), z.unknown()) +export const zPostAuthPluginDatasourceByProviderIdUpdateResponse = zSimpleResultResponse export const zPostAuthPluginDatasourceByProviderIdUpdateNameBody = zDatasourceUpdateNamePayload diff --git a/packages/contracts/generated/api/console/billing/orpc.gen.ts b/packages/contracts/generated/api/console/billing/orpc.gen.ts index 501f8a4e46..9abd8e8fe1 100644 --- a/packages/contracts/generated/api/console/billing/orpc.gen.ts +++ b/packages/contracts/generated/api/console/billing/orpc.gen.ts @@ -5,22 +5,15 @@ import * as z from 'zod' import { zGetBillingInvoicesResponse, + zGetBillingSubscriptionQuery, zGetBillingSubscriptionResponse, zPutBillingPartnersByPartnerKeyTenantsBody, zPutBillingPartnersByPartnerKeyTenantsPath, 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', @@ -35,16 +28,10 @@ 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({ - 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.', + description: 'Sync partner tenants bindings', inputStructure: 'detailed', method: 'PUT', operationId: 'putBillingPartnersByPartnerKeyTenants', @@ -71,22 +58,15 @@ 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', path: '/billing/subscription', tags: ['console'], }) + .input(z.object({ query: zGetBillingSubscriptionQuery })) .output(zGetBillingSubscriptionResponse) export const subscription = { diff --git a/packages/contracts/generated/api/console/billing/types.gen.ts b/packages/contracts/generated/api/console/billing/types.gen.ts index 7a9880c03e..ffcc9835b2 100644 --- a/packages/contracts/generated/api/console/billing/types.gen.ts +++ b/packages/contracts/generated/api/console/billing/types.gen.ts @@ -4,6 +4,10 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type BillingResponse = { + [key: string]: unknown +} + export type PartnerTenantsPayload = { click_id: string } @@ -16,9 +20,7 @@ export type GetBillingInvoicesData = { } export type GetBillingInvoicesResponses = { - 200: { - [key: string]: unknown - } + 200: BillingResponse } export type GetBillingInvoicesResponse @@ -34,18 +36,11 @@ export type PutBillingPartnersByPartnerKeyTenantsData = { } export type PutBillingPartnersByPartnerKeyTenantsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PutBillingPartnersByPartnerKeyTenantsError - = PutBillingPartnersByPartnerKeyTenantsErrors[keyof PutBillingPartnersByPartnerKeyTenantsErrors] - export type PutBillingPartnersByPartnerKeyTenantsResponses = { - 200: { - [key: string]: unknown - } + 200: BillingResponse } export type PutBillingPartnersByPartnerKeyTenantsResponse @@ -54,14 +49,15 @@ export type PutBillingPartnersByPartnerKeyTenantsResponse export type GetBillingSubscriptionData = { body?: never path?: never - query?: never + query: { + interval: 'month' | 'year' + plan: 'professional' | 'team' + } url: '/billing/subscription' } export type GetBillingSubscriptionResponses = { - 200: { - [key: string]: unknown - } + 200: BillingResponse } export type GetBillingSubscriptionResponse diff --git a/packages/contracts/generated/api/console/billing/zod.gen.ts b/packages/contracts/generated/api/console/billing/zod.gen.ts index 7b5412c7f4..3292612c04 100644 --- a/packages/contracts/generated/api/console/billing/zod.gen.ts +++ b/packages/contracts/generated/api/console/billing/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * BillingResponse + */ +export const zBillingResponse = z.record(z.string(), z.unknown()) + /** * PartnerTenantsPayload */ @@ -12,7 +17,7 @@ export const zPartnerTenantsPayload = z.object({ /** * Success */ -export const zGetBillingInvoicesResponse = z.record(z.string(), z.unknown()) +export const zGetBillingInvoicesResponse = zBillingResponse export const zPutBillingPartnersByPartnerKeyTenantsBody = zPartnerTenantsPayload @@ -23,9 +28,14 @@ export const zPutBillingPartnersByPartnerKeyTenantsPath = z.object({ /** * Tenants synced to partner successfully */ -export const zPutBillingPartnersByPartnerKeyTenantsResponse = z.record(z.string(), z.unknown()) +export const zPutBillingPartnersByPartnerKeyTenantsResponse = zBillingResponse + +export const zGetBillingSubscriptionQuery = z.object({ + interval: z.enum(['month', 'year']), + plan: z.enum(['professional', 'team']), +}) /** * Success */ -export const zGetBillingSubscriptionResponse = z.record(z.string(), z.unknown()) +export const zGetBillingSubscriptionResponse = zBillingResponse diff --git a/packages/contracts/generated/api/console/code-based-extension/orpc.gen.ts b/packages/contracts/generated/api/console/code-based-extension/orpc.gen.ts index b3baddafd4..f60e6e2c8b 100644 --- a/packages/contracts/generated/api/console/code-based-extension/orpc.gen.ts +++ b/packages/contracts/generated/api/console/code-based-extension/orpc.gen.ts @@ -17,7 +17,7 @@ export const get = oc path: '/code-based-extension', tags: ['console'], }) - .input(z.object({ query: zGetCodeBasedExtensionQuery.optional() })) + .input(z.object({ query: zGetCodeBasedExtensionQuery })) .output(zGetCodeBasedExtensionResponse) export const codeBasedExtension = { diff --git a/packages/contracts/generated/api/console/code-based-extension/types.gen.ts b/packages/contracts/generated/api/console/code-based-extension/types.gen.ts index 85d224f8d1..f6abfd3212 100644 --- a/packages/contracts/generated/api/console/code-based-extension/types.gen.ts +++ b/packages/contracts/generated/api/console/code-based-extension/types.gen.ts @@ -12,8 +12,8 @@ export type CodeBasedExtensionResponse = { export type GetCodeBasedExtensionData = { body?: never path?: never - query?: { - module?: string + query: { + module: string } url: '/code-based-extension' } diff --git a/packages/contracts/generated/api/console/code-based-extension/zod.gen.ts b/packages/contracts/generated/api/console/code-based-extension/zod.gen.ts index 3cd520cb97..4be7457624 100644 --- a/packages/contracts/generated/api/console/code-based-extension/zod.gen.ts +++ b/packages/contracts/generated/api/console/code-based-extension/zod.gen.ts @@ -11,7 +11,7 @@ export const zCodeBasedExtensionResponse = z.object({ }) export const zGetCodeBasedExtensionQuery = z.object({ - module: z.string().optional(), + module: z.string(), }) /** diff --git a/packages/contracts/generated/api/console/compliance/orpc.gen.ts b/packages/contracts/generated/api/console/compliance/orpc.gen.ts index ec7a9be60f..e68c87e7eb 100644 --- a/packages/contracts/generated/api/console/compliance/orpc.gen.ts +++ b/packages/contracts/generated/api/console/compliance/orpc.gen.ts @@ -7,16 +7,10 @@ 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({ - 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.', + description: 'Get compliance document download link', inputStructure: 'detailed', method: 'GET', operationId: 'getComplianceDownload', diff --git a/packages/contracts/generated/api/console/compliance/types.gen.ts b/packages/contracts/generated/api/console/compliance/types.gen.ts index 12ab2a82a8..71ffbba58d 100644 --- a/packages/contracts/generated/api/console/compliance/types.gen.ts +++ b/packages/contracts/generated/api/console/compliance/types.gen.ts @@ -4,6 +4,10 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type ComplianceDownloadResponse = { + [key: string]: unknown +} + export type GetComplianceDownloadData = { body?: never path?: never @@ -14,9 +18,7 @@ export type GetComplianceDownloadData = { } export type GetComplianceDownloadResponses = { - 200: { - [key: string]: unknown - } + 200: ComplianceDownloadResponse } export type GetComplianceDownloadResponse diff --git a/packages/contracts/generated/api/console/compliance/zod.gen.ts b/packages/contracts/generated/api/console/compliance/zod.gen.ts index 2d42e75fbc..167051fee8 100644 --- a/packages/contracts/generated/api/console/compliance/zod.gen.ts +++ b/packages/contracts/generated/api/console/compliance/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * ComplianceDownloadResponse + */ +export const zComplianceDownloadResponse = z.record(z.string(), z.unknown()) + export const zGetComplianceDownloadQuery = z.object({ doc_name: z.string(), }) @@ -9,4 +14,4 @@ export const zGetComplianceDownloadQuery = z.object({ /** * Success */ -export const zGetComplianceDownloadResponse = z.record(z.string(), z.unknown()) +export const zGetComplianceDownloadResponse = zComplianceDownloadResponse diff --git a/packages/contracts/generated/api/console/datasets/orpc.gen.ts b/packages/contracts/generated/api/console/datasets/orpc.gen.ts index 13ce55e275..a8b096168b 100644 --- a/packages/contracts/generated/api/console/datasets/orpc.gen.ts +++ b/packages/contracts/generated/api/console/datasets/orpc.gen.ts @@ -295,16 +295,10 @@ 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({ - 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.', + description: 'Create external knowledge dataset', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsExternal', @@ -352,16 +346,10 @@ 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({ - 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.', + description: 'Get external knowledge API template details', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsExternalKnowledgeApiByExternalKnowledgeApiId', @@ -371,16 +359,8 @@ 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', @@ -404,16 +384,10 @@ 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({ - 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.', + description: 'Get external knowledge API templates', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsExternalKnowledgeApi', @@ -423,20 +397,13 @@ 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', path: '/datasets/external-knowledge-api', + successStatus: 201, tags: ['console'], }) .input(z.object({ body: zPostDatasetsExternalKnowledgeApiBody })) @@ -450,16 +417,10 @@ 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({ - 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.', + description: 'Estimate dataset indexing cost', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsIndexingEstimate', @@ -475,16 +436,10 @@ 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({ - 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.', + description: 'Initialize dataset with documents', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsInit', @@ -517,16 +472,8 @@ 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 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', @@ -542,16 +489,10 @@ 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 get8 = oc .route({ - 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.', + description: 'Get dataset document processing rules', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsProcessRule', @@ -641,16 +582,8 @@ export const autoDisableLogs = { 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 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: 'getDatasetsByDatasetIdBatchByBatchIndexingEstimate', @@ -692,16 +625,10 @@ 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({ - 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.', + description: 'Download selected dataset documents as a single ZIP archive (upload-file only)', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip', @@ -817,16 +744,10 @@ 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 get15 = oc .route({ - 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.', + description: 'Estimate document indexing cost', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimate', @@ -902,16 +823,8 @@ 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 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: 'getDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLog', @@ -1272,16 +1185,11 @@ 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 get22 = 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\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatus', @@ -1329,16 +1237,10 @@ 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 get24 = oc .route({ - 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.', + description: 'Get document details', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId', @@ -1402,16 +1304,8 @@ export const get25 = 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', @@ -1458,16 +1352,10 @@ 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({ - 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.', + description: 'Test external knowledge retrieval for dataset', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdExternalHitTesting', @@ -1488,16 +1376,10 @@ 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({ - 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.', + description: 'Test dataset knowledge retrieval', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdHitTesting', @@ -1772,16 +1654,10 @@ export const get34 = 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({ - 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.', + description: 'Update dataset details', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetId', diff --git a/packages/contracts/generated/api/console/datasets/types.gen.ts b/packages/contracts/generated/api/console/datasets/types.gen.ts index 748bbac760..a24c6cf92a 100644 --- a/packages/contracts/generated/api/console/datasets/types.gen.ts +++ b/packages/contracts/generated/api/console/datasets/types.gen.ts @@ -100,9 +100,7 @@ export type DatasetDetail = { author_name?: string built_in_field_enabled?: boolean chunk_structure?: string - created_at?: { - [key: string]: unknown - } + created_at?: number created_by?: string data_source_type?: string description?: string @@ -130,13 +128,19 @@ export type DatasetDetail = { tags?: Array total_available_documents?: number total_documents?: number - updated_at?: { - [key: string]: unknown - } + updated_at?: number updated_by?: string word_count?: number } +export type ExternalKnowledgeApiListResponse = { + data: Array + has_more: boolean + limit: number + page: number + total: number +} + export type ExternalKnowledgeApiPayload = { name: string settings: { @@ -144,6 +148,19 @@ export type ExternalKnowledgeApiPayload = { } } +export type ExternalKnowledgeApiResponse = { + created_at: string + created_by: string + dataset_bindings?: Array + description: string + id: string + name: string + settings?: { + [key: string]: unknown + } | null + tenant_id: string +} + export type UsageCountResponse = { count: number is_using: boolean @@ -213,6 +230,10 @@ export type IndexingEstimate = { total_segments: number } +export type OpaqueObjectResponse = { + [key: string]: unknown +} + export type RetrievalSettingResponse = { retrieval_method: Array } @@ -308,6 +329,8 @@ export type DocumentBatchDownloadZipPayload = { document_ids: Array } +export type BinaryFileResponse = Blob | File + export type GenerateSummaryPayload = { document_list: Array } @@ -448,6 +471,14 @@ export type ExternalHitTestingPayload = { query: string } +export type ExternalRetrievalTestResponse + = | { + [key: string]: unknown + } + | Array<{ + [key: string]: unknown + }> + export type HitTestingPayload = { attachment_ids?: Array | null external_retrieval_model?: { @@ -648,6 +679,11 @@ export type Tag = { type: string } +export type ExternalKnowledgeDatasetBindingResponse = { + id: string + name: string +} + export type IndexingEstimatePreviewItemResponse = { child_chunks?: Array | null content: string @@ -1100,13 +1136,9 @@ export type PostDatasetsData = { } export type PostDatasetsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostDatasetsError = PostDatasetsErrors[keyof PostDatasetsErrors] - export type PostDatasetsResponses = { 201: DatasetDetailResponse } @@ -1149,13 +1181,9 @@ export type PostDatasetsApiKeysData = { } export type PostDatasetsApiKeysErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostDatasetsApiKeysError = PostDatasetsApiKeysErrors[keyof PostDatasetsApiKeysErrors] - export type PostDatasetsApiKeysResponses = { 200: ApiKeyItem } @@ -1219,16 +1247,10 @@ export type PostDatasetsExternalData = { } export type PostDatasetsExternalErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type PostDatasetsExternalError = PostDatasetsExternalErrors[keyof PostDatasetsExternalErrors] - export type PostDatasetsExternalResponses = { 201: DatasetDetail } @@ -1241,16 +1263,14 @@ export type GetDatasetsExternalKnowledgeApiData = { path?: never query?: { keyword?: string - limit?: string - page?: string + limit?: number + page?: number } url: '/datasets/external-knowledge-api' } export type GetDatasetsExternalKnowledgeApiResponses = { - 200: { - [key: string]: unknown - } + 200: ExternalKnowledgeApiListResponse } export type GetDatasetsExternalKnowledgeApiResponse @@ -1264,9 +1284,7 @@ export type PostDatasetsExternalKnowledgeApiData = { } export type PostDatasetsExternalKnowledgeApiResponses = { - 200: { - [key: string]: unknown - } + 201: ExternalKnowledgeApiResponse } export type PostDatasetsExternalKnowledgeApiResponse @@ -1298,18 +1316,11 @@ export type GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdData = { } export type GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdError - = GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdErrors[keyof GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdErrors] - export type GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponses = { - 200: { - [key: string]: unknown - } + 200: ExternalKnowledgeApiResponse } export type GetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse @@ -1325,9 +1336,7 @@ export type PatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdData = { } export type PatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponses = { - 200: { - [key: string]: unknown - } + 200: ExternalKnowledgeApiResponse } export type PatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse @@ -1371,13 +1380,9 @@ export type PostDatasetsInitData = { } export type PostDatasetsInitErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostDatasetsInitError = PostDatasetsInitErrors[keyof PostDatasetsInitErrors] - export type PostDatasetsInitResponses = { 201: DatasetAndDocumentResponse } @@ -1422,9 +1427,7 @@ export type GetDatasetsProcessRuleData = { } export type GetDatasetsProcessRuleResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsProcessRuleResponse @@ -1486,17 +1489,10 @@ export type GetDatasetsByDatasetIdData = { } export type GetDatasetsByDatasetIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetDatasetsByDatasetIdError - = GetDatasetsByDatasetIdErrors[keyof GetDatasetsByDatasetIdErrors] - export type GetDatasetsByDatasetIdResponses = { 200: DatasetDetailWithPartialMembersResponse } @@ -1514,17 +1510,10 @@ export type PatchDatasetsByDatasetIdData = { } export type PatchDatasetsByDatasetIdErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdError - = PatchDatasetsByDatasetIdErrors[keyof PatchDatasetsByDatasetIdErrors] - export type PatchDatasetsByDatasetIdResponses = { 200: DatasetDetailWithPartialMembersResponse } @@ -1559,14 +1548,9 @@ export type GetDatasetsByDatasetIdAutoDisableLogsData = { } export type GetDatasetsByDatasetIdAutoDisableLogsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsByDatasetIdAutoDisableLogsError - = GetDatasetsByDatasetIdAutoDisableLogsErrors[keyof GetDatasetsByDatasetIdAutoDisableLogsErrors] - export type GetDatasetsByDatasetIdAutoDisableLogsResponses = { 200: AutoDisableLogsResponse } @@ -1585,9 +1569,7 @@ export type GetDatasetsByDatasetIdBatchByBatchIndexingEstimateData = { } export type GetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse @@ -1675,9 +1657,7 @@ export type PostDatasetsByDatasetIdDocumentsDownloadZipData = { } export type PostDatasetsByDatasetIdDocumentsDownloadZipResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type PostDatasetsByDatasetIdDocumentsDownloadZipResponse @@ -1693,20 +1673,11 @@ export type PostDatasetsByDatasetIdDocumentsGenerateSummaryData = { } export type PostDatasetsByDatasetIdDocumentsGenerateSummaryErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 403: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsGenerateSummaryError - = PostDatasetsByDatasetIdDocumentsGenerateSummaryErrors[keyof PostDatasetsByDatasetIdDocumentsGenerateSummaryErrors] - export type PostDatasetsByDatasetIdDocumentsGenerateSummaryResponses = { 200: SimpleResultResponse } @@ -1777,18 +1748,11 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdError - = GetDatasetsByDatasetIdDocumentsByDocumentIdErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsByDatasetIdDocumentsByDocumentIdResponse @@ -1822,21 +1786,12 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateError - = GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateResponse @@ -1853,14 +1808,9 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusError - = GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusResponses = { 200: DocumentStatusResponse } @@ -1879,17 +1829,10 @@ export type PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataData = { } export type PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataError - = PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataErrors[keyof PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataErrors] - export type PutDatasetsByDatasetIdDocumentsByDocumentIdMetadataResponses = { 200: SimpleResultMessageResponse } @@ -1925,9 +1868,7 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogData } export type GetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogResponse @@ -1979,17 +1920,10 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionData } export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionError - = PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionErrors[keyof PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionErrors] - export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionResponses = { 200: SimpleResultResponse } @@ -2275,18 +2209,11 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusError - = GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusResponses = { - 200: { - [key: string]: unknown - } + 200: OpaqueObjectResponse } export type GetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusResponse @@ -2319,14 +2246,9 @@ export type GetDatasetsByDatasetIdErrorDocsData = { } export type GetDatasetsByDatasetIdErrorDocsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetDatasetsByDatasetIdErrorDocsError - = GetDatasetsByDatasetIdErrorDocsErrors[keyof GetDatasetsByDatasetIdErrorDocsErrors] - export type GetDatasetsByDatasetIdErrorDocsResponses = { 200: ErrorDocsResponse } @@ -2344,21 +2266,12 @@ export type PostDatasetsByDatasetIdExternalHitTestingData = { } export type PostDatasetsByDatasetIdExternalHitTestingErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostDatasetsByDatasetIdExternalHitTestingError - = PostDatasetsByDatasetIdExternalHitTestingErrors[keyof PostDatasetsByDatasetIdExternalHitTestingErrors] - export type PostDatasetsByDatasetIdExternalHitTestingResponses = { - 200: { - [key: string]: unknown - } + 200: ExternalRetrievalTestResponse } export type PostDatasetsByDatasetIdExternalHitTestingResponse @@ -2374,17 +2287,10 @@ export type PostDatasetsByDatasetIdHitTestingData = { } export type PostDatasetsByDatasetIdHitTestingErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostDatasetsByDatasetIdHitTestingError - = PostDatasetsByDatasetIdHitTestingErrors[keyof PostDatasetsByDatasetIdHitTestingErrors] - export type PostDatasetsByDatasetIdHitTestingResponses = { 200: HitTestingResponse } @@ -2517,17 +2423,10 @@ export type GetDatasetsByDatasetIdPermissionPartUsersData = { } export type GetDatasetsByDatasetIdPermissionPartUsersErrors = { - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 403: unknown + 404: unknown } -export type GetDatasetsByDatasetIdPermissionPartUsersError - = GetDatasetsByDatasetIdPermissionPartUsersErrors[keyof GetDatasetsByDatasetIdPermissionPartUsersErrors] - export type GetDatasetsByDatasetIdPermissionPartUsersResponses = { 200: PartialMemberListResponse } @@ -2625,14 +2524,9 @@ export type PostDatasetsByResourceIdApiKeysData = { } export type PostDatasetsByResourceIdApiKeysErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostDatasetsByResourceIdApiKeysError - = PostDatasetsByResourceIdApiKeysErrors[keyof PostDatasetsByResourceIdApiKeysErrors] - export type PostDatasetsByResourceIdApiKeysResponses = { 201: ApiKeyItem } diff --git a/packages/contracts/generated/api/console/datasets/zod.gen.ts b/packages/contracts/generated/api/console/datasets/zod.gen.ts index 3cc933a568..5a5f928279 100644 --- a/packages/contracts/generated/api/console/datasets/zod.gen.ts +++ b/packages/contracts/generated/api/console/datasets/zod.gen.ts @@ -91,6 +91,11 @@ export const zNotionEstimatePayload = z.object({ process_rule: z.record(z.string(), z.unknown()), }) +/** + * OpaqueObjectResponse + */ +export const zOpaqueObjectResponse = z.record(z.string(), z.unknown()) + /** * RetrievalSettingResponse */ @@ -122,6 +127,11 @@ export const zDocumentBatchDownloadZipPayload = z.object({ document_ids: z.array(z.uuid()).min(1).max(100), }) +/** + * BinaryFileResponse + */ +export const zBinaryFileResponse = z.custom() + /** * GenerateSummaryPayload */ @@ -237,6 +247,14 @@ export const zExternalHitTestingPayload = z.object({ query: z.string(), }) +/** + * ExternalRetrievalTestResponse + */ +export const zExternalRetrievalTestResponse = z.union([ + z.record(z.string(), z.unknown()), + z.array(z.record(z.string(), z.unknown())), +]) + /** * MetadataArgs */ @@ -421,6 +439,39 @@ export const zTag = z.object({ type: z.string(), }) +/** + * ExternalKnowledgeDatasetBindingResponse + */ +export const zExternalKnowledgeDatasetBindingResponse = z.object({ + id: z.string(), + name: z.string(), +}) + +/** + * ExternalKnowledgeApiResponse + */ +export const zExternalKnowledgeApiResponse = z.object({ + created_at: z.string(), + created_by: z.string(), + dataset_bindings: z.array(zExternalKnowledgeDatasetBindingResponse).optional(), + description: z.string(), + id: z.string(), + name: z.string(), + settings: z.record(z.string(), z.unknown()).nullish(), + tenant_id: z.string(), +}) + +/** + * ExternalKnowledgeApiListResponse + */ +export const zExternalKnowledgeApiListResponse = z.object({ + data: z.array(zExternalKnowledgeApiResponse), + has_more: z.boolean(), + limit: z.int(), + page: z.int(), + total: z.int(), +}) + /** * IndexingEstimatePreviewItemResponse */ @@ -1054,7 +1105,15 @@ export const zDatasetDetail = z.object({ author_name: z.string().optional(), built_in_field_enabled: z.boolean().optional(), chunk_structure: z.string().optional(), - created_at: z.record(z.string(), z.unknown()).optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), created_by: z.string().optional(), data_source_type: z.string().optional(), description: z.string().optional(), @@ -1082,7 +1141,15 @@ export const zDatasetDetail = z.object({ tags: z.array(zTag).optional(), total_available_documents: z.int().optional(), total_documents: z.int().optional(), - updated_at: z.record(z.string(), z.unknown()).optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), updated_by: z.string().optional(), word_count: z.int().optional(), }) @@ -1472,21 +1539,21 @@ export const zPostDatasetsExternalResponse = zDatasetDetail export const zGetDatasetsExternalKnowledgeApiQuery = z.object({ keyword: z.string().optional(), - limit: z.string().optional(), - page: z.string().optional(), + limit: z.int().optional().default(20), + page: z.int().optional().default(1), }) /** * External API templates retrieved successfully */ -export const zGetDatasetsExternalKnowledgeApiResponse = z.record(z.string(), z.unknown()) +export const zGetDatasetsExternalKnowledgeApiResponse = zExternalKnowledgeApiListResponse export const zPostDatasetsExternalKnowledgeApiBody = zExternalKnowledgeApiPayload /** - * Success + * External API template created successfully */ -export const zPostDatasetsExternalKnowledgeApiResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsExternalKnowledgeApiResponse = zExternalKnowledgeApiResponse export const zDeleteDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z.object({ external_knowledge_api_id: z.string(), @@ -1504,10 +1571,8 @@ export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z.ob /** * External API template retrieved successfully */ -export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse + = zExternalKnowledgeApiResponse export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdBody = zExternalKnowledgeApiPayload @@ -1517,12 +1582,10 @@ export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z. }) /** - * Success + * External API template updated successfully */ -export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse + = zExternalKnowledgeApiResponse export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdUseCheckPath = z.object({ external_knowledge_api_id: z.string(), @@ -1567,7 +1630,7 @@ export const zGetDatasetsProcessRuleQuery = z.object({ /** * Process rules retrieved successfully */ -export const zGetDatasetsProcessRuleResponse = z.record(z.string(), z.unknown()) +export const zGetDatasetsProcessRuleResponse = zOpaqueObjectResponse /** * Retrieval settings retrieved successfully @@ -1637,12 +1700,9 @@ export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimatePath = z.object( }) /** - * Success + * Batch indexing estimate calculated successfully */ -export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse = zOpaqueObjectResponse export const zGetDatasetsByDatasetIdBatchByBatchIndexingStatusPath = z.object({ batch: z.string(), @@ -1699,12 +1759,9 @@ export const zPostDatasetsByDatasetIdDocumentsDownloadZipPath = z.object({ }) /** - * Success + * ZIP archive generated successfully */ -export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = zBinaryFileResponse export const zPostDatasetsByDatasetIdDocumentsGenerateSummaryBody = zGenerateSummaryPayload @@ -1760,10 +1817,7 @@ export const zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery = z.object({ /** * Document retrieved successfully */ -export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = zOpaqueObjectResponse export const zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath = z.object({ dataset_id: z.string(), @@ -1783,10 +1837,8 @@ export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimatePath = /** * Indexing estimate calculated successfully */ -export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateResponse + = zOpaqueObjectResponse export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusPath = z.object({ dataset_id: z.string(), @@ -1829,12 +1881,10 @@ export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogPat }) /** - * Success + * Document pipeline execution log retrieved successfully */ -export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogResponse + = zOpaqueObjectResponse export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingPausePath = z.object({ dataset_id: z.string(), @@ -2084,10 +2134,8 @@ export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusPath = z.o /** * Summary status retrieved successfully */ -export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusResponse + = zOpaqueObjectResponse export const zGetDatasetsByDatasetIdDocumentsByDocumentIdWebsiteSyncPath = z.object({ dataset_id: z.string(), @@ -2117,7 +2165,7 @@ export const zPostDatasetsByDatasetIdExternalHitTestingPath = z.object({ /** * External hit testing completed successfully */ -export const zPostDatasetsByDatasetIdExternalHitTestingResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsByDatasetIdExternalHitTestingResponse = zExternalRetrievalTestResponse export const zPostDatasetsByDatasetIdHitTestingBody = zHitTestingPayload 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 b00fdb1c63..0fcc10b989 100644 --- a/packages/contracts/generated/api/console/email-register/orpc.gen.ts +++ b/packages/contracts/generated/api/console/email-register/orpc.gen.ts @@ -1,73 +1,56 @@ // This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' +import * as z from 'zod' import { + zPostEmailRegisterBody, zPostEmailRegisterResponse, + zPostEmailRegisterSendEmailBody, zPostEmailRegisterSendEmailResponse, + zPostEmailRegisterValidityBody, 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', path: '/email-register/send-email', tags: ['console'], }) + .input(z.object({ body: zPostEmailRegisterSendEmailBody })) .output(zPostEmailRegisterSendEmailResponse) 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', path: '/email-register/validity', tags: ['console'], }) + .input(z.object({ body: zPostEmailRegisterValidityBody })) .output(zPostEmailRegisterValidityResponse) 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', path: '/email-register', tags: ['console'], }) + .input(z.object({ body: zPostEmailRegisterBody })) .output(zPostEmailRegisterResponse) export const emailRegister = { diff --git a/packages/contracts/generated/api/console/email-register/types.gen.ts b/packages/contracts/generated/api/console/email-register/types.gen.ts index cca4d75415..2a315d2c63 100644 --- a/packages/contracts/generated/api/console/email-register/types.gen.ts +++ b/packages/contracts/generated/api/console/email-register/types.gen.ts @@ -4,34 +4,62 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type EmailRegisterResetPayload = { + language?: string | null + new_password: string + password_confirm: string + timezone?: string | null + token: string +} + +export type EmailRegisterResetResponse = { + data: EmailRegisterTokenPairResponse + result: string +} + +export type EmailRegisterSendPayload = { + email: string + language?: string | null +} + export type SimpleResultDataResponse = { data: string result: string } +export type EmailRegisterValidityPayload = { + code: string + email: string + token: string +} + export type VerificationTokenResponse = { email: string is_valid: boolean token: string } +export type EmailRegisterTokenPairResponse = { + access_token: string + csrf_token: string + refresh_token: string +} + export type PostEmailRegisterData = { - body?: never + body: EmailRegisterResetPayload path?: never query?: never url: '/email-register' } export type PostEmailRegisterResponses = { - 200: { - [key: string]: unknown - } + 200: EmailRegisterResetResponse } export type PostEmailRegisterResponse = PostEmailRegisterResponses[keyof PostEmailRegisterResponses] export type PostEmailRegisterSendEmailData = { - body?: never + body: EmailRegisterSendPayload path?: never query?: never url: '/email-register/send-email' @@ -45,7 +73,7 @@ export type PostEmailRegisterSendEmailResponse = PostEmailRegisterSendEmailResponses[keyof PostEmailRegisterSendEmailResponses] export type PostEmailRegisterValidityData = { - body?: never + body: EmailRegisterValidityPayload path?: never query?: never url: '/email-register/validity' diff --git a/packages/contracts/generated/api/console/email-register/zod.gen.ts b/packages/contracts/generated/api/console/email-register/zod.gen.ts index 490777db90..ae7ba7d566 100644 --- a/packages/contracts/generated/api/console/email-register/zod.gen.ts +++ b/packages/contracts/generated/api/console/email-register/zod.gen.ts @@ -2,6 +2,25 @@ import * as z from 'zod' +/** + * EmailRegisterResetPayload + */ +export const zEmailRegisterResetPayload = z.object({ + language: z.string().nullish(), + new_password: z.string(), + password_confirm: z.string(), + timezone: z.string().nullish(), + token: z.string(), +}) + +/** + * EmailRegisterSendPayload + */ +export const zEmailRegisterSendPayload = z.object({ + email: z.string(), + language: z.string().nullish(), +}) + /** * SimpleResultDataResponse */ @@ -10,6 +29,15 @@ export const zSimpleResultDataResponse = z.object({ result: z.string(), }) +/** + * EmailRegisterValidityPayload + */ +export const zEmailRegisterValidityPayload = z.object({ + code: z.string(), + email: z.string(), + token: z.string(), +}) + /** * VerificationTokenResponse */ @@ -19,16 +47,39 @@ export const zVerificationTokenResponse = z.object({ token: z.string(), }) +/** + * EmailRegisterTokenPairResponse + */ +export const zEmailRegisterTokenPairResponse = z.object({ + access_token: z.string(), + csrf_token: z.string(), + refresh_token: z.string(), +}) + +/** + * EmailRegisterResetResponse + */ +export const zEmailRegisterResetResponse = z.object({ + data: zEmailRegisterTokenPairResponse, + result: z.string(), +}) + +export const zPostEmailRegisterBody = zEmailRegisterResetPayload + /** * Success */ -export const zPostEmailRegisterResponse = z.record(z.string(), z.unknown()) +export const zPostEmailRegisterResponse = zEmailRegisterResetResponse + +export const zPostEmailRegisterSendEmailBody = zEmailRegisterSendPayload /** * Success */ export const zPostEmailRegisterSendEmailResponse = zSimpleResultDataResponse +export const zPostEmailRegisterValidityBody = zEmailRegisterValidityPayload + /** * Success */ diff --git a/packages/contracts/generated/api/console/explore/orpc.gen.ts b/packages/contracts/generated/api/console/explore/orpc.gen.ts index 4933c1ec12..db163ae92a 100644 --- a/packages/contracts/generated/api/console/explore/orpc.gen.ts +++ b/packages/contracts/generated/api/console/explore/orpc.gen.ts @@ -8,19 +8,12 @@ import { zGetExploreAppsByAppIdResponse, zGetExploreAppsQuery, zGetExploreAppsResponse, + zGetExploreBannersQuery, 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', @@ -52,16 +45,9 @@ 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', @@ -69,6 +55,7 @@ export const get3 = oc summary: 'Get banner list', tags: ['default'], }) + .input(z.object({ query: zGetExploreBannersQuery.optional() })) .output(zGetExploreBannersResponse) export const banners = { diff --git a/packages/contracts/generated/api/console/explore/types.gen.ts b/packages/contracts/generated/api/console/explore/types.gen.ts index 2e468e062d..72920964ad 100644 --- a/packages/contracts/generated/api/console/explore/types.gen.ts +++ b/packages/contracts/generated/api/console/explore/types.gen.ts @@ -9,6 +9,12 @@ export type RecommendedAppListResponse = { recommended_apps: Array } +export type RecommendedAppDetailResponse = { + [key: string]: unknown +} + +export type BannerListResponse = Array + export type RecommendedAppResponse = { app?: RecommendedAppInfoResponse | null app_id: string @@ -22,6 +28,15 @@ export type RecommendedAppResponse = { privacy_policy?: string | null } +export type BannerResponse = { + content: unknown + created_at?: string | null + id: string + link?: string | null + sort: number + status: string +} + export type RecommendedAppInfoResponse = { icon?: string | null icon_background?: string | null @@ -56,9 +71,7 @@ export type GetExploreAppsByAppIdData = { } export type GetExploreAppsByAppIdResponses = { - 200: { - [key: string]: unknown - } + 200: RecommendedAppDetailResponse } export type GetExploreAppsByAppIdResponse @@ -67,14 +80,14 @@ export type GetExploreAppsByAppIdResponse export type GetExploreBannersData = { body?: never path?: never - query?: never + query?: { + language?: string + } url: '/explore/banners' } export type GetExploreBannersResponses = { - 200: { - [key: string]: unknown - } + 200: BannerListResponse } export type GetExploreBannersResponse = GetExploreBannersResponses[keyof GetExploreBannersResponses] diff --git a/packages/contracts/generated/api/console/explore/zod.gen.ts b/packages/contracts/generated/api/console/explore/zod.gen.ts index dcbb95e20b..913338afdf 100644 --- a/packages/contracts/generated/api/console/explore/zod.gen.ts +++ b/packages/contracts/generated/api/console/explore/zod.gen.ts @@ -2,6 +2,28 @@ import * as z from 'zod' +/** + * RecommendedAppDetailResponse + */ +export const zRecommendedAppDetailResponse = z.record(z.string(), z.unknown()) + +/** + * BannerResponse + */ +export const zBannerResponse = z.object({ + content: z.unknown(), + created_at: z.string().nullish(), + id: z.string(), + link: z.string().nullish(), + sort: z.int(), + status: z.string(), +}) + +/** + * BannerListResponse + */ +export const zBannerListResponse = z.array(zBannerResponse) + /** * RecommendedAppInfoResponse */ @@ -54,9 +76,13 @@ export const zGetExploreAppsByAppIdPath = z.object({ /** * Success */ -export const zGetExploreAppsByAppIdResponse = z.record(z.string(), z.unknown()) +export const zGetExploreAppsByAppIdResponse = zRecommendedAppDetailResponse + +export const zGetExploreBannersQuery = z.object({ + language: z.string().optional().default('en-US'), +}) /** * Success */ -export const zGetExploreBannersResponse = z.record(z.string(), z.unknown()) +export const zGetExploreBannersResponse = zBannerListResponse diff --git a/packages/contracts/generated/api/console/forgot-password/types.gen.ts b/packages/contracts/generated/api/console/forgot-password/types.gen.ts index b58165c8eb..c551d799e5 100644 --- a/packages/contracts/generated/api/console/forgot-password/types.gen.ts +++ b/packages/contracts/generated/api/console/forgot-password/types.gen.ts @@ -45,13 +45,9 @@ export type PostForgotPasswordData = { } export type PostForgotPasswordErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostForgotPasswordError = PostForgotPasswordErrors[keyof PostForgotPasswordErrors] - export type PostForgotPasswordResponses = { 200: ForgotPasswordEmailResponse } @@ -67,14 +63,9 @@ export type PostForgotPasswordResetsData = { } export type PostForgotPasswordResetsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostForgotPasswordResetsError - = PostForgotPasswordResetsErrors[keyof PostForgotPasswordResetsErrors] - export type PostForgotPasswordResetsResponses = { 200: ForgotPasswordResetResponse } @@ -90,14 +81,9 @@ export type PostForgotPasswordValidityData = { } export type PostForgotPasswordValidityErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostForgotPasswordValidityError - = PostForgotPasswordValidityErrors[keyof PostForgotPasswordValidityErrors] - export type PostForgotPasswordValidityResponses = { 200: ForgotPasswordCheckResponse } diff --git a/packages/contracts/generated/api/console/form/orpc.gen.ts b/packages/contracts/generated/api/console/form/orpc.gen.ts index d28f1b4bb4..5cb831538f 100644 --- a/packages/contracts/generated/api/console/form/orpc.gen.ts +++ b/packages/contracts/generated/api/console/form/orpc.gen.ts @@ -15,16 +15,10 @@ 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({ - 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.', + description: 'GET /console/api/form/human_input/', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -47,16 +41,11 @@ 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}\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'POST /console/api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', diff --git a/packages/contracts/generated/api/console/form/types.gen.ts b/packages/contracts/generated/api/console/form/types.gen.ts index fb908f1c70..9565a18219 100644 --- a/packages/contracts/generated/api/console/form/types.gen.ts +++ b/packages/contracts/generated/api/console/form/types.gen.ts @@ -4,6 +4,10 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type ConsoleHumanInputFormDefinitionResponse = { + [key: string]: unknown +} + export type HumanInputFormSubmitPayload = { action: string form_inputs: { @@ -14,6 +18,10 @@ export type HumanInputFormSubmitPayload = { } } +export type ConsoleHumanInputFormSubmitResponse = { + [key: string]: unknown +} + export type GetFormHumanInputByFormTokenData = { body?: never path: { @@ -24,9 +32,7 @@ export type GetFormHumanInputByFormTokenData = { } export type GetFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: ConsoleHumanInputFormDefinitionResponse } export type GetFormHumanInputByFormTokenResponse @@ -42,9 +48,7 @@ export type PostFormHumanInputByFormTokenData = { } export type PostFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: ConsoleHumanInputFormSubmitResponse } export type PostFormHumanInputByFormTokenResponse diff --git a/packages/contracts/generated/api/console/form/zod.gen.ts b/packages/contracts/generated/api/console/form/zod.gen.ts index 8d74f49963..54029facb7 100644 --- a/packages/contracts/generated/api/console/form/zod.gen.ts +++ b/packages/contracts/generated/api/console/form/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * ConsoleHumanInputFormDefinitionResponse + */ +export const zConsoleHumanInputFormDefinitionResponse = z.record(z.string(), z.unknown()) + /** * HumanInputFormSubmitPayload */ @@ -11,6 +16,11 @@ export const zHumanInputFormSubmitPayload = z.object({ inputs: z.record(z.string(), z.unknown()), }) +/** + * ConsoleHumanInputFormSubmitResponse + */ +export const zConsoleHumanInputFormSubmitResponse = z.record(z.string(), z.unknown()) + export const zGetFormHumanInputByFormTokenPath = z.object({ form_token: z.string(), }) @@ -18,7 +28,7 @@ export const zGetFormHumanInputByFormTokenPath = z.object({ /** * Success */ -export const zGetFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zGetFormHumanInputByFormTokenResponse = zConsoleHumanInputFormDefinitionResponse export const zPostFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayload @@ -29,4 +39,4 @@ export const zPostFormHumanInputByFormTokenPath = z.object({ /** * Success */ -export const zPostFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zPostFormHumanInputByFormTokenResponse = zConsoleHumanInputFormSubmitResponse 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 414e72dcb2..026f3bdf51 100644 --- a/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/installed-apps/orpc.gen.ts @@ -28,13 +28,16 @@ import { zGetInstalledAppsByInstalledAppIdSavedMessagesPath, zGetInstalledAppsByInstalledAppIdSavedMessagesQuery, zGetInstalledAppsByInstalledAppIdSavedMessagesResponse, + zGetInstalledAppsQuery, zGetInstalledAppsResponse, + zPatchInstalledAppsByInstalledAppIdBody, zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath, zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse, zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath, zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse, zPatchInstalledAppsByInstalledAppIdPath, zPatchInstalledAppsByInstalledAppIdResponse, + zPostInstalledAppsBody, zPostInstalledAppsByInstalledAppIdAudioToTextPath, zPostInstalledAppsByInstalledAppIdAudioToTextResponse, zPostInstalledAppsByInstalledAppIdChatMessagesBody, @@ -67,16 +70,8 @@ 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', @@ -109,16 +104,8 @@ 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', @@ -157,16 +144,8 @@ 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', @@ -186,16 +165,8 @@ 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', @@ -263,16 +234,8 @@ 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', @@ -312,16 +275,8 @@ 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', @@ -365,16 +320,8 @@ 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', @@ -396,16 +343,9 @@ 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', @@ -422,16 +362,9 @@ 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', @@ -462,16 +395,8 @@ 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', @@ -508,16 +433,8 @@ 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', @@ -538,16 +455,9 @@ 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', @@ -611,23 +521,20 @@ 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', path: '/installed-apps/{installed_app_id}', tags: ['console'], }) - .input(z.object({ params: zPatchInstalledAppsByInstalledAppIdPath })) + .input( + z.object({ + body: zPatchInstalledAppsByInstalledAppIdBody, + params: zPatchInstalledAppsByInstalledAppIdPath, + }), + ) .output(zPatchInstalledAppsByInstalledAppIdResponse) export const byInstalledAppId = { @@ -653,24 +560,18 @@ export const get8 = oc path: '/installed-apps', tags: ['console'], }) + .input(z.object({ query: zGetInstalledAppsQuery.optional() })) .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', path: '/installed-apps', tags: ['console'], }) + .input(z.object({ body: zPostInstalledAppsBody })) .output(zPostInstalledAppsResponse) export const installedApps = { diff --git a/packages/contracts/generated/api/console/installed-apps/types.gen.ts b/packages/contracts/generated/api/console/installed-apps/types.gen.ts index 875c249244..6111cf7e10 100644 --- a/packages/contracts/generated/api/console/installed-apps/types.gen.ts +++ b/packages/contracts/generated/api/console/installed-apps/types.gen.ts @@ -8,15 +8,27 @@ export type InstalledAppListResponse = { installed_apps: Array } +export type InstalledAppCreatePayload = { + app_id: string +} + export type SimpleMessageResponse = { message: string } +export type InstalledAppUpdatePayload = { + is_pinned?: boolean | null +} + export type SimpleResultMessageResponse = { message: string result: string } +export type AudioTranscriptResponse = { + text: string +} + export type ChatMessagePayload = { conversation_id?: string | null files?: Array | null @@ -32,6 +44,8 @@ export type ChatMessagePayload = { retriever_from?: string } +export type GeneratedAppResponse = JsonValue + export type SimpleResultResponse = { result: string } @@ -48,15 +62,39 @@ export type CompletionMessageExplorePayload = { retriever_from?: string } +export type ConversationInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + export type ConversationRenamePayload = { auto_generate?: boolean name?: string | null } +export type SimpleConversation = { + created_at?: number | null + id: string + inputs: { + [key: string]: JsonValue + } + introduction?: string | null + name: string + status: string + updated_at?: number | null +} + export type ResultResponse = { result: string } +export type MessageInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + export type MessageFeedbackPayload = { content?: string | null message_id: string @@ -67,6 +105,33 @@ export type SuggestedQuestionsResponse = { data: Array } +export type ExploreAppMetaResponse = { + tool_icons?: { + [key: string]: unknown + } +} + +export type Parameters = { + annotation_reply: JsonObject + file_upload: JsonObject + more_like_this: JsonObject + opening_statement?: string | null + retriever_resource: JsonObject + sensitive_word_avoidance: JsonObject + speech_to_text: JsonObject + suggested_questions: Array + suggested_questions_after_answer: JsonObject + system_parameters: SystemParameters + text_to_speech: JsonObject + user_input_form: Array +} + +export type SavedMessageInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + export type SavedMessageCreatePayload = { message_id: string } @@ -78,6 +143,8 @@ export type TextToAudioPayload = { voice?: string | null } +export type AudioBinaryResponse = Blob | File + export type WorkflowRunPayload = { files?: Array<{ [key: string]: unknown @@ -97,6 +164,60 @@ export type InstalledAppResponse = { uninstallable: boolean } +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + +export type MessageListItem = { + agent_thoughts: Array + answer: string + conversation_id: string + created_at?: number | null + error?: string | null + extra_contents: Array + feedback?: SimpleFeedback | null + id: string + inputs: { + [key: string]: JsonValueType + } + message_files: Array + parent_message_id?: string | null + query: string + retriever_resources: Array + status: string +} + +export type JsonObject = { + [key: string]: unknown +} + +export type SystemParameters = { + audio_file_size_limit: number + file_size_limit: number + image_file_size_limit: number + video_file_size_limit: number + workflow_file_upload_limit: number +} + +export type SavedMessageItem = { + answer: string + created_at?: number | null + feedback?: SimpleFeedback | null + id: string + inputs: { + [key: string]: JsonValueType + } + message_files: Array + query: string +} + export type InstalledAppInfoResponse = { icon?: string | null icon_background?: string | null @@ -107,10 +228,172 @@ export type InstalledAppInfoResponse = { use_icon_as_answer_icon?: boolean | null } +export type AgentThought = { + chain_id?: string | null + created_at?: number | null + files: Array + id: string + message_chain_id?: string | null + message_id: string + observation?: string | null + position: number + thought?: string | null + tool?: string | null + tool_input?: string | null + tool_labels: JsonValue +} + +export type HumanInputContent = { + form_definition?: HumanInputFormDefinition | null + form_submission_data?: HumanInputFormSubmissionData | null + submitted: boolean + type?: ExecutionContentType + workflow_run_id: string +} + +export type SimpleFeedback = { + rating?: string | null +} + +export type JsonValueType = unknown + +export type MessageFile = { + belongs_to?: string | null + filename: string + id: string + mime_type?: string | null + size?: number | null + transfer_method: string + type: string + upload_file_id?: string | null + url?: string | null +} + +export type RetrieverResource = { + content?: string | null + created_at?: number | null + data_source_type?: string | null + dataset_id?: string | null + dataset_name?: string | null + document_id?: string | null + document_name?: string | null + hit_count?: number | null + id?: string + index_node_hash?: string | null + message_id?: string + position: number + score?: number | null + segment_id?: string | null + segment_position?: number | null + summary?: string | null + word_count?: number | null +} + +export type HumanInputFormDefinition = { + actions?: Array + display_in_ui?: boolean + expiration_time: number + form_content: string + form_id: string + form_token?: string | null + inputs?: Array + node_id: string + node_title: string + resolved_default_values?: { + [key: string]: unknown + } +} + +export type HumanInputFormSubmissionData = { + action_id: string + action_text: string + node_id: string + node_title: string + rendered_content: string + submitted_data?: { + [key: string]: JsonValue2 + } | null +} + +export type ExecutionContentType = 'human_input' + +export type UserActionConfig = { + button_style?: ButtonStyle + id: string + title: string +} + +export type FormInputConfig + = | ({ + type: 'paragraph' + } & ParagraphInputConfig) + | ({ + type: 'select' + } & SelectInputConfig) + | ({ + type: 'file' + } & FileInputConfig) + | ({ + type: 'file-list' + } & FileListInputConfig) + +export type JsonValue2 = unknown + +export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary' + +export type ParagraphInputConfig = { + default?: StringSource | null + output_variable_name: string + type?: 'paragraph' +} + +export type SelectInputConfig = { + option_source: StringListSource + output_variable_name: string + type?: 'select' +} + +export type FileInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + output_variable_name: string + type?: 'file' +} + +export type FileListInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + number_limits?: number + output_variable_name: string + type?: 'file-list' +} + +export type StringSource = { + selector?: Array + type: ValueSourceType + value?: string +} + +export type StringListSource = { + selector?: Array + type: ValueSourceType + value?: Array +} + +export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video' + +export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file' + +export type ValueSourceType = 'constant' | 'variable' + export type GetInstalledAppsData = { body?: never path?: never - query?: never + query?: { + app_id?: string + } url: '/installed-apps' } @@ -121,7 +404,7 @@ export type GetInstalledAppsResponses = { export type GetInstalledAppsResponse = GetInstalledAppsResponses[keyof GetInstalledAppsResponses] export type PostInstalledAppsData = { - body?: never + body: InstalledAppCreatePayload path?: never query?: never url: '/installed-apps' @@ -150,7 +433,7 @@ export type DeleteInstalledAppsByInstalledAppIdResponse = DeleteInstalledAppsByInstalledAppIdResponses[keyof DeleteInstalledAppsByInstalledAppIdResponses] export type PatchInstalledAppsByInstalledAppIdData = { - body?: never + body: InstalledAppUpdatePayload path: { installed_app_id: string } @@ -175,9 +458,7 @@ export type PostInstalledAppsByInstalledAppIdAudioToTextData = { } export type PostInstalledAppsByInstalledAppIdAudioToTextResponses = { - 200: { - [key: string]: unknown - } + 200: AudioTranscriptResponse } export type PostInstalledAppsByInstalledAppIdAudioToTextResponse @@ -193,9 +474,7 @@ export type PostInstalledAppsByInstalledAppIdChatMessagesData = { } export type PostInstalledAppsByInstalledAppIdChatMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostInstalledAppsByInstalledAppIdChatMessagesResponse @@ -228,9 +507,7 @@ export type PostInstalledAppsByInstalledAppIdCompletionMessagesData = { } export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponse @@ -267,9 +544,7 @@ export type GetInstalledAppsByInstalledAppIdConversationsData = { } export type GetInstalledAppsByInstalledAppIdConversationsResponses = { - 200: { - [key: string]: unknown - } + 200: ConversationInfiniteScrollPagination } export type GetInstalledAppsByInstalledAppIdConversationsResponse @@ -303,9 +578,7 @@ export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameData = { } export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleConversation } export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse @@ -359,9 +632,7 @@ export type GetInstalledAppsByInstalledAppIdMessagesData = { } export type GetInstalledAppsByInstalledAppIdMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: MessageInfiniteScrollPagination } export type GetInstalledAppsByInstalledAppIdMessagesResponse @@ -397,9 +668,7 @@ export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisData } export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse @@ -432,9 +701,7 @@ export type GetInstalledAppsByInstalledAppIdMetaData = { } export type GetInstalledAppsByInstalledAppIdMetaResponses = { - 200: { - [key: string]: unknown - } + 200: ExploreAppMetaResponse } export type GetInstalledAppsByInstalledAppIdMetaResponse @@ -450,9 +717,7 @@ export type GetInstalledAppsByInstalledAppIdParametersData = { } export type GetInstalledAppsByInstalledAppIdParametersResponses = { - 200: { - [key: string]: unknown - } + 200: Parameters } export type GetInstalledAppsByInstalledAppIdParametersResponse @@ -471,9 +736,7 @@ export type GetInstalledAppsByInstalledAppIdSavedMessagesData = { } export type GetInstalledAppsByInstalledAppIdSavedMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: SavedMessageInfiniteScrollPagination } export type GetInstalledAppsByInstalledAppIdSavedMessagesResponse @@ -522,9 +785,7 @@ export type PostInstalledAppsByInstalledAppIdTextToAudioData = { } export type PostInstalledAppsByInstalledAppIdTextToAudioResponses = { - 200: { - [key: string]: unknown - } + 200: AudioBinaryResponse } export type PostInstalledAppsByInstalledAppIdTextToAudioResponse @@ -540,9 +801,7 @@ export type PostInstalledAppsByInstalledAppIdWorkflowsRunData = { } export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponse diff --git a/packages/contracts/generated/api/console/installed-apps/zod.gen.ts b/packages/contracts/generated/api/console/installed-apps/zod.gen.ts index 31d6189d9c..055b53936b 100644 --- a/packages/contracts/generated/api/console/installed-apps/zod.gen.ts +++ b/packages/contracts/generated/api/console/installed-apps/zod.gen.ts @@ -2,6 +2,13 @@ import * as z from 'zod' +/** + * InstalledAppCreatePayload + */ +export const zInstalledAppCreatePayload = z.object({ + app_id: z.string(), +}) + /** * SimpleMessageResponse */ @@ -9,6 +16,13 @@ export const zSimpleMessageResponse = z.object({ message: z.string(), }) +/** + * InstalledAppUpdatePayload + */ +export const zInstalledAppUpdatePayload = z.object({ + is_pinned: z.boolean().nullish(), +}) + /** * SimpleResultMessageResponse */ @@ -17,6 +31,13 @@ export const zSimpleResultMessageResponse = z.object({ result: z.string(), }) +/** + * AudioTranscriptResponse + */ +export const zAudioTranscriptResponse = z.object({ + text: z.string(), +}) + /** * ChatMessagePayload */ @@ -80,6 +101,13 @@ export const zSuggestedQuestionsResponse = z.object({ data: z.array(z.string()), }) +/** + * ExploreAppMetaResponse + */ +export const zExploreAppMetaResponse = z.object({ + tool_icons: z.record(z.string(), z.unknown()).optional(), +}) + /** * SavedMessageCreatePayload */ @@ -97,6 +125,11 @@ export const zTextToAudioPayload = z.object({ voice: z.string().nullish(), }) +/** + * AudioBinaryResponse + */ +export const zAudioBinaryResponse = z.custom() + /** * WorkflowRunPayload */ @@ -105,6 +138,75 @@ export const zWorkflowRunPayload = z.object({ inputs: z.record(z.string(), z.unknown()), }) +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue + +/** + * SimpleConversation + */ +export const zSimpleConversation = z.object({ + created_at: z.int().nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValue), + introduction: z.string().nullish(), + name: z.string(), + status: z.string(), + updated_at: z.int().nullish(), +}) + +/** + * ConversationInfiniteScrollPagination + */ +export const zConversationInfiniteScrollPagination = z.object({ + data: z.array(zSimpleConversation), + has_more: z.boolean(), + limit: z.int(), +}) + +export const zJsonObject = z.record(z.string(), z.unknown()) + +/** + * SystemParameters + */ +export const zSystemParameters = z.object({ + audio_file_size_limit: z.int(), + file_size_limit: z.int(), + image_file_size_limit: z.int(), + video_file_size_limit: z.int(), + workflow_file_upload_limit: z.int(), +}) + +/** + * Parameters + */ +export const zParameters = z.object({ + annotation_reply: zJsonObject, + file_upload: zJsonObject, + more_like_this: zJsonObject, + opening_statement: z.string().nullish(), + retriever_resource: zJsonObject, + sensitive_word_avoidance: zJsonObject, + speech_to_text: zJsonObject, + suggested_questions: z.array(z.string()), + suggested_questions_after_answer: zJsonObject, + system_parameters: zSystemParameters, + text_to_speech: zJsonObject, + user_input_form: z.array(zJsonObject), +}) + /** * InstalledAppInfoResponse */ @@ -138,11 +240,290 @@ export const zInstalledAppListResponse = z.object({ installed_apps: z.array(zInstalledAppResponse), }) +/** + * AgentThought + */ +export const zAgentThought = z.object({ + chain_id: z.string().nullish(), + created_at: z.int().nullish(), + files: z.array(z.string()), + id: z.string(), + message_chain_id: z.string().nullish(), + message_id: z.string(), + observation: z.string().nullish(), + position: z.int(), + thought: z.string().nullish(), + tool: z.string().nullish(), + tool_input: z.string().nullish(), + tool_labels: zJsonValue, +}) + +/** + * SimpleFeedback + */ +export const zSimpleFeedback = z.object({ + rating: z.string().nullish(), +}) + +export const zJsonValueType = z.unknown() + +/** + * MessageFile + */ +export const zMessageFile = z.object({ + belongs_to: z.string().nullish(), + filename: z.string(), + id: z.string(), + mime_type: z.string().nullish(), + size: z.int().nullish(), + transfer_method: z.string(), + type: z.string(), + upload_file_id: z.string().nullish(), + url: z.string().nullish(), +}) + +/** + * SavedMessageItem + */ +export const zSavedMessageItem = z.object({ + answer: z.string(), + created_at: z.int().nullish(), + feedback: zSimpleFeedback.nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValueType), + message_files: z.array(zMessageFile), + query: z.string(), +}) + +/** + * SavedMessageInfiniteScrollPagination + */ +export const zSavedMessageInfiniteScrollPagination = z.object({ + data: z.array(zSavedMessageItem), + has_more: z.boolean(), + limit: z.int(), +}) + +/** + * RetrieverResource + */ +export const zRetrieverResource = z.object({ + content: z.string().nullish(), + created_at: z.int().nullish(), + data_source_type: z.string().nullish(), + dataset_id: z.string().nullish(), + dataset_name: z.string().nullish(), + document_id: z.string().nullish(), + document_name: z.string().nullish(), + hit_count: z.int().nullish(), + id: z.string().optional(), + index_node_hash: z.string().nullish(), + message_id: z.string().optional(), + position: z.int(), + score: z.number().nullish(), + segment_id: z.string().nullish(), + segment_position: z.int().nullish(), + summary: z.string().nullish(), + word_count: z.int().nullish(), +}) + +/** + * ExecutionContentType + */ +export const zExecutionContentType = z.enum(['human_input']) + +export const zJsonValue2 = z.unknown() + +/** + * HumanInputFormSubmissionData + */ +export const zHumanInputFormSubmissionData = z.object({ + action_id: z.string(), + action_text: z.string(), + node_id: z.string(), + node_title: z.string(), + rendered_content: z.string(), + submitted_data: z.record(z.string(), zJsonValue2).nullish(), +}) + +/** + * ButtonStyle + * + * Button styles for user actions. + */ +export const zButtonStyle = z.enum(['accent', 'default', 'ghost', 'primary']) + +/** + * UserActionConfig + * + * User action configuration. + */ +export const zUserActionConfig = z.object({ + button_style: zButtonStyle.optional().default('default'), + id: z.string().max(20), + title: z.string().max(100), +}) + +/** + * FileType + */ +export const zFileType = z.enum(['audio', 'custom', 'document', 'image', 'video']) + +/** + * FileTransferMethod + */ +export const zFileTransferMethod = z.enum([ + 'datasource_file', + 'local_file', + 'remote_url', + 'tool_file', +]) + +/** + * FileInputConfig + */ +export const zFileInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + output_variable_name: z.string(), + type: z.literal('file').optional().default('file'), +}) + +/** + * FileListInputConfig + */ +export const zFileListInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + number_limits: z.int().gte(0).optional().default(0), + output_variable_name: z.string(), + type: z.literal('file-list').optional().default('file-list'), +}) + +/** + * ValueSourceType + * + * ValueSourceType records whether the value comes from a static setting + * in form definiton, or a variable while the workflow is running. + */ +export const zValueSourceType = z.enum(['constant', 'variable']) + +/** + * StringSource + * + * Default configuration for form inputs. + */ +export const zStringSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.string().optional().default(''), +}) + +/** + * ParagraphInputConfig + * + * Form input definition. + */ +export const zParagraphInputConfig = z.object({ + default: zStringSource.nullish(), + output_variable_name: z.string(), + type: z.literal('paragraph').optional().default('paragraph'), +}) + +/** + * StringListSource + */ +export const zStringListSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.array(z.string()).optional(), +}) + +/** + * SelectInputConfig + */ +export const zSelectInputConfig = z.object({ + option_source: zStringListSource, + output_variable_name: z.string(), + type: z.literal('select').optional().default('select'), +}) + +export const zFormInputConfig = z.discriminatedUnion('type', [ + zParagraphInputConfig.extend({ type: z.literal('paragraph') }), + zSelectInputConfig.extend({ type: z.literal('select') }), + zFileInputConfig.extend({ type: z.literal('file') }), + zFileListInputConfig.extend({ type: z.literal('file-list') }), +]) + +/** + * HumanInputFormDefinition + */ +export const zHumanInputFormDefinition = z.object({ + actions: z.array(zUserActionConfig).optional(), + display_in_ui: z.boolean().optional().default(false), + expiration_time: z.int(), + form_content: z.string(), + form_id: z.string(), + form_token: z.string().nullish(), + inputs: z.array(zFormInputConfig).optional(), + node_id: z.string(), + node_title: z.string(), + resolved_default_values: z.record(z.string(), z.unknown()).optional(), +}) + +/** + * HumanInputContent + */ +export const zHumanInputContent = z.object({ + form_definition: zHumanInputFormDefinition.nullish(), + form_submission_data: zHumanInputFormSubmissionData.nullish(), + submitted: z.boolean(), + type: zExecutionContentType.optional().default('human_input'), + workflow_run_id: z.string(), +}) + +/** + * MessageListItem + */ +export const zMessageListItem = z.object({ + agent_thoughts: z.array(zAgentThought), + answer: z.string(), + conversation_id: z.string(), + created_at: z.int().nullish(), + error: z.string().nullish(), + extra_contents: z.array(zHumanInputContent), + feedback: zSimpleFeedback.nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValueType), + message_files: z.array(zMessageFile), + parent_message_id: z.string().nullish(), + query: z.string(), + retriever_resources: z.array(zRetrieverResource), + status: z.string(), +}) + +/** + * MessageInfiniteScrollPagination + */ +export const zMessageInfiniteScrollPagination = z.object({ + data: z.array(zMessageListItem), + has_more: z.boolean(), + limit: z.int(), +}) + +export const zGetInstalledAppsQuery = z.object({ + app_id: z.string().optional(), +}) + /** * Success */ export const zGetInstalledAppsResponse = zInstalledAppListResponse +export const zPostInstalledAppsBody = zInstalledAppCreatePayload + /** * Success */ @@ -157,6 +538,8 @@ export const zDeleteInstalledAppsByInstalledAppIdPath = z.object({ */ export const zDeleteInstalledAppsByInstalledAppIdResponse = z.void() +export const zPatchInstalledAppsByInstalledAppIdBody = zInstalledAppUpdatePayload + export const zPatchInstalledAppsByInstalledAppIdPath = z.object({ installed_app_id: z.string(), }) @@ -173,10 +556,7 @@ export const zPostInstalledAppsByInstalledAppIdAudioToTextPath = z.object({ /** * Success */ -export const zPostInstalledAppsByInstalledAppIdAudioToTextResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdAudioToTextResponse = zAudioTranscriptResponse export const zPostInstalledAppsByInstalledAppIdChatMessagesBody = zChatMessagePayload @@ -187,10 +567,7 @@ export const zPostInstalledAppsByInstalledAppIdChatMessagesPath = z.object({ /** * Success */ -export const zPostInstalledAppsByInstalledAppIdChatMessagesResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdChatMessagesResponse = zGeneratedAppResponse export const zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath = z.object({ installed_app_id: z.string(), @@ -213,10 +590,7 @@ export const zPostInstalledAppsByInstalledAppIdCompletionMessagesPath = z.object /** * Success */ -export const zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse = zGeneratedAppResponse export const zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath = z.object({ installed_app_id: z.string(), @@ -242,10 +616,8 @@ export const zGetInstalledAppsByInstalledAppIdConversationsQuery = z.object({ /** * Success */ -export const zGetInstalledAppsByInstalledAppIdConversationsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetInstalledAppsByInstalledAppIdConversationsResponse + = zConversationInfiniteScrollPagination export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath = z.object({ c_id: z.string(), @@ -266,12 +638,9 @@ export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath = z.ob }) /** - * Success + * Conversation renamed successfully */ -export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse = zSimpleConversation export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath = z.object({ c_id: z.string(), @@ -306,7 +675,7 @@ export const zGetInstalledAppsByInstalledAppIdMessagesQuery = z.object({ /** * Success */ -export const zGetInstalledAppsByInstalledAppIdMessagesResponse = z.record(z.string(), z.unknown()) +export const zGetInstalledAppsByInstalledAppIdMessagesResponse = zMessageInfiniteScrollPagination export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody = zMessageFeedbackPayload @@ -334,10 +703,8 @@ export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQue /** * Success */ -export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse + = zGeneratedAppResponse export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath = z.object({ installed_app_id: z.string(), @@ -357,7 +724,7 @@ export const zGetInstalledAppsByInstalledAppIdMetaPath = z.object({ /** * Success */ -export const zGetInstalledAppsByInstalledAppIdMetaResponse = z.record(z.string(), z.unknown()) +export const zGetInstalledAppsByInstalledAppIdMetaResponse = zExploreAppMetaResponse export const zGetInstalledAppsByInstalledAppIdParametersPath = z.object({ installed_app_id: z.string(), @@ -366,7 +733,7 @@ export const zGetInstalledAppsByInstalledAppIdParametersPath = z.object({ /** * Success */ -export const zGetInstalledAppsByInstalledAppIdParametersResponse = z.record(z.string(), z.unknown()) +export const zGetInstalledAppsByInstalledAppIdParametersResponse = zParameters export const zGetInstalledAppsByInstalledAppIdSavedMessagesPath = z.object({ installed_app_id: z.string(), @@ -380,10 +747,8 @@ export const zGetInstalledAppsByInstalledAppIdSavedMessagesQuery = z.object({ /** * Success */ -export const zGetInstalledAppsByInstalledAppIdSavedMessagesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetInstalledAppsByInstalledAppIdSavedMessagesResponse + = zSavedMessageInfiniteScrollPagination export const zPostInstalledAppsByInstalledAppIdSavedMessagesBody = zSavedMessageCreatePayload @@ -415,10 +780,7 @@ export const zPostInstalledAppsByInstalledAppIdTextToAudioPath = z.object({ /** * Success */ -export const zPostInstalledAppsByInstalledAppIdTextToAudioResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdTextToAudioResponse = zAudioBinaryResponse export const zPostInstalledAppsByInstalledAppIdWorkflowsRunBody = zWorkflowRunPayload @@ -429,10 +791,7 @@ export const zPostInstalledAppsByInstalledAppIdWorkflowsRunPath = z.object({ /** * Success */ -export const zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse = zGeneratedAppResponse export const zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath = z.object({ installed_app_id: z.string(), 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 f91220f369..3aff6a9a3b 100644 --- a/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/instruction-generate/orpc.gen.ts @@ -12,16 +12,10 @@ 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({ - 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.', + description: 'Get instruction generation template', inputStructure: 'detailed', method: 'POST', operationId: 'postInstructionGenerateTemplate', @@ -37,16 +31,10 @@ 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({ - 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.', + description: 'Generate instruction for workflow nodes or general use', inputStructure: 'detailed', method: 'POST', operationId: 'postInstructionGenerate', diff --git a/packages/contracts/generated/api/console/instruction-generate/types.gen.ts b/packages/contracts/generated/api/console/instruction-generate/types.gen.ts index c17d0c451b..82a9bee086 100644 --- a/packages/contracts/generated/api/console/instruction-generate/types.gen.ts +++ b/packages/contracts/generated/api/console/instruction-generate/types.gen.ts @@ -14,10 +14,16 @@ export type InstructionGeneratePayload = { node_id?: string } +export type GeneratorResponse = unknown + export type InstructionTemplatePayload = { type: string } +export type SimpleDataResponse = { + data: string +} + export type ModelConfig = { completion_params?: { [key: string]: unknown @@ -37,21 +43,12 @@ export type PostInstructionGenerateData = { } export type PostInstructionGenerateErrors = { - 400: { - [key: string]: unknown - } - 402: { - [key: string]: unknown - } + 400: unknown + 402: unknown } -export type PostInstructionGenerateError - = PostInstructionGenerateErrors[keyof PostInstructionGenerateErrors] - export type PostInstructionGenerateResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratorResponse } export type PostInstructionGenerateResponse @@ -65,18 +62,11 @@ export type PostInstructionGenerateTemplateData = { } export type PostInstructionGenerateTemplateErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostInstructionGenerateTemplateError - = PostInstructionGenerateTemplateErrors[keyof PostInstructionGenerateTemplateErrors] - export type PostInstructionGenerateTemplateResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleDataResponse } export type PostInstructionGenerateTemplateResponse diff --git a/packages/contracts/generated/api/console/instruction-generate/zod.gen.ts b/packages/contracts/generated/api/console/instruction-generate/zod.gen.ts index b24c9b178f..2d89050e2a 100644 --- a/packages/contracts/generated/api/console/instruction-generate/zod.gen.ts +++ b/packages/contracts/generated/api/console/instruction-generate/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * GeneratorResponse + */ +export const zGeneratorResponse = z.unknown() + /** * InstructionTemplatePayload */ @@ -9,6 +14,13 @@ export const zInstructionTemplatePayload = z.object({ type: z.string(), }) +/** + * SimpleDataResponse + */ +export const zSimpleDataResponse = z.object({ + data: z.string(), +}) + /** * LLMMode * @@ -44,11 +56,11 @@ export const zPostInstructionGenerateBody = zInstructionGeneratePayload /** * Instruction generated successfully */ -export const zPostInstructionGenerateResponse = z.record(z.string(), z.unknown()) +export const zPostInstructionGenerateResponse = zGeneratorResponse export const zPostInstructionGenerateTemplateBody = zInstructionTemplatePayload /** * Template retrieved successfully */ -export const zPostInstructionGenerateTemplateResponse = z.record(z.string(), z.unknown()) +export const zPostInstructionGenerateTemplateResponse = zSimpleDataResponse diff --git a/packages/contracts/generated/api/console/mcp/orpc.gen.ts b/packages/contracts/generated/api/console/mcp/orpc.gen.ts deleted file mode 100644 index 6508e34a42..0000000000 --- a/packages/contracts/generated/api/console/mcp/orpc.gen.ts +++ /dev/null @@ -1,39 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -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', - path: '/mcp/oauth/callback', - tags: ['console'], - }) - .output(zGetMcpOauthCallbackResponse) - -export const callback = { - get, -} - -export const oauth = { - callback, -} - -export const mcp = { - oauth, -} - -export const contract = { - mcp, -} diff --git a/packages/contracts/generated/api/console/mcp/types.gen.ts b/packages/contracts/generated/api/console/mcp/types.gen.ts deleted file mode 100644 index 4e96a66393..0000000000 --- a/packages/contracts/generated/api/console/mcp/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type ClientOptions = { - baseUrl: `${string}://${string}/console/api` | (string & {}) -} - -export type GetMcpOauthCallbackData = { - body?: never - path?: never - query?: never - url: '/mcp/oauth/callback' -} - -export type GetMcpOauthCallbackResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetMcpOauthCallbackResponse - = GetMcpOauthCallbackResponses[keyof GetMcpOauthCallbackResponses] diff --git a/packages/contracts/generated/api/console/mcp/zod.gen.ts b/packages/contracts/generated/api/console/mcp/zod.gen.ts deleted file mode 100644 index ade0c01f7a..0000000000 --- a/packages/contracts/generated/api/console/mcp/zod.gen.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import * as z from 'zod' - -/** - * Success - */ -export const zGetMcpOauthCallbackResponse = z.record(z.string(), z.unknown()) diff --git a/packages/contracts/generated/api/console/notification/orpc.gen.ts b/packages/contracts/generated/api/console/notification/orpc.gen.ts index c7d55612af..6fcfa31376 100644 --- a/packages/contracts/generated/api/console/notification/orpc.gen.ts +++ b/packages/contracts/generated/api/console/notification/orpc.gen.ts @@ -1,27 +1,27 @@ // This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' +import * as z from 'zod' -import { zGetNotificationResponse, zPostNotificationDismissResponse } from './zod.gen' +import { + zGetNotificationResponse, + zPostNotificationDismissBody, + zPostNotificationDismissResponse, +} from './zod.gen' /** * 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({ - 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.', + description: 'Mark a notification as dismissed for the current user.', inputStructure: 'detailed', method: 'POST', operationId: 'postNotificationDismiss', path: '/notification/dismiss', tags: ['console'], }) + .input(z.object({ body: zPostNotificationDismissBody })) .output(zPostNotificationDismissResponse) export const dismiss = { @@ -30,16 +30,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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.', inputStructure: 'detailed', method: 'GET', operationId: 'getNotification', diff --git a/packages/contracts/generated/api/console/notification/types.gen.ts b/packages/contracts/generated/api/console/notification/types.gen.ts index eb068725f3..07376b7a66 100644 --- a/packages/contracts/generated/api/console/notification/types.gen.ts +++ b/packages/contracts/generated/api/console/notification/types.gen.ts @@ -4,10 +4,29 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type NotificationResponse = { + notifications: Array + should_show: boolean +} + +export type DismissNotificationPayload = { + notification_id: string +} + export type SimpleResultResponse = { result: string } +export type NotificationItemResponse = { + body: string + frequency?: string | null + lang: string + notification_id?: string | null + subtitle: string + title: string + title_pic_url: string +} + export type GetNotificationData = { body?: never path?: never @@ -16,37 +35,26 @@ export type GetNotificationData = { } export type GetNotificationErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetNotificationError = GetNotificationErrors[keyof GetNotificationErrors] - export type GetNotificationResponses = { - 200: { - [key: string]: unknown - } + 200: NotificationResponse } export type GetNotificationResponse = GetNotificationResponses[keyof GetNotificationResponses] export type PostNotificationDismissData = { - body?: never + body: DismissNotificationPayload path?: never query?: never url: '/notification/dismiss' } export type PostNotificationDismissErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type PostNotificationDismissError - = PostNotificationDismissErrors[keyof PostNotificationDismissErrors] - export type PostNotificationDismissResponses = { 200: SimpleResultResponse } diff --git a/packages/contracts/generated/api/console/notification/zod.gen.ts b/packages/contracts/generated/api/console/notification/zod.gen.ts index dcf4aaa56b..fb39eada2d 100644 --- a/packages/contracts/generated/api/console/notification/zod.gen.ts +++ b/packages/contracts/generated/api/console/notification/zod.gen.ts @@ -2,6 +2,13 @@ import * as z from 'zod' +/** + * DismissNotificationPayload + */ +export const zDismissNotificationPayload = z.object({ + notification_id: z.string(), +}) + /** * SimpleResultResponse */ @@ -9,10 +16,33 @@ export const zSimpleResultResponse = z.object({ result: z.string(), }) +/** + * NotificationItemResponse + */ +export const zNotificationItemResponse = z.object({ + body: z.string(), + frequency: z.string().nullish(), + lang: z.string(), + notification_id: z.string().nullish(), + subtitle: z.string(), + title: z.string(), + title_pic_url: z.string(), +}) + +/** + * NotificationResponse + */ +export const zNotificationResponse = z.object({ + notifications: z.array(zNotificationItemResponse), + should_show: z.boolean(), +}) + /** * Success — inspect should_show to decide whether to render the modal */ -export const zGetNotificationResponse = z.record(z.string(), z.unknown()) +export const zGetNotificationResponse = zNotificationResponse + +export const zPostNotificationDismissBody = zDismissNotificationPayload /** * Success diff --git a/packages/contracts/generated/api/console/oauth/orpc.gen.ts b/packages/contracts/generated/api/console/oauth/orpc.gen.ts index 5ef03ccb96..ab1bd8552b 100644 --- a/packages/contracts/generated/api/console/oauth/orpc.gen.ts +++ b/packages/contracts/generated/api/console/oauth/orpc.gen.ts @@ -4,9 +4,6 @@ import { oc } from '@orpc/contract' import * as z from 'zod' import { - zGetOauthAuthorizeByProviderPath, - zGetOauthAuthorizeByProviderQuery, - zGetOauthAuthorizeByProviderResponse, zGetOauthDataSourceBindingByProviderPath, zGetOauthDataSourceBindingByProviderQuery, zGetOauthDataSourceBindingByProviderResponse, @@ -14,66 +11,25 @@ import { zGetOauthDataSourceByProviderByBindingIdSyncResponse, zGetOauthDataSourceByProviderPath, zGetOauthDataSourceByProviderResponse, - zGetOauthDataSourceCallbackByProviderPath, - zGetOauthDataSourceCallbackByProviderQuery, - zGetOauthDataSourceCallbackByProviderResponse, - zGetOauthLoginByProviderPath, - zGetOauthLoginByProviderQuery, - zGetOauthLoginByProviderResponse, - zGetOauthPluginByProviderIdDatasourceCallbackPath, - zGetOauthPluginByProviderIdDatasourceCallbackResponse, zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlPath, + zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlQuery, zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse, zGetOauthPluginByProviderToolAuthorizationUrlPath, zGetOauthPluginByProviderToolAuthorizationUrlResponse, - zGetOauthPluginByProviderToolCallbackPath, - zGetOauthPluginByProviderToolCallbackResponse, - zGetOauthPluginByProviderTriggerCallbackPath, - zGetOauthPluginByProviderTriggerCallbackResponse, + zPostOauthProviderAccountBody, zPostOauthProviderAccountResponse, + zPostOauthProviderAuthorizeBody, zPostOauthProviderAuthorizeResponse, + zPostOauthProviderBody, zPostOauthProviderResponse, + zPostOauthProviderTokenBody, zPostOauthProviderTokenResponse, } from './zod.gen' -/** - * 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({ - 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', - path: '/oauth/authorize/{provider}', - tags: ['console'], - }) - .input( - z.object({ - params: zGetOauthAuthorizeByProviderPath, - query: zGetOauthAuthorizeByProviderQuery.optional(), - }), - ) - .output(zGetOauthAuthorizeByProviderResponse) - -export const byProvider = { - get, -} - -export const authorize = { - byProvider, -} - /** * Bind OAuth data source with authorization code */ -export const get2 = oc +export const get = oc .route({ description: 'Bind OAuth data source with authorization code', inputStructure: 'detailed', @@ -85,57 +41,23 @@ export const get2 = oc .input( z.object({ params: zGetOauthDataSourceBindingByProviderPath, - query: zGetOauthDataSourceBindingByProviderQuery.optional(), + query: zGetOauthDataSourceBindingByProviderQuery, }), ) .output(zGetOauthDataSourceBindingByProviderResponse) -export const byProvider2 = { - get: get2, +export const byProvider = { + get, } export const binding = { - byProvider: byProvider2, -} - -/** - * 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({ - 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', - path: '/oauth/data-source/callback/{provider}', - tags: ['console'], - }) - .input( - z.object({ - params: zGetOauthDataSourceCallbackByProviderPath, - query: zGetOauthDataSourceCallbackByProviderQuery.optional(), - }), - ) - .output(zGetOauthDataSourceCallbackByProviderResponse) - -export const byProvider3 = { - get: get3, -} - -export const callback = { - byProvider: byProvider3, + byProvider, } /** * Sync data from OAuth data source */ -export const get4 = oc +export const get2 = oc .route({ description: 'Sync data from OAuth data source', inputStructure: 'detailed', @@ -148,7 +70,7 @@ export const get4 = oc .output(zGetOauthDataSourceByProviderByBindingIdSyncResponse) export const sync = { - get: get4, + get: get2, } export const byBindingId = { @@ -158,7 +80,7 @@ export const byBindingId = { /** * Get OAuth authorization URL for data source provider */ -export const get5 = oc +export const get3 = oc .route({ description: 'Get OAuth authorization URL for data source provider', inputStructure: 'detailed', @@ -170,99 +92,37 @@ export const get5 = oc .input(z.object({ params: zGetOauthDataSourceByProviderPath })) .output(zGetOauthDataSourceByProviderResponse) -export const byProvider4 = { - get: get5, +export const byProvider2 = { + get: get3, byBindingId, } export const dataSource = { binding, - callback, - byProvider: byProvider4, + byProvider: byProvider2, } -/** - * 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 +export const get4 = oc .route({ - 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', - path: '/oauth/login/{provider}', - tags: ['console'], - }) - .input( - z.object({ - params: zGetOauthLoginByProviderPath, - query: zGetOauthLoginByProviderQuery.optional(), - }), - ) - .output(zGetOauthLoginByProviderResponse) - -export const byProvider5 = { - get: get6, -} - -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', - path: '/oauth/plugin/{provider_id}/datasource/callback', - tags: ['console'], - }) - .input(z.object({ params: zGetOauthPluginByProviderIdDatasourceCallbackPath })) - .output(zGetOauthPluginByProviderIdDatasourceCallbackResponse) - -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', path: '/oauth/plugin/{provider_id}/datasource/get-authorization-url', tags: ['console'], }) - .input(z.object({ params: zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlPath })) + .input( + z.object({ + params: zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlPath, + query: zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlQuery.optional(), + }), + ) .output(zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse) export const getAuthorizationUrl = { - get: get8, + get: get4, } export const datasource = { - callback: callback2, getAuthorizationUrl, } @@ -270,16 +130,8 @@ 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 +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: 'getOauthPluginByProviderToolAuthorizationUrl', @@ -290,172 +142,87 @@ export const get9 = oc .output(zGetOauthPluginByProviderToolAuthorizationUrlResponse) 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', - path: '/oauth/plugin/{provider}/tool/callback', - tags: ['console'], - }) - .input(z.object({ params: zGetOauthPluginByProviderToolCallbackPath })) - .output(zGetOauthPluginByProviderToolCallbackResponse) - -export const callback3 = { - get: get10, + get: get5, } export const tool = { authorizationUrl, - callback: callback3, } -/** - * 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', - path: '/oauth/plugin/{provider}/trigger/callback', - summary: 'Handle OAuth callback for trigger provider', - tags: ['console'], - }) - .input(z.object({ params: zGetOauthPluginByProviderTriggerCallbackPath })) - .output(zGetOauthPluginByProviderTriggerCallbackResponse) - -export const callback4 = { - get: get11, -} - -export const trigger = { - callback: callback4, -} - -export const byProvider6 = { +export const byProvider3 = { tool, - trigger, } export const plugin = { byProviderId, - byProvider: byProvider6, + byProvider: byProvider3, } -/** - * Generated 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', path: '/oauth/provider/account', tags: ['console'], }) + .input(z.object({ body: zPostOauthProviderAccountBody })) .output(zPostOauthProviderAccountResponse) 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', path: '/oauth/provider/authorize', tags: ['console'], }) + .input(z.object({ body: zPostOauthProviderAuthorizeBody })) .output(zPostOauthProviderAuthorizeResponse) -export const authorize2 = { +export const authorize = { 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', path: '/oauth/provider/token', tags: ['console'], }) + .input(z.object({ body: zPostOauthProviderTokenBody })) .output(zPostOauthProviderTokenResponse) 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', path: '/oauth/provider', tags: ['console'], }) + .input(z.object({ body: zPostOauthProviderBody })) .output(zPostOauthProviderResponse) export const provider = { post: post4, account, - authorize: authorize2, + authorize, token, } export const oauth = { - authorize, dataSource, - login, plugin, provider, } diff --git a/packages/contracts/generated/api/console/oauth/types.gen.ts b/packages/contracts/generated/api/console/oauth/types.gen.ts index 15bad82f5e..b6d27affa3 100644 --- a/packages/contracts/generated/api/console/oauth/types.gen.ts +++ b/packages/contracts/generated/api/console/oauth/types.gen.ts @@ -16,56 +16,70 @@ export type OAuthDataSourceSyncResponse = { result: string } -export type GetOauthAuthorizeByProviderData = { - body?: never - path: { - provider: string - } - query?: { - code?: string - state?: string - } - url: '/oauth/authorize/{provider}' +export type PluginOAuthAuthorizationUrlResponse = { + authorization_url: string } -export type GetOauthAuthorizeByProviderErrors = { - 400: { +export type OAuthProviderRequest = { + client_id: string + redirect_uri: string +} + +export type OAuthProviderAppResponse = { + app_icon: string + app_label: { [key: string]: unknown } + scope: string } -export type GetOauthAuthorizeByProviderError - = GetOauthAuthorizeByProviderErrors[keyof GetOauthAuthorizeByProviderErrors] - -export type GetOauthAuthorizeByProviderResponses = { - 200: { - [key: string]: unknown - } +export type OAuthClientPayload = { + client_id: string } -export type GetOauthAuthorizeByProviderResponse - = GetOauthAuthorizeByProviderResponses[keyof GetOauthAuthorizeByProviderResponses] +export type OAuthProviderAccountResponse = { + avatar?: string | null + email: string + interface_language: string + name: string + timezone: string +} + +export type OAuthProviderAuthorizeResponse = { + code: string +} + +export type OAuthTokenRequest = { + client_id: string + client_secret?: string | null + code?: string | null + grant_type: string + redirect_uri?: string | null + refresh_token?: string | null +} + +export type OAuthProviderTokenResponse = { + access_token: string + expires_in: number + refresh_token: string + token_type: string +} export type GetOauthDataSourceBindingByProviderData = { body?: never path: { provider: string } - query?: { - code?: string + query: { + code: string } url: '/oauth/data-source/binding/{provider}' } export type GetOauthDataSourceBindingByProviderErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetOauthDataSourceBindingByProviderError - = GetOauthDataSourceBindingByProviderErrors[keyof GetOauthDataSourceBindingByProviderErrors] - export type GetOauthDataSourceBindingByProviderResponses = { 200: OAuthDataSourceBindingResponse } @@ -73,36 +87,6 @@ export type GetOauthDataSourceBindingByProviderResponses = { export type GetOauthDataSourceBindingByProviderResponse = GetOauthDataSourceBindingByProviderResponses[keyof GetOauthDataSourceBindingByProviderResponses] -export type GetOauthDataSourceCallbackByProviderData = { - body?: never - path: { - provider: string - } - query?: { - code?: string - error?: string - } - url: '/oauth/data-source/callback/{provider}' -} - -export type GetOauthDataSourceCallbackByProviderErrors = { - 400: { - [key: string]: unknown - } -} - -export type GetOauthDataSourceCallbackByProviderError - = GetOauthDataSourceCallbackByProviderErrors[keyof GetOauthDataSourceCallbackByProviderErrors] - -export type GetOauthDataSourceCallbackByProviderResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetOauthDataSourceCallbackByProviderResponse - = GetOauthDataSourceCallbackByProviderResponses[keyof GetOauthDataSourceCallbackByProviderResponses] - export type GetOauthDataSourceByProviderData = { body?: never path: { @@ -113,17 +97,10 @@ export type GetOauthDataSourceByProviderData = { } export type GetOauthDataSourceByProviderErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 400: unknown + 403: unknown } -export type GetOauthDataSourceByProviderError - = GetOauthDataSourceByProviderErrors[keyof GetOauthDataSourceByProviderErrors] - export type GetOauthDataSourceByProviderResponses = { 200: OAuthDataSourceResponse } @@ -142,14 +119,9 @@ export type GetOauthDataSourceByProviderByBindingIdSyncData = { } export type GetOauthDataSourceByProviderByBindingIdSyncErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type GetOauthDataSourceByProviderByBindingIdSyncError - = GetOauthDataSourceByProviderByBindingIdSyncErrors[keyof GetOauthDataSourceByProviderByBindingIdSyncErrors] - export type GetOauthDataSourceByProviderByBindingIdSyncResponses = { 200: OAuthDataSourceSyncResponse } @@ -157,66 +129,19 @@ export type GetOauthDataSourceByProviderByBindingIdSyncResponses = { export type GetOauthDataSourceByProviderByBindingIdSyncResponse = GetOauthDataSourceByProviderByBindingIdSyncResponses[keyof GetOauthDataSourceByProviderByBindingIdSyncResponses] -export type GetOauthLoginByProviderData = { - body?: never - path: { - provider: string - } - query?: { - invite_token?: string - } - url: '/oauth/login/{provider}' -} - -export type GetOauthLoginByProviderErrors = { - 400: { - [key: string]: unknown - } -} - -export type GetOauthLoginByProviderError - = GetOauthLoginByProviderErrors[keyof GetOauthLoginByProviderErrors] - -export type GetOauthLoginByProviderResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetOauthLoginByProviderResponse - = GetOauthLoginByProviderResponses[keyof GetOauthLoginByProviderResponses] - -export type GetOauthPluginByProviderIdDatasourceCallbackData = { - body?: never - path: { - provider_id: string - } - query?: never - url: '/oauth/plugin/{provider_id}/datasource/callback' -} - -export type GetOauthPluginByProviderIdDatasourceCallbackResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetOauthPluginByProviderIdDatasourceCallbackResponse - = GetOauthPluginByProviderIdDatasourceCallbackResponses[keyof GetOauthPluginByProviderIdDatasourceCallbackResponses] - export type GetOauthPluginByProviderIdDatasourceGetAuthorizationUrlData = { body?: never path: { provider_id: string } - query?: never + query?: { + credential_id?: string + } url: '/oauth/plugin/{provider_id}/datasource/get-authorization-url' } export type GetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponses = { - 200: { - [key: string]: unknown - } + 200: PluginOAuthAuthorizationUrlResponse } export type GetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse @@ -232,108 +157,62 @@ export type GetOauthPluginByProviderToolAuthorizationUrlData = { } export type GetOauthPluginByProviderToolAuthorizationUrlResponses = { - 200: { - [key: string]: unknown - } + 200: PluginOAuthAuthorizationUrlResponse } export type GetOauthPluginByProviderToolAuthorizationUrlResponse = GetOauthPluginByProviderToolAuthorizationUrlResponses[keyof GetOauthPluginByProviderToolAuthorizationUrlResponses] -export type GetOauthPluginByProviderToolCallbackData = { - body?: never - path: { - provider: string - } - query?: never - url: '/oauth/plugin/{provider}/tool/callback' -} - -export type GetOauthPluginByProviderToolCallbackResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetOauthPluginByProviderToolCallbackResponse - = GetOauthPluginByProviderToolCallbackResponses[keyof GetOauthPluginByProviderToolCallbackResponses] - -export type GetOauthPluginByProviderTriggerCallbackData = { - body?: never - path: { - provider: string - } - query?: never - url: '/oauth/plugin/{provider}/trigger/callback' -} - -export type GetOauthPluginByProviderTriggerCallbackResponses = { - 200: { - [key: string]: unknown - } -} - -export type GetOauthPluginByProviderTriggerCallbackResponse - = GetOauthPluginByProviderTriggerCallbackResponses[keyof GetOauthPluginByProviderTriggerCallbackResponses] - export type PostOauthProviderData = { - body?: never + body: OAuthProviderRequest path?: never query?: never url: '/oauth/provider' } export type PostOauthProviderResponses = { - 200: { - [key: string]: unknown - } + 200: OAuthProviderAppResponse } export type PostOauthProviderResponse = PostOauthProviderResponses[keyof PostOauthProviderResponses] export type PostOauthProviderAccountData = { - body?: never + body: OAuthClientPayload path?: never query?: never url: '/oauth/provider/account' } export type PostOauthProviderAccountResponses = { - 200: { - [key: string]: unknown - } + 200: OAuthProviderAccountResponse } export type PostOauthProviderAccountResponse = PostOauthProviderAccountResponses[keyof PostOauthProviderAccountResponses] export type PostOauthProviderAuthorizeData = { - body?: never + body: OAuthClientPayload path?: never query?: never url: '/oauth/provider/authorize' } export type PostOauthProviderAuthorizeResponses = { - 200: { - [key: string]: unknown - } + 200: OAuthProviderAuthorizeResponse } export type PostOauthProviderAuthorizeResponse = PostOauthProviderAuthorizeResponses[keyof PostOauthProviderAuthorizeResponses] export type PostOauthProviderTokenData = { - body?: never + body: OAuthTokenRequest path?: never query?: never url: '/oauth/provider/token' } export type PostOauthProviderTokenResponses = { - 200: { - [key: string]: unknown - } + 200: OAuthProviderTokenResponse } export type PostOauthProviderTokenResponse diff --git a/packages/contracts/generated/api/console/oauth/zod.gen.ts b/packages/contracts/generated/api/console/oauth/zod.gen.ts index a96b7e3382..569b35ec4d 100644 --- a/packages/contracts/generated/api/console/oauth/zod.gen.ts +++ b/packages/contracts/generated/api/console/oauth/zod.gen.ts @@ -23,26 +23,83 @@ export const zOAuthDataSourceSyncResponse = z.object({ result: z.string(), }) -export const zGetOauthAuthorizeByProviderPath = z.object({ - provider: z.string(), -}) - -export const zGetOauthAuthorizeByProviderQuery = z.object({ - code: z.string().optional(), - state: z.string().optional(), +/** + * PluginOAuthAuthorizationUrlResponse + */ +export const zPluginOAuthAuthorizationUrlResponse = z.object({ + authorization_url: z.string(), }) /** - * Success + * OAuthProviderRequest */ -export const zGetOauthAuthorizeByProviderResponse = z.record(z.string(), z.unknown()) +export const zOAuthProviderRequest = z.object({ + client_id: z.string(), + redirect_uri: z.string(), +}) + +/** + * OAuthProviderAppResponse + */ +export const zOAuthProviderAppResponse = z.object({ + app_icon: z.string(), + app_label: z.record(z.string(), z.unknown()), + scope: z.string(), +}) + +/** + * OAuthClientPayload + */ +export const zOAuthClientPayload = z.object({ + client_id: z.string(), +}) + +/** + * OAuthProviderAccountResponse + */ +export const zOAuthProviderAccountResponse = z.object({ + avatar: z.string().nullish(), + email: z.string(), + interface_language: z.string(), + name: z.string(), + timezone: z.string(), +}) + +/** + * OAuthProviderAuthorizeResponse + */ +export const zOAuthProviderAuthorizeResponse = z.object({ + code: z.string(), +}) + +/** + * OAuthTokenRequest + */ +export const zOAuthTokenRequest = z.object({ + client_id: z.string(), + client_secret: z.string().nullish(), + code: z.string().nullish(), + grant_type: z.string(), + redirect_uri: z.string().nullish(), + refresh_token: z.string().nullish(), +}) + +/** + * OAuthProviderTokenResponse + */ +export const zOAuthProviderTokenResponse = z.object({ + access_token: z.string(), + expires_in: z.int(), + refresh_token: z.string(), + token_type: z.string(), +}) export const zGetOauthDataSourceBindingByProviderPath = z.object({ provider: z.string(), }) export const zGetOauthDataSourceBindingByProviderQuery = z.object({ - code: z.string().optional(), + code: z.string(), }) /** @@ -50,20 +107,6 @@ export const zGetOauthDataSourceBindingByProviderQuery = z.object({ */ export const zGetOauthDataSourceBindingByProviderResponse = zOAuthDataSourceBindingResponse -export const zGetOauthDataSourceCallbackByProviderPath = z.object({ - provider: z.string(), -}) - -export const zGetOauthDataSourceCallbackByProviderQuery = z.object({ - code: z.string().optional(), - error: z.string().optional(), -}) - -/** - * Success - */ -export const zGetOauthDataSourceCallbackByProviderResponse = z.record(z.string(), z.unknown()) - export const zGetOauthDataSourceByProviderPath = z.object({ provider: z.string(), }) @@ -83,89 +126,54 @@ export const zGetOauthDataSourceByProviderByBindingIdSyncPath = z.object({ */ export const zGetOauthDataSourceByProviderByBindingIdSyncResponse = zOAuthDataSourceSyncResponse -export const zGetOauthLoginByProviderPath = z.object({ - provider: z.string(), -}) - -export const zGetOauthLoginByProviderQuery = z.object({ - invite_token: z.string().optional(), -}) - -/** - * Success - */ -export const zGetOauthLoginByProviderResponse = z.record(z.string(), z.unknown()) - -export const zGetOauthPluginByProviderIdDatasourceCallbackPath = z.object({ - provider_id: z.string(), -}) - -/** - * Success - */ -export const zGetOauthPluginByProviderIdDatasourceCallbackResponse = z.record( - z.string(), - z.unknown(), -) - export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlPath = z.object({ provider_id: z.string(), }) +export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlQuery = z.object({ + credential_id: z.string().optional(), +}) + /** - * Success + * Authorization URL retrieved successfully */ -export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse + = zPluginOAuthAuthorizationUrlResponse export const zGetOauthPluginByProviderToolAuthorizationUrlPath = z.object({ provider: z.string(), }) /** - * Success + * Authorization URL retrieved successfully */ -export const zGetOauthPluginByProviderToolAuthorizationUrlResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetOauthPluginByProviderToolAuthorizationUrlResponse + = zPluginOAuthAuthorizationUrlResponse -export const zGetOauthPluginByProviderToolCallbackPath = z.object({ - provider: z.string(), -}) +export const zPostOauthProviderBody = zOAuthProviderRequest /** * Success */ -export const zGetOauthPluginByProviderToolCallbackResponse = z.record(z.string(), z.unknown()) +export const zPostOauthProviderResponse = zOAuthProviderAppResponse -export const zGetOauthPluginByProviderTriggerCallbackPath = z.object({ - provider: z.string(), -}) +export const zPostOauthProviderAccountBody = zOAuthClientPayload /** * Success */ -export const zGetOauthPluginByProviderTriggerCallbackResponse = z.record(z.string(), z.unknown()) +export const zPostOauthProviderAccountResponse = zOAuthProviderAccountResponse + +export const zPostOauthProviderAuthorizeBody = zOAuthClientPayload /** * Success */ -export const zPostOauthProviderResponse = z.record(z.string(), z.unknown()) +export const zPostOauthProviderAuthorizeResponse = zOAuthProviderAuthorizeResponse + +export const zPostOauthProviderTokenBody = zOAuthTokenRequest /** * Success */ -export const zPostOauthProviderAccountResponse = z.record(z.string(), z.unknown()) - -/** - * Success - */ -export const zPostOauthProviderAuthorizeResponse = z.record(z.string(), z.unknown()) - -/** - * Success - */ -export const zPostOauthProviderTokenResponse = z.record(z.string(), z.unknown()) +export const zPostOauthProviderTokenResponse = zOAuthProviderTokenResponse diff --git a/packages/contracts/generated/api/console/orpc.gen.ts b/packages/contracts/generated/api/console/orpc.gen.ts index ef5f95f637..ec59d8cccd 100644 --- a/packages/contracts/generated/api/console/orpc.gen.ts +++ b/packages/contracts/generated/api/console/orpc.gen.ts @@ -27,7 +27,6 @@ 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' @@ -79,7 +78,6 @@ export const contract = { instructionGenerate, login, logout, - mcp, notification, notion, oauth, diff --git a/packages/contracts/generated/api/console/rag/orpc.gen.ts b/packages/contracts/generated/api/console/rag/orpc.gen.ts index a4d22839fe..ea52e39d5f 100644 --- a/packages/contracts/generated/api/console/rag/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rag/orpc.gen.ts @@ -22,8 +22,10 @@ import { zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdPath, zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse, zGetRagPipelinesByPipelineIdWorkflowRunsPath, + zGetRagPipelinesByPipelineIdWorkflowRunsQuery, zGetRagPipelinesByPipelineIdWorkflowRunsResponse, zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath, + zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery, zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse, zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsPath, zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse, @@ -35,8 +37,10 @@ import { zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse, zGetRagPipelinesByPipelineIdWorkflowsDraftPath, zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath, + zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersQuery, zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse, zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath, + zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersQuery, zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse, zGetRagPipelinesByPipelineIdWorkflowsDraftResponse, zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesPath, @@ -44,18 +48,23 @@ import { zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath, zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse, zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath, + zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesQuery, zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse, zGetRagPipelinesByPipelineIdWorkflowsPath, zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath, + zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersQuery, zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse, zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath, + zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersQuery, zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse, zGetRagPipelinesByPipelineIdWorkflowsPublishPath, zGetRagPipelinesByPipelineIdWorkflowsPublishResponse, + zGetRagPipelinesByPipelineIdWorkflowsQuery, zGetRagPipelinesByPipelineIdWorkflowsResponse, zGetRagPipelinesDatasourcePluginsResponse, zGetRagPipelinesImportsByPipelineIdCheckDependenciesPath, zGetRagPipelinesImportsByPipelineIdCheckDependenciesResponse, + zGetRagPipelinesRecommendedPluginsQuery, zGetRagPipelinesRecommendedPluginsResponse, zGetRagPipelineTemplatesByTemplateIdPath, zGetRagPipelineTemplatesByTemplateIdQuery, @@ -65,6 +74,7 @@ import { zPatchRagPipelineCustomizedTemplatesByTemplateIdBody, zPatchRagPipelineCustomizedTemplatesByTemplateIdPath, zPatchRagPipelineCustomizedTemplatesByTemplateIdResponse, + zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdBody, zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath, zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse, zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdBody, @@ -82,6 +92,7 @@ import { zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopResponse, zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestorePath, zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestoreResponse, + zPostRagPipelinesByPipelineIdWorkflowsDraftBody, zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunBody, zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunPath, zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponse, @@ -135,16 +146,8 @@ 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', @@ -216,16 +219,8 @@ 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', @@ -244,16 +239,8 @@ 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', @@ -275,16 +262,8 @@ 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', @@ -352,38 +331,23 @@ 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', path: '/rag/pipelines/recommended-plugins', tags: ['console'], }) + .input(z.object({ query: zGetRagPipelinesRecommendedPluginsQuery.optional() })) .output(zGetRagPipelinesRecommendedPluginsResponse) 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', @@ -405,16 +369,8 @@ 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', @@ -536,7 +492,12 @@ export const get9 = oc summary: 'Get workflow run list', tags: ['console'], }) - .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowRunsPath })) + .input( + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowRunsPath, + query: zGetRagPipelinesByPipelineIdWorkflowRunsQuery.optional(), + }), + ) .output(zGetRagPipelinesByPipelineIdWorkflowRunsResponse) export const workflowRuns = { @@ -547,16 +508,9 @@ 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', @@ -567,6 +521,8 @@ export const get10 = oc .input( z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath, + query: + zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery.optional(), }), ) .output(zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse) @@ -577,16 +533,9 @@ 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', @@ -604,16 +553,9 @@ 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', @@ -643,16 +585,9 @@ 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', @@ -679,16 +614,9 @@ export const datasource = { /** * Get 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 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', @@ -705,16 +633,9 @@ 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', @@ -748,16 +669,9 @@ 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', @@ -806,16 +720,9 @@ 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', @@ -835,20 +742,13 @@ 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', path: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables', + successStatus: 204, tags: ['console'], }) .input( @@ -856,16 +756,8 @@ 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', @@ -892,16 +784,9 @@ 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', @@ -910,7 +795,10 @@ export const get15 = oc tags: ['console'], }) .input( - z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath }), + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath, + query: zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersQuery, + }), ) .output(zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse) @@ -924,16 +812,9 @@ 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', @@ -941,7 +822,12 @@ export const get16 = oc summary: 'Get second step parameters of rag pipeline', tags: ['console'], }) - .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath })) + .input( + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath, + query: zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersQuery, + }), + ) .output(zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse) export const parameters2 = { @@ -954,16 +840,9 @@ 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', @@ -983,16 +862,8 @@ 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', @@ -1006,16 +877,8 @@ 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', @@ -1031,20 +894,13 @@ 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', path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}', + successStatus: 204, tags: ['console'], }) .input( @@ -1052,16 +908,8 @@ 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', @@ -1071,16 +919,8 @@ 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', @@ -1102,20 +942,13 @@ 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', path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables', + successStatus: 204, tags: ['console'], }) .input(z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesPath })) @@ -1123,16 +956,9 @@ export const delete4 = oc /** * Get 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 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', @@ -1140,7 +966,12 @@ export const get19 = oc summary: 'Get draft workflow', tags: ['console'], }) - .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath })) + .input( + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath, + query: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesQuery.optional(), + }), + ) .output(zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse) export const variables2 = { @@ -1151,16 +982,9 @@ 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', @@ -1173,16 +997,9 @@ 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', @@ -1190,7 +1007,12 @@ export const post15 = oc summary: 'Sync draft workflow', tags: ['console'], }) - .input(z.object({ params: zPostRagPipelinesByPipelineIdWorkflowsDraftPath })) + .input( + z.object({ + body: zPostRagPipelinesByPipelineIdWorkflowsDraftBody, + params: zPostRagPipelinesByPipelineIdWorkflowsDraftPath, + }), + ) .output(zPostRagPipelinesByPipelineIdWorkflowsDraftResponse) export const draft = { @@ -1210,16 +1032,9 @@ 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', @@ -1252,16 +1067,9 @@ 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', @@ -1283,16 +1091,9 @@ 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', @@ -1327,16 +1128,9 @@ 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', @@ -1345,7 +1139,10 @@ export const get22 = oc tags: ['console'], }) .input( - z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath }), + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath, + query: zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersQuery, + }), ) .output(zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse) @@ -1359,16 +1156,9 @@ 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', @@ -1377,7 +1167,10 @@ export const get23 = oc tags: ['console'], }) .input( - z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath }), + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath, + query: zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersQuery, + }), ) .output(zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse) @@ -1391,16 +1184,9 @@ 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', @@ -1460,16 +1246,9 @@ 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', @@ -1477,7 +1256,12 @@ export const patch3 = oc summary: 'Update workflow attributes', tags: ['console'], }) - .input(z.object({ params: zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath })) + .input( + z.object({ + body: zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdBody, + params: zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath, + }), + ) .output(zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse) export const byWorkflowId = { @@ -1488,16 +1272,9 @@ 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', @@ -1505,7 +1282,12 @@ export const get24 = oc summary: 'Get published workflows', tags: ['console'], }) - .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPath })) + .input( + z.object({ + params: zGetRagPipelinesByPipelineIdWorkflowsPath, + query: zGetRagPipelinesByPipelineIdWorkflowsQuery.optional(), + }), + ) .output(zGetRagPipelinesByPipelineIdWorkflowsResponse) export const workflows = { diff --git a/packages/contracts/generated/api/console/rag/types.gen.ts b/packages/contracts/generated/api/console/rag/types.gen.ts index 00d9fe0013..49572f971b 100644 --- a/packages/contracts/generated/api/console/rag/types.gen.ts +++ b/packages/contracts/generated/api/console/rag/types.gen.ts @@ -87,6 +87,8 @@ export type PipelineTemplateDetailResponse = { name: string } +export type RagPipelineOpaqueResponse = unknown + export type RagPipelineImportPayload = { description?: string | null icon?: string | null @@ -143,6 +145,14 @@ export type WorkflowPaginationResponse = { page: number } +export type DefaultBlockConfigsResponse = Array<{ + [key: string]: unknown +}> + +export type DefaultBlockConfigResponse = { + [key: string]: unknown +} + export type WorkflowResponse = { conversation_variables: Array created_at: number @@ -165,6 +175,25 @@ export type WorkflowResponse = { version: string } +export type DraftWorkflowSyncPayload = { + conversation_variables?: Array<{ + [key: string]: unknown + }> | null + environment_variables?: Array<{ + [key: string]: unknown + }> | null + features?: { + [key: string]: unknown + } | null + graph: { + [key: string]: unknown + } + hash?: string | null + rag_pipeline_variables?: Array<{ + [key: string]: unknown + }> | null +} + export type RagPipelineWorkflowSyncResponse = { hash: string result: string @@ -213,6 +242,10 @@ export type WorkflowRunNodeExecutionResponse = { title?: string | null } +export type EnvironmentVariableListResponse = { + items: Array +} + export type NodeRunPayload = { inputs?: { [key: string]: unknown @@ -225,6 +258,14 @@ export type NodeRunRequiredPayload = { } } +export type WorkflowDraftVariableList = { + items?: Array +} + +export type RagPipelineStepParametersResponse = { + variables: unknown +} + export type DraftWorkflowRunPayload = { datasource_info_list: Array<{ [key: string]: unknown @@ -236,6 +277,36 @@ export type DraftWorkflowRunPayload = { start_node_id: string } +export type WorkflowDraftVariableListWithoutValue = { + items?: Array + total?: number +} + +export type WorkflowDraftVariable = { + description?: string + edited?: boolean + full_content?: { + [key: string]: unknown + } + id?: string + is_truncated?: boolean + name?: string + selector?: Array + type?: string + value?: + | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + value_type?: string + visible?: boolean +} + export type WorkflowDraftVariablePatchPayload = { name?: string | null value?: unknown | null @@ -254,6 +325,8 @@ export type Parser = { } } +export type DataSourceContentPreviewResponse = unknown + export type PublishedWorkflowRunPayload = { datasource_info_list: Array<{ [key: string]: unknown @@ -268,6 +341,11 @@ export type PublishedWorkflowRunPayload = { start_node_id: string } +export type WorkflowUpdatePayload = { + marked_comment?: string | null + marked_name?: string | null +} + export type ImportStatus = 'completed' | 'completed-with-warnings' | 'failed' | 'pending' export type DatasetDocMetadataResponse = { @@ -370,9 +448,7 @@ export type WorkflowConversationVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -380,9 +456,7 @@ export type WorkflowEnvironmentVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -391,9 +465,7 @@ export type PipelineVariableResponse = { allowed_file_types?: Array | null allowed_file_upload_methods?: Array | null belong_to_node_id: string - default_value?: { - [key: string]: unknown - } + default_value?: unknown label: string max_length?: number | null options?: Array | null @@ -405,6 +477,31 @@ export type PipelineVariableResponse = { variable: string } +export type EnvironmentVariableItemResponse = { + description?: string | null + editable: boolean + edited: boolean + id: string + name: string + selector: Array + type: string + value: unknown + value_type: string + visible: boolean +} + +export type WorkflowDraftVariableWithoutValue = { + description?: string + edited?: boolean + id?: string + is_truncated?: boolean + name?: string + selector?: Array + type?: string + value_type?: string + visible?: boolean +} + export type DatasetRerankingModelResponse = { reranking_model_name?: string | null reranking_provider_name?: string | null @@ -564,9 +661,7 @@ export type GetRagPipelinesDatasourcePluginsData = { } export type GetRagPipelinesDatasourcePluginsResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type GetRagPipelinesDatasourcePluginsResponse @@ -636,14 +731,14 @@ export type GetRagPipelinesImportsByPipelineIdCheckDependenciesResponse export type GetRagPipelinesRecommendedPluginsData = { body?: never path?: never - query?: never + query?: { + type?: string + } url: '/rag/pipelines/recommended-plugins' } export type GetRagPipelinesRecommendedPluginsResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type GetRagPipelinesRecommendedPluginsResponse @@ -659,9 +754,7 @@ export type PostRagPipelinesTransformDatasetsByDatasetIdData = { } export type PostRagPipelinesTransformDatasetsByDatasetIdResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesTransformDatasetsByDatasetIdResponse @@ -706,7 +799,10 @@ export type GetRagPipelinesByPipelineIdWorkflowRunsData = { path: { pipeline_id: string } - query?: never + query?: { + last_id?: string + limit?: number + } url: '/rag/pipelines/{pipeline_id}/workflow-runs' } @@ -773,19 +869,19 @@ export type GetRagPipelinesByPipelineIdWorkflowsData = { path: { pipeline_id: string } - query?: never + query?: { + limit?: number + named_only?: boolean + page?: number + user_id?: string + } url: '/rag/pipelines/{pipeline_id}/workflows' } export type GetRagPipelinesByPipelineIdWorkflowsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type GetRagPipelinesByPipelineIdWorkflowsError - = GetRagPipelinesByPipelineIdWorkflowsErrors[keyof GetRagPipelinesByPipelineIdWorkflowsErrors] - export type GetRagPipelinesByPipelineIdWorkflowsResponses = { 200: WorkflowPaginationResponse } @@ -803,9 +899,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsData } export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultBlockConfigsResponse } export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse @@ -817,14 +911,14 @@ export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlo block_type: string pipeline_id: string } - query?: never + query?: { + q?: string + } url: '/rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs/{block_type}' } export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultBlockConfigResponse } export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse @@ -840,14 +934,9 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftData = { } export type GetRagPipelinesByPipelineIdWorkflowsDraftErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetRagPipelinesByPipelineIdWorkflowsDraftError - = GetRagPipelinesByPipelineIdWorkflowsDraftErrors[keyof GetRagPipelinesByPipelineIdWorkflowsDraftErrors] - export type GetRagPipelinesByPipelineIdWorkflowsDraftResponses = { 200: WorkflowResponse } @@ -856,7 +945,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftResponse = GetRagPipelinesByPipelineIdWorkflowsDraftResponses[keyof GetRagPipelinesByPipelineIdWorkflowsDraftResponses] export type PostRagPipelinesByPipelineIdWorkflowsDraftData = { - body?: never + body: DraftWorkflowSyncPayload path: { pipeline_id: string } @@ -882,9 +971,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRun } export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponse @@ -916,9 +1003,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesData = } export type GetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: EnvironmentVariableListResponse } export type GetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponse @@ -935,9 +1020,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunD } export type PostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunResponse @@ -954,9 +1037,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunData = } export type PostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponse @@ -1007,9 +1088,7 @@ export type DeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesDa } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse @@ -1026,9 +1105,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesData } export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariableList } export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse @@ -1039,14 +1116,14 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersData path: { pipeline_id: string } - query?: never + query: { + node_id: string + } url: '/rag/pipelines/{pipeline_id}/workflows/draft/pre-processing/parameters' } export type GetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineStepParametersResponse } export type GetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse @@ -1057,14 +1134,14 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersData = path: { pipeline_id: string } - query?: never + query: { + node_id: string + } url: '/rag/pipelines/{pipeline_id}/workflows/draft/processing/parameters' } export type GetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineStepParametersResponse } export type GetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse @@ -1080,9 +1157,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftRunData = { } export type PostRagPipelinesByPipelineIdWorkflowsDraftRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsDraftRunResponse @@ -1098,9 +1173,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesData = { } export type GetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariableList } export type GetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponse @@ -1116,9 +1189,7 @@ export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesData = { } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse @@ -1129,14 +1200,15 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesData = { path: { pipeline_id: string } - query?: never + query?: { + limit?: number + page?: number + } url: '/rag/pipelines/{pipeline_id}/workflows/draft/variables' } export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariableListWithoutValue } export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse @@ -1153,9 +1225,7 @@ export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdDat } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponses = { - 200: { - [key: string]: unknown - } + 204: void } export type DeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse @@ -1172,9 +1242,7 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdData = } export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariable } export type GetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse @@ -1191,9 +1259,7 @@ export type PatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdData } export type PatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariable } export type PatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse @@ -1210,9 +1276,8 @@ export type PutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetD } export type PutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowDraftVariable + 204: void } export type PutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse @@ -1262,9 +1327,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeI export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewResponses = { - 200: { - [key: string]: unknown - } + 200: DataSourceContentPreviewResponse } export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewResponse @@ -1281,9 +1344,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeI } export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunResponse @@ -1294,14 +1355,14 @@ export type GetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParameters path: { pipeline_id: string } - query?: never + query: { + node_id: string + } url: '/rag/pipelines/{pipeline_id}/workflows/published/pre-processing/parameters' } export type GetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineStepParametersResponse } export type GetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse @@ -1312,14 +1373,14 @@ export type GetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersDat path: { pipeline_id: string } - query?: never + query: { + node_id: string + } url: '/rag/pipelines/{pipeline_id}/workflows/published/processing/parameters' } export type GetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineStepParametersResponse } export type GetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse @@ -1335,9 +1396,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsPublishedRunData = { } export type PostRagPipelinesByPipelineIdWorkflowsPublishedRunResponses = { - 200: { - [key: string]: unknown - } + 200: RagPipelineOpaqueResponse } export type PostRagPipelinesByPipelineIdWorkflowsPublishedRunResponse @@ -1361,7 +1420,7 @@ export type DeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse = DeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponses[keyof DeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponses] export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdData = { - body?: never + body: WorkflowUpdatePayload path: { pipeline_id: string workflow_id: string @@ -1371,20 +1430,11 @@ export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdData = { } export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors = { - 400: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 403: unknown + 404: unknown } -export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdError - = PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors[keyof PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdErrors] - export type PatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponses = { 200: WorkflowResponse } diff --git a/packages/contracts/generated/api/console/rag/zod.gen.ts b/packages/contracts/generated/api/console/rag/zod.gen.ts index 7506d274fe..31120fab14 100644 --- a/packages/contracts/generated/api/console/rag/zod.gen.ts +++ b/packages/contracts/generated/api/console/rag/zod.gen.ts @@ -39,6 +39,11 @@ export const zPipelineTemplateDetailResponse = z.object({ name: z.string(), }) +/** + * RagPipelineOpaqueResponse + */ +export const zRagPipelineOpaqueResponse = z.unknown() + /** * RagPipelineImportPayload */ @@ -61,6 +66,28 @@ export const zSimpleResultResponse = z.object({ result: z.string(), }) +/** + * DefaultBlockConfigsResponse + */ +export const zDefaultBlockConfigsResponse = z.array(z.record(z.string(), z.unknown())) + +/** + * DefaultBlockConfigResponse + */ +export const zDefaultBlockConfigResponse = z.record(z.string(), z.unknown()) + +/** + * DraftWorkflowSyncPayload + */ +export const zDraftWorkflowSyncPayload = z.object({ + conversation_variables: z.array(z.record(z.string(), z.unknown())).nullish(), + environment_variables: z.array(z.record(z.string(), z.unknown())).nullish(), + features: z.record(z.string(), z.unknown()).nullish(), + graph: z.record(z.string(), z.unknown()), + hash: z.string().nullish(), + rag_pipeline_variables: z.array(z.record(z.string(), z.unknown())).nullish(), +}) + /** * RagPipelineWorkflowSyncResponse */ @@ -103,6 +130,13 @@ export const zNodeRunRequiredPayload = z.object({ inputs: z.record(z.string(), z.unknown()), }) +/** + * RagPipelineStepParametersResponse + */ +export const zRagPipelineStepParametersResponse = z.object({ + variables: z.unknown(), +}) + /** * DraftWorkflowRunPayload */ @@ -113,6 +147,33 @@ export const zDraftWorkflowRunPayload = z.object({ start_node_id: z.string(), }) +export const zWorkflowDraftVariable = z.object({ + description: z.string().optional(), + edited: z.boolean().optional(), + full_content: z.record(z.string(), z.unknown()).optional(), + id: z.string().optional(), + is_truncated: z.boolean().optional(), + name: z.string().optional(), + selector: z.array(z.string()).optional(), + type: z.string().optional(), + value: z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullish(), + value_type: z.string().optional(), + visible: z.boolean().optional(), +}) + +export const zWorkflowDraftVariableList = z.object({ + items: z.array(zWorkflowDraftVariable).optional(), +}) + /** * WorkflowDraftVariablePatchPayload */ @@ -138,6 +199,11 @@ export const zParser = z.object({ inputs: z.record(z.string(), z.unknown()), }) +/** + * DataSourceContentPreviewResponse + */ +export const zDataSourceContentPreviewResponse = z.unknown() + /** * PublishedWorkflowRunPayload */ @@ -151,6 +217,14 @@ export const zPublishedWorkflowRunPayload = z.object({ start_node_id: z.string(), }) +/** + * WorkflowUpdatePayload + */ +export const zWorkflowUpdatePayload = z.object({ + marked_comment: z.string().max(100).nullish(), + marked_name: z.string().max(20).nullish(), +}) + /** * ImportStatus */ @@ -356,7 +430,7 @@ export const zWorkflowConversationVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -367,7 +441,7 @@ export const zWorkflowEnvironmentVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -379,7 +453,7 @@ export const zPipelineVariableResponse = z.object({ 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(), + default_value: z.unknown().optional(), label: z.string(), max_length: z.int().nullish(), options: z.array(z.string()).nullish(), @@ -422,6 +496,46 @@ export const zWorkflowPaginationResponse = z.object({ page: z.int(), }) +/** + * EnvironmentVariableItemResponse + */ +export const zEnvironmentVariableItemResponse = z.object({ + description: z.string().nullish(), + editable: z.boolean(), + edited: z.boolean(), + id: z.string(), + name: z.string(), + selector: z.array(z.string()), + type: z.string(), + value: z.unknown(), + value_type: z.string(), + visible: z.boolean(), +}) + +/** + * EnvironmentVariableListResponse + */ +export const zEnvironmentVariableListResponse = z.object({ + items: z.array(zEnvironmentVariableItemResponse), +}) + +export const zWorkflowDraftVariableWithoutValue = z.object({ + description: z.string().optional(), + edited: z.boolean().optional(), + id: z.string().optional(), + is_truncated: z.boolean().optional(), + name: z.string().optional(), + selector: z.array(z.string()).optional(), + type: z.string().optional(), + value_type: z.string().optional(), + visible: z.boolean().optional(), +}) + +export const zWorkflowDraftVariableListWithoutValue = z.object({ + items: z.array(zWorkflowDraftVariableWithoutValue).optional(), + total: z.int().optional(), +}) + /** * DatasetRerankingModelResponse */ @@ -625,7 +739,7 @@ export const zGetRagPipelineTemplatesByTemplateIdResponse = zPipelineTemplateDet /** * Success */ -export const zGetRagPipelinesDatasourcePluginsResponse = z.record(z.string(), z.unknown()) +export const zGetRagPipelinesDatasourcePluginsResponse = zRagPipelineOpaqueResponse export const zPostRagPipelinesImportsBody = zRagPipelineImportPayload @@ -653,10 +767,14 @@ export const zGetRagPipelinesImportsByPipelineIdCheckDependenciesPath = z.object export const zGetRagPipelinesImportsByPipelineIdCheckDependenciesResponse = zRagPipelineImportCheckDependenciesResponse +export const zGetRagPipelinesRecommendedPluginsQuery = z.object({ + type: z.string().optional().default('all'), +}) + /** * Success */ -export const zGetRagPipelinesRecommendedPluginsResponse = z.record(z.string(), z.unknown()) +export const zGetRagPipelinesRecommendedPluginsResponse = zRagPipelineOpaqueResponse export const zPostRagPipelinesTransformDatasetsByDatasetIdPath = z.object({ dataset_id: z.string(), @@ -665,10 +783,7 @@ export const zPostRagPipelinesTransformDatasetsByDatasetIdPath = z.object({ /** * Success */ -export const zPostRagPipelinesTransformDatasetsByDatasetIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostRagPipelinesTransformDatasetsByDatasetIdResponse = zRagPipelineOpaqueResponse export const zPostRagPipelinesByPipelineIdCustomizedPublishBody = zCustomizedPipelineTemplatePayload @@ -698,6 +813,11 @@ export const zGetRagPipelinesByPipelineIdWorkflowRunsPath = z.object({ pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowRunsQuery = z.object({ + last_id: z.string().optional(), + limit: z.int().gte(1).lte(100).optional().default(20), +}) + /** * Workflow runs retrieved successfully */ @@ -739,6 +859,13 @@ export const zGetRagPipelinesByPipelineIdWorkflowsPath = z.object({ pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowsQuery = z.object({ + limit: z.int().gte(1).lte(100).optional().default(10), + named_only: z.boolean().optional().default(false), + page: z.int().gte(1).lte(99999).optional().default(1), + user_id: z.string().optional(), +}) + /** * Published workflows retrieved successfully */ @@ -749,12 +876,10 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsPat }) /** - * Success + * Default block configs retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse + = zDefaultBlockConfigsResponse export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath = z.object({ @@ -762,11 +887,16 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByB pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery + = z.object({ + q: z.string().optional(), + }) + /** - * Success + * Default block config retrieved successfully */ export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse - = z.record(z.string(), z.unknown()) + = zDefaultBlockConfigResponse export const zGetRagPipelinesByPipelineIdWorkflowsDraftPath = z.object({ pipeline_id: z.string(), @@ -777,6 +907,8 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDraftPath = z.object({ */ export const zGetRagPipelinesByPipelineIdWorkflowsDraftResponse = zWorkflowResponse +export const zPostRagPipelinesByPipelineIdWorkflowsDraftBody = zDraftWorkflowSyncPayload + export const zPostRagPipelinesByPipelineIdWorkflowsDraftPath = z.object({ pipeline_id: z.string(), }) @@ -798,7 +930,7 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdR * Success */ export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponse - = z.record(z.string(), z.unknown()) + = zRagPipelineOpaqueResponse export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectBody = zDatasourceVariablesPayload @@ -818,12 +950,10 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesPath }) /** - * Success + * Environment variables retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponse + = zEnvironmentVariableListResponse export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunBody = zNodeRunPayload @@ -837,7 +967,7 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRu * Success */ export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunResponse - = z.record(z.string(), z.unknown()) + = zRagPipelineOpaqueResponse export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunBody = zNodeRunPayload @@ -849,10 +979,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunPath /** * Success */ -export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponse + = zRagPipelineOpaqueResponse export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunPath = z.object({ node_id: z.string(), @@ -885,12 +1013,9 @@ export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables }) /** - * Success + * Node variables deleted successfully */ -export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse = z.void() export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath = z.object({ node_id: z.string(), @@ -898,36 +1023,38 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPat }) /** - * Success + * Node variables retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse + = zWorkflowDraftVariableList export const zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath = z.object({ pipeline_id: z.string(), }) -/** - * Success - */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse = z.record( - z.string(), - z.unknown(), -) - -export const zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath = z.object({ - pipeline_id: z.string(), +export const zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersQuery = z.object({ + node_id: z.string(), }) /** * Success */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse + = zRagPipelineStepParametersResponse + +export const zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath = z.object({ + pipeline_id: z.string(), +}) + +export const zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersQuery = z.object({ + node_id: z.string(), +}) + +/** + * Success + */ +export const zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse + = zRagPipelineStepParametersResponse export const zPostRagPipelinesByPipelineIdWorkflowsDraftRunBody = zDraftWorkflowRunPayload @@ -938,46 +1065,41 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftRunPath = z.object({ /** * Success */ -export const zPostRagPipelinesByPipelineIdWorkflowsDraftRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostRagPipelinesByPipelineIdWorkflowsDraftRunResponse = zRagPipelineOpaqueResponse export const zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesPath = z.object({ pipeline_id: z.string(), }) /** - * Success + * System variables retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponse + = zWorkflowDraftVariableList export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesPath = z.object({ pipeline_id: z.string(), }) /** - * Success + * Workflow variables deleted successfully */ -export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse = z.void() export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath = z.object({ pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesQuery = z.object({ + limit: z.int().gte(1).lte(100).optional().default(20), + page: z.int().gte(1).lte(100000).optional().default(1), +}) + /** - * Success + * Workflow variables retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse + = zWorkflowDraftVariableListWithoutValue export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath = z.object({ pipeline_id: z.string(), @@ -985,12 +1107,9 @@ export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdP }) /** - * Success + * Variable deleted successfully */ -export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse = z.void() export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath = z.object({ pipeline_id: z.string(), @@ -998,12 +1117,10 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath }) /** - * Success + * Variable retrieved successfully */ -export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse + = zWorkflowDraftVariable export const zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdBody = zWorkflowDraftVariablePatchPayload @@ -1014,23 +1131,19 @@ export const zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPa }) /** - * Success + * Variable updated successfully */ -export const zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse + = zWorkflowDraftVariable export const zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetPath = z.object({ pipeline_id: z.string(), variable_id: z.string(), }) -/** - * Success - */ -export const zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse - = z.record(z.string(), z.unknown()) +export const zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse = z.union( + [zWorkflowDraftVariable, z.void()], +) export const zGetRagPipelinesByPipelineIdWorkflowsPublishPath = z.object({ pipeline_id: z.string(), @@ -1064,7 +1177,7 @@ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNod * Success */ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewResponse - = z.record(z.string(), z.unknown()) + = zDataSourceContentPreviewResponse export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunBody = zDatasourceNodeRunPayload @@ -1079,29 +1192,35 @@ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNod * Success */ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunResponse - = z.record(z.string(), z.unknown()) + = zRagPipelineOpaqueResponse export const zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath = z.object({ pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersQuery = z.object({ + node_id: z.string(), +}) + /** * Success */ export const zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse - = z.record(z.string(), z.unknown()) + = zRagPipelineStepParametersResponse export const zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath = z.object({ pipeline_id: z.string(), }) +export const zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersQuery = z.object({ + node_id: z.string(), +}) + /** * Success */ -export const zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse + = zRagPipelineStepParametersResponse export const zPostRagPipelinesByPipelineIdWorkflowsPublishedRunBody = zPublishedWorkflowRunPayload @@ -1112,10 +1231,7 @@ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedRunPath = z.object({ /** * Success */ -export const zPostRagPipelinesByPipelineIdWorkflowsPublishedRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostRagPipelinesByPipelineIdWorkflowsPublishedRunResponse = zRagPipelineOpaqueResponse export const zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath = z.object({ pipeline_id: z.string(), @@ -1127,6 +1243,8 @@ export const zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath = z.object */ export const zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse = z.void() +export const zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdBody = zWorkflowUpdatePayload + export const zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath = z.object({ pipeline_id: z.string(), workflow_id: z.string(), 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 fb3909f748..1c5252525c 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,16 +7,10 @@ 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({ - 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.', + description: 'Generate code rules using LLM', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleCodeGenerate', diff --git a/packages/contracts/generated/api/console/rule-code-generate/types.gen.ts b/packages/contracts/generated/api/console/rule-code-generate/types.gen.ts index c5fafa90a9..a1165a4f8a 100644 --- a/packages/contracts/generated/api/console/rule-code-generate/types.gen.ts +++ b/packages/contracts/generated/api/console/rule-code-generate/types.gen.ts @@ -11,6 +11,8 @@ export type RuleCodeGeneratePayload = { no_variable?: boolean } +export type GeneratorResponse = unknown + export type ModelConfig = { completion_params?: { [key: string]: unknown @@ -30,20 +32,12 @@ export type PostRuleCodeGenerateData = { } export type PostRuleCodeGenerateErrors = { - 400: { - [key: string]: unknown - } - 402: { - [key: string]: unknown - } + 400: unknown + 402: unknown } -export type PostRuleCodeGenerateError = PostRuleCodeGenerateErrors[keyof PostRuleCodeGenerateErrors] - export type PostRuleCodeGenerateResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratorResponse } export type PostRuleCodeGenerateResponse diff --git a/packages/contracts/generated/api/console/rule-code-generate/zod.gen.ts b/packages/contracts/generated/api/console/rule-code-generate/zod.gen.ts index f98d2f5dc0..97e1b81628 100644 --- a/packages/contracts/generated/api/console/rule-code-generate/zod.gen.ts +++ b/packages/contracts/generated/api/console/rule-code-generate/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * GeneratorResponse + */ +export const zGeneratorResponse = z.unknown() + /** * LLMMode * @@ -34,4 +39,4 @@ export const zPostRuleCodeGenerateBody = zRuleCodeGeneratePayload /** * Code rules generated successfully */ -export const zPostRuleCodeGenerateResponse = z.record(z.string(), z.unknown()) +export const zPostRuleCodeGenerateResponse = zGeneratorResponse 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 1351b459cc..7bd233de2b 100644 --- a/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/rule-generate/orpc.gen.ts @@ -7,16 +7,10 @@ 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({ - 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.', + description: 'Generate rule configuration using LLM', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleGenerate', diff --git a/packages/contracts/generated/api/console/rule-generate/types.gen.ts b/packages/contracts/generated/api/console/rule-generate/types.gen.ts index 01f44c096c..4e7c142146 100644 --- a/packages/contracts/generated/api/console/rule-generate/types.gen.ts +++ b/packages/contracts/generated/api/console/rule-generate/types.gen.ts @@ -10,6 +10,8 @@ export type RuleGeneratePayload = { no_variable?: boolean } +export type GeneratorResponse = unknown + export type ModelConfig = { completion_params?: { [key: string]: unknown @@ -29,20 +31,12 @@ export type PostRuleGenerateData = { } export type PostRuleGenerateErrors = { - 400: { - [key: string]: unknown - } - 402: { - [key: string]: unknown - } + 400: unknown + 402: unknown } -export type PostRuleGenerateError = PostRuleGenerateErrors[keyof PostRuleGenerateErrors] - export type PostRuleGenerateResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratorResponse } export type PostRuleGenerateResponse = PostRuleGenerateResponses[keyof PostRuleGenerateResponses] diff --git a/packages/contracts/generated/api/console/rule-generate/zod.gen.ts b/packages/contracts/generated/api/console/rule-generate/zod.gen.ts index aae7b67f0f..6e539e63f4 100644 --- a/packages/contracts/generated/api/console/rule-generate/zod.gen.ts +++ b/packages/contracts/generated/api/console/rule-generate/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * GeneratorResponse + */ +export const zGeneratorResponse = z.unknown() + /** * LLMMode * @@ -33,4 +38,4 @@ export const zPostRuleGenerateBody = zRuleGeneratePayload /** * Rule configuration generated successfully */ -export const zPostRuleGenerateResponse = z.record(z.string(), z.unknown()) +export const zPostRuleGenerateResponse = zGeneratorResponse 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 3fef5f3c3f..276442f1c9 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,16 +10,10 @@ 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({ - 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.', + description: 'Generate structured output rules using LLM', inputStructure: 'detailed', method: 'POST', operationId: 'postRuleStructuredOutputGenerate', diff --git a/packages/contracts/generated/api/console/rule-structured-output-generate/types.gen.ts b/packages/contracts/generated/api/console/rule-structured-output-generate/types.gen.ts index 0ab9d90904..f7da1cd5cc 100644 --- a/packages/contracts/generated/api/console/rule-structured-output-generate/types.gen.ts +++ b/packages/contracts/generated/api/console/rule-structured-output-generate/types.gen.ts @@ -9,6 +9,8 @@ export type RuleStructuredOutputPayload = { model_config: ModelConfig } +export type GeneratorResponse = unknown + export type ModelConfig = { completion_params?: { [key: string]: unknown @@ -28,21 +30,12 @@ export type PostRuleStructuredOutputGenerateData = { } export type PostRuleStructuredOutputGenerateErrors = { - 400: { - [key: string]: unknown - } - 402: { - [key: string]: unknown - } + 400: unknown + 402: unknown } -export type PostRuleStructuredOutputGenerateError - = PostRuleStructuredOutputGenerateErrors[keyof PostRuleStructuredOutputGenerateErrors] - export type PostRuleStructuredOutputGenerateResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratorResponse } export type PostRuleStructuredOutputGenerateResponse diff --git a/packages/contracts/generated/api/console/rule-structured-output-generate/zod.gen.ts b/packages/contracts/generated/api/console/rule-structured-output-generate/zod.gen.ts index ddcabbba49..6119b0010d 100644 --- a/packages/contracts/generated/api/console/rule-structured-output-generate/zod.gen.ts +++ b/packages/contracts/generated/api/console/rule-structured-output-generate/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * GeneratorResponse + */ +export const zGeneratorResponse = z.unknown() + /** * LLMMode * @@ -32,4 +37,4 @@ export const zPostRuleStructuredOutputGenerateBody = zRuleStructuredOutputPayloa /** * Structured output generated successfully */ -export const zPostRuleStructuredOutputGenerateResponse = z.record(z.string(), z.unknown()) +export const zPostRuleStructuredOutputGenerateResponse = zGeneratorResponse diff --git a/packages/contracts/generated/api/console/snippets/orpc.gen.ts b/packages/contracts/generated/api/console/snippets/orpc.gen.ts index d64e39b211..29c8c3c6ee 100644 --- a/packages/contracts/generated/api/console/snippets/orpc.gen.ts +++ b/packages/contracts/generated/api/console/snippets/orpc.gen.ts @@ -15,6 +15,7 @@ import { zGetSnippetsBySnippetIdWorkflowRunsByRunIdPath, zGetSnippetsBySnippetIdWorkflowRunsByRunIdResponse, zGetSnippetsBySnippetIdWorkflowRunsPath, + zGetSnippetsBySnippetIdWorkflowRunsQuery, zGetSnippetsBySnippetIdWorkflowRunsResponse, zGetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsPath, zGetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponse, @@ -76,16 +77,11 @@ import { * * Uses both the legacy stop flag mechanism and the graph engine * command channel for backward compatibility. - * - * Generated 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: - 'Uses both the legacy stop flag mechanism and the graph engine\ncommand channel for backward compatibility.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Uses both the legacy stop flag mechanism and the graph engine\ncommand channel for backward compatibility.', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStop', @@ -159,7 +155,12 @@ export const get3 = oc summary: 'List workflow runs for snippet', tags: ['console'], }) - .input(z.object({ params: zGetSnippetsBySnippetIdWorkflowRunsPath })) + .input( + z.object({ + params: zGetSnippetsBySnippetIdWorkflowRunsPath, + query: zGetSnippetsBySnippetIdWorkflowRunsQuery.optional(), + }), + ) .output(zGetSnippetsBySnippetIdWorkflowRunsResponse) export const workflowRuns = { @@ -170,16 +171,9 @@ export const workflowRuns = { /** * Get default block configurations for snippet 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 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: 'getSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigs', @@ -196,16 +190,9 @@ export const defaultWorkflowBlockConfigs = { /** * Get snippet draft workflow configuration limits - * - * Generated 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: 'getSnippetsBySnippetIdWorkflowsDraftConfig', @@ -222,16 +209,11 @@ export const config = { /** * Conversation variables are not used in snippet workflows; returns an empty list for API parity - * - * Generated 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: - 'Conversation variables are not used in snippet workflows; returns an empty list for API parity\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Conversation variables are not used in snippet workflows; returns an empty list for API parity', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftConversationVariables', @@ -247,16 +229,10 @@ export const conversationVariables = { /** * Get environment variables from snippet draft workflow graph - * - * Generated 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: - 'Get environment variables from snippet draft workflow graph\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Get environment variables from snippet draft workflow graph', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftEnvironmentVariables', @@ -276,16 +252,11 @@ export const environmentVariables = { * Run draft workflow iteration node for snippet * Iteration nodes execute their internal sub-graph multiple times over an input list. * Returns an SSE event stream with iteration progress and results. - * - * Generated 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: - 'Run draft workflow iteration node for snippet\nIteration nodes execute their internal sub-graph multiple times over an input list.\nReturns an SSE event stream with iteration progress and results.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Run draft workflow iteration node for snippet\nIteration nodes execute their internal sub-graph multiple times over an input list.\nReturns an SSE event stream with iteration progress and results.', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRun', @@ -323,16 +294,11 @@ export const iteration = { * Run draft workflow loop node for snippet * Loop nodes execute their internal sub-graph repeatedly until a condition is met. * Returns an SSE event stream with loop progress and results. - * - * Generated 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: - 'Run draft workflow loop node for snippet\nLoop nodes execute their internal sub-graph repeatedly until a condition is met.\nReturns an SSE event stream with loop progress and results.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Run draft workflow loop node for snippet\nLoop nodes execute their internal sub-graph repeatedly until a condition is met.\nReturns an SSE event stream with loop progress and results.', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRun', @@ -395,16 +361,11 @@ export const lastRun = { * Run a single node in snippet draft workflow (single-step debugging) * Executes a specific node with provided inputs for single-step debugging. * Returns the node execution result including status, outputs, and timing. - * - * Generated 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: - 'Run a single node in snippet draft workflow (single-step debugging)\nExecutes a specific node with provided inputs for single-step debugging.\nReturns the node execution result including status, outputs, and timing.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Run a single node in snippet draft workflow (single-step debugging)\nExecutes a specific node with provided inputs for single-step debugging.\nReturns the node execution result including status, outputs, and timing.', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRun', @@ -442,16 +403,10 @@ export const delete_ = oc /** * Get variables for a specific node (snippet 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 get9 = oc .route({ - deprecated: true, - description: - 'Get variables for a specific node (snippet 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.', + description: 'Get variables for a specific node (snippet draft workflow)', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariables', @@ -481,16 +436,11 @@ export const nodes3 = { * * Executes the snippet's draft workflow with the provided inputs * and returns an SSE event stream with execution progress and results. - * - * Generated 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: - 'Executes the snippet\'s draft workflow with the provided inputs\nand returns an SSE event stream with execution progress and results.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Executes the snippet\'s draft workflow with the provided inputs\nand returns an SSE event stream with execution progress and results.', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowsDraftRun', @@ -512,16 +462,11 @@ export const run4 = { /** * System variables are not used in snippet workflows; returns an empty list for API parity - * - * Generated 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: - 'System variables are not used in snippet workflows; returns an empty list for API parity\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'System variables are not used in snippet workflows; returns an empty list for API parity', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftSystemVariables', @@ -537,16 +482,10 @@ export const systemVariables = { /** * Reset a draft workflow variable to its default value (snippet scope) - * - * Generated 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: - 'Reset a draft workflow variable to its default value (snippet scope)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Reset a draft workflow variable to its default value (snippet scope)', inputStructure: 'detailed', method: 'PUT', operationId: 'putSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdReset', @@ -578,16 +517,10 @@ export const delete2 = oc /** * Get a specific draft workflow variable (snippet scope) - * - * Generated 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: - 'Get a specific draft workflow variable (snippet scope)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Get a specific draft workflow variable (snippet scope)', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftVariablesByVariableId', @@ -599,16 +532,10 @@ export const get11 = oc /** * Update a draft workflow variable (snippet scope) - * - * Generated 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: - 'Update a draft workflow variable (snippet scope)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Update a draft workflow variable (snippet scope)', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableId', @@ -648,16 +575,10 @@ export const delete3 = oc /** * List draft workflow variables without values (paginated, snippet scope) - * - * Generated 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: - 'List draft workflow variables without values (paginated, snippet scope)\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'List draft workflow variables without values (paginated, snippet scope)', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflowsDraftVariables', @@ -680,16 +601,9 @@ export const variables2 = { /** * Get draft workflow for snippet - * - * Generated 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: 'getSnippetsBySnippetIdWorkflowsDraft', @@ -702,16 +616,9 @@ export const get13 = oc /** * Sync draft workflow for snippet - * - * Generated 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: 'postSnippetsBySnippetIdWorkflowsDraft', @@ -743,16 +650,9 @@ export const draft = { /** * Get published workflow for snippet - * - * Generated 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: 'getSnippetsBySnippetIdWorkflowsPublish', @@ -765,16 +665,9 @@ export const get14 = oc /** * Publish snippet 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 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: 'postSnippetsBySnippetIdWorkflowsPublish', @@ -799,16 +692,10 @@ export const publish = { * Restore a published snippet workflow version into the draft workflow * * Restore a published snippet 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 post8 = oc .route({ - deprecated: true, - description: - 'Restore a published snippet 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.', + description: 'Restore a published snippet workflow version into the draft workflow', inputStructure: 'detailed', method: 'POST', operationId: 'postSnippetsBySnippetIdWorkflowsByWorkflowIdRestore', @@ -831,16 +718,10 @@ export const byWorkflowId = { * Get all published workflow versions for snippet * * Get all published workflows for a snippet - * - * Generated 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: - 'Get all published workflows for a snippet\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Get all published workflows for a snippet', inputStructure: 'detailed', method: 'GET', operationId: 'getSnippetsBySnippetIdWorkflows', diff --git a/packages/contracts/generated/api/console/snippets/types.gen.ts b/packages/contracts/generated/api/console/snippets/types.gen.ts index f12b39725d..d46a6389a5 100644 --- a/packages/contracts/generated/api/console/snippets/types.gen.ts +++ b/packages/contracts/generated/api/console/snippets/types.gen.ts @@ -10,6 +10,10 @@ export type WorkflowRunPaginationResponse = { limit: number } +export type SimpleResultResponse = { + result: string +} + export type WorkflowRunDetailResponse = { created_at?: number | null created_by_account?: SimpleAccount | null @@ -40,6 +44,10 @@ export type WorkflowPaginationResponse = { page: number } +export type DefaultBlockConfigsResponse = Array<{ + [key: string]: unknown +}> + export type SnippetWorkflowResponse = { conversation_variables: Array created_at: number @@ -78,16 +86,32 @@ export type SnippetDraftSyncPayload = { }> | null } +export type WorkflowRestoreResponse = { + hash: string + result: string + updated_at: number +} + +export type SnippetDraftConfigResponse = { + parallel_depth_limit: number +} + export type WorkflowDraftVariableList = { items?: Array } +export type EnvironmentVariableListResponse = { + items: Array +} + export type SnippetIterationNodeRunPayload = { inputs?: { [key: string]: unknown } | null } +export type GeneratedAppResponse = JsonValue + export type SnippetLoopNodeRunPayload = { inputs?: { [key: string]: unknown @@ -140,9 +164,7 @@ export type SnippetDraftRunPayload = { export type WorkflowDraftVariableListWithoutValue = { items?: Array - total?: { - [key: string]: unknown - } + total?: number } export type WorkflowDraftVariable = { @@ -156,9 +178,16 @@ export type WorkflowDraftVariable = { name?: string selector?: Array type?: string - value?: { - [key: string]: unknown - } + value?: + | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null value_type?: string visible?: boolean } @@ -174,6 +203,11 @@ export type PublishWorkflowPayload = { } | null } +export type WorkflowPublishResponse = { + created_at: number + result: string +} + export type WorkflowRunForListResponse = { created_at?: number | null created_by_account?: SimpleAccount | null @@ -227,9 +261,7 @@ export type WorkflowConversationVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -237,9 +269,7 @@ export type WorkflowEnvironmentVariableResponse = { description: string id: string name: string - value: { - [key: string]: unknown - } + value: unknown value_type: string } @@ -248,9 +278,7 @@ export type PipelineVariableResponse = { allowed_file_types?: Array | null allowed_file_upload_methods?: Array | null belong_to_node_id: string - default_value?: { - [key: string]: unknown - } + default_value?: unknown label: string max_length?: number | null options?: Array | null @@ -262,6 +290,30 @@ export type PipelineVariableResponse = { variable: string } +export type EnvironmentVariableItemResponse = { + description?: string | null + editable: boolean + edited: boolean + id: string + name: string + selector: Array + type: string + value: unknown + value_type: string + visible: boolean +} + +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + export type WorkflowDraftVariableWithoutValue = { description?: string edited?: boolean @@ -279,7 +331,10 @@ export type GetSnippetsBySnippetIdWorkflowRunsData = { path: { snippet_id: string } - query?: never + query?: { + last_id?: string + limit?: number + } url: '/snippets/{snippet_id}/workflow-runs' } @@ -301,18 +356,11 @@ export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopData = { } export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopError - = PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopErrors[keyof PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopErrors] - export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponse @@ -329,14 +377,9 @@ export type GetSnippetsBySnippetIdWorkflowRunsByRunIdData = { } export type GetSnippetsBySnippetIdWorkflowRunsByRunIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowRunsByRunIdError - = GetSnippetsBySnippetIdWorkflowRunsByRunIdErrors[keyof GetSnippetsBySnippetIdWorkflowRunsByRunIdErrors] - export type GetSnippetsBySnippetIdWorkflowRunsByRunIdResponses = { 200: WorkflowRunDetailResponse } @@ -390,9 +433,7 @@ export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsData = { } export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultBlockConfigsResponse } export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponse @@ -408,14 +449,9 @@ export type GetSnippetsBySnippetIdWorkflowsDraftData = { } export type GetSnippetsBySnippetIdWorkflowsDraftErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowsDraftError - = GetSnippetsBySnippetIdWorkflowsDraftErrors[keyof GetSnippetsBySnippetIdWorkflowsDraftErrors] - export type GetSnippetsBySnippetIdWorkflowsDraftResponses = { 200: SnippetWorkflowResponse } @@ -433,18 +469,11 @@ export type PostSnippetsBySnippetIdWorkflowsDraftData = { } export type PostSnippetsBySnippetIdWorkflowsDraftErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostSnippetsBySnippetIdWorkflowsDraftError - = PostSnippetsBySnippetIdWorkflowsDraftErrors[keyof PostSnippetsBySnippetIdWorkflowsDraftErrors] - export type PostSnippetsBySnippetIdWorkflowsDraftResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowRestoreResponse } export type PostSnippetsBySnippetIdWorkflowsDraftResponse @@ -460,9 +489,7 @@ export type GetSnippetsBySnippetIdWorkflowsDraftConfigData = { } export type GetSnippetsBySnippetIdWorkflowsDraftConfigResponses = { - 200: { - [key: string]: unknown - } + 200: SnippetDraftConfigResponse } export type GetSnippetsBySnippetIdWorkflowsDraftConfigResponse @@ -494,18 +521,11 @@ export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesData = { } export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesError - = GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesErrors[keyof GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesErrors] - export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponses = { - 200: { - [key: string]: unknown - } + 200: EnvironmentVariableListResponse } export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponse @@ -522,18 +542,11 @@ export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunData = } export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunError - = PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunErrors[keyof PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunErrors] - export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponse @@ -550,18 +563,11 @@ export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunData = { } export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunError - = PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunErrors[keyof PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunErrors] - export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponse @@ -578,14 +584,9 @@ export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunData = { } export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunError - = GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunErrors[keyof GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunErrors] - export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunResponses = { 200: WorkflowRunNodeExecutionResponse } @@ -604,14 +605,9 @@ export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunData = { } export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunError - = PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunErrors[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunErrors] - export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunResponses = { 200: WorkflowRunNodeExecutionResponse } @@ -663,18 +659,11 @@ export type PostSnippetsBySnippetIdWorkflowsDraftRunData = { } export type PostSnippetsBySnippetIdWorkflowsDraftRunErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowsDraftRunError - = PostSnippetsBySnippetIdWorkflowsDraftRunErrors[keyof PostSnippetsBySnippetIdWorkflowsDraftRunErrors] - export type PostSnippetsBySnippetIdWorkflowsDraftRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostSnippetsBySnippetIdWorkflowsDraftRunResponse @@ -742,14 +731,9 @@ export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = { } export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdError - = DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors[keyof DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors] - export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = { 204: void } @@ -768,14 +752,9 @@ export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = { } export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdError - = GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors[keyof GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors] - export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = { 200: WorkflowDraftVariable } @@ -794,14 +773,9 @@ export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = { } export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdError - = PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors[keyof PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors] - export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = { 200: WorkflowDraftVariable } @@ -820,14 +794,9 @@ export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetData = } export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetError - = PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetErrors[keyof PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetErrors] - export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetResponses = { 200: WorkflowDraftVariable 204: void @@ -846,14 +815,9 @@ export type GetSnippetsBySnippetIdWorkflowsPublishData = { } export type GetSnippetsBySnippetIdWorkflowsPublishErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetSnippetsBySnippetIdWorkflowsPublishError - = GetSnippetsBySnippetIdWorkflowsPublishErrors[keyof GetSnippetsBySnippetIdWorkflowsPublishErrors] - export type GetSnippetsBySnippetIdWorkflowsPublishResponses = { 200: SnippetWorkflowResponse } @@ -871,18 +835,11 @@ export type PostSnippetsBySnippetIdWorkflowsPublishData = { } export type PostSnippetsBySnippetIdWorkflowsPublishErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostSnippetsBySnippetIdWorkflowsPublishError - = PostSnippetsBySnippetIdWorkflowsPublishErrors[keyof PostSnippetsBySnippetIdWorkflowsPublishErrors] - export type PostSnippetsBySnippetIdWorkflowsPublishResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowPublishResponse } export type PostSnippetsBySnippetIdWorkflowsPublishResponse @@ -899,21 +856,12 @@ export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreData = { } export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreError - = PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreErrors[keyof PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreErrors] - export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponses = { - 200: { - [key: string]: unknown - } + 200: WorkflowRestoreResponse } export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponse diff --git a/packages/contracts/generated/api/console/snippets/zod.gen.ts b/packages/contracts/generated/api/console/snippets/zod.gen.ts index 85a1f63d45..8f1756ba49 100644 --- a/packages/contracts/generated/api/console/snippets/zod.gen.ts +++ b/packages/contracts/generated/api/console/snippets/zod.gen.ts @@ -2,6 +2,18 @@ import * as z from 'zod' +/** + * SimpleResultResponse + */ +export const zSimpleResultResponse = z.object({ + result: z.string(), +}) + +/** + * DefaultBlockConfigsResponse + */ +export const zDefaultBlockConfigsResponse = z.array(z.record(z.string(), z.unknown())) + /** * SnippetDraftSyncPayload * @@ -14,6 +26,22 @@ export const zSnippetDraftSyncPayload = z.object({ input_fields: z.array(z.record(z.string(), z.unknown())).nullish(), }) +/** + * WorkflowRestoreResponse + */ +export const zWorkflowRestoreResponse = z.object({ + hash: z.string(), + result: z.string(), + updated_at: z.int(), +}) + +/** + * SnippetDraftConfigResponse + */ +export const zSnippetDraftConfigResponse = z.object({ + parallel_depth_limit: z.int(), +}) + /** * SnippetIterationNodeRunPayload * @@ -62,7 +90,16 @@ export const zWorkflowDraftVariable = z.object({ name: z.string().optional(), selector: z.array(z.string()).optional(), type: z.string().optional(), - value: z.record(z.string(), z.unknown()).optional(), + value: z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullish(), value_type: z.string().optional(), visible: z.boolean().optional(), }) @@ -88,6 +125,14 @@ export const zPublishWorkflowPayload = z.object({ knowledge_base_setting: z.record(z.string(), z.unknown()).nullish(), }) +/** + * WorkflowPublishResponse + */ +export const zWorkflowPublishResponse = z.object({ + created_at: z.int(), + result: z.string(), +}) + /** * SimpleAccount */ @@ -197,7 +242,7 @@ export const zWorkflowConversationVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -208,7 +253,7 @@ export const zWorkflowEnvironmentVariableResponse = z.object({ description: z.string(), id: z.string(), name: z.string(), - value: z.record(z.string(), z.unknown()), + value: z.unknown(), value_type: z.string(), }) @@ -220,7 +265,7 @@ export const zPipelineVariableResponse = z.object({ 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(), + default_value: z.unknown().optional(), label: z.string(), max_length: z.int().nullish(), options: z.array(z.string()).nullish(), @@ -285,6 +330,45 @@ export const zWorkflowPaginationResponse = z.object({ page: z.int(), }) +/** + * EnvironmentVariableItemResponse + */ +export const zEnvironmentVariableItemResponse = z.object({ + description: z.string().nullish(), + editable: z.boolean(), + edited: z.boolean(), + id: z.string(), + name: z.string(), + selector: z.array(z.string()), + type: z.string(), + value: z.unknown(), + value_type: z.string(), + visible: z.boolean(), +}) + +/** + * EnvironmentVariableListResponse + */ +export const zEnvironmentVariableListResponse = z.object({ + items: z.array(zEnvironmentVariableItemResponse), +}) + +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue + export const zWorkflowDraftVariableWithoutValue = z.object({ description: z.string().optional(), edited: z.boolean().optional(), @@ -299,13 +383,18 @@ export const zWorkflowDraftVariableWithoutValue = z.object({ export const zWorkflowDraftVariableListWithoutValue = z.object({ items: z.array(zWorkflowDraftVariableWithoutValue).optional(), - total: z.record(z.string(), z.unknown()).optional(), + total: z.int().optional(), }) export const zGetSnippetsBySnippetIdWorkflowRunsPath = z.object({ snippet_id: z.string(), }) +export const zGetSnippetsBySnippetIdWorkflowRunsQuery = z.object({ + last_id: z.string().optional(), + limit: z.int().gte(1).lte(100).optional().default(20), +}) + /** * Workflow runs retrieved successfully */ @@ -319,10 +408,7 @@ export const zPostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopPath = z.objec /** * Task stopped successfully */ -export const zPostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponse = zSimpleResultResponse export const zGetSnippetsBySnippetIdWorkflowRunsByRunIdPath = z.object({ run_id: z.string(), @@ -366,10 +452,8 @@ export const zGetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsPath = z /** * Default block configs retrieved successfully */ -export const zGetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponse + = zDefaultBlockConfigsResponse export const zGetSnippetsBySnippetIdWorkflowsDraftPath = z.object({ snippet_id: z.string(), @@ -389,7 +473,7 @@ export const zPostSnippetsBySnippetIdWorkflowsDraftPath = z.object({ /** * Draft workflow synced successfully */ -export const zPostSnippetsBySnippetIdWorkflowsDraftResponse = z.record(z.string(), z.unknown()) +export const zPostSnippetsBySnippetIdWorkflowsDraftResponse = zWorkflowRestoreResponse export const zGetSnippetsBySnippetIdWorkflowsDraftConfigPath = z.object({ snippet_id: z.string(), @@ -398,7 +482,7 @@ export const zGetSnippetsBySnippetIdWorkflowsDraftConfigPath = z.object({ /** * Draft config retrieved successfully */ -export const zGetSnippetsBySnippetIdWorkflowsDraftConfigResponse = z.record(z.string(), z.unknown()) +export const zGetSnippetsBySnippetIdWorkflowsDraftConfigResponse = zSnippetDraftConfigResponse export const zGetSnippetsBySnippetIdWorkflowsDraftConversationVariablesPath = z.object({ snippet_id: z.string(), @@ -417,10 +501,8 @@ export const zGetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesPath = z.o /** * Environment variables retrieved successfully */ -export const zGetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponse + = zEnvironmentVariableListResponse export const zPostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunBody = zSnippetIterationNodeRunPayload @@ -433,10 +515,8 @@ export const zPostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunPath /** * Iteration node run started successfully (SSE stream) */ -export const zPostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponse + = zGeneratedAppResponse export const zPostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunBody = zSnippetLoopNodeRunPayload @@ -449,10 +529,8 @@ export const zPostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunPath = z. /** * Loop node run started successfully (SSE stream) */ -export const zPostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponse + = zGeneratedAppResponse export const zGetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunPath = z.object({ node_id: z.string(), @@ -509,7 +587,7 @@ export const zPostSnippetsBySnippetIdWorkflowsDraftRunPath = z.object({ /** * Draft workflow run started successfully (SSE stream) */ -export const zPostSnippetsBySnippetIdWorkflowsDraftRunResponse = z.record(z.string(), z.unknown()) +export const zPostSnippetsBySnippetIdWorkflowsDraftRunResponse = zGeneratedAppResponse export const zGetSnippetsBySnippetIdWorkflowsDraftSystemVariablesPath = z.object({ snippet_id: z.string(), @@ -608,7 +686,7 @@ export const zPostSnippetsBySnippetIdWorkflowsPublishPath = z.object({ /** * Workflow published successfully */ -export const zPostSnippetsBySnippetIdWorkflowsPublishResponse = z.record(z.string(), z.unknown()) +export const zPostSnippetsBySnippetIdWorkflowsPublishResponse = zWorkflowPublishResponse export const zPostSnippetsBySnippetIdWorkflowsByWorkflowIdRestorePath = z.object({ snippet_id: z.string(), @@ -618,7 +696,4 @@ export const zPostSnippetsBySnippetIdWorkflowsByWorkflowIdRestorePath = z.object /** * Workflow restored successfully */ -export const zPostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponse = zWorkflowRestoreResponse diff --git a/packages/contracts/generated/api/console/spec/orpc.gen.ts b/packages/contracts/generated/api/console/spec/orpc.gen.ts index 9af554b5c5..bd2e750e6d 100644 --- a/packages/contracts/generated/api/console/spec/orpc.gen.ts +++ b/packages/contracts/generated/api/console/spec/orpc.gen.ts @@ -8,16 +8,10 @@ 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({ - 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.', + description: 'Used for frontend component type mapping', inputStructure: 'detailed', method: 'GET', operationId: 'getSpecSchemaDefinitions', diff --git a/packages/contracts/generated/api/console/spec/types.gen.ts b/packages/contracts/generated/api/console/spec/types.gen.ts index eaad80aa9a..e7b9c0ea9b 100644 --- a/packages/contracts/generated/api/console/spec/types.gen.ts +++ b/packages/contracts/generated/api/console/spec/types.gen.ts @@ -4,6 +4,8 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type SchemaDefinitionsResponse = unknown + export type GetSpecSchemaDefinitionsData = { body?: never path?: never @@ -12,9 +14,7 @@ export type GetSpecSchemaDefinitionsData = { } export type GetSpecSchemaDefinitionsResponses = { - 200: { - [key: string]: unknown - } + 200: SchemaDefinitionsResponse } export type GetSpecSchemaDefinitionsResponse diff --git a/packages/contracts/generated/api/console/spec/zod.gen.ts b/packages/contracts/generated/api/console/spec/zod.gen.ts index fa057bc269..8fc487d5ac 100644 --- a/packages/contracts/generated/api/console/spec/zod.gen.ts +++ b/packages/contracts/generated/api/console/spec/zod.gen.ts @@ -2,7 +2,12 @@ import * as z from 'zod' +/** + * SchemaDefinitionsResponse + */ +export const zSchemaDefinitionsResponse = z.unknown() + /** * Success */ -export const zGetSpecSchemaDefinitionsResponse = z.record(z.string(), z.unknown()) +export const zGetSpecSchemaDefinitionsResponse = zSchemaDefinitionsResponse diff --git a/packages/contracts/generated/api/console/tags/types.gen.ts b/packages/contracts/generated/api/console/tags/types.gen.ts index 2f80bf565f..33b39716e6 100644 --- a/packages/contracts/generated/api/console/tags/types.gen.ts +++ b/packages/contracts/generated/api/console/tags/types.gen.ts @@ -27,7 +27,7 @@ export type GetTagsData = { path?: never query?: { keyword?: string - type?: string + type?: '' | 'app' | 'knowledge' | 'snippet' } url: '/tags' } diff --git a/packages/contracts/generated/api/console/tags/zod.gen.ts b/packages/contracts/generated/api/console/tags/zod.gen.ts index 2c83bb29ac..0e7d7bd1c6 100644 --- a/packages/contracts/generated/api/console/tags/zod.gen.ts +++ b/packages/contracts/generated/api/console/tags/zod.gen.ts @@ -36,7 +36,7 @@ export const zTagBasePayload = z.object({ export const zGetTagsQuery = z.object({ keyword: z.string().optional(), - type: z.string().optional(), + type: z.enum(['', 'app', 'knowledge', 'snippet']).optional().default(''), }) /** diff --git a/packages/contracts/generated/api/console/test/orpc.gen.ts b/packages/contracts/generated/api/console/test/orpc.gen.ts index 27b46e3381..1bdf526b70 100644 --- a/packages/contracts/generated/api/console/test/orpc.gen.ts +++ b/packages/contracts/generated/api/console/test/orpc.gen.ts @@ -7,16 +7,10 @@ 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({ - 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.', + description: 'Bedrock retrieval test (internal use only)', inputStructure: 'detailed', method: 'POST', operationId: 'postTestRetrieval', diff --git a/packages/contracts/generated/api/console/test/types.gen.ts b/packages/contracts/generated/api/console/test/types.gen.ts index 3e04b732ee..421460c015 100644 --- a/packages/contracts/generated/api/console/test/types.gen.ts +++ b/packages/contracts/generated/api/console/test/types.gen.ts @@ -10,6 +10,14 @@ export type BedrockRetrievalPayload = { retrieval_setting: BedrockRetrievalSetting } +export type ExternalRetrievalTestResponse + = | { + [key: string]: unknown + } + | Array<{ + [key: string]: unknown + }> + export type BedrockRetrievalSetting = { score_threshold?: number top_k?: number | null @@ -23,9 +31,7 @@ export type PostTestRetrievalData = { } export type PostTestRetrievalResponses = { - 200: { - [key: string]: unknown - } + 200: ExternalRetrievalTestResponse } export type PostTestRetrievalResponse = PostTestRetrievalResponses[keyof PostTestRetrievalResponses] diff --git a/packages/contracts/generated/api/console/test/zod.gen.ts b/packages/contracts/generated/api/console/test/zod.gen.ts index 9421c6c03f..35ec1f4b03 100644 --- a/packages/contracts/generated/api/console/test/zod.gen.ts +++ b/packages/contracts/generated/api/console/test/zod.gen.ts @@ -2,6 +2,14 @@ import * as z from 'zod' +/** + * ExternalRetrievalTestResponse + */ +export const zExternalRetrievalTestResponse = z.union([ + z.record(z.string(), z.unknown()), + z.array(z.record(z.string(), z.unknown())), +]) + /** * BedrockRetrievalSetting * @@ -26,4 +34,4 @@ export const zPostTestRetrievalBody = zBedrockRetrievalPayload /** * Bedrock retrieval test completed */ -export const zPostTestRetrievalResponse = z.record(z.string(), z.unknown()) +export const zPostTestRetrievalResponse = zExternalRetrievalTestResponse 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 4a10ee7cb8..ebc2624fa1 100644 --- a/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts +++ b/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts @@ -5,6 +5,7 @@ import * as z from 'zod' import { zGetTrialAppsByAppIdDatasetsPath, + zGetTrialAppsByAppIdDatasetsQuery, zGetTrialAppsByAppIdDatasetsResponse, zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsPath, zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse, @@ -34,16 +35,8 @@ 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', @@ -57,16 +50,8 @@ 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', @@ -85,16 +70,8 @@ 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', @@ -113,39 +90,28 @@ 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', path: '/trial-apps/{app_id}/datasets', tags: ['console'], }) - .input(z.object({ params: zGetTrialAppsByAppIdDatasetsPath })) + .input( + z.object({ + params: zGetTrialAppsByAppIdDatasetsPath, + query: zGetTrialAppsByAppIdDatasetsQuery.optional(), + }), + ) .output(zGetTrialAppsByAppIdDatasetsResponse) 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', @@ -169,16 +135,9 @@ 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', @@ -197,16 +156,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Returns the site configuration for the application including theme, icons, and text.', inputStructure: 'detailed', method: 'GET', operationId: 'getTrialAppsByAppIdSite', @@ -221,16 +175,8 @@ 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', @@ -251,16 +197,9 @@ 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', @@ -282,16 +221,9 @@ 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', @@ -316,16 +248,9 @@ 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', @@ -344,16 +269,9 @@ 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/trial-apps/types.gen.ts b/packages/contracts/generated/api/console/trial-apps/types.gen.ts index 2965aafebf..5021da0afd 100644 --- a/packages/contracts/generated/api/console/trial-apps/types.gen.ts +++ b/packages/contracts/generated/api/console/trial-apps/types.gen.ts @@ -4,6 +4,36 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type TrialAppDetailWithSite = { + access_mode?: string + api_base_url?: string + created_at?: number + created_by?: string + deleted_tools?: Array + description?: string + enable_api?: boolean + enable_site?: boolean + icon?: string + icon_background?: string + icon_type?: string + icon_url?: string + id?: string + max_active_requests?: number + mode?: string + model_config?: TrialAppModelConfig + name?: string + site?: TrialSite + tags?: Array + updated_at?: number + updated_by?: string + use_icon_as_answer_icon?: boolean + workflow?: TrialWorkflowPartial +} + +export type AudioTranscriptResponse = { + text: string +} + export type ChatRequest = { conversation_id?: string | null files?: Array | null @@ -15,6 +45,8 @@ export type ChatRequest = { retriever_from?: string } +export type GeneratedAppResponse = JsonValue + export type CompletionRequest = { files?: Array | null inputs: { @@ -25,6 +57,50 @@ export type CompletionRequest = { retriever_from?: string } +export type TrialDatasetList = { + data?: Array + has_more?: boolean + limit?: number + page?: number + total?: number +} + +export type SuggestedQuestionsResponse = { + data: Array +} + +export type Parameters = { + annotation_reply: JsonObject + file_upload: JsonObject + more_like_this: JsonObject + opening_statement?: string | null + retriever_resource: JsonObject + sensitive_word_avoidance: JsonObject + speech_to_text: JsonObject + suggested_questions: Array + suggested_questions_after_answer: JsonObject + system_parameters: SystemParameters + text_to_speech: JsonObject + user_input_form: Array +} + +export type Site = { + chat_color_theme?: string | null + chat_color_theme_inverted: boolean + copyright?: string | null + custom_disclaimer?: string | null + default_language: string + description?: string | null + icon?: string | null + icon_background?: string | null + icon_type?: string | null + readonly icon_url: string | null + privacy_policy?: string | null + show_workflow_steps: boolean + title: string + use_icon_as_answer_icon: boolean +} + export type TextToSpeechRequest = { message_id?: string | null streaming?: boolean | null @@ -32,6 +108,32 @@ export type TextToSpeechRequest = { voice?: string | null } +export type AudioBinaryResponse = Blob | File + +export type TrialWorkflow = { + conversation_variables?: Array + created_at?: number + created_by?: TrialSimpleAccount + environment_variables?: Array<{ + [key: string]: unknown + }> + 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?: TrialSimpleAccount + version?: string +} + export type WorkflowRunRequest = { files?: Array | null inputs: { @@ -39,6 +141,215 @@ export type WorkflowRunRequest = { } } +export type SimpleResultResponse = { + result: string +} + +export type TrialDeletedTool = { + provider_id?: string + tool_name?: string + type?: string +} + +export type TrialAppModelConfig = { + agent_mode?: { + [key: string]: unknown + } + annotation_reply?: { + [key: string]: unknown + } + chat_prompt_config?: { + [key: string]: unknown + } + completion_prompt_config?: { + [key: string]: unknown + } + created_at?: number + created_by?: string + dataset_configs?: { + [key: string]: unknown + } + dataset_query_variable?: string + external_data_tools?: Array<{ + [key: string]: unknown + }> + file_upload?: { + [key: string]: unknown + } + model?: { + [key: string]: unknown + } + more_like_this?: { + [key: string]: unknown + } + opening_statement?: string + pre_prompt?: string + prompt_type?: string + retriever_resource?: { + [key: string]: unknown + } + sensitive_word_avoidance?: { + [key: string]: unknown + } + speech_to_text?: { + [key: string]: unknown + } + suggested_questions?: Array + suggested_questions_after_answer?: { + [key: string]: unknown + } + text_to_speech?: { + [key: string]: unknown + } + updated_at?: number + updated_by?: string + user_input_form?: Array<{ + [key: string]: unknown + }> +} + +export type TrialSite = { + access_token?: string + app_base_url?: string + chat_color_theme?: string + chat_color_theme_inverted?: boolean + code?: string + copyright?: string + created_at?: number + created_by?: string + custom_disclaimer?: string + customize_domain?: string + customize_token_strategy?: string + default_language?: string + description?: string + icon?: string + icon_background?: string + icon_type?: string + icon_url?: string + privacy_policy?: string + prompt_public?: boolean + show_workflow_steps?: boolean + title?: string + updated_at?: number + updated_by?: string + use_icon_as_answer_icon?: boolean +} + +export type TrialTag = { + id?: string + name?: string + type?: string +} + +export type TrialWorkflowPartial = { + created_at?: number + created_by?: string + id?: string + updated_at?: number + updated_by?: string +} + +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + +export type TrialDataset = { + created_at?: number + created_by?: string + data_source_type?: string + description?: string + id?: string + indexing_technique?: string + name?: string + permission?: string +} + +export type JsonObject = { + [key: string]: unknown +} + +export type SystemParameters = { + audio_file_size_limit: number + file_size_limit: number + image_file_size_limit: number + video_file_size_limit: number + workflow_file_upload_limit: number +} + +export type TrialConversationVariable = { + description?: string + id?: string + name?: string + value?: + | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + value_type?: string +} + +export type TrialSimpleAccount = { + email?: string + id?: string + name?: string +} + +export type TrialPipelineVariable = { + allow_file_extension?: Array + allow_file_upload_methods?: Array + allowed_file_types?: Array + belong_to_node_id?: string + default_value?: + | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + label?: string + max_length?: number + options?: Array + placeholder?: string + required?: boolean + tooltips?: string + type?: string + unit?: string + variable?: string +} + +export type GeneratedAppResponseWritable = JsonValue + +export type SiteWritable = { + chat_color_theme?: string | null + chat_color_theme_inverted: boolean + copyright?: string | null + custom_disclaimer?: string | null + default_language: string + description?: string | null + icon?: string | null + icon_background?: string | null + icon_type?: string | null + privacy_policy?: string | null + show_workflow_steps: boolean + title: string + use_icon_as_answer_icon: boolean +} + export type GetTrialAppsByAppIdData = { body?: never path: { @@ -49,9 +360,7 @@ export type GetTrialAppsByAppIdData = { } export type GetTrialAppsByAppIdResponses = { - 200: { - [key: string]: unknown - } + 200: TrialAppDetailWithSite } export type GetTrialAppsByAppIdResponse @@ -67,9 +376,7 @@ export type PostTrialAppsByAppIdAudioToTextData = { } export type PostTrialAppsByAppIdAudioToTextResponses = { - 200: { - [key: string]: unknown - } + 200: AudioTranscriptResponse } export type PostTrialAppsByAppIdAudioToTextResponse @@ -85,9 +392,7 @@ export type PostTrialAppsByAppIdChatMessagesData = { } export type PostTrialAppsByAppIdChatMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostTrialAppsByAppIdChatMessagesResponse @@ -103,9 +408,7 @@ export type PostTrialAppsByAppIdCompletionMessagesData = { } export type PostTrialAppsByAppIdCompletionMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostTrialAppsByAppIdCompletionMessagesResponse @@ -116,14 +419,16 @@ export type GetTrialAppsByAppIdDatasetsData = { path: { app_id: string } - query?: never + query?: { + ids?: Array + limit?: number + page?: number + } url: '/trial-apps/{app_id}/datasets' } export type GetTrialAppsByAppIdDatasetsResponses = { - 200: { - [key: string]: unknown - } + 200: TrialDatasetList } export type GetTrialAppsByAppIdDatasetsResponse @@ -140,9 +445,7 @@ export type GetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsData = { } export type GetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponses = { - 200: { - [key: string]: unknown - } + 200: SuggestedQuestionsResponse } export type GetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse @@ -158,9 +461,7 @@ export type GetTrialAppsByAppIdParametersData = { } export type GetTrialAppsByAppIdParametersResponses = { - 200: { - [key: string]: unknown - } + 200: Parameters } export type GetTrialAppsByAppIdParametersResponse @@ -176,9 +477,7 @@ export type GetTrialAppsByAppIdSiteData = { } export type GetTrialAppsByAppIdSiteResponses = { - 200: { - [key: string]: unknown - } + 200: Site } export type GetTrialAppsByAppIdSiteResponse @@ -194,9 +493,7 @@ export type PostTrialAppsByAppIdTextToAudioData = { } export type PostTrialAppsByAppIdTextToAudioResponses = { - 200: { - [key: string]: unknown - } + 200: AudioBinaryResponse } export type PostTrialAppsByAppIdTextToAudioResponse @@ -212,9 +509,7 @@ export type GetTrialAppsByAppIdWorkflowsData = { } export type GetTrialAppsByAppIdWorkflowsResponses = { - 200: { - [key: string]: unknown - } + 200: TrialWorkflow } export type GetTrialAppsByAppIdWorkflowsResponse @@ -230,9 +525,7 @@ export type PostTrialAppsByAppIdWorkflowsRunData = { } export type PostTrialAppsByAppIdWorkflowsRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostTrialAppsByAppIdWorkflowsRunResponse @@ -249,9 +542,7 @@ export type PostTrialAppsByAppIdWorkflowsTasksByTaskIdStopData = { } export type PostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse diff --git a/packages/contracts/generated/api/console/trial-apps/zod.gen.ts b/packages/contracts/generated/api/console/trial-apps/zod.gen.ts index f7a52425a2..8f284cda86 100644 --- a/packages/contracts/generated/api/console/trial-apps/zod.gen.ts +++ b/packages/contracts/generated/api/console/trial-apps/zod.gen.ts @@ -2,6 +2,13 @@ import * as z from 'zod' +/** + * AudioTranscriptResponse + */ +export const zAudioTranscriptResponse = z.object({ + text: z.string(), +}) + /** * ChatRequest */ @@ -25,6 +32,33 @@ export const zCompletionRequest = z.object({ retriever_from: z.string().optional().default('explore_app'), }) +/** + * SuggestedQuestionsResponse + */ +export const zSuggestedQuestionsResponse = z.object({ + data: z.array(z.string()), +}) + +/** + * Site + */ +export const zSite = z.object({ + chat_color_theme: z.string().nullish(), + chat_color_theme_inverted: z.boolean(), + copyright: z.string().nullish(), + custom_disclaimer: z.string().nullish(), + default_language: z.string(), + description: z.string().nullish(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + icon_type: z.string().nullish(), + icon_url: z.string().nullable(), + privacy_policy: z.string().nullish(), + show_workflow_steps: z.boolean(), + title: z.string(), + use_icon_as_answer_icon: z.boolean(), +}) + /** * TextToSpeechRequest */ @@ -35,6 +69,11 @@ export const zTextToSpeechRequest = z.object({ voice: z.string().nullish(), }) +/** + * AudioBinaryResponse + */ +export const zAudioBinaryResponse = z.custom() + /** * WorkflowRunRequest */ @@ -43,6 +82,358 @@ export const zWorkflowRunRequest = z.object({ inputs: z.record(z.string(), z.unknown()), }) +/** + * SimpleResultResponse + */ +export const zSimpleResultResponse = z.object({ + result: z.string(), +}) + +export const zTrialDeletedTool = z.object({ + provider_id: z.string().optional(), + tool_name: z.string().optional(), + type: z.string().optional(), +}) + +export const zTrialAppModelConfig = z.object({ + agent_mode: z.record(z.string(), z.unknown()).optional(), + annotation_reply: z.record(z.string(), z.unknown()).optional(), + chat_prompt_config: z.record(z.string(), z.unknown()).optional(), + completion_prompt_config: z.record(z.string(), z.unknown()).optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: z.string().optional(), + dataset_configs: z.record(z.string(), z.unknown()).optional(), + dataset_query_variable: z.string().optional(), + external_data_tools: z.array(z.record(z.string(), z.unknown())).optional(), + file_upload: z.record(z.string(), z.unknown()).optional(), + model: z.record(z.string(), z.unknown()).optional(), + more_like_this: z.record(z.string(), z.unknown()).optional(), + opening_statement: z.string().optional(), + pre_prompt: z.string().optional(), + prompt_type: z.string().optional(), + retriever_resource: z.record(z.string(), z.unknown()).optional(), + sensitive_word_avoidance: z.record(z.string(), z.unknown()).optional(), + speech_to_text: z.record(z.string(), z.unknown()).optional(), + suggested_questions: z.array(z.string()).optional(), + suggested_questions_after_answer: z.record(z.string(), z.unknown()).optional(), + text_to_speech: z.record(z.string(), z.unknown()).optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + updated_by: z.string().optional(), + user_input_form: z.array(z.record(z.string(), z.unknown())).optional(), +}) + +export const zTrialSite = z.object({ + access_token: z.string().optional(), + app_base_url: z.string().optional(), + chat_color_theme: z.string().optional(), + chat_color_theme_inverted: z.boolean().optional(), + code: z.string().optional(), + copyright: z.string().optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: z.string().optional(), + custom_disclaimer: z.string().optional(), + customize_domain: z.string().optional(), + customize_token_strategy: z.string().optional(), + default_language: z.string().optional(), + description: z.string().optional(), + icon: z.string().optional(), + icon_background: z.string().optional(), + icon_type: z.string().optional(), + icon_url: z.string().optional(), + privacy_policy: z.string().optional(), + prompt_public: z.boolean().optional(), + show_workflow_steps: z.boolean().optional(), + title: z.string().optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + updated_by: z.string().optional(), + use_icon_as_answer_icon: z.boolean().optional(), +}) + +export const zTrialTag = z.object({ + id: z.string().optional(), + name: z.string().optional(), + type: z.string().optional(), +}) + +export const zTrialWorkflowPartial = z.object({ + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: z.string().optional(), + id: z.string().optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + updated_by: z.string().optional(), +}) + +export const zTrialAppDetailWithSite = z.object({ + access_mode: z.string().optional(), + api_base_url: z.string().optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: z.string().optional(), + deleted_tools: z.array(zTrialDeletedTool).optional(), + description: z.string().optional(), + enable_api: z.boolean().optional(), + enable_site: z.boolean().optional(), + icon: z.string().optional(), + icon_background: z.string().optional(), + icon_type: z.string().optional(), + icon_url: z.string().optional(), + id: z.string().optional(), + max_active_requests: z.int().optional(), + mode: z.string().optional(), + model_config: zTrialAppModelConfig.optional(), + name: z.string().optional(), + site: zTrialSite.optional(), + tags: z.array(zTrialTag).optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + updated_by: z.string().optional(), + use_icon_as_answer_icon: z.boolean().optional(), + workflow: zTrialWorkflowPartial.optional(), +}) + +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue + +export const zTrialDataset = z.object({ + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: z.string().optional(), + data_source_type: z.string().optional(), + description: z.string().optional(), + id: z.string().optional(), + indexing_technique: z.string().optional(), + name: z.string().optional(), + permission: z.string().optional(), +}) + +export const zTrialDatasetList = z.object({ + data: z.array(zTrialDataset).optional(), + has_more: z.boolean().optional(), + limit: z.int().optional(), + page: z.int().optional(), + total: z.int().optional(), +}) + +export const zJsonObject = z.record(z.string(), z.unknown()) + +/** + * SystemParameters + */ +export const zSystemParameters = z.object({ + audio_file_size_limit: z.int(), + file_size_limit: z.int(), + image_file_size_limit: z.int(), + video_file_size_limit: z.int(), + workflow_file_upload_limit: z.int(), +}) + +/** + * Parameters + */ +export const zParameters = z.object({ + annotation_reply: zJsonObject, + file_upload: zJsonObject, + more_like_this: zJsonObject, + opening_statement: z.string().nullish(), + retriever_resource: zJsonObject, + sensitive_word_avoidance: zJsonObject, + speech_to_text: zJsonObject, + suggested_questions: z.array(z.string()), + suggested_questions_after_answer: zJsonObject, + system_parameters: zSystemParameters, + text_to_speech: zJsonObject, + user_input_form: z.array(zJsonObject), +}) + +export const zTrialConversationVariable = z.object({ + description: z.string().optional(), + id: z.string().optional(), + name: z.string().optional(), + value: z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullish(), + value_type: z.string().optional(), +}) + +export const zTrialSimpleAccount = z.object({ + email: z.string().optional(), + id: z.string().optional(), + name: z.string().optional(), +}) + +export const zTrialPipelineVariable = 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(), + default_value: z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullish(), + 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(), +}) + +export const zTrialWorkflow = z.object({ + conversation_variables: z.array(zTrialConversationVariable).optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + created_by: zTrialSimpleAccount.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(zTrialPipelineVariable).optional(), + tool_published: z.boolean().optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + updated_by: zTrialSimpleAccount.optional(), + version: z.string().optional(), +}) + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponseWritable = zJsonValue + +/** + * Site + */ +export const zSiteWritable = z.object({ + chat_color_theme: z.string().nullish(), + chat_color_theme_inverted: z.boolean(), + copyright: z.string().nullish(), + custom_disclaimer: z.string().nullish(), + default_language: z.string(), + description: z.string().nullish(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + icon_type: z.string().nullish(), + privacy_policy: z.string().nullish(), + show_workflow_steps: z.boolean(), + title: z.string(), + use_icon_as_answer_icon: z.boolean(), +}) + export const zGetTrialAppsByAppIdPath = z.object({ app_id: z.string(), }) @@ -50,7 +441,7 @@ export const zGetTrialAppsByAppIdPath = z.object({ /** * Success */ -export const zGetTrialAppsByAppIdResponse = z.record(z.string(), z.unknown()) +export const zGetTrialAppsByAppIdResponse = zTrialAppDetailWithSite export const zPostTrialAppsByAppIdAudioToTextPath = z.object({ app_id: z.string(), @@ -59,7 +450,7 @@ export const zPostTrialAppsByAppIdAudioToTextPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdAudioToTextResponse = z.record(z.string(), z.unknown()) +export const zPostTrialAppsByAppIdAudioToTextResponse = zAudioTranscriptResponse export const zPostTrialAppsByAppIdChatMessagesBody = zChatRequest @@ -70,7 +461,7 @@ export const zPostTrialAppsByAppIdChatMessagesPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdChatMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostTrialAppsByAppIdChatMessagesResponse = zGeneratedAppResponse export const zPostTrialAppsByAppIdCompletionMessagesBody = zCompletionRequest @@ -81,16 +472,22 @@ export const zPostTrialAppsByAppIdCompletionMessagesPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdCompletionMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostTrialAppsByAppIdCompletionMessagesResponse = zGeneratedAppResponse export const zGetTrialAppsByAppIdDatasetsPath = z.object({ app_id: z.string(), }) +export const zGetTrialAppsByAppIdDatasetsQuery = z.object({ + ids: z.array(z.string()).optional(), + limit: z.int().gte(1).optional().default(20), + page: z.int().gte(1).optional().default(1), +}) + /** * Success */ -export const zGetTrialAppsByAppIdDatasetsResponse = z.record(z.string(), z.unknown()) +export const zGetTrialAppsByAppIdDatasetsResponse = zTrialDatasetList export const zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsPath = z.object({ app_id: z.string(), @@ -100,10 +497,8 @@ export const zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsPath = z.o /** * Success */ -export const zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse + = zSuggestedQuestionsResponse export const zGetTrialAppsByAppIdParametersPath = z.object({ app_id: z.string(), @@ -112,7 +507,7 @@ export const zGetTrialAppsByAppIdParametersPath = z.object({ /** * Success */ -export const zGetTrialAppsByAppIdParametersResponse = z.record(z.string(), z.unknown()) +export const zGetTrialAppsByAppIdParametersResponse = zParameters export const zGetTrialAppsByAppIdSitePath = z.object({ app_id: z.string(), @@ -121,7 +516,7 @@ export const zGetTrialAppsByAppIdSitePath = z.object({ /** * Success */ -export const zGetTrialAppsByAppIdSiteResponse = z.record(z.string(), z.unknown()) +export const zGetTrialAppsByAppIdSiteResponse = zSite export const zPostTrialAppsByAppIdTextToAudioBody = zTextToSpeechRequest @@ -132,7 +527,7 @@ export const zPostTrialAppsByAppIdTextToAudioPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdTextToAudioResponse = z.record(z.string(), z.unknown()) +export const zPostTrialAppsByAppIdTextToAudioResponse = zAudioBinaryResponse export const zGetTrialAppsByAppIdWorkflowsPath = z.object({ app_id: z.string(), @@ -141,7 +536,7 @@ export const zGetTrialAppsByAppIdWorkflowsPath = z.object({ /** * Success */ -export const zGetTrialAppsByAppIdWorkflowsResponse = z.record(z.string(), z.unknown()) +export const zGetTrialAppsByAppIdWorkflowsResponse = zTrialWorkflow export const zPostTrialAppsByAppIdWorkflowsRunBody = zWorkflowRunRequest @@ -152,7 +547,7 @@ export const zPostTrialAppsByAppIdWorkflowsRunPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdWorkflowsRunResponse = z.record(z.string(), z.unknown()) +export const zPostTrialAppsByAppIdWorkflowsRunResponse = zGeneratedAppResponse export const zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopPath = z.object({ app_id: z.string(), @@ -162,7 +557,4 @@ export const zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopPath = z.object({ /** * Success */ -export const zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse = zSimpleResultResponse diff --git a/packages/contracts/generated/api/console/website/orpc.gen.ts b/packages/contracts/generated/api/console/website/orpc.gen.ts index 5ed1fcd8ab..698f656967 100644 --- a/packages/contracts/generated/api/console/website/orpc.gen.ts +++ b/packages/contracts/generated/api/console/website/orpc.gen.ts @@ -13,16 +13,10 @@ 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({ - 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.', + description: 'Get website crawl status', inputStructure: 'detailed', method: 'GET', operationId: 'getWebsiteCrawlStatusByJobId', @@ -47,16 +41,10 @@ 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({ - 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.', + description: 'Crawl website content', inputStructure: 'detailed', method: 'POST', operationId: 'postWebsiteCrawl', diff --git a/packages/contracts/generated/api/console/website/types.gen.ts b/packages/contracts/generated/api/console/website/types.gen.ts index c8ea0de7b6..79640ae6f6 100644 --- a/packages/contracts/generated/api/console/website/types.gen.ts +++ b/packages/contracts/generated/api/console/website/types.gen.ts @@ -12,6 +12,10 @@ export type WebsiteCrawlPayload = { url: string } +export type WebsiteCrawlResponse = { + [key: string]: unknown +} + export type PostWebsiteCrawlData = { body: WebsiteCrawlPayload path?: never @@ -20,17 +24,11 @@ export type PostWebsiteCrawlData = { } export type PostWebsiteCrawlErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostWebsiteCrawlError = PostWebsiteCrawlErrors[keyof PostWebsiteCrawlErrors] - export type PostWebsiteCrawlResponses = { - 200: { - [key: string]: unknown - } + 200: WebsiteCrawlResponse } export type PostWebsiteCrawlResponse = PostWebsiteCrawlResponses[keyof PostWebsiteCrawlResponses] @@ -47,21 +45,12 @@ export type GetWebsiteCrawlStatusByJobIdData = { } export type GetWebsiteCrawlStatusByJobIdErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type GetWebsiteCrawlStatusByJobIdError - = GetWebsiteCrawlStatusByJobIdErrors[keyof GetWebsiteCrawlStatusByJobIdErrors] - export type GetWebsiteCrawlStatusByJobIdResponses = { - 200: { - [key: string]: unknown - } + 200: WebsiteCrawlResponse } export type GetWebsiteCrawlStatusByJobIdResponse diff --git a/packages/contracts/generated/api/console/website/zod.gen.ts b/packages/contracts/generated/api/console/website/zod.gen.ts index 88f1d4a7c8..fbcdff022b 100644 --- a/packages/contracts/generated/api/console/website/zod.gen.ts +++ b/packages/contracts/generated/api/console/website/zod.gen.ts @@ -11,12 +11,17 @@ export const zWebsiteCrawlPayload = z.object({ url: z.string(), }) +/** + * WebsiteCrawlResponse + */ +export const zWebsiteCrawlResponse = z.record(z.string(), z.unknown()) + export const zPostWebsiteCrawlBody = zWebsiteCrawlPayload /** * Website crawl initiated successfully */ -export const zPostWebsiteCrawlResponse = z.record(z.string(), z.unknown()) +export const zPostWebsiteCrawlResponse = zWebsiteCrawlResponse export const zGetWebsiteCrawlStatusByJobIdPath = z.object({ job_id: z.string(), @@ -29,4 +34,4 @@ export const zGetWebsiteCrawlStatusByJobIdQuery = z.object({ /** * Crawl status retrieved successfully */ -export const zGetWebsiteCrawlStatusByJobIdResponse = z.record(z.string(), z.unknown()) +export const zGetWebsiteCrawlStatusByJobIdResponse = zWebsiteCrawlResponse diff --git a/packages/contracts/generated/api/console/workflow-generate/orpc.gen.ts b/packages/contracts/generated/api/console/workflow-generate/orpc.gen.ts index c5d3715d9a..79168ac377 100644 --- a/packages/contracts/generated/api/console/workflow-generate/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workflow-generate/orpc.gen.ts @@ -7,16 +7,10 @@ import { zPostWorkflowGenerateBody, zPostWorkflowGenerateResponse } from './zod. /** * Generate a Dify workflow graph from natural 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 post = oc .route({ - deprecated: true, - description: - 'Generate a Dify workflow graph from natural language\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Generate a Dify workflow graph from natural language', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowGenerate', diff --git a/packages/contracts/generated/api/console/workflow-generate/types.gen.ts b/packages/contracts/generated/api/console/workflow-generate/types.gen.ts index a97ef33806..7f67a572cb 100644 --- a/packages/contracts/generated/api/console/workflow-generate/types.gen.ts +++ b/packages/contracts/generated/api/console/workflow-generate/types.gen.ts @@ -14,6 +14,8 @@ export type WorkflowGeneratePayload = { model_config: ModelConfig } +export type GeneratorResponse = unknown + export type ModelConfig = { completion_params?: { [key: string]: unknown @@ -33,20 +35,12 @@ export type PostWorkflowGenerateData = { } export type PostWorkflowGenerateErrors = { - 400: { - [key: string]: unknown - } - 402: { - [key: string]: unknown - } + 400: unknown + 402: unknown } -export type PostWorkflowGenerateError = PostWorkflowGenerateErrors[keyof PostWorkflowGenerateErrors] - export type PostWorkflowGenerateResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratorResponse } export type PostWorkflowGenerateResponse diff --git a/packages/contracts/generated/api/console/workflow-generate/zod.gen.ts b/packages/contracts/generated/api/console/workflow-generate/zod.gen.ts index 1bfc7b2bda..c57f0e3141 100644 --- a/packages/contracts/generated/api/console/workflow-generate/zod.gen.ts +++ b/packages/contracts/generated/api/console/workflow-generate/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * GeneratorResponse + */ +export const zGeneratorResponse = z.unknown() + /** * LLMMode * @@ -41,4 +46,4 @@ export const zPostWorkflowGenerateBody = zWorkflowGeneratePayload /** * Workflow graph generated successfully */ -export const zPostWorkflowGenerateResponse = z.record(z.string(), z.unknown()) +export const zPostWorkflowGenerateResponse = zGeneratorResponse diff --git a/packages/contracts/generated/api/console/workflow/orpc.gen.ts b/packages/contracts/generated/api/console/workflow/orpc.gen.ts index 1470137236..66f3e74a48 100644 --- a/packages/contracts/generated/api/console/workflow/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workflow/orpc.gen.ts @@ -16,16 +16,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'GET /console/api/workflow//events\n\nReturns Server-Sent Events stream.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByWorkflowRunIdEvents', diff --git a/packages/contracts/generated/api/console/workflow/types.gen.ts b/packages/contracts/generated/api/console/workflow/types.gen.ts index e8a205378a..bf0e0464a8 100644 --- a/packages/contracts/generated/api/console/workflow/types.gen.ts +++ b/packages/contracts/generated/api/console/workflow/types.gen.ts @@ -4,6 +4,8 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type EventStreamResponse = string + export type WorkflowPauseDetailsResponse = { paused_at?: string | null paused_nodes: Array @@ -31,9 +33,7 @@ export type GetWorkflowByWorkflowRunIdEventsData = { } export type GetWorkflowByWorkflowRunIdEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetWorkflowByWorkflowRunIdEventsResponse @@ -49,14 +49,9 @@ export type GetWorkflowByWorkflowRunIdPauseDetailsData = { } export type GetWorkflowByWorkflowRunIdPauseDetailsErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetWorkflowByWorkflowRunIdPauseDetailsError - = GetWorkflowByWorkflowRunIdPauseDetailsErrors[keyof GetWorkflowByWorkflowRunIdPauseDetailsErrors] - export type GetWorkflowByWorkflowRunIdPauseDetailsResponses = { 200: WorkflowPauseDetailsResponse } diff --git a/packages/contracts/generated/api/console/workflow/zod.gen.ts b/packages/contracts/generated/api/console/workflow/zod.gen.ts index 2a834f2ec3..100ad25c22 100644 --- a/packages/contracts/generated/api/console/workflow/zod.gen.ts +++ b/packages/contracts/generated/api/console/workflow/zod.gen.ts @@ -2,6 +2,11 @@ import * as z from 'zod' +/** + * EventStreamResponse + */ +export const zEventStreamResponse = z.string() + /** * HumanInputPauseTypeResponse */ @@ -33,9 +38,9 @@ export const zGetWorkflowByWorkflowRunIdEventsPath = z.object({ }) /** - * Success + * SSE event stream */ -export const zGetWorkflowByWorkflowRunIdEventsResponse = z.record(z.string(), z.unknown()) +export const zGetWorkflowByWorkflowRunIdEventsResponse = zEventStreamResponse export const zGetWorkflowByWorkflowRunIdPauseDetailsPath = z.object({ workflow_run_id: z.string(), diff --git a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts index 91a36f10b6..ecfc3d44ef 100644 --- a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts @@ -33,6 +33,7 @@ import { zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesPath, zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesResponse, zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportPath, + zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportQuery, zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponse, zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdPath, zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdResponse, @@ -86,14 +87,19 @@ import { zGetWorkspacesCurrentPluginTasksQuery, zGetWorkspacesCurrentPluginTasksResponse, zGetWorkspacesCurrentToolLabelsResponse, + zGetWorkspacesCurrentToolProviderApiGetQuery, zGetWorkspacesCurrentToolProviderApiGetResponse, + zGetWorkspacesCurrentToolProviderApiRemoteQuery, zGetWorkspacesCurrentToolProviderApiRemoteResponse, + zGetWorkspacesCurrentToolProviderApiToolsQuery, zGetWorkspacesCurrentToolProviderApiToolsResponse, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoPath, + zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoQuery, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponse, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypePath, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypeResponse, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsPath, + zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsQuery, zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponse, zGetWorkspacesCurrentToolProviderBuiltinByProviderIconPath, zGetWorkspacesCurrentToolProviderBuiltinByProviderIconResponse, @@ -109,8 +115,11 @@ import { zGetWorkspacesCurrentToolProviderMcpToolsByProviderIdResponse, zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdPath, zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdResponse, + zGetWorkspacesCurrentToolProvidersQuery, zGetWorkspacesCurrentToolProvidersResponse, + zGetWorkspacesCurrentToolProviderWorkflowGetQuery, zGetWorkspacesCurrentToolProviderWorkflowGetResponse, + zGetWorkspacesCurrentToolProviderWorkflowToolsQuery, zGetWorkspacesCurrentToolProviderWorkflowToolsResponse, zGetWorkspacesCurrentToolsApiResponse, zGetWorkspacesCurrentToolsBuiltinResponse, @@ -319,16 +328,10 @@ 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({ - 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.', + description: 'Get specific agent provider details', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentAgentProviderByProviderName', @@ -348,16 +351,10 @@ 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({ - 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.', + description: 'Get list of available agent providers', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentAgentProviders', @@ -374,16 +371,10 @@ export const agentProviders = { * Confirm a pending snippet import * * Confirm a pending snippet import - * - * Generated 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: - 'Confirm a pending snippet import\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Confirm a pending snippet import', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirm', @@ -406,16 +397,10 @@ export const byImportId = { * Import snippet from DSL * * Import snippet from DSL - * - * Generated 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: - 'Import snippet from DSL\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Import snippet from DSL', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentCustomizedSnippetsImports', @@ -435,16 +420,10 @@ export const imports = { * Check dependencies for a snippet * * Check dependencies for a snippet - * - * Generated 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: - 'Check dependencies for a snippet\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Check dependencies for a snippet', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependencies', @@ -465,16 +444,10 @@ export const checkDependencies = { * Export snippet as DSL * * Export snippet configuration as DSL - * - * Generated 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: - 'Export snippet configuration as DSL\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Export snippet configuration as DSL', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentCustomizedSnippetsBySnippetIdExport', @@ -482,7 +455,12 @@ export const get4 = oc summary: 'Export snippet as DSL', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportPath, + query: zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponse) export const export_ = { @@ -493,16 +471,10 @@ export const export_ = { * Increment snippet use count when it is inserted into a workflow * * Increment snippet use count by 1 - * - * Generated 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: - 'Increment snippet use count by 1\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'Increment snippet use count by 1', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrement', @@ -541,16 +513,9 @@ export const delete_ = oc /** * Get customized snippet 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({ - deprecated: true, - description: - 'Generated 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: 'getWorkspacesCurrentCustomizedSnippetsBySnippetId', @@ -563,16 +528,9 @@ export const get5 = oc /** * Update customized snippet - * - * Generated 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: 'patchWorkspacesCurrentCustomizedSnippetsBySnippetId', @@ -599,16 +557,9 @@ export const bySnippetId = { /** * List customized snippets with pagination and search - * - * Generated 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: 'getWorkspacesCurrentCustomizedSnippets', @@ -621,16 +572,9 @@ export const get6 = oc /** * Create a new customized snippet - * - * Generated 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: 'postWorkspacesCurrentCustomizedSnippets', @@ -663,16 +607,8 @@ export const datasetOperators = { 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: 'getWorkspacesCurrentDefaultModel', @@ -701,15 +637,13 @@ 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 post6 = oc .route({ deprecated: true, description: - '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.', + 'Deprecated legacy alias for creating a plugin endpoint. Use POST /workspaces/current/endpoints instead.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpointsCreate', @@ -786,16 +720,10 @@ 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 get9 = oc .route({ - 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.', + description: 'List endpoints for a specific plugin', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentEndpointsListPlugin', @@ -811,16 +739,10 @@ 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 get10 = oc .route({ - 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.', + description: 'List plugin endpoints with pagination', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentEndpointsList', @@ -838,15 +760,13 @@ 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 post10 = oc .route({ deprecated: true, description: - '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.', + 'Deprecated legacy alias for updating a plugin endpoint. Use PATCH /workspaces/current/endpoints/{id} instead.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpointsUpdate', @@ -877,16 +797,10 @@ export const delete3 = 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 patch2 = oc .route({ - 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.', + description: 'Update a plugin endpoint', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchWorkspacesCurrentEndpointsById', @@ -908,16 +822,10 @@ 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 post11 = oc .route({ - 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.', + description: 'Create a new plugin endpoint', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkspacesCurrentEndpoints', @@ -938,20 +846,13 @@ 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 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: 'postWorkspacesCurrentMembersInviteEmail', path: '/workspaces/current/members/invite-email', + successStatus: 201, tags: ['console'], }) .input(z.object({ body: zPostWorkspacesCurrentMembersInviteEmailBody })) @@ -991,16 +892,8 @@ export const sendOwnerTransferConfirmEmail = { 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 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: 'postWorkspacesCurrentMembersByMemberIdOwnerTransfer', @@ -1019,16 +912,8 @@ export const ownerTransfer = { 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 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', @@ -1047,16 +932,8 @@ 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 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: 'deleteWorkspacesCurrentMembersByMemberId', @@ -1090,16 +967,8 @@ 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 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: 'getWorkspacesCurrentModelProvidersByProviderCheckoutUrl', @@ -1133,16 +1002,8 @@ export const switch_ = { 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 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: 'postWorkspacesCurrentModelProvidersByProviderCredentialsValidate', @@ -1178,16 +1039,8 @@ export const delete5 = 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 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: 'getWorkspacesCurrentModelProvidersByProviderCredentials', @@ -1202,20 +1055,13 @@ export const get13 = 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 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: 'postWorkspacesCurrentModelProvidersByProviderCredentials', path: '/workspaces/current/model-providers/{provider}/credentials', + successStatus: 201, tags: ['console'], }) .input( @@ -1226,16 +1072,8 @@ export const post18 = 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', @@ -1279,16 +1117,8 @@ export const switch2 = { post: post19, } -/** - * Generated 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: 'postWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidate', @@ -1324,16 +1154,8 @@ export const delete6 = 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 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: 'getWorkspacesCurrentModelProvidersByProviderModelsCredentials', @@ -1348,20 +1170,13 @@ export const get14 = 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 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: 'postWorkspacesCurrentModelProvidersByProviderModelsCredentials', path: '/workspaces/current/model-providers/{provider}/models/credentials', + successStatus: 201, tags: ['console'], }) .input( @@ -1372,16 +1187,8 @@ export const post21 = 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', @@ -1445,16 +1252,8 @@ export const enable2 = { patch: patch4, } -/** - * Generated 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: @@ -1477,16 +1276,8 @@ export const credentialsValidate = { 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: @@ -1518,16 +1309,8 @@ 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 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: 'getWorkspacesCurrentModelProvidersByProviderModelsParameterRules', @@ -1563,16 +1346,8 @@ export const delete7 = 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 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: 'getWorkspacesCurrentModelProvidersByProviderModels', @@ -1582,16 +1357,8 @@ export const get16 = 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 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: 'postWorkspacesCurrentModelProvidersByProviderModels', @@ -1644,16 +1411,8 @@ 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 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: 'getWorkspacesCurrentModelProviders', @@ -1668,16 +1427,8 @@ 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 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: 'getWorkspacesCurrentModelsModelTypesByModelType', @@ -1721,16 +1472,8 @@ export const permission = { 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 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: 'getWorkspacesCurrentPluginAsset', @@ -1758,16 +1501,8 @@ export const debuggingKey = { get: get21, } -/** - * Generated 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: 'getWorkspacesCurrentPluginFetchManifest', @@ -1781,16 +1516,8 @@ export const fetchManifest = { get: get22, } -/** - * Generated 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: 'getWorkspacesCurrentPluginIcon', @@ -1804,16 +1531,8 @@ export const icon = { get: get23, } -/** - * Generated 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: 'postWorkspacesCurrentPluginInstallGithub', @@ -1827,16 +1546,8 @@ export const github = { 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 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: 'postWorkspacesCurrentPluginInstallMarketplace', @@ -1850,16 +1561,8 @@ export const marketplace = { post: post27, } -/** - * Generated 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: 'postWorkspacesCurrentPluginInstallPkg', @@ -1879,16 +1582,8 @@ 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 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: 'postWorkspacesCurrentPluginListInstallationsIds', @@ -1906,16 +1601,8 @@ 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 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: 'postWorkspacesCurrentPluginListLatestVersions', @@ -1929,16 +1616,8 @@ export const latestVersions = { 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: 'getWorkspacesCurrentPluginList', @@ -1954,16 +1633,8 @@ 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 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: 'getWorkspacesCurrentPluginMarketplacePkg', @@ -1981,16 +1652,8 @@ 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 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: 'getWorkspacesCurrentPluginParametersDynamicOptions', @@ -2006,16 +1669,9 @@ 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 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: 'postWorkspacesCurrentPluginParametersDynamicOptionsWithCredentials', @@ -2052,16 +1708,8 @@ export const change = { 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 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: 'getWorkspacesCurrentPluginPermissionFetch', @@ -2079,16 +1727,8 @@ 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 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: 'postWorkspacesCurrentPluginPreferencesAutoupgradeExclude', @@ -2106,16 +1746,8 @@ 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 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: 'postWorkspacesCurrentPluginPreferencesChange', @@ -2129,16 +1761,8 @@ export const change2 = { 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 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: 'getWorkspacesCurrentPluginPreferencesFetch', @@ -2157,16 +1781,8 @@ 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 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: 'getWorkspacesCurrentPluginReadme', @@ -2225,16 +1841,8 @@ export const delete8 = { 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 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: 'getWorkspacesCurrentPluginTasksByTaskId', @@ -2249,16 +1857,8 @@ export const byTaskId = { delete: delete8, } -/** - * Generated 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: 'getWorkspacesCurrentPluginTasks', @@ -2289,16 +1889,8 @@ export const uninstall = { 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: 'postWorkspacesCurrentPluginUpgradeGithub', @@ -2312,16 +1904,8 @@ export const github2 = { post: post39, } -/** - * Generated 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: 'postWorkspacesCurrentPluginUpgradeMarketplace', @@ -2340,16 +1924,8 @@ 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 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: 'postWorkspacesCurrentPluginUploadBundle', @@ -2362,16 +1938,8 @@ export const bundle = { 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 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: 'postWorkspacesCurrentPluginUploadGithub', @@ -2385,16 +1953,8 @@ export const github3 = { 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: 'postWorkspacesCurrentPluginUploadPkg', @@ -2431,16 +1991,8 @@ 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 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: 'getWorkspacesCurrentToolLabels', @@ -2453,16 +2005,8 @@ export const toolLabels = { 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: 'postWorkspacesCurrentToolProviderApiAdd', @@ -2476,16 +2020,8 @@ export const add = { post: post44, } -/** - * Generated 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: 'postWorkspacesCurrentToolProviderApiDelete', @@ -2499,60 +2035,38 @@ export const delete9 = { 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: 'getWorkspacesCurrentToolProviderApiGet', path: '/workspaces/current/tool-provider/api/get', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProviderApiGetQuery })) .output(zGetWorkspacesCurrentToolProviderApiGetResponse) export const get34 = { 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 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: 'getWorkspacesCurrentToolProviderApiRemote', path: '/workspaces/current/tool-provider/api/remote', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProviderApiRemoteQuery })) .output(zGetWorkspacesCurrentToolProviderApiRemoteResponse) export const remote = { 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: 'postWorkspacesCurrentToolProviderApiSchema', @@ -2566,16 +2080,8 @@ export const schema = { 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: 'postWorkspacesCurrentToolProviderApiTestPre', @@ -2593,38 +2099,23 @@ 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 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: 'getWorkspacesCurrentToolProviderApiTools', path: '/workspaces/current/tool-provider/api/tools', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProviderApiToolsQuery })) .output(zGetWorkspacesCurrentToolProviderApiToolsResponse) export const tools = { 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 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: 'postWorkspacesCurrentToolProviderApiUpdate', @@ -2649,16 +2140,8 @@ 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 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: 'postWorkspacesCurrentToolProviderBuiltinByProviderAdd', @@ -2677,39 +2160,28 @@ export const add2 = { post: post49, } -/** - * Generated 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfo', path: '/workspaces/current/tool-provider/builtin/{provider}/credential/info', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoPath, + query: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponse) export const info = { 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: @@ -2740,39 +2212,28 @@ 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 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderCredentials', path: '/workspaces/current/tool-provider/builtin/{provider}/credentials', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsPath, + query: zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponse) export const credentials3 = { get: get39, } -/** - * Generated 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: 'postWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredential', @@ -2791,16 +2252,8 @@ export const defaultCredential = { 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 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: 'postWorkspacesCurrentToolProviderBuiltinByProviderDelete', @@ -2819,16 +2272,8 @@ export const delete10 = { post: post51, } -/** - * Generated 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderIcon', @@ -2842,16 +2287,8 @@ export const icon2 = { 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 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderInfo', @@ -2865,16 +2302,8 @@ export const info2 = { get: get41, } -/** - * Generated 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchema', @@ -2890,16 +2319,8 @@ export const clientSchema = { get: get42, } -/** - * Generated 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: 'deleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2913,16 +2334,8 @@ export const delete11 = 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 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: 'getWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2934,16 +2347,8 @@ export const get43 = 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 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: 'postWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient', @@ -2969,16 +2374,8 @@ 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 get44 = oc .route({ - deprecated: true, - description: - 'Generated 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', @@ -2992,16 +2389,8 @@ export const tools2 = { get: get44, } -/** - * Generated 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: 'postWorkspacesCurrentToolProviderBuiltinByProviderUpdate', @@ -3037,16 +2426,8 @@ 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 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: 'postWorkspacesCurrentToolProviderMcpAuth', @@ -3060,16 +2441,8 @@ export const auth = { post: post54, } -/** - * Generated 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: 'getWorkspacesCurrentToolProviderMcpToolsByProviderId', @@ -3087,16 +2460,8 @@ 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 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: 'getWorkspacesCurrentToolProviderMcpUpdateByProviderId', @@ -3125,16 +2490,8 @@ export const delete12 = 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 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: 'postWorkspacesCurrentToolProviderMcp', @@ -3144,16 +2501,8 @@ export const post55 = 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', @@ -3172,16 +2521,8 @@ 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 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: 'postWorkspacesCurrentToolProviderWorkflowCreate', @@ -3195,16 +2536,8 @@ export const create2 = { post: post56, } -/** - * Generated 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: 'postWorkspacesCurrentToolProviderWorkflowDelete', @@ -3218,60 +2551,38 @@ export const delete13 = { post: post57, } -/** - * Generated 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: 'getWorkspacesCurrentToolProviderWorkflowGet', path: '/workspaces/current/tool-provider/workflow/get', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProviderWorkflowGetQuery.optional() })) .output(zGetWorkspacesCurrentToolProviderWorkflowGetResponse) export const get48 = { 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 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: 'getWorkspacesCurrentToolProviderWorkflowTools', path: '/workspaces/current/tool-provider/workflow/tools', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProviderWorkflowToolsQuery })) .output(zGetWorkspacesCurrentToolProviderWorkflowToolsResponse) export const tools4 = { 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 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: 'postWorkspacesCurrentToolProviderWorkflowUpdate', @@ -3300,38 +2611,23 @@ 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 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: 'getWorkspacesCurrentToolProviders', path: '/workspaces/current/tool-providers', tags: ['console'], }) + .input(z.object({ query: zGetWorkspacesCurrentToolProvidersQuery.optional() })) .output(zGetWorkspacesCurrentToolProvidersResponse) export const toolProviders = { get: get50, } -/** - * Generated 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: 'getWorkspacesCurrentToolsApi', @@ -3344,16 +2640,8 @@ export const api2 = { get: get51, } -/** - * Generated 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: 'getWorkspacesCurrentToolsBuiltin', @@ -3366,16 +2654,8 @@ export const builtin2 = { get: get52, } -/** - * Generated 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: 'getWorkspacesCurrentToolsMcp', @@ -3388,16 +2668,8 @@ export const mcp2 = { get: get53, } -/** - * Generated 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: 'getWorkspacesCurrentToolsWorkflow', @@ -3417,16 +2689,8 @@ 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 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: 'getWorkspacesCurrentTriggerProviderByProviderIcon', @@ -3442,16 +2706,9 @@ 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 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: 'getWorkspacesCurrentTriggerProviderByProviderInfo', @@ -3468,16 +2725,9 @@ 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 delete14 = oc .route({ - deprecated: true, - description: - 'Generated 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', @@ -3490,16 +2740,9 @@ export const delete14 = 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 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: 'getWorkspacesCurrentTriggerProviderByProviderOauthClient', @@ -3512,16 +2755,9 @@ export const get57 = 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 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: 'postWorkspacesCurrentTriggerProviderByProviderOauthClient', @@ -3549,16 +2785,9 @@ 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 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: @@ -3588,16 +2817,9 @@ 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 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: 'postWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreate', @@ -3619,16 +2841,9 @@ 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 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: @@ -3657,16 +2872,9 @@ 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 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: @@ -3696,16 +2904,9 @@ 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 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: @@ -3735,16 +2936,9 @@ 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 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: @@ -3778,16 +2972,9 @@ 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 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: 'getWorkspacesCurrentTriggerProviderByProviderSubscriptionsList', @@ -3804,16 +2991,9 @@ 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 get61 = oc .route({ - deprecated: true, - description: - 'Generated 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', @@ -3838,16 +3018,9 @@ 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 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: @@ -3914,16 +3087,9 @@ export const delete15 = { /** * 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 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: 'postWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpdate', @@ -3959,16 +3125,9 @@ 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 get62 = oc .route({ - deprecated: true, - description: - 'Generated 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', @@ -4013,20 +3172,13 @@ 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 post68 = oc .route({ - deprecated: true, - description: - 'Generated contract types 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', path: '/workspaces/custom-config/webapp-logo/upload', + successStatus: 201, tags: ['console'], }) .output(zPostWorkspacesCustomConfigWebappLogoUploadResponse) @@ -4039,16 +3191,8 @@ 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 post69 = oc .route({ - deprecated: true, - description: - 'Generated contract types 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', @@ -4063,16 +3207,8 @@ 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 post70 = oc .route({ - deprecated: true, - description: - 'Generated contract types 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', @@ -4086,16 +3222,8 @@ export const info4 = { post: post70, } -/** - * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. - * - * @deprecated - */ export const post71 = oc .route({ - deprecated: true, - description: - 'Generated contract types 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', @@ -4109,16 +3237,8 @@ export const switch3 = { post: post71, } -/** - * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate. - * - * @deprecated - */ export const get63 = oc .route({ - deprecated: true, - description: - 'Generated 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', @@ -4148,16 +3268,8 @@ 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 get64 = oc .route({ - deprecated: true, - description: - 'Generated 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/console/workspaces/types.gen.ts b/packages/contracts/generated/api/console/workspaces/types.gen.ts index 5597046c62..a3c207dd22 100644 --- a/packages/contracts/generated/api/console/workspaces/types.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/types.gen.ts @@ -4,6 +4,10 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } +export type TenantListResponse = { + workspaces: Array +} + export type TenantInfoResponse = { created_at?: number | null custom_config?: WorkspaceCustomConfigResponse | null @@ -19,8 +23,16 @@ export type TenantInfoResponse = { trial_end_reason?: string | null } +export type AgentProviderResponse = { + [key: string]: unknown +} + +export type AgentProviderListResponse = Array<{ + [key: string]: unknown +}> + export type SnippetPagination = { - data?: Array + data?: Array has_more?: boolean limit?: number page?: number @@ -39,9 +51,7 @@ export type CreateSnippetPayload = { } export type Snippet = { - created_at?: { - [key: string]: unknown - } + created_at?: number created_by?: AnonymousInlineModelB0Fd3F86D9D5 description?: string graph?: { @@ -58,9 +68,7 @@ export type Snippet = { name?: string tags?: Array type?: string - updated_at?: { - [key: string]: unknown - } + updated_at?: number updated_by?: AnonymousInlineModelB0Fd3F86D9D5 use_count?: number version?: number @@ -75,16 +83,35 @@ export type SnippetImportPayload = { yaml_url?: string | null } +export type SnippetImportResponse = { + [key: string]: unknown +} + export type UpdateSnippetPayload = { description?: string | null icon_info?: IconInfo | null name?: string | null } +export type SnippetDependencyCheckResponse = { + [key: string]: unknown +} + +export type TextFileResponse = string + +export type SnippetUseCountResponse = { + result: string + use_count: number +} + export type AccountWithRoleList = { accounts: Array } +export type DefaultModelDataResponse = { + data?: DefaultModelResponse | null +} + export type ParserPostDefault = { model_settings: Array } @@ -158,6 +185,12 @@ export type MemberInvitePayload = { role: TenantAccountRole } +export type MemberInviteResponse = { + invitation_results: Array + result: string + tenant_id: string +} + export type OwnerTransferCheckPayload = { code: string token: string @@ -178,6 +211,11 @@ export type SimpleResultDataResponse = { result: string } +export type MemberActionTenantResponse = { + result: string + tenant_id: string +} + export type OwnerTransferPayload = { token: string } @@ -186,10 +224,24 @@ export type MemberRoleUpdatePayload = { role: string } +export type ModelProviderListResponse = { + data: Array +} + +export type ModelProviderPaymentCheckoutUrlResponse = { + payment_link: string +} + export type ParserCredentialDelete = { credential_id: string } +export type ProviderCredentialResponse = { + credentials?: { + [key: string]: unknown + } | null +} + export type ParserCredentialCreate = { credentials: { [key: string]: unknown @@ -215,11 +267,20 @@ export type ParserCredentialValidate = { } } +export type ProviderCredentialValidateResponse = { + error?: string | null + result: 'error' | 'success' +} + export type ParserDeleteModels = { model: string model_type: ModelType } +export type ModelWithProviderListResponse = { + data: Array +} + export type ParserPostModels = { config_from?: string | null credential_id?: string | null @@ -234,6 +295,16 @@ export type ParserDeleteCredential = { model_type: ModelType } +export type ModelCredentialResponse = { + available_credentials: Array + credentials?: { + [key: string]: unknown + } + current_credential_id?: string | null + current_credential_name?: string | null + load_balancing: ModelCredentialLoadBalancingResponse +} + export type ParserCreateCredential = { credentials: { [key: string]: unknown @@ -267,6 +338,11 @@ export type ParserValidate = { model_type: ModelType } +export type ModelCredentialValidateResponse = { + error?: string | null + result: string +} + export type LoadBalancingCredentialPayload = { credentials: { [key: string]: unknown @@ -275,22 +351,41 @@ export type LoadBalancingCredentialPayload = { model_type: ModelType } +export type LoadBalancingCredentialValidateResponse = { + error?: string | null + result: string +} + +export type ModelParameterRulesResponse = { + data: Array +} + export type ParserPreferredProviderType = { preferred_provider_type: 'custom' | 'system' } +export type ProviderWithModelsDataResponse = { + data: Array +} + export type WorkspacePermissionResponse = { allow_member_invite: boolean allow_owner_transfer: boolean workspace_id: string } +export type BinaryFileResponse = Blob | File + export type PluginDebuggingKeyResponse = { host: string key: string port: number } +export type PluginManifestResponse = { + manifest: unknown +} + export type ParserGithubInstall = { package: string plugin_unique_identifier: string @@ -298,14 +393,33 @@ export type ParserGithubInstall = { version: string } +export type PluginDaemonOperationResponse = unknown + export type ParserPluginIdentifiers = { plugin_unique_identifiers: Array } +export type PluginListResponse = { + plugins: unknown + total: number +} + export type ParserLatest = { plugin_ids: Array } +export type PluginInstallationsResponse = { + plugins: unknown +} + +export type PluginVersionsResponse = { + versions: unknown +} + +export type PluginDynamicOptionsResponse = { + options: unknown +} + export type ParserDynamicOptionsWithCredentials = { action: string credential_id: string @@ -326,15 +440,42 @@ export type SuccessResponse = { success: boolean } +export type PluginPermissionResponse = { + debug_permission: DebugPermission + install_permission: InstallPermission +} + export type ParserExcludePlugin = { plugin_id: string } +export type PluginOperationSuccessResponse = { + message?: string | null + success: boolean +} + export type ParserPreferencesChange = { auto_upgrade: PluginAutoUpgradeSettingsPayload permission: PluginPermissionSettingsPayload } +export type PluginPreferencesResponse = { + auto_upgrade: PluginAutoUpgradeSettingsPayload + permission: PluginPermissionSettingsPayload +} + +export type PluginReadmeResponse = { + readme: string +} + +export type PluginTasksResponse = { + tasks: unknown +} + +export type PluginTaskResponse = { + task: unknown +} + export type ParserUninstall = { plugin_installation_id: string } @@ -358,6 +499,8 @@ export type ParserGithubUpload = { version: string } +export type ToolProviderOpaqueResponse = unknown + export type ApiToolProviderAddPayload = { credentials: { [key: string]: unknown @@ -427,6 +570,14 @@ export type BuiltinToolCredentialDeletePayload = { credential_id: string } +export type ToolOAuthClientSchemaResponse = Array<{ + [key: string]: unknown +}> + +export type ToolOAuthCustomClientResponse = { + [key: string]: unknown +} + export type ToolOAuthCustomClientPayload = { client_params?: { [key: string]: unknown @@ -520,6 +671,20 @@ export type WorkflowToolUpdatePayload = { workflow_tool_id: string } +export type TriggerProviderOpaqueResponse = unknown + +export type TriggerOAuthClientResponse = { + configured: boolean + custom_configured: boolean + custom_enabled: boolean + oauth_client_schema: unknown + params: { + [key: string]: unknown + } + redirect_uri: string + system_configured: boolean +} + export type TriggerOAuthClientPayload = { client_params?: { [key: string]: unknown @@ -550,11 +715,26 @@ export type TriggerSubscriptionBuilderVerifyPayload = { } } +export type TriggerOAuthAuthorizeResponse = { + authorization_url: string + subscription_builder: unknown + subscription_builder_id: string +} + export type WorkspaceCustomConfigPayload = { remove_webapp_brand?: boolean | null replace_webapp_logo?: string | null } +export type WorkspaceMutationResponse = { + result: string + tenant: TenantInfoResponse +} + +export type WorkspaceLogoUploadResponse = { + id: string +} + export type WorkspaceInfoPayload = { name: string } @@ -563,16 +743,28 @@ export type SwitchWorkspacePayload = { tenant_id: string } +export type SwitchWorkspaceResponse = { + new_tenant: TenantInfoResponse + result: string +} + +export type TenantListItemResponse = { + created_at?: number | null + current: boolean + id: string + name?: string | null + plan?: string | null + status?: string | null +} + export type WorkspaceCustomConfigResponse = { remove_webapp_brand?: boolean | null replace_webapp_logo?: string | null } -export type AnonymousInlineModel7B67Ac8A4Db8 = { +export type AnonymousInlineModelEfd591151Ea9 = { author_name?: string - created_at?: { - [key: string]: unknown - } + created_at?: number created_by?: string description?: string icon_info?: { @@ -583,9 +775,7 @@ export type AnonymousInlineModel7B67Ac8A4Db8 = { name?: string tags?: Array type?: string - updated_at?: { - [key: string]: unknown - } + updated_at?: number updated_by?: string use_count?: number version?: number @@ -633,6 +823,12 @@ export type AccountWithRole = { status: string } +export type DefaultModelResponse = { + model: string + model_type: ModelType + provider: SimpleProviderEntityResponse +} + export type Inner = { model?: string | null model_type: ModelType @@ -641,8 +837,49 @@ export type Inner = { export type TenantAccountRole = 'admin' | 'dataset_operator' | 'editor' | 'normal' | 'owner' +export type MemberInviteResultResponse = { + email: string + message?: string | null + status: string + url?: string | null +} + +export type ProviderResponse = { + background?: string | null + configurate_methods: Array + custom_configuration: CustomConfigurationResponse + description?: I18nObject | null + help?: ProviderHelpEntity | null + icon_small?: I18nObject | null + icon_small_dark?: I18nObject | null + label: I18nObject + model_credential_schema?: ModelCredentialSchema | null + preferred_provider_type: ProviderType + provider: string + provider_credential_schema?: ProviderCredentialSchema | null + supported_model_types: Array + system_configuration: SystemConfigurationResponse + tenant_id: string +} + export type ModelType = 'llm' | 'moderation' | 'rerank' | 'speech2text' | 'text-embedding' | 'tts' +export type ModelWithProviderEntityResponse = { + deprecated?: boolean + features?: Array | null + fetch_from: FetchFrom + has_invalid_load_balancing_configs?: boolean + label: I18nObject + load_balancing_enabled?: boolean + model: string + model_properties: { + [key in ModelPropertyKey]?: unknown + } + model_type: ModelType + provider: SimpleProviderEntityResponse + status: ModelStatus +} + export type LoadBalancingPayload = { configs?: Array<{ [key: string]: unknown @@ -650,6 +887,42 @@ export type LoadBalancingPayload = { enabled?: boolean | null } +export type CredentialConfiguration = { + credential_id: string + credential_name: string +} + +export type ModelCredentialLoadBalancingResponse = { + configs?: Array<{ + [key: string]: unknown + }> + enabled: boolean +} + +export type ParameterRule = { + default?: unknown | null + help?: I18nObject | null + label: I18nObject + max?: number | null + min?: number | null + name: string + options?: Array + precision?: number | null + required?: boolean + type: ParameterType + use_template?: string | null +} + +export type ProviderWithModelsResponse = { + icon_small?: I18nObject | null + icon_small_dark?: I18nObject | null + label: I18nObject + models: Array + provider: string + status: CustomConfigurationStatus + tenant_id: string +} + export type DebugPermission = 'admins' | 'everyone' | 'noone' export type InstallPermission = 'admins' | 'everyone' | 'noone' @@ -679,12 +952,202 @@ export type WorkflowToolParameterConfiguration = { name: string } +export type SimpleProviderEntityResponse = { + icon_small?: I18nObject | null + icon_small_dark?: I18nObject | null + label: I18nObject + models?: Array + provider: string + provider_name?: string + supported_model_types: Array + tenant_id: string +} + +export type ConfigurateMethod = 'customizable-model' | 'predefined-model' + +export type CustomConfigurationResponse = { + available_credentials?: Array | null + can_added_models?: Array | null + current_credential_id?: string | null + current_credential_name?: string | null + custom_models?: Array | null + status: CustomConfigurationStatus +} + +export type I18nObject = { + en_US: string + zh_Hans?: string | null +} + +export type ProviderHelpEntity = { + title: I18nObject + url: I18nObject +} + +export type ModelCredentialSchema = { + credential_form_schemas: Array + model: FieldModelSchema +} + +export type ProviderType = 'custom' | 'system' + +export type ProviderCredentialSchema = { + credential_form_schemas: Array +} + +export type SystemConfigurationResponse = { + current_quota_type?: ProviderQuotaType | null + enabled: boolean + quota_configurations?: Array +} + +export type ModelFeature + = | 'agent-thought' + | 'audio' + | 'document' + | 'multi-tool-call' + | 'polling' + | 'stream-tool-call' + | 'structured-output' + | 'tool-call' + | 'video' + | 'vision' + +export type FetchFrom = 'customizable-model' | 'predefined-model' + +export type ModelPropertyKey + = | 'audio_type' + | 'context_size' + | 'default_voice' + | 'file_upload_limit' + | 'max_characters_per_chunk' + | 'max_chunks' + | 'max_workers' + | 'mode' + | 'supported_file_extensions' + | 'voices' + | 'word_limit' + +export type ModelStatus + = | 'active' + | 'credential-removed' + | 'disabled' + | 'no-configure' + | 'no-permission' + | 'quota-exceeded' + +export type ParameterType = 'boolean' | 'float' | 'int' | 'string' | 'text' + +export type ProviderModelWithStatusEntity = { + deprecated?: boolean + features?: Array | null + fetch_from: FetchFrom + has_invalid_load_balancing_configs?: boolean + label: I18nObject + load_balancing_enabled?: boolean + model: string + model_properties: { + [key in ModelPropertyKey]?: unknown + } + model_type: ModelType + status: ModelStatus +} + +export type CustomConfigurationStatus = 'active' | 'no-configure' + export type StrategySetting = 'disabled' | 'fix_only' | 'latest' export type UpgradeMode = 'all' | 'exclude' | 'partial' export type ToolParameterForm = 'form' | 'llm' | 'schema' +export type AiModelEntityResponse = { + deprecated?: boolean + features?: Array | null + fetch_from: FetchFrom + label: I18nObject + model: string + model_properties: { + [key in ModelPropertyKey]?: unknown + } + model_type: ModelType + parameter_rules?: Array + pricing?: PriceConfigResponse | null +} + +export type UnaddedModelConfiguration = { + model: string + model_type: ModelType +} + +export type CustomModelConfiguration = { + available_model_credentials?: Array + credentials: { + [key: string]: unknown + } | null + current_credential_id?: string | null + current_credential_name?: string | null + model: string + model_type: ModelType + unadded_to_model_list?: boolean | null +} + +export type CredentialFormSchema = { + default?: string | null + label: I18nObject + max_length?: number + options?: Array | null + placeholder?: I18nObject | null + required?: boolean + show_on?: Array + type: FormType + variable: string +} + +export type FieldModelSchema = { + label: I18nObject + placeholder?: I18nObject | null +} + +export type ProviderQuotaType = 'free' | 'paid' | 'trial' + +export type QuotaConfiguration = { + is_valid: boolean + quota_limit: number + quota_type: ProviderQuotaType + quota_unit: QuotaUnit + quota_used: number + restrict_models?: Array +} + +export type PriceConfigResponse = { + currency: string + input: string + output?: string | null + unit: string +} + +export type FormOption = { + label: I18nObject + show_on?: Array + value: string +} + +export type FormShowOnObject = { + value: string + variable: string +} + +export type FormType = 'radio' | 'secret-input' | 'select' | 'switch' | 'text-input' + +export type QuotaUnit = 'credits' | 'times' | 'tokens' + +export type RestrictModel = { + base_model_name?: string | null + model: string + model_type: ModelType +} + export type GetWorkspacesData = { body?: never path?: never @@ -693,9 +1156,7 @@ export type GetWorkspacesData = { } export type GetWorkspacesResponses = { - 200: { - [key: string]: unknown - } + 200: TenantListResponse } export type GetWorkspacesResponse = GetWorkspacesResponses[keyof GetWorkspacesResponses] @@ -724,9 +1185,7 @@ export type GetWorkspacesCurrentAgentProviderByProviderNameData = { } export type GetWorkspacesCurrentAgentProviderByProviderNameResponses = { - 200: { - [key: string]: unknown - } + 200: AgentProviderResponse } export type GetWorkspacesCurrentAgentProviderByProviderNameResponse @@ -740,9 +1199,7 @@ export type GetWorkspacesCurrentAgentProvidersData = { } export type GetWorkspacesCurrentAgentProvidersResponses = { - 200: Array<{ - [key: string]: unknown - }> + 200: AgentProviderListResponse } export type GetWorkspacesCurrentAgentProvidersResponse @@ -777,14 +1234,9 @@ export type PostWorkspacesCurrentCustomizedSnippetsData = { } export type PostWorkspacesCurrentCustomizedSnippetsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostWorkspacesCurrentCustomizedSnippetsError - = PostWorkspacesCurrentCustomizedSnippetsErrors[keyof PostWorkspacesCurrentCustomizedSnippetsErrors] - export type PostWorkspacesCurrentCustomizedSnippetsResponses = { 201: Snippet } @@ -800,21 +1252,12 @@ export type PostWorkspacesCurrentCustomizedSnippetsImportsData = { } export type PostWorkspacesCurrentCustomizedSnippetsImportsErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostWorkspacesCurrentCustomizedSnippetsImportsError - = PostWorkspacesCurrentCustomizedSnippetsImportsErrors[keyof PostWorkspacesCurrentCustomizedSnippetsImportsErrors] - export type PostWorkspacesCurrentCustomizedSnippetsImportsResponses = { - 200: { - [key: string]: unknown - } - 202: { - [key: string]: unknown - } + 200: SnippetImportResponse + 202: SnippetImportResponse } export type PostWorkspacesCurrentCustomizedSnippetsImportsResponse @@ -830,18 +1273,11 @@ export type PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmData } export type PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmErrors = { - 400: { - [key: string]: unknown - } + 400: unknown } -export type PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmError - = PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmErrors[keyof PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmErrors] - export type PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmResponses = { - 200: { - [key: string]: unknown - } + 200: SnippetImportResponse } export type PostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmResponse @@ -857,14 +1293,9 @@ export type DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdData = { } export type DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdError - = DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors[keyof DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors] - export type DeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdResponses = { 204: void } @@ -882,14 +1313,9 @@ export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdData = { } export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdError - = GetWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors[keyof GetWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors] - export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdResponses = { 200: Snippet } @@ -907,17 +1333,10 @@ export type PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdData = { } export type PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdError - = PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors[keyof PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdErrors] - export type PatchWorkspacesCurrentCustomizedSnippetsBySnippetIdResponses = { 200: Snippet } @@ -935,18 +1354,11 @@ export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesDa } export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesError - = GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesErrors[keyof GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesErrors] - export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesResponses = { - 200: { - [key: string]: unknown - } + 200: SnippetDependencyCheckResponse } export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesResponse @@ -957,23 +1369,18 @@ export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportData = { path: { snippet_id: string } - query?: never + query?: { + include_secret?: string + } url: '/workspaces/current/customized-snippets/{snippet_id}/export' } export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportError - = GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportErrors[keyof GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportErrors] - export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponses = { - 200: { - [key: string]: unknown - } + 200: TextFileResponse } export type GetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponse @@ -989,18 +1396,11 @@ export type PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementD } export type PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementErrors = { - 404: { - [key: string]: unknown - } + 404: unknown } -export type PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementError - = PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementErrors[keyof PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementErrors] - export type PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementResponses = { - 200: { - [key: string]: unknown - } + 200: SnippetUseCountResponse } export type PostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementResponse @@ -1030,9 +1430,7 @@ export type GetWorkspacesCurrentDefaultModelData = { } export type GetWorkspacesCurrentDefaultModelResponses = { - 200: { - [key: string]: unknown - } + 200: DefaultModelDataResponse } export type GetWorkspacesCurrentDefaultModelResponse @@ -1060,14 +1458,9 @@ export type PostWorkspacesCurrentEndpointsData = { } export type PostWorkspacesCurrentEndpointsErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsError - = PostWorkspacesCurrentEndpointsErrors[keyof PostWorkspacesCurrentEndpointsErrors] - export type PostWorkspacesCurrentEndpointsResponses = { 200: EndpointCreateResponse } @@ -1083,14 +1476,9 @@ export type PostWorkspacesCurrentEndpointsCreateData = { } export type PostWorkspacesCurrentEndpointsCreateErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsCreateError - = PostWorkspacesCurrentEndpointsCreateErrors[keyof PostWorkspacesCurrentEndpointsCreateErrors] - export type PostWorkspacesCurrentEndpointsCreateResponses = { 200: EndpointCreateResponse } @@ -1106,14 +1494,9 @@ export type PostWorkspacesCurrentEndpointsDeleteData = { } export type PostWorkspacesCurrentEndpointsDeleteErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsDeleteError - = PostWorkspacesCurrentEndpointsDeleteErrors[keyof PostWorkspacesCurrentEndpointsDeleteErrors] - export type PostWorkspacesCurrentEndpointsDeleteResponses = { 200: EndpointDeleteResponse } @@ -1129,14 +1512,9 @@ export type PostWorkspacesCurrentEndpointsDisableData = { } export type PostWorkspacesCurrentEndpointsDisableErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsDisableError - = PostWorkspacesCurrentEndpointsDisableErrors[keyof PostWorkspacesCurrentEndpointsDisableErrors] - export type PostWorkspacesCurrentEndpointsDisableResponses = { 200: EndpointDisableResponse } @@ -1152,14 +1530,9 @@ export type PostWorkspacesCurrentEndpointsEnableData = { } export type PostWorkspacesCurrentEndpointsEnableErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsEnableError - = PostWorkspacesCurrentEndpointsEnableErrors[keyof PostWorkspacesCurrentEndpointsEnableErrors] - export type PostWorkspacesCurrentEndpointsEnableResponses = { 200: EndpointEnableResponse } @@ -1210,14 +1583,9 @@ export type PostWorkspacesCurrentEndpointsUpdateData = { } export type PostWorkspacesCurrentEndpointsUpdateErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PostWorkspacesCurrentEndpointsUpdateError - = PostWorkspacesCurrentEndpointsUpdateErrors[keyof PostWorkspacesCurrentEndpointsUpdateErrors] - export type PostWorkspacesCurrentEndpointsUpdateResponses = { 200: EndpointUpdateResponse } @@ -1235,14 +1603,9 @@ export type DeleteWorkspacesCurrentEndpointsByIdData = { } export type DeleteWorkspacesCurrentEndpointsByIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type DeleteWorkspacesCurrentEndpointsByIdError - = DeleteWorkspacesCurrentEndpointsByIdErrors[keyof DeleteWorkspacesCurrentEndpointsByIdErrors] - export type DeleteWorkspacesCurrentEndpointsByIdResponses = { 200: EndpointDeleteResponse } @@ -1260,14 +1623,9 @@ export type PatchWorkspacesCurrentEndpointsByIdData = { } export type PatchWorkspacesCurrentEndpointsByIdErrors = { - 403: { - [key: string]: unknown - } + 403: unknown } -export type PatchWorkspacesCurrentEndpointsByIdError - = PatchWorkspacesCurrentEndpointsByIdErrors[keyof PatchWorkspacesCurrentEndpointsByIdErrors] - export type PatchWorkspacesCurrentEndpointsByIdResponses = { 200: EndpointUpdateResponse } @@ -1297,9 +1655,7 @@ export type PostWorkspacesCurrentMembersInviteEmailData = { } export type PostWorkspacesCurrentMembersInviteEmailResponses = { - 200: { - [key: string]: unknown - } + 201: MemberInviteResponse } export type PostWorkspacesCurrentMembersInviteEmailResponse @@ -1343,9 +1699,7 @@ export type DeleteWorkspacesCurrentMembersByMemberIdData = { } export type DeleteWorkspacesCurrentMembersByMemberIdResponses = { - 200: { - [key: string]: unknown - } + 200: MemberActionTenantResponse } export type DeleteWorkspacesCurrentMembersByMemberIdResponse @@ -1361,9 +1715,7 @@ export type PostWorkspacesCurrentMembersByMemberIdOwnerTransferData = { } export type PostWorkspacesCurrentMembersByMemberIdOwnerTransferResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostWorkspacesCurrentMembersByMemberIdOwnerTransferResponse @@ -1379,9 +1731,7 @@ export type PutWorkspacesCurrentMembersByMemberIdUpdateRoleData = { } export type PutWorkspacesCurrentMembersByMemberIdUpdateRoleResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PutWorkspacesCurrentMembersByMemberIdUpdateRoleResponse @@ -1397,9 +1747,7 @@ export type GetWorkspacesCurrentModelProvidersData = { } export type GetWorkspacesCurrentModelProvidersResponses = { - 200: { - [key: string]: unknown - } + 200: ModelProviderListResponse } export type GetWorkspacesCurrentModelProvidersResponse @@ -1415,9 +1763,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderCheckoutUrlData = { } export type GetWorkspacesCurrentModelProvidersByProviderCheckoutUrlResponses = { - 200: { - [key: string]: unknown - } + 200: ModelProviderPaymentCheckoutUrlResponse } export type GetWorkspacesCurrentModelProvidersByProviderCheckoutUrlResponse @@ -1451,9 +1797,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderCredentialsData = { } export type GetWorkspacesCurrentModelProvidersByProviderCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: ProviderCredentialResponse } export type GetWorkspacesCurrentModelProvidersByProviderCredentialsResponse @@ -1469,9 +1813,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderCredentialsData = { } export type PostWorkspacesCurrentModelProvidersByProviderCredentialsResponses = { - 200: { - [key: string]: unknown - } + 201: SimpleResultResponse } export type PostWorkspacesCurrentModelProvidersByProviderCredentialsResponse @@ -1487,9 +1829,7 @@ export type PutWorkspacesCurrentModelProvidersByProviderCredentialsData = { } export type PutWorkspacesCurrentModelProvidersByProviderCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PutWorkspacesCurrentModelProvidersByProviderCredentialsResponse @@ -1521,9 +1861,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateData } export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponses = { - 200: { - [key: string]: unknown - } + 200: ProviderCredentialValidateResponse } export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponse @@ -1555,9 +1893,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderModelsData = { } export type GetWorkspacesCurrentModelProvidersByProviderModelsResponses = { - 200: { - [key: string]: unknown - } + 200: ModelWithProviderListResponse } export type GetWorkspacesCurrentModelProvidersByProviderModelsResponse @@ -1573,9 +1909,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsData = { } export type PostWorkspacesCurrentModelProvidersByProviderModelsResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostWorkspacesCurrentModelProvidersByProviderModelsResponse @@ -1612,9 +1946,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderModelsCredentialsData = } export type GetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: ModelCredentialResponse } export type GetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse @@ -1630,9 +1962,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsData = } export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponses = { - 200: { - [key: string]: unknown - } + 201: SimpleResultResponse } export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse @@ -1648,9 +1978,7 @@ export type PutWorkspacesCurrentModelProvidersByProviderModelsCredentialsData = } export type PutWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PutWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse @@ -1682,9 +2010,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValida } export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponses = { - 200: { - [key: string]: unknown - } + 200: ModelCredentialValidateResponse } export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponse @@ -1734,9 +2060,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConf export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsCredentialsValidateResponses = { - 200: { - [key: string]: unknown - } + 200: LoadBalancingCredentialValidateResponse } export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsCredentialsValidateResponse @@ -1755,9 +2079,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConf export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsByConfigIdCredentialsValidateResponses = { - 200: { - [key: string]: unknown - } + 200: LoadBalancingCredentialValidateResponse } export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsByConfigIdCredentialsValidateResponse @@ -1775,9 +2097,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesData } export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponses = { - 200: { - [key: string]: unknown - } + 200: ModelParameterRulesResponse } export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponse @@ -1809,9 +2129,7 @@ export type GetWorkspacesCurrentModelsModelTypesByModelTypeData = { } export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponses = { - 200: { - [key: string]: unknown - } + 200: ProviderWithModelsDataResponse } export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponse @@ -1842,9 +2160,7 @@ export type GetWorkspacesCurrentPluginAssetData = { } export type GetWorkspacesCurrentPluginAssetResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetWorkspacesCurrentPluginAssetResponse @@ -1874,9 +2190,7 @@ export type GetWorkspacesCurrentPluginFetchManifestData = { } export type GetWorkspacesCurrentPluginFetchManifestResponses = { - 200: { - [key: string]: unknown - } + 200: PluginManifestResponse } export type GetWorkspacesCurrentPluginFetchManifestResponse @@ -1893,9 +2207,7 @@ export type GetWorkspacesCurrentPluginIconData = { } export type GetWorkspacesCurrentPluginIconResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetWorkspacesCurrentPluginIconResponse @@ -1909,9 +2221,7 @@ export type PostWorkspacesCurrentPluginInstallGithubData = { } export type PostWorkspacesCurrentPluginInstallGithubResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginInstallGithubResponse @@ -1925,9 +2235,7 @@ export type PostWorkspacesCurrentPluginInstallMarketplaceData = { } export type PostWorkspacesCurrentPluginInstallMarketplaceResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginInstallMarketplaceResponse @@ -1941,9 +2249,7 @@ export type PostWorkspacesCurrentPluginInstallPkgData = { } export type PostWorkspacesCurrentPluginInstallPkgResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginInstallPkgResponse @@ -1960,9 +2266,7 @@ export type GetWorkspacesCurrentPluginListData = { } export type GetWorkspacesCurrentPluginListResponses = { - 200: { - [key: string]: unknown - } + 200: PluginListResponse } export type GetWorkspacesCurrentPluginListResponse @@ -1976,9 +2280,7 @@ export type PostWorkspacesCurrentPluginListInstallationsIdsData = { } export type PostWorkspacesCurrentPluginListInstallationsIdsResponses = { - 200: { - [key: string]: unknown - } + 200: PluginInstallationsResponse } export type PostWorkspacesCurrentPluginListInstallationsIdsResponse @@ -1992,9 +2294,7 @@ export type PostWorkspacesCurrentPluginListLatestVersionsData = { } export type PostWorkspacesCurrentPluginListLatestVersionsResponses = { - 200: { - [key: string]: unknown - } + 200: PluginVersionsResponse } export type PostWorkspacesCurrentPluginListLatestVersionsResponse @@ -2010,9 +2310,7 @@ export type GetWorkspacesCurrentPluginMarketplacePkgData = { } export type GetWorkspacesCurrentPluginMarketplacePkgResponses = { - 200: { - [key: string]: unknown - } + 200: PluginManifestResponse } export type GetWorkspacesCurrentPluginMarketplacePkgResponse @@ -2033,9 +2331,7 @@ export type GetWorkspacesCurrentPluginParametersDynamicOptionsData = { } export type GetWorkspacesCurrentPluginParametersDynamicOptionsResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDynamicOptionsResponse } export type GetWorkspacesCurrentPluginParametersDynamicOptionsResponse @@ -2049,9 +2345,7 @@ export type PostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsDa } export type PostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDynamicOptionsResponse } export type PostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsResponse @@ -2079,9 +2373,7 @@ export type GetWorkspacesCurrentPluginPermissionFetchData = { } export type GetWorkspacesCurrentPluginPermissionFetchResponses = { - 200: { - [key: string]: unknown - } + 200: PluginPermissionResponse } export type GetWorkspacesCurrentPluginPermissionFetchResponse @@ -2095,9 +2387,7 @@ export type PostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeData = { } export type PostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeResponses = { - 200: { - [key: string]: unknown - } + 200: PluginOperationSuccessResponse } export type PostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeResponse @@ -2111,9 +2401,7 @@ export type PostWorkspacesCurrentPluginPreferencesChangeData = { } export type PostWorkspacesCurrentPluginPreferencesChangeResponses = { - 200: { - [key: string]: unknown - } + 200: PluginOperationSuccessResponse } export type PostWorkspacesCurrentPluginPreferencesChangeResponse @@ -2127,9 +2415,7 @@ export type GetWorkspacesCurrentPluginPreferencesFetchData = { } export type GetWorkspacesCurrentPluginPreferencesFetchResponses = { - 200: { - [key: string]: unknown - } + 200: PluginPreferencesResponse } export type GetWorkspacesCurrentPluginPreferencesFetchResponse @@ -2146,9 +2432,7 @@ export type GetWorkspacesCurrentPluginReadmeData = { } export type GetWorkspacesCurrentPluginReadmeResponses = { - 200: { - [key: string]: unknown - } + 200: PluginReadmeResponse } export type GetWorkspacesCurrentPluginReadmeResponse @@ -2165,9 +2449,7 @@ export type GetWorkspacesCurrentPluginTasksData = { } export type GetWorkspacesCurrentPluginTasksResponses = { - 200: { - [key: string]: unknown - } + 200: PluginTasksResponse } export type GetWorkspacesCurrentPluginTasksResponse @@ -2197,9 +2479,7 @@ export type GetWorkspacesCurrentPluginTasksByTaskIdData = { } export type GetWorkspacesCurrentPluginTasksByTaskIdResponses = { - 200: { - [key: string]: unknown - } + 200: PluginTaskResponse } export type GetWorkspacesCurrentPluginTasksByTaskIdResponse @@ -2260,9 +2540,7 @@ export type PostWorkspacesCurrentPluginUpgradeGithubData = { } export type PostWorkspacesCurrentPluginUpgradeGithubResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginUpgradeGithubResponse @@ -2276,9 +2554,7 @@ export type PostWorkspacesCurrentPluginUpgradeMarketplaceData = { } export type PostWorkspacesCurrentPluginUpgradeMarketplaceResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginUpgradeMarketplaceResponse @@ -2292,9 +2568,7 @@ export type PostWorkspacesCurrentPluginUploadBundleData = { } export type PostWorkspacesCurrentPluginUploadBundleResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginUploadBundleResponse @@ -2308,9 +2582,7 @@ export type PostWorkspacesCurrentPluginUploadGithubData = { } export type PostWorkspacesCurrentPluginUploadGithubResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginUploadGithubResponse @@ -2324,9 +2596,7 @@ export type PostWorkspacesCurrentPluginUploadPkgData = { } export type PostWorkspacesCurrentPluginUploadPkgResponses = { - 200: { - [key: string]: unknown - } + 200: PluginDaemonOperationResponse } export type PostWorkspacesCurrentPluginUploadPkgResponse @@ -2340,9 +2610,7 @@ export type GetWorkspacesCurrentToolLabelsData = { } export type GetWorkspacesCurrentToolLabelsResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolLabelsResponse @@ -2356,9 +2624,7 @@ export type PostWorkspacesCurrentToolProviderApiAddData = { } export type PostWorkspacesCurrentToolProviderApiAddResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderApiAddResponse @@ -2372,9 +2638,7 @@ export type PostWorkspacesCurrentToolProviderApiDeleteData = { } export type PostWorkspacesCurrentToolProviderApiDeleteResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderApiDeleteResponse @@ -2383,14 +2647,14 @@ export type PostWorkspacesCurrentToolProviderApiDeleteResponse export type GetWorkspacesCurrentToolProviderApiGetData = { body?: never path?: never - query?: never + query: { + provider: string + } url: '/workspaces/current/tool-provider/api/get' } export type GetWorkspacesCurrentToolProviderApiGetResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderApiGetResponse @@ -2399,14 +2663,14 @@ export type GetWorkspacesCurrentToolProviderApiGetResponse export type GetWorkspacesCurrentToolProviderApiRemoteData = { body?: never path?: never - query?: never + query: { + url: string + } url: '/workspaces/current/tool-provider/api/remote' } export type GetWorkspacesCurrentToolProviderApiRemoteResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderApiRemoteResponse @@ -2420,9 +2684,7 @@ export type PostWorkspacesCurrentToolProviderApiSchemaData = { } export type PostWorkspacesCurrentToolProviderApiSchemaResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderApiSchemaResponse @@ -2436,9 +2698,7 @@ export type PostWorkspacesCurrentToolProviderApiTestPreData = { } export type PostWorkspacesCurrentToolProviderApiTestPreResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderApiTestPreResponse @@ -2447,14 +2707,14 @@ export type PostWorkspacesCurrentToolProviderApiTestPreResponse export type GetWorkspacesCurrentToolProviderApiToolsData = { body?: never path?: never - query?: never + query: { + provider: string + } url: '/workspaces/current/tool-provider/api/tools' } export type GetWorkspacesCurrentToolProviderApiToolsResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderApiToolsResponse @@ -2468,9 +2728,7 @@ export type PostWorkspacesCurrentToolProviderApiUpdateData = { } export type PostWorkspacesCurrentToolProviderApiUpdateResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderApiUpdateResponse @@ -2486,9 +2744,7 @@ export type PostWorkspacesCurrentToolProviderBuiltinByProviderAddData = { } export type PostWorkspacesCurrentToolProviderBuiltinByProviderAddResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderBuiltinByProviderAddResponse @@ -2499,14 +2755,14 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoData path: { provider: string } - query?: never + query?: { + include_credential_ids?: Array + } url: '/workspaces/current/tool-provider/builtin/{provider}/credential/info' } export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponse @@ -2525,9 +2781,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByC export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypeResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypeResponse @@ -2538,14 +2792,14 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsData = { path: { provider: string } - query?: never + query?: { + include_credential_ids?: Array + } url: '/workspaces/current/tool-provider/builtin/{provider}/credentials' } export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponse @@ -2561,9 +2815,7 @@ export type PostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentialD } export type PostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentialResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentialResponse @@ -2579,9 +2831,7 @@ export type PostWorkspacesCurrentToolProviderBuiltinByProviderDeleteData = { } export type PostWorkspacesCurrentToolProviderBuiltinByProviderDeleteResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderBuiltinByProviderDeleteResponse @@ -2597,9 +2847,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderIconData = { } export type GetWorkspacesCurrentToolProviderBuiltinByProviderIconResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderIconResponse @@ -2615,9 +2863,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderInfoData = { } export type GetWorkspacesCurrentToolProviderBuiltinByProviderInfoResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderInfoResponse @@ -2633,9 +2879,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaDa } export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaResponses = { - 200: { - [key: string]: unknown - } + 200: ToolOAuthClientSchemaResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaResponse @@ -2651,9 +2895,7 @@ export type DeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClien } export type DeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type DeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse @@ -2669,9 +2911,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientDa } export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponses = { - 200: { - [key: string]: unknown - } + 200: ToolOAuthCustomClientResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse @@ -2687,9 +2927,7 @@ export type PostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientD } export type PostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse @@ -2705,9 +2943,7 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderToolsData = { } export type GetWorkspacesCurrentToolProviderBuiltinByProviderToolsResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderBuiltinByProviderToolsResponse @@ -2723,9 +2959,7 @@ export type PostWorkspacesCurrentToolProviderBuiltinByProviderUpdateData = { } export type PostWorkspacesCurrentToolProviderBuiltinByProviderUpdateResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderBuiltinByProviderUpdateResponse @@ -2753,9 +2987,7 @@ export type PostWorkspacesCurrentToolProviderMcpData = { } export type PostWorkspacesCurrentToolProviderMcpResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderMcpResponse @@ -2769,9 +3001,7 @@ export type PutWorkspacesCurrentToolProviderMcpData = { } export type PutWorkspacesCurrentToolProviderMcpResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PutWorkspacesCurrentToolProviderMcpResponse @@ -2785,9 +3015,7 @@ export type PostWorkspacesCurrentToolProviderMcpAuthData = { } export type PostWorkspacesCurrentToolProviderMcpAuthResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderMcpAuthResponse @@ -2803,9 +3031,7 @@ export type GetWorkspacesCurrentToolProviderMcpToolsByProviderIdData = { } export type GetWorkspacesCurrentToolProviderMcpToolsByProviderIdResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderMcpToolsByProviderIdResponse @@ -2821,9 +3047,7 @@ export type GetWorkspacesCurrentToolProviderMcpUpdateByProviderIdData = { } export type GetWorkspacesCurrentToolProviderMcpUpdateByProviderIdResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderMcpUpdateByProviderIdResponse @@ -2837,9 +3061,7 @@ export type PostWorkspacesCurrentToolProviderWorkflowCreateData = { } export type PostWorkspacesCurrentToolProviderWorkflowCreateResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderWorkflowCreateResponse @@ -2853,9 +3075,7 @@ export type PostWorkspacesCurrentToolProviderWorkflowDeleteData = { } export type PostWorkspacesCurrentToolProviderWorkflowDeleteResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderWorkflowDeleteResponse @@ -2864,14 +3084,15 @@ export type PostWorkspacesCurrentToolProviderWorkflowDeleteResponse export type GetWorkspacesCurrentToolProviderWorkflowGetData = { body?: never path?: never - query?: never + query?: { + workflow_app_id?: string + workflow_tool_id?: string + } url: '/workspaces/current/tool-provider/workflow/get' } export type GetWorkspacesCurrentToolProviderWorkflowGetResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderWorkflowGetResponse @@ -2880,14 +3101,14 @@ export type GetWorkspacesCurrentToolProviderWorkflowGetResponse export type GetWorkspacesCurrentToolProviderWorkflowToolsData = { body?: never path?: never - query?: never + query: { + workflow_tool_id: string + } url: '/workspaces/current/tool-provider/workflow/tools' } export type GetWorkspacesCurrentToolProviderWorkflowToolsResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProviderWorkflowToolsResponse @@ -2901,9 +3122,7 @@ export type PostWorkspacesCurrentToolProviderWorkflowUpdateData = { } export type PostWorkspacesCurrentToolProviderWorkflowUpdateResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type PostWorkspacesCurrentToolProviderWorkflowUpdateResponse @@ -2912,14 +3131,14 @@ export type PostWorkspacesCurrentToolProviderWorkflowUpdateResponse export type GetWorkspacesCurrentToolProvidersData = { body?: never path?: never - query?: never + query?: { + type?: 'api' | 'builtin' | 'mcp' | 'model' | 'workflow' + } url: '/workspaces/current/tool-providers' } export type GetWorkspacesCurrentToolProvidersResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolProvidersResponse @@ -2933,9 +3152,7 @@ export type GetWorkspacesCurrentToolsApiData = { } export type GetWorkspacesCurrentToolsApiResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolsApiResponse @@ -2949,9 +3166,7 @@ export type GetWorkspacesCurrentToolsBuiltinData = { } export type GetWorkspacesCurrentToolsBuiltinResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolsBuiltinResponse @@ -2965,9 +3180,7 @@ export type GetWorkspacesCurrentToolsMcpData = { } export type GetWorkspacesCurrentToolsMcpResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolsMcpResponse @@ -2981,9 +3194,7 @@ export type GetWorkspacesCurrentToolsWorkflowData = { } export type GetWorkspacesCurrentToolsWorkflowResponses = { - 200: { - [key: string]: unknown - } + 200: ToolProviderOpaqueResponse } export type GetWorkspacesCurrentToolsWorkflowResponse @@ -2999,9 +3210,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderIconData = { } export type GetWorkspacesCurrentTriggerProviderByProviderIconResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetWorkspacesCurrentTriggerProviderByProviderIconResponse @@ -3017,9 +3226,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderInfoData = { } export type GetWorkspacesCurrentTriggerProviderByProviderInfoResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type GetWorkspacesCurrentTriggerProviderByProviderInfoResponse @@ -3035,9 +3242,7 @@ export type DeleteWorkspacesCurrentTriggerProviderByProviderOauthClientData = { } export type DeleteWorkspacesCurrentTriggerProviderByProviderOauthClientResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type DeleteWorkspacesCurrentTriggerProviderByProviderOauthClientResponse @@ -3053,9 +3258,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderOauthClientData = { } export type GetWorkspacesCurrentTriggerProviderByProviderOauthClientResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerOAuthClientResponse } export type GetWorkspacesCurrentTriggerProviderByProviderOauthClientResponse @@ -3071,9 +3274,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderOauthClientData = { } export type PostWorkspacesCurrentTriggerProviderByProviderOauthClientResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleResultResponse } export type PostWorkspacesCurrentTriggerProviderByProviderOauthClientResponse @@ -3092,9 +3293,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBu export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBuildBySubscriptionBuilderIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBuildBySubscriptionBuilderIdResponse @@ -3110,9 +3309,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCr } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreateResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreateResponse @@ -3131,9 +3328,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderLog export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderLogsBySubscriptionBuilderIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderLogsBySubscriptionBuilderIdResponse @@ -3152,9 +3347,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderUp export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderUpdateBySubscriptionBuilderIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderUpdateBySubscriptionBuilderIdResponse @@ -3173,9 +3366,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderVe export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderVerifyAndUpdateBySubscriptionBuilderIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderVerifyAndUpdateBySubscriptionBuilderIdResponse @@ -3194,9 +3385,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderByS export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBySubscriptionBuilderIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBySubscriptionBuilderIdResponse @@ -3212,9 +3401,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListData = } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListResponse @@ -3230,9 +3417,7 @@ export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAutho } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAuthorizeResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerOAuthAuthorizeResponse } export type GetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAuthorizeResponse @@ -3251,9 +3436,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyByS export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponse @@ -3285,9 +3468,7 @@ export type PostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpd } export type PostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpdateResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type PostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpdateResponse @@ -3301,9 +3482,7 @@ export type GetWorkspacesCurrentTriggersData = { } export type GetWorkspacesCurrentTriggersResponses = { - 200: { - [key: string]: unknown - } + 200: TriggerProviderOpaqueResponse } export type GetWorkspacesCurrentTriggersResponse @@ -3317,9 +3496,7 @@ export type PostWorkspacesCustomConfigData = { } export type PostWorkspacesCustomConfigResponses = { - 200: { - [key: string]: unknown - } + 200: WorkspaceMutationResponse } export type PostWorkspacesCustomConfigResponse @@ -3333,9 +3510,7 @@ export type PostWorkspacesCustomConfigWebappLogoUploadData = { } export type PostWorkspacesCustomConfigWebappLogoUploadResponses = { - 200: { - [key: string]: unknown - } + 201: WorkspaceLogoUploadResponse } export type PostWorkspacesCustomConfigWebappLogoUploadResponse @@ -3349,9 +3524,7 @@ export type PostWorkspacesInfoData = { } export type PostWorkspacesInfoResponses = { - 200: { - [key: string]: unknown - } + 200: WorkspaceMutationResponse } export type PostWorkspacesInfoResponse @@ -3365,9 +3538,7 @@ export type PostWorkspacesSwitchData = { } export type PostWorkspacesSwitchResponses = { - 200: { - [key: string]: unknown - } + 200: SwitchWorkspaceResponse } export type PostWorkspacesSwitchResponse @@ -3386,9 +3557,7 @@ export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangData } export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse diff --git a/packages/contracts/generated/api/console/workspaces/zod.gen.ts b/packages/contracts/generated/api/console/workspaces/zod.gen.ts index 3c46c777b2..f35dd93991 100644 --- a/packages/contracts/generated/api/console/workspaces/zod.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/zod.gen.ts @@ -2,6 +2,16 @@ import * as z from 'zod' +/** + * AgentProviderResponse + */ +export const zAgentProviderResponse = z.record(z.string(), z.unknown()) + +/** + * AgentProviderListResponse + */ +export const zAgentProviderListResponse = z.array(z.record(z.string(), z.unknown())) + /** * SnippetImportPayload * @@ -16,6 +26,29 @@ export const zSnippetImportPayload = z.object({ yaml_url: z.string().nullish(), }) +/** + * SnippetImportResponse + */ +export const zSnippetImportResponse = z.record(z.string(), z.unknown()) + +/** + * SnippetDependencyCheckResponse + */ +export const zSnippetDependencyCheckResponse = z.record(z.string(), z.unknown()) + +/** + * TextFileResponse + */ +export const zTextFileResponse = z.string() + +/** + * SnippetUseCountResponse + */ +export const zSnippetUseCountResponse = z.object({ + result: z.string(), + use_count: z.int(), +}) + /** * SimpleResultResponse */ @@ -137,6 +170,14 @@ export const zSimpleResultDataResponse = z.object({ result: z.string(), }) +/** + * MemberActionTenantResponse + */ +export const zMemberActionTenantResponse = z.object({ + result: z.string(), + tenant_id: z.string(), +}) + /** * OwnerTransferPayload */ @@ -151,6 +192,13 @@ export const zMemberRoleUpdatePayload = z.object({ role: z.string(), }) +/** + * ModelProviderPaymentCheckoutUrlResponse + */ +export const zModelProviderPaymentCheckoutUrlResponse = z.object({ + payment_link: z.string(), +}) + /** * ParserCredentialDelete */ @@ -158,6 +206,13 @@ export const zParserCredentialDelete = z.object({ credential_id: z.string(), }) +/** + * ProviderCredentialResponse + */ +export const zProviderCredentialResponse = z.object({ + credentials: z.record(z.string(), z.unknown()).nullish(), +}) + /** * ParserCredentialCreate */ @@ -189,6 +244,30 @@ export const zParserCredentialValidate = z.object({ credentials: z.record(z.string(), z.unknown()), }) +/** + * ProviderCredentialValidateResponse + */ +export const zProviderCredentialValidateResponse = z.object({ + error: z.string().nullish(), + result: z.enum(['error', 'success']), +}) + +/** + * ModelCredentialValidateResponse + */ +export const zModelCredentialValidateResponse = z.object({ + error: z.string().nullish(), + result: z.string(), +}) + +/** + * LoadBalancingCredentialValidateResponse + */ +export const zLoadBalancingCredentialValidateResponse = z.object({ + error: z.string().nullish(), + result: z.string(), +}) + /** * ParserPreferredProviderType */ @@ -205,6 +284,11 @@ export const zWorkspacePermissionResponse = z.object({ workspace_id: z.string(), }) +/** + * BinaryFileResponse + */ +export const zBinaryFileResponse = z.custom() + /** * PluginDebuggingKeyResponse */ @@ -214,6 +298,13 @@ export const zPluginDebuggingKeyResponse = z.object({ port: z.int(), }) +/** + * PluginManifestResponse + */ +export const zPluginManifestResponse = z.object({ + manifest: z.unknown(), +}) + /** * ParserGithubInstall */ @@ -224,6 +315,11 @@ export const zParserGithubInstall = z.object({ version: z.string(), }) +/** + * PluginDaemonOperationResponse + */ +export const zPluginDaemonOperationResponse = z.unknown() + /** * ParserPluginIdentifiers */ @@ -231,6 +327,14 @@ export const zParserPluginIdentifiers = z.object({ plugin_unique_identifiers: z.array(z.string()), }) +/** + * PluginListResponse + */ +export const zPluginListResponse = z.object({ + plugins: z.unknown(), + total: z.int(), +}) + /** * ParserLatest */ @@ -238,6 +342,27 @@ export const zParserLatest = z.object({ plugin_ids: z.array(z.string()), }) +/** + * PluginInstallationsResponse + */ +export const zPluginInstallationsResponse = z.object({ + plugins: z.unknown(), +}) + +/** + * PluginVersionsResponse + */ +export const zPluginVersionsResponse = z.object({ + versions: z.unknown(), +}) + +/** + * PluginDynamicOptionsResponse + */ +export const zPluginDynamicOptionsResponse = z.object({ + options: z.unknown(), +}) + /** * ParserDynamicOptionsWithCredentials */ @@ -264,6 +389,35 @@ export const zParserExcludePlugin = z.object({ plugin_id: z.string(), }) +/** + * PluginOperationSuccessResponse + */ +export const zPluginOperationSuccessResponse = z.object({ + message: z.string().nullish(), + success: z.boolean(), +}) + +/** + * PluginReadmeResponse + */ +export const zPluginReadmeResponse = z.object({ + readme: z.string(), +}) + +/** + * PluginTasksResponse + */ +export const zPluginTasksResponse = z.object({ + tasks: z.unknown(), +}) + +/** + * PluginTaskResponse + */ +export const zPluginTaskResponse = z.object({ + task: z.unknown(), +}) + /** * ParserUninstall */ @@ -299,6 +453,11 @@ export const zParserGithubUpload = z.object({ version: z.string(), }) +/** + * ToolProviderOpaqueResponse + */ +export const zToolProviderOpaqueResponse = z.unknown() + /** * ApiToolProviderDeletePayload */ @@ -327,6 +486,16 @@ export const zBuiltinToolCredentialDeletePayload = z.object({ credential_id: z.string(), }) +/** + * ToolOAuthClientSchemaResponse + */ +export const zToolOAuthClientSchemaResponse = z.array(z.record(z.string(), z.unknown())) + +/** + * ToolOAuthCustomClientResponse + */ +export const zToolOAuthCustomClientResponse = z.record(z.string(), z.unknown()) + /** * ToolOAuthCustomClientPayload */ @@ -366,6 +535,24 @@ export const zWorkflowToolDeletePayload = z.object({ workflow_tool_id: z.string(), }) +/** + * TriggerProviderOpaqueResponse + */ +export const zTriggerProviderOpaqueResponse = z.unknown() + +/** + * TriggerOAuthClientResponse + */ +export const zTriggerOAuthClientResponse = z.object({ + configured: z.boolean(), + custom_configured: z.boolean(), + custom_enabled: z.boolean(), + oauth_client_schema: z.unknown(), + params: z.record(z.string(), z.unknown()), + redirect_uri: z.string(), + system_configured: z.boolean(), +}) + /** * TriggerOAuthClientPayload */ @@ -398,6 +585,15 @@ export const zTriggerSubscriptionBuilderVerifyPayload = z.object({ credentials: z.record(z.string(), z.unknown()), }) +/** + * TriggerOAuthAuthorizeResponse + */ +export const zTriggerOAuthAuthorizeResponse = z.object({ + authorization_url: z.string(), + subscription_builder: z.unknown(), + subscription_builder_id: z.string(), +}) + /** * WorkspaceCustomConfigPayload */ @@ -406,6 +602,13 @@ export const zWorkspaceCustomConfigPayload = z.object({ replace_webapp_logo: z.string().nullish(), }) +/** + * WorkspaceLogoUploadResponse + */ +export const zWorkspaceLogoUploadResponse = z.object({ + id: z.string(), +}) + /** * WorkspaceInfoPayload */ @@ -420,6 +623,25 @@ export const zSwitchWorkspacePayload = z.object({ tenant_id: z.string(), }) +/** + * TenantListItemResponse + */ +export const zTenantListItemResponse = z.object({ + created_at: z.int().nullish(), + current: z.boolean(), + id: z.string(), + name: z.string().nullish(), + plan: z.string().nullish(), + status: z.string().nullish(), +}) + +/** + * TenantListResponse + */ +export const zTenantListResponse = z.object({ + workspaces: z.array(zTenantListItemResponse), +}) + /** * WorkspaceCustomConfigResponse */ @@ -446,6 +668,22 @@ export const zTenantInfoResponse = z.object({ trial_end_reason: z.string().nullish(), }) +/** + * WorkspaceMutationResponse + */ +export const zWorkspaceMutationResponse = z.object({ + result: z.string(), + tenant: zTenantInfoResponse, +}) + +/** + * SwitchWorkspaceResponse + */ +export const zSwitchWorkspaceResponse = z.object({ + new_tenant: zTenantInfoResponse, + result: z.string(), +}) + /** * IconInfo * @@ -512,7 +750,15 @@ export const zAnonymousInlineModel7B8B49Ca164e = z.object({ }) export const zSnippet = z.object({ - created_at: z.record(z.string(), z.unknown()).optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), created_by: zAnonymousInlineModelB0Fd3F86D9D5.optional(), description: z.string().optional(), graph: z.record(z.string(), z.unknown()).optional(), @@ -523,15 +769,31 @@ export const zSnippet = z.object({ name: z.string().optional(), tags: z.array(zAnonymousInlineModel7B8B49Ca164e).optional(), type: z.string().optional(), - updated_at: z.record(z.string(), z.unknown()).optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), updated_by: zAnonymousInlineModelB0Fd3F86D9D5.optional(), use_count: z.int().optional(), version: z.int().optional(), }) -export const zAnonymousInlineModel7B67Ac8A4Db8 = z.object({ +export const zAnonymousInlineModelEfd591151Ea9 = z.object({ author_name: z.string().optional(), - created_at: z.record(z.string(), z.unknown()).optional(), + created_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), created_by: z.string().optional(), description: z.string().optional(), icon_info: z.record(z.string(), z.unknown()).optional(), @@ -540,14 +802,22 @@ export const zAnonymousInlineModel7B67Ac8A4Db8 = z.object({ name: z.string().optional(), tags: z.array(zAnonymousInlineModel7B8B49Ca164e).optional(), type: z.string().optional(), - updated_at: z.record(z.string(), z.unknown()).optional(), + updated_at: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), updated_by: z.string().optional(), use_count: z.int().optional(), version: z.int().optional(), }) export const zSnippetPagination = z.object({ - data: z.array(zAnonymousInlineModel7B67Ac8A4Db8).optional(), + data: z.array(zAnonymousInlineModelEfd591151Ea9).optional(), has_more: z.boolean().optional(), limit: z.int().optional(), page: z.int().optional(), @@ -590,6 +860,25 @@ export const zMemberInvitePayload = z.object({ role: zTenantAccountRole, }) +/** + * MemberInviteResultResponse + */ +export const zMemberInviteResultResponse = z.object({ + email: z.string(), + message: z.string().nullish(), + status: z.string(), + url: z.string().nullish(), +}) + +/** + * MemberInviteResponse + */ +export const zMemberInviteResponse = z.object({ + invitation_results: z.array(zMemberInviteResultResponse), + result: z.string(), + tenant_id: z.string(), +}) + /** * ModelType * @@ -704,6 +993,35 @@ export const zParserPostModels = z.object({ model_type: zModelType, }) +/** + * CredentialConfiguration + * + * Model class for credential configuration. + */ +export const zCredentialConfiguration = z.object({ + credential_id: z.string(), + credential_name: z.string(), +}) + +/** + * ModelCredentialLoadBalancingResponse + */ +export const zModelCredentialLoadBalancingResponse = z.object({ + configs: z.array(z.record(z.string(), z.unknown())).optional(), + enabled: z.boolean(), +}) + +/** + * ModelCredentialResponse + */ +export const zModelCredentialResponse = z.object({ + available_credentials: z.array(zCredentialConfiguration), + credentials: z.record(z.string(), z.unknown()).optional(), + current_credential_id: z.string().nullish(), + current_credential_name: z.string().nullish(), + load_balancing: zModelCredentialLoadBalancingResponse, +}) + /** * DebugPermission */ @@ -722,6 +1040,14 @@ export const zParserPermissionChange = z.object({ install_permission: zInstallPermission, }) +/** + * PluginPermissionResponse + */ +export const zPluginPermissionResponse = z.object({ + debug_permission: zDebugPermission, + install_permission: zInstallPermission, +}) + /** * PluginPermissionSettingsPayload */ @@ -838,6 +1164,176 @@ export const zMcpProviderUpdatePayload = z.object({ server_url: z.string(), }) +/** + * ConfigurateMethod + * + * Enum class for configurate method of provider model. + */ +export const zConfigurateMethod = z.enum(['customizable-model', 'predefined-model']) + +/** + * I18nObject + * + * Model class for i18n object. + */ +export const zI18nObject = z.object({ + en_US: z.string(), + zh_Hans: z.string().nullish(), +}) + +/** + * ProviderHelpEntity + * + * Model class for provider help. + */ +export const zProviderHelpEntity = z.object({ + title: zI18nObject, + url: zI18nObject, +}) + +/** + * ProviderType + */ +export const zProviderType = z.enum(['custom', 'system']) + +/** + * ModelFeature + * + * Enum class for llm feature. + */ +export const zModelFeature = z.enum([ + 'agent-thought', + 'audio', + 'document', + 'multi-tool-call', + 'polling', + 'stream-tool-call', + 'structured-output', + 'tool-call', + 'video', + 'vision', +]) + +/** + * FetchFrom + * + * Enum class for fetch from. + */ +export const zFetchFrom = z.enum(['customizable-model', 'predefined-model']) + +/** + * ModelPropertyKey + * + * Enum class for model property key. + */ +export const zModelPropertyKey = z.enum([ + 'audio_type', + 'context_size', + 'default_voice', + 'file_upload_limit', + 'max_characters_per_chunk', + 'max_chunks', + 'max_workers', + 'mode', + 'supported_file_extensions', + 'voices', + 'word_limit', +]) + +/** + * ModelStatus + * + * Enum class for model status. + */ +export const zModelStatus = z.enum([ + 'active', + 'credential-removed', + 'disabled', + 'no-configure', + 'no-permission', + 'quota-exceeded', +]) + +/** + * ParameterType + * + * Enum class for parameter type. + */ +export const zParameterType = z.enum(['boolean', 'float', 'int', 'string', 'text']) + +/** + * ParameterRule + * + * Model class for parameter rule. + */ +export const zParameterRule = z.object({ + default: z.unknown().nullish(), + help: zI18nObject.nullish(), + label: zI18nObject, + max: z.number().nullish(), + min: z.number().nullish(), + name: z.string(), + options: z.array(z.string()).optional().default([]), + precision: z.int().nullish(), + required: z.boolean().optional().default(false), + type: zParameterType, + use_template: z.string().nullish(), +}) + +/** + * ModelParameterRulesResponse + */ +export const zModelParameterRulesResponse = z.object({ + data: z.array(zParameterRule), +}) + +/** + * ProviderModelWithStatusEntity + * + * Model class for model response. + */ +export const zProviderModelWithStatusEntity = z.object({ + deprecated: z.boolean().optional().default(false), + features: z.array(zModelFeature).nullish(), + fetch_from: zFetchFrom, + has_invalid_load_balancing_configs: z.boolean().optional().default(false), + label: zI18nObject, + load_balancing_enabled: z.boolean().optional().default(false), + model: z.string(), + model_properties: z.record(z.string(), z.unknown()), + model_type: zModelType, + status: zModelStatus, +}) + +/** + * CustomConfigurationStatus + * + * Enum class for custom configuration status. + */ +export const zCustomConfigurationStatus = z.enum(['active', 'no-configure']) + +/** + * ProviderWithModelsResponse + * + * Model class for provider with models response. + */ +export const zProviderWithModelsResponse = z.object({ + icon_small: zI18nObject.nullish(), + icon_small_dark: zI18nObject.nullish(), + label: zI18nObject, + models: z.array(zProviderModelWithStatusEntity), + provider: z.string(), + status: zCustomConfigurationStatus, + tenant_id: z.string(), +}) + +/** + * ProviderWithModelsDataResponse + */ +export const zProviderWithModelsDataResponse = z.object({ + data: z.array(zProviderWithModelsResponse), +}) + /** * StrategySetting */ @@ -867,6 +1363,14 @@ export const zParserPreferencesChange = z.object({ permission: zPluginPermissionSettingsPayload, }) +/** + * PluginPreferencesResponse + */ +export const zPluginPreferencesResponse = z.object({ + auto_upgrade: zPluginAutoUpgradeSettingsPayload, + permission: zPluginPermissionSettingsPayload, +}) + /** * ToolParameterForm */ @@ -911,10 +1415,285 @@ export const zWorkflowToolUpdatePayload = z.object({ workflow_tool_id: z.string(), }) +/** + * UnaddedModelConfiguration + * + * Model class for provider unadded model configuration. + */ +export const zUnaddedModelConfiguration = z.object({ + model: z.string(), + model_type: zModelType, +}) + +/** + * CustomModelConfiguration + * + * Model class for provider custom model configuration. + */ +export const zCustomModelConfiguration = z.object({ + available_model_credentials: z.array(zCredentialConfiguration).optional().default([]), + credentials: z.record(z.string(), z.unknown()).nullable(), + current_credential_id: z.string().nullish(), + current_credential_name: z.string().nullish(), + model: z.string(), + model_type: zModelType, + unadded_to_model_list: z.boolean().nullish().default(false), +}) + +/** + * CustomConfigurationResponse + * + * Model class for provider custom configuration response. + */ +export const zCustomConfigurationResponse = z.object({ + available_credentials: z.array(zCredentialConfiguration).nullish(), + can_added_models: z.array(zUnaddedModelConfiguration).nullish(), + current_credential_id: z.string().nullish(), + current_credential_name: z.string().nullish(), + custom_models: z.array(zCustomModelConfiguration).nullish(), + status: zCustomConfigurationStatus, +}) + +/** + * FieldModelSchema + */ +export const zFieldModelSchema = z.object({ + label: zI18nObject, + placeholder: zI18nObject.nullish(), +}) + +/** + * ProviderQuotaType + */ +export const zProviderQuotaType = z.enum(['free', 'paid', 'trial']) + +/** + * PriceConfigResponse + * + * Serialized pricing info with codegen-safe decimal string patterns. + */ +export const zPriceConfigResponse = z.object({ + currency: z.string(), + input: z.string().regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/), + output: z + .string() + .regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/) + .nullish(), + unit: z.string().regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/), +}) + +/** + * AIModelEntityResponse + */ +export const zAiModelEntityResponse = z.object({ + deprecated: z.boolean().optional().default(false), + features: z.array(zModelFeature).nullish(), + fetch_from: zFetchFrom, + label: zI18nObject, + model: z.string(), + model_properties: z.record(z.string(), z.unknown()), + model_type: zModelType, + parameter_rules: z.array(zParameterRule).optional().default([]), + pricing: zPriceConfigResponse.nullish(), +}) + +/** + * SimpleProviderEntityResponse + * + * Simple provider entity response. + */ +export const zSimpleProviderEntityResponse = z.object({ + icon_small: zI18nObject.nullish(), + icon_small_dark: zI18nObject.nullish(), + label: zI18nObject, + models: z.array(zAiModelEntityResponse).optional().default([]), + provider: z.string(), + provider_name: z.string().optional().default(''), + supported_model_types: z.array(zModelType), + tenant_id: z.string(), +}) + +/** + * DefaultModelResponse + * + * Default model entity. + */ +export const zDefaultModelResponse = z.object({ + model: z.string(), + model_type: zModelType, + provider: zSimpleProviderEntityResponse, +}) + +/** + * DefaultModelDataResponse + */ +export const zDefaultModelDataResponse = z.object({ + data: zDefaultModelResponse.nullish(), +}) + +/** + * ModelWithProviderEntityResponse + * + * Model with provider entity. + */ +export const zModelWithProviderEntityResponse = z.object({ + deprecated: z.boolean().optional().default(false), + features: z.array(zModelFeature).nullish(), + fetch_from: zFetchFrom, + has_invalid_load_balancing_configs: z.boolean().optional().default(false), + label: zI18nObject, + load_balancing_enabled: z.boolean().optional().default(false), + model: z.string(), + model_properties: z.record(z.string(), z.unknown()), + model_type: zModelType, + provider: zSimpleProviderEntityResponse, + status: zModelStatus, +}) + +/** + * ModelWithProviderListResponse + */ +export const zModelWithProviderListResponse = z.object({ + data: z.array(zModelWithProviderEntityResponse), +}) + +/** + * FormShowOnObject + * + * Model class for form show on. + */ +export const zFormShowOnObject = z.object({ + value: z.string(), + variable: z.string(), +}) + +/** + * FormOption + * + * Model class for form option. + */ +export const zFormOption = z.object({ + label: zI18nObject, + show_on: z.array(zFormShowOnObject).optional().default([]), + value: z.string(), +}) + +/** + * FormType + * + * Enum class for form type. + */ +export const zFormType = z.enum(['radio', 'secret-input', 'select', 'switch', 'text-input']) + +/** + * CredentialFormSchema + * + * Model class for credential form schema. + */ +export const zCredentialFormSchema = z.object({ + default: z.string().nullish(), + label: zI18nObject, + max_length: z.int().optional().default(0), + options: z.array(zFormOption).nullish(), + placeholder: zI18nObject.nullish(), + required: z.boolean().optional().default(true), + show_on: z.array(zFormShowOnObject).optional().default([]), + type: zFormType, + variable: z.string(), +}) + +/** + * ModelCredentialSchema + * + * Model class for model credential schema. + */ +export const zModelCredentialSchema = z.object({ + credential_form_schemas: z.array(zCredentialFormSchema), + model: zFieldModelSchema, +}) + +/** + * ProviderCredentialSchema + * + * Model class for provider credential schema. + */ +export const zProviderCredentialSchema = z.object({ + credential_form_schemas: z.array(zCredentialFormSchema), +}) + +/** + * QuotaUnit + */ +export const zQuotaUnit = z.enum(['credits', 'times', 'tokens']) + +/** + * RestrictModel + */ +export const zRestrictModel = z.object({ + base_model_name: z.string().nullish(), + model: z.string(), + model_type: zModelType, +}) + +/** + * QuotaConfiguration + * + * Model class for provider quota configuration. + */ +export const zQuotaConfiguration = z.object({ + is_valid: z.boolean(), + quota_limit: z.int(), + quota_type: zProviderQuotaType, + quota_unit: zQuotaUnit, + quota_used: z.int(), + restrict_models: z.array(zRestrictModel).optional().default([]), +}) + +/** + * SystemConfigurationResponse + * + * Model class for provider system configuration response. + */ +export const zSystemConfigurationResponse = z.object({ + current_quota_type: zProviderQuotaType.nullish(), + enabled: z.boolean(), + quota_configurations: z.array(zQuotaConfiguration).optional().default([]), +}) + +/** + * ProviderResponse + * + * Model class for provider response. + */ +export const zProviderResponse = z.object({ + background: z.string().nullish(), + configurate_methods: z.array(zConfigurateMethod), + custom_configuration: zCustomConfigurationResponse, + description: zI18nObject.nullish(), + help: zProviderHelpEntity.nullish(), + icon_small: zI18nObject.nullish(), + icon_small_dark: zI18nObject.nullish(), + label: zI18nObject, + model_credential_schema: zModelCredentialSchema.nullish(), + preferred_provider_type: zProviderType, + provider: z.string(), + provider_credential_schema: zProviderCredentialSchema.nullish(), + supported_model_types: z.array(zModelType), + system_configuration: zSystemConfigurationResponse, + tenant_id: z.string(), +}) + +/** + * ModelProviderListResponse + */ +export const zModelProviderListResponse = z.object({ + data: z.array(zProviderResponse), +}) + /** * Success */ -export const zGetWorkspacesResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesResponse = zTenantListResponse /** * Success @@ -926,19 +1705,14 @@ export const zGetWorkspacesCurrentAgentProviderByProviderNamePath = z.object({ }) /** - * Agent provider details + * Success */ -export const zGetWorkspacesCurrentAgentProviderByProviderNameResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentAgentProviderByProviderNameResponse = zAgentProviderResponse /** * Success */ -export const zGetWorkspacesCurrentAgentProvidersResponse = z.array( - z.record(z.string(), z.unknown()), -) +export const zGetWorkspacesCurrentAgentProvidersResponse = zAgentProviderListResponse export const zGetWorkspacesCurrentCustomizedSnippetsQuery = z.object({ creators: z.array(z.string()).optional(), @@ -963,10 +1737,10 @@ export const zPostWorkspacesCurrentCustomizedSnippetsResponse = zSnippet export const zPostWorkspacesCurrentCustomizedSnippetsImportsBody = zSnippetImportPayload -export const zPostWorkspacesCurrentCustomizedSnippetsImportsResponse = z.union([ - z.record(z.string(), z.unknown()), - z.record(z.string(), z.unknown()), -]) +/** + * Snippet imported successfully + */ +export const zPostWorkspacesCurrentCustomizedSnippetsImportsResponse = zSnippetImportResponse export const zPostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmPath = z.object({ import_id: z.string(), @@ -975,10 +1749,8 @@ export const zPostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmPat /** * Import confirmed successfully */ -export const zPostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentCustomizedSnippetsImportsByImportIdConfirmResponse + = zSnippetImportResponse export const zDeleteWorkspacesCurrentCustomizedSnippetsBySnippetIdPath = z.object({ snippet_id: z.string(), @@ -1016,22 +1788,21 @@ export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependencies /** * Dependencies checked successfully */ -export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdCheckDependenciesResponse + = zSnippetDependencyCheckResponse export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportPath = z.object({ snippet_id: z.string(), }) +export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportQuery = z.object({ + include_secret: z.string().optional().default('false'), +}) + /** * Snippet exported successfully */ -export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentCustomizedSnippetsBySnippetIdExportResponse = zTextFileResponse export const zPostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementPath = z.object({ snippet_id: z.string(), @@ -1041,7 +1812,7 @@ export const zPostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncremen * Use count incremented successfully */ export const zPostWorkspacesCurrentCustomizedSnippetsBySnippetIdUseCountIncrementResponse - = z.record(z.string(), z.unknown()) + = zSnippetUseCountResponse /** * Success @@ -1055,7 +1826,7 @@ export const zGetWorkspacesCurrentDefaultModelQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentDefaultModelResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentDefaultModelResponse = zDefaultModelDataResponse export const zPostWorkspacesCurrentDefaultModelBody = zParserPostDefault @@ -1157,7 +1928,7 @@ export const zPostWorkspacesCurrentMembersInviteEmailBody = zMemberInvitePayload /** * Success */ -export const zPostWorkspacesCurrentMembersInviteEmailResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentMembersInviteEmailResponse = zMemberInviteResponse export const zPostWorkspacesCurrentMembersOwnerTransferCheckBody = zOwnerTransferCheckPayload @@ -1182,7 +1953,7 @@ export const zDeleteWorkspacesCurrentMembersByMemberIdPath = z.object({ /** * Success */ -export const zDeleteWorkspacesCurrentMembersByMemberIdResponse = z.record(z.string(), z.unknown()) +export const zDeleteWorkspacesCurrentMembersByMemberIdResponse = zMemberActionTenantResponse export const zPostWorkspacesCurrentMembersByMemberIdOwnerTransferBody = zOwnerTransferPayload @@ -1193,10 +1964,7 @@ export const zPostWorkspacesCurrentMembersByMemberIdOwnerTransferPath = z.object /** * Success */ -export const zPostWorkspacesCurrentMembersByMemberIdOwnerTransferResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentMembersByMemberIdOwnerTransferResponse = zSimpleResultResponse export const zPutWorkspacesCurrentMembersByMemberIdUpdateRoleBody = zMemberRoleUpdatePayload @@ -1207,10 +1975,7 @@ export const zPutWorkspacesCurrentMembersByMemberIdUpdateRolePath = z.object({ /** * Success */ -export const zPutWorkspacesCurrentMembersByMemberIdUpdateRoleResponse = z.record( - z.string(), - z.unknown(), -) +export const zPutWorkspacesCurrentMembersByMemberIdUpdateRoleResponse = zSimpleResultResponse export const zGetWorkspacesCurrentModelProvidersQuery = z.object({ model_type: z @@ -1221,7 +1986,7 @@ export const zGetWorkspacesCurrentModelProvidersQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentModelProvidersResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentModelProvidersResponse = zModelProviderListResponse export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlPath = z.object({ provider: z.string(), @@ -1230,10 +1995,8 @@ export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlPath = z.ob /** * Success */ -export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlResponse + = zModelProviderPaymentCheckoutUrlResponse export const zDeleteWorkspacesCurrentModelProvidersByProviderCredentialsBody = zParserCredentialDelete @@ -1258,10 +2021,8 @@ export const zGetWorkspacesCurrentModelProvidersByProviderCredentialsQuery = z.o /** * Success */ -export const zGetWorkspacesCurrentModelProvidersByProviderCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelProvidersByProviderCredentialsResponse + = zProviderCredentialResponse export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsBody = zParserCredentialCreate @@ -1270,12 +2031,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsPath = z.o }) /** - * Success + * Credential created successfully */ -export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsResponse + = zSimpleResultResponse export const zPutWorkspacesCurrentModelProvidersByProviderCredentialsBody = zParserCredentialUpdate @@ -1284,12 +2043,10 @@ export const zPutWorkspacesCurrentModelProvidersByProviderCredentialsPath = z.ob }) /** - * Success + * Credential updated successfully */ -export const zPutWorkspacesCurrentModelProvidersByProviderCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPutWorkspacesCurrentModelProvidersByProviderCredentialsResponse + = zSimpleResultResponse export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsSwitchBody = zParserCredentialSwitch @@ -1312,12 +2069,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsValidatePa }) /** - * Success + * Credential validation result */ -export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponse + = zProviderCredentialValidateResponse export const zDeleteWorkspacesCurrentModelProvidersByProviderModelsBody = zParserDeleteModels @@ -1337,10 +2092,8 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsPath = z.object( /** * Success */ -export const zGetWorkspacesCurrentModelProvidersByProviderModelsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelProvidersByProviderModelsResponse + = zModelWithProviderListResponse export const zPostWorkspacesCurrentModelProvidersByProviderModelsBody = zParserPostModels @@ -1351,10 +2104,7 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsPath = z.object /** * Success */ -export const zPostWorkspacesCurrentModelProvidersByProviderModelsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentModelProvidersByProviderModelsResponse = zSimpleResultResponse export const zDeleteWorkspacesCurrentModelProvidersByProviderModelsCredentialsBody = zParserDeleteCredential @@ -1382,10 +2132,8 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsQuery /** * Success */ -export const zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse + = zModelCredentialResponse export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsBody = zParserCreateCredential @@ -1395,12 +2143,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsPath }) /** - * Success + * Credential created successfully */ -export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse + = zSimpleResultResponse export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsBody = zParserUpdateCredential @@ -1410,12 +2156,10 @@ export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsPath }) /** - * Success + * Credential updated successfully */ -export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse + = zSimpleResultResponse export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsSwitchBody = zParserSwitch @@ -1440,10 +2184,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsVali ) /** - * Success + * Credential validation result */ export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponse - = z.record(z.string(), z.unknown()) + = zModelCredentialValidateResponse export const zPatchWorkspacesCurrentModelProvidersByProviderModelsDisableBody = zParserDeleteModels @@ -1478,10 +2222,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingCo }) /** - * Success + * Credential validation result */ export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsCredentialsValidateResponse - = z.record(z.string(), z.unknown()) + = zLoadBalancingCredentialValidateResponse export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsByConfigIdCredentialsValidateBody = zLoadBalancingCredentialPayload @@ -1493,10 +2237,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingCo }) /** - * Success + * Credential validation result */ export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsByConfigIdCredentialsValidateResponse - = z.record(z.string(), z.unknown()) + = zLoadBalancingCredentialValidateResponse export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesPath = z.object({ provider: z.string(), @@ -1509,10 +2253,8 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesQu /** * Success */ -export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponse + = zModelParameterRulesResponse export const zPostWorkspacesCurrentModelProvidersByProviderPreferredProviderTypeBody = zParserPreferredProviderType @@ -1534,10 +2276,8 @@ export const zGetWorkspacesCurrentModelsModelTypesByModelTypePath = z.object({ /** * Success */ -export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse + = zProviderWithModelsDataResponse /** * Success @@ -1552,7 +2292,7 @@ export const zGetWorkspacesCurrentPluginAssetQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginAssetResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginAssetResponse = zBinaryFileResponse /** * Success @@ -1566,7 +2306,7 @@ export const zGetWorkspacesCurrentPluginFetchManifestQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginFetchManifestResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginFetchManifestResponse = zPluginManifestResponse export const zGetWorkspacesCurrentPluginIconQuery = z.object({ filename: z.string(), @@ -1576,31 +2316,28 @@ export const zGetWorkspacesCurrentPluginIconQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginIconResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginIconResponse = zBinaryFileResponse export const zPostWorkspacesCurrentPluginInstallGithubBody = zParserGithubInstall /** * Success */ -export const zPostWorkspacesCurrentPluginInstallGithubResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginInstallGithubResponse = zPluginDaemonOperationResponse export const zPostWorkspacesCurrentPluginInstallMarketplaceBody = zParserPluginIdentifiers /** * Success */ -export const zPostWorkspacesCurrentPluginInstallMarketplaceResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginInstallMarketplaceResponse = zPluginDaemonOperationResponse export const zPostWorkspacesCurrentPluginInstallPkgBody = zParserPluginIdentifiers /** * Success */ -export const zPostWorkspacesCurrentPluginInstallPkgResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginInstallPkgResponse = zPluginDaemonOperationResponse export const zGetWorkspacesCurrentPluginListQuery = z.object({ page: z.int().gte(1).optional().default(1), @@ -1610,27 +2347,21 @@ export const zGetWorkspacesCurrentPluginListQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginListResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginListResponse = zPluginListResponse export const zPostWorkspacesCurrentPluginListInstallationsIdsBody = zParserLatest /** * Success */ -export const zPostWorkspacesCurrentPluginListInstallationsIdsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginListInstallationsIdsResponse = zPluginInstallationsResponse export const zPostWorkspacesCurrentPluginListLatestVersionsBody = zParserLatest /** * Success */ -export const zPostWorkspacesCurrentPluginListLatestVersionsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginListLatestVersionsResponse = zPluginVersionsResponse export const zGetWorkspacesCurrentPluginMarketplacePkgQuery = z.object({ plugin_unique_identifier: z.string(), @@ -1639,7 +2370,7 @@ export const zGetWorkspacesCurrentPluginMarketplacePkgQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginMarketplacePkgResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginMarketplacePkgResponse = zPluginManifestResponse export const zGetWorkspacesCurrentPluginParametersDynamicOptionsQuery = z.object({ action: z.string(), @@ -1653,10 +2384,8 @@ export const zGetWorkspacesCurrentPluginParametersDynamicOptionsQuery = z.object /** * Success */ -export const zGetWorkspacesCurrentPluginParametersDynamicOptionsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentPluginParametersDynamicOptionsResponse + = zPluginDynamicOptionsResponse export const zPostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsBody = zParserDynamicOptionsWithCredentials @@ -1664,10 +2393,8 @@ export const zPostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentials /** * Success */ -export const zPostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginParametersDynamicOptionsWithCredentialsResponse + = zPluginDynamicOptionsResponse export const zPostWorkspacesCurrentPluginPermissionChangeBody = zParserPermissionChange @@ -1679,32 +2406,27 @@ export const zPostWorkspacesCurrentPluginPermissionChangeResponse = zSuccessResp /** * Success */ -export const zGetWorkspacesCurrentPluginPermissionFetchResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginPermissionFetchResponse = zPluginPermissionResponse export const zPostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeBody = zParserExcludePlugin /** * Success */ -export const zPostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginPreferencesAutoupgradeExcludeResponse + = zPluginOperationSuccessResponse export const zPostWorkspacesCurrentPluginPreferencesChangeBody = zParserPreferencesChange /** * Success */ -export const zPostWorkspacesCurrentPluginPreferencesChangeResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginPreferencesChangeResponse = zPluginOperationSuccessResponse /** * Success */ -export const zGetWorkspacesCurrentPluginPreferencesFetchResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginPreferencesFetchResponse = zPluginPreferencesResponse export const zGetWorkspacesCurrentPluginReadmeQuery = z.object({ language: z.string().optional().default('en-US'), @@ -1714,7 +2436,7 @@ export const zGetWorkspacesCurrentPluginReadmeQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginReadmeResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginReadmeResponse = zPluginReadmeResponse export const zGetWorkspacesCurrentPluginTasksQuery = z.object({ page: z.int().gte(1).optional().default(1), @@ -1724,7 +2446,7 @@ export const zGetWorkspacesCurrentPluginTasksQuery = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginTasksResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginTasksResponse = zPluginTasksResponse /** * Success @@ -1738,7 +2460,7 @@ export const zGetWorkspacesCurrentPluginTasksByTaskIdPath = z.object({ /** * Success */ -export const zGetWorkspacesCurrentPluginTasksByTaskIdResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentPluginTasksByTaskIdResponse = zPluginTaskResponse export const zPostWorkspacesCurrentPluginTasksByTaskIdDeletePath = z.object({ task_id: z.string(), @@ -1771,92 +2493,98 @@ export const zPostWorkspacesCurrentPluginUpgradeGithubBody = zParserGithubUpgrad /** * Success */ -export const zPostWorkspacesCurrentPluginUpgradeGithubResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginUpgradeGithubResponse = zPluginDaemonOperationResponse export const zPostWorkspacesCurrentPluginUpgradeMarketplaceBody = zParserMarketplaceUpgrade /** * Success */ -export const zPostWorkspacesCurrentPluginUpgradeMarketplaceResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentPluginUpgradeMarketplaceResponse = zPluginDaemonOperationResponse /** * Success */ -export const zPostWorkspacesCurrentPluginUploadBundleResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginUploadBundleResponse = zPluginDaemonOperationResponse export const zPostWorkspacesCurrentPluginUploadGithubBody = zParserGithubUpload /** * Success */ -export const zPostWorkspacesCurrentPluginUploadGithubResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginUploadGithubResponse = zPluginDaemonOperationResponse /** * Success */ -export const zPostWorkspacesCurrentPluginUploadPkgResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentPluginUploadPkgResponse = zPluginDaemonOperationResponse /** * Success */ -export const zGetWorkspacesCurrentToolLabelsResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolLabelsResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderApiAddBody = zApiToolProviderAddPayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderApiAddResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderApiAddResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderApiDeleteBody = zApiToolProviderDeletePayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderApiDeleteResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderApiDeleteResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProviderApiGetQuery = z.object({ + provider: z.string(), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProviderApiGetResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolProviderApiGetResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProviderApiRemoteQuery = z.object({ + url: z.url().min(1).max(2083), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProviderApiRemoteResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolProviderApiRemoteResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderApiSchemaBody = zApiToolSchemaPayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderApiSchemaResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderApiSchemaResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderApiTestPreBody = zApiToolTestPayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderApiTestPreResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderApiTestPreResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProviderApiToolsQuery = z.object({ + provider: z.string(), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProviderApiToolsResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolProviderApiToolsResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderApiUpdateBody = zApiToolProviderUpdatePayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderApiUpdateResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderApiUpdateResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderBuiltinByProviderAddBody = zBuiltinToolAddPayload @@ -1867,22 +2595,22 @@ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderAddPath = z.obje /** * Success */ -export const zPostWorkspacesCurrentToolProviderBuiltinByProviderAddResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderBuiltinByProviderAddResponse + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoPath = z.object({ provider: z.string(), }) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoQuery = z.object({ + include_credential_ids: z.array(z.string()).optional(), +}) + /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoResponse + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypePath = z.object({ @@ -1894,19 +2622,21 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaB * Success */ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypeResponse - = z.record(z.string(), z.unknown()) + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsPath = z.object({ provider: z.string(), }) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsQuery = z.object({ + include_credential_ids: z.array(z.string()).optional(), +}) + /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialsResponse + = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentialBody = zBuiltinProviderDefaultCredentialPayload @@ -1919,7 +2649,7 @@ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentia * Success */ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDefaultCredentialResponse - = z.record(z.string(), z.unknown()) + = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDeleteBody = zBuiltinToolCredentialDeletePayload @@ -1931,10 +2661,8 @@ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDeletePath = z.o /** * Success */ -export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDeleteResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderBuiltinByProviderDeleteResponse + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderIconPath = z.object({ provider: z.string(), @@ -1943,10 +2671,7 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderIconPath = z.obje /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderIconResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderIconResponse = zBinaryFileResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderInfoPath = z.object({ provider: z.string(), @@ -1955,10 +2680,8 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderInfoPath = z.obje /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderInfoResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderInfoResponse + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaPath = z.object({ provider: z.string(), @@ -1967,10 +2690,8 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchema /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthClientSchemaResponse + = zToolOAuthClientSchemaResponse export const zDeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientPath = z.object({ provider: z.string(), @@ -1980,7 +2701,7 @@ export const zDeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomCli * Success */ export const zDeleteWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse - = z.record(z.string(), z.unknown()) + = zSimpleResultResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientPath = z.object({ provider: z.string(), @@ -1989,10 +2710,8 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClient /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse + = zToolOAuthCustomClientResponse export const zPostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientBody = zToolOAuthCustomClientPayload @@ -2005,7 +2724,7 @@ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClien * Success */ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderOauthCustomClientResponse - = z.record(z.string(), z.unknown()) + = zSimpleResultResponse export const zGetWorkspacesCurrentToolProviderBuiltinByProviderToolsPath = z.object({ provider: z.string(), @@ -2014,10 +2733,8 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderToolsPath = z.obj /** * Success */ -export const zGetWorkspacesCurrentToolProviderBuiltinByProviderToolsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderBuiltinByProviderToolsResponse + = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderBuiltinByProviderUpdateBody = zBuiltinToolUpdatePayload @@ -2029,10 +2746,8 @@ export const zPostWorkspacesCurrentToolProviderBuiltinByProviderUpdatePath = z.o /** * Success */ -export const zPostWorkspacesCurrentToolProviderBuiltinByProviderUpdateResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderBuiltinByProviderUpdateResponse + = zToolProviderOpaqueResponse export const zDeleteWorkspacesCurrentToolProviderMcpBody = zMcpProviderDeletePayload @@ -2046,21 +2761,21 @@ export const zPostWorkspacesCurrentToolProviderMcpBody = zMcpProviderCreatePaylo /** * Success */ -export const zPostWorkspacesCurrentToolProviderMcpResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderMcpResponse = zToolProviderOpaqueResponse export const zPutWorkspacesCurrentToolProviderMcpBody = zMcpProviderUpdatePayload /** * Success */ -export const zPutWorkspacesCurrentToolProviderMcpResponse = z.record(z.string(), z.unknown()) +export const zPutWorkspacesCurrentToolProviderMcpResponse = zSimpleResultResponse export const zPostWorkspacesCurrentToolProviderMcpAuthBody = zMcpAuthPayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderMcpAuthResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCurrentToolProviderMcpAuthResponse = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderMcpToolsByProviderIdPath = z.object({ provider_id: z.string(), @@ -2069,10 +2784,8 @@ export const zGetWorkspacesCurrentToolProviderMcpToolsByProviderIdPath = z.objec /** * Success */ -export const zGetWorkspacesCurrentToolProviderMcpToolsByProviderIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderMcpToolsByProviderIdResponse + = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdPath = z.object({ provider_id: z.string(), @@ -2081,81 +2794,77 @@ export const zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdPath = z.obje /** * Success */ -export const zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderMcpUpdateByProviderIdResponse + = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderWorkflowCreateBody = zWorkflowToolCreatePayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderWorkflowCreateResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderWorkflowCreateResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderWorkflowDeleteBody = zWorkflowToolDeletePayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderWorkflowDeleteResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderWorkflowDeleteResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProviderWorkflowGetQuery = z.object({ + workflow_app_id: z.string().optional(), + workflow_tool_id: z.string().optional(), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProviderWorkflowGetResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderWorkflowGetResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProviderWorkflowToolsQuery = z.object({ + workflow_tool_id: z.string(), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProviderWorkflowToolsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentToolProviderWorkflowToolsResponse = zToolProviderOpaqueResponse export const zPostWorkspacesCurrentToolProviderWorkflowUpdateBody = zWorkflowToolUpdatePayload /** * Success */ -export const zPostWorkspacesCurrentToolProviderWorkflowUpdateResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentToolProviderWorkflowUpdateResponse = zToolProviderOpaqueResponse + +export const zGetWorkspacesCurrentToolProvidersQuery = z.object({ + type: z.enum(['api', 'builtin', 'mcp', 'model', 'workflow']).optional(), +}) /** * Success */ -export const zGetWorkspacesCurrentToolProvidersResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolProvidersResponse = zToolProviderOpaqueResponse /** * Success */ -export const zGetWorkspacesCurrentToolsApiResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolsApiResponse = zToolProviderOpaqueResponse /** * Success */ -export const zGetWorkspacesCurrentToolsBuiltinResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolsBuiltinResponse = zToolProviderOpaqueResponse /** * Success */ -export const zGetWorkspacesCurrentToolsMcpResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolsMcpResponse = zToolProviderOpaqueResponse /** * Success */ -export const zGetWorkspacesCurrentToolsWorkflowResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentToolsWorkflowResponse = zToolProviderOpaqueResponse export const zGetWorkspacesCurrentTriggerProviderByProviderIconPath = z.object({ provider: z.string(), @@ -2164,10 +2873,7 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderIconPath = z.object({ /** * Success */ -export const zGetWorkspacesCurrentTriggerProviderByProviderIconResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentTriggerProviderByProviderIconResponse = zBinaryFileResponse export const zGetWorkspacesCurrentTriggerProviderByProviderInfoPath = z.object({ provider: z.string(), @@ -2176,10 +2882,8 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderInfoPath = z.object({ /** * Success */ -export const zGetWorkspacesCurrentTriggerProviderByProviderInfoResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentTriggerProviderByProviderInfoResponse + = zTriggerProviderOpaqueResponse export const zDeleteWorkspacesCurrentTriggerProviderByProviderOauthClientPath = z.object({ provider: z.string(), @@ -2188,10 +2892,8 @@ export const zDeleteWorkspacesCurrentTriggerProviderByProviderOauthClientPath = /** * Success */ -export const zDeleteWorkspacesCurrentTriggerProviderByProviderOauthClientResponse = z.record( - z.string(), - z.unknown(), -) +export const zDeleteWorkspacesCurrentTriggerProviderByProviderOauthClientResponse + = zSimpleResultResponse export const zGetWorkspacesCurrentTriggerProviderByProviderOauthClientPath = z.object({ provider: z.string(), @@ -2200,10 +2902,8 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderOauthClientPath = z.o /** * Success */ -export const zGetWorkspacesCurrentTriggerProviderByProviderOauthClientResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentTriggerProviderByProviderOauthClientResponse + = zTriggerOAuthClientResponse export const zPostWorkspacesCurrentTriggerProviderByProviderOauthClientBody = zTriggerOAuthClientPayload @@ -2215,10 +2915,8 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderOauthClientPath = z. /** * Success */ -export const zPostWorkspacesCurrentTriggerProviderByProviderOauthClientResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostWorkspacesCurrentTriggerProviderByProviderOauthClientResponse + = zSimpleResultResponse export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBuildBySubscriptionBuilderIdBody = zTriggerSubscriptionBuilderUpdatePayload @@ -2233,7 +2931,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilder * Success */ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBuildBySubscriptionBuilderIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreateBody = zTriggerSubscriptionBuilderCreatePayload @@ -2247,7 +2945,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilder * Success */ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderCreateResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderLogsBySubscriptionBuilderIdPath = z.object({ @@ -2259,7 +2957,7 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderL * Success */ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderLogsBySubscriptionBuilderIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderUpdateBySubscriptionBuilderIdBody = zTriggerSubscriptionBuilderUpdatePayload @@ -2274,7 +2972,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilder * Success */ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderUpdateBySubscriptionBuilderIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderVerifyAndUpdateBySubscriptionBuilderIdBody = zTriggerSubscriptionBuilderVerifyPayload @@ -2289,7 +2987,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilder * Success */ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderVerifyAndUpdateBySubscriptionBuilderIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBySubscriptionBuilderIdPath = z.object({ @@ -2301,7 +2999,7 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderB * Success */ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsBuilderBySubscriptionBuilderIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListPath = z.object({ provider: z.string(), @@ -2310,10 +3008,8 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListPath /** * Success */ -export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsListResponse + = zTriggerProviderOpaqueResponse export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAuthorizePath = z.object({ @@ -2321,10 +3017,10 @@ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAut }) /** - * Success + * Authorization URL retrieved successfully */ export const zGetWorkspacesCurrentTriggerProviderByProviderSubscriptionsOauthAuthorizeResponse - = z.record(z.string(), z.unknown()) + = zTriggerOAuthAuthorizeResponse export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdBody = zTriggerSubscriptionBuilderVerifyPayload @@ -2339,7 +3035,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyB * Success */ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse export const zPostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsDeletePath = z.object({ @@ -2364,38 +3060,38 @@ export const zPostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsU * Success */ export const zPostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsUpdateResponse - = z.record(z.string(), z.unknown()) + = zTriggerProviderOpaqueResponse /** * Success */ -export const zGetWorkspacesCurrentTriggersResponse = z.record(z.string(), z.unknown()) +export const zGetWorkspacesCurrentTriggersResponse = zTriggerProviderOpaqueResponse export const zPostWorkspacesCustomConfigBody = zWorkspaceCustomConfigPayload /** * Success */ -export const zPostWorkspacesCustomConfigResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCustomConfigResponse = zWorkspaceMutationResponse /** - * Success + * Logo uploaded */ -export const zPostWorkspacesCustomConfigWebappLogoUploadResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesCustomConfigWebappLogoUploadResponse = zWorkspaceLogoUploadResponse export const zPostWorkspacesInfoBody = zWorkspaceInfoPayload /** * Success */ -export const zPostWorkspacesInfoResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesInfoResponse = zWorkspaceMutationResponse export const zPostWorkspacesSwitchBody = zSwitchWorkspacePayload /** * Success */ -export const zPostWorkspacesSwitchResponse = z.record(z.string(), z.unknown()) +export const zPostWorkspacesSwitchResponse = zSwitchWorkspaceResponse export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangPath = z.object({ icon_type: z.string(), @@ -2407,7 +3103,5 @@ export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangPat /** * Success */ -export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse + = zBinaryFileResponse diff --git a/packages/contracts/generated/api/openapi/orpc.gen.ts b/packages/contracts/generated/api/openapi/orpc.gen.ts index 15375c33c1..bc7cbea340 100644 --- a/packages/contracts/generated/api/openapi/orpc.gen.ts +++ b/packages/contracts/generated/api/openapi/orpc.gen.ts @@ -23,6 +23,7 @@ import { zGetAppsByAppIdFormHumanInputByFormTokenPath, zGetAppsByAppIdFormHumanInputByFormTokenResponse, zGetAppsByAppIdTasksByTaskIdEventsPath, + zGetAppsByAppIdTasksByTaskIdEventsQuery, zGetAppsByAppIdTasksByTaskIdEventsResponse, zGetAppsQuery, zGetAppsResponse, @@ -236,16 +237,8 @@ export const files = { 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 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: 'getAppsByAppIdFormHumanInputByFormToken', @@ -284,16 +277,8 @@ export const form = { humanInput, } -/** - * Generated 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: 'postAppsByAppIdRun', @@ -307,23 +292,20 @@ export const run = { 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 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: 'getAppsByAppIdTasksByTaskIdEvents', path: '/apps/{app_id}/tasks/{task_id}/events', tags: ['openapi'], }) - .input(z.object({ params: zGetAppsByAppIdTasksByTaskIdEventsPath })) + .input( + z.object({ + params: zGetAppsByAppIdTasksByTaskIdEventsPath, + query: zGetAppsByAppIdTasksByTaskIdEventsQuery.optional(), + }), + ) .output(zGetAppsByAppIdTasksByTaskIdEventsResponse) export const events = { @@ -440,16 +422,8 @@ export const lookup = { 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 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: 'postOauthDeviceToken', diff --git a/packages/contracts/generated/api/openapi/types.gen.ts b/packages/contracts/generated/api/openapi/types.gen.ts index 2dccca42e6..244ce92417 100644 --- a/packages/contracts/generated/api/openapi/types.gen.ts +++ b/packages/contracts/generated/api/openapi/types.gen.ts @@ -168,6 +168,18 @@ export type DevicePollRequest = { device_code: string } +export type DeviceTokenResponse = { + account?: AccountPayload | null + default_workspace_id?: string | null + expires_at: string + subject_email?: string | null + subject_issuer?: string | null + subject_type: 'account' | 'external_sso' + token: string + token_id: string + workspaces?: Array +} + export type ErrorBody = { code: string details?: Array | null @@ -182,6 +194,8 @@ export type ErrorDetail = { type: string } +export type EventStreamResponse = string + export type FileResponse = { conversation_id?: string | null created_at?: number | null @@ -215,6 +229,20 @@ export type HealthResponse = { ok: boolean } +export type HumanInputFormDefinitionResponse = { + expiration_time?: number | null + form_content: string + inputs?: Array<{ + [key: string]: unknown + }> + resolved_default_values: { + [key: string]: string + } + user_actions?: Array<{ + [key: string]: unknown + }> +} + export type HumanInputFormSubmitPayload = { action: string inputs: { @@ -684,18 +712,10 @@ export type PostAppsByAppIdFilesUploadData = { } export type PostAppsByAppIdFilesUploadErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 413: unknown + 415: unknown default: ErrorBody } @@ -720,9 +740,7 @@ export type GetAppsByAppIdFormHumanInputByFormTokenData = { } export type GetAppsByAppIdFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormDefinitionResponse } export type GetAppsByAppIdFormHumanInputByFormTokenResponse @@ -769,9 +787,7 @@ export type PostAppsByAppIdRunErrors = { export type PostAppsByAppIdRunError = PostAppsByAppIdRunErrors[keyof PostAppsByAppIdRunErrors] export type PostAppsByAppIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type PostAppsByAppIdRunResponse @@ -783,14 +799,15 @@ export type GetAppsByAppIdTasksByTaskIdEventsData = { app_id: string task_id: string } - query?: never + query?: { + continue_on_pause?: boolean + include_state_snapshot?: boolean + } url: '/apps/{app_id}/tasks/{task_id}/events' } export type GetAppsByAppIdTasksByTaskIdEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetAppsByAppIdTasksByTaskIdEventsResponse @@ -886,9 +903,7 @@ export type PostOauthDeviceTokenData = { } export type PostOauthDeviceTokenResponses = { - 200: { - [key: string]: unknown - } + 200: DeviceTokenResponse } export type PostOauthDeviceTokenResponse diff --git a/packages/contracts/generated/api/openapi/zod.gen.ts b/packages/contracts/generated/api/openapi/zod.gen.ts index e8077b321a..df0d82117a 100644 --- a/packages/contracts/generated/api/openapi/zod.gen.ts +++ b/packages/contracts/generated/api/openapi/zod.gen.ts @@ -183,6 +183,11 @@ export const zErrorBody = z.object({ status: z.int(), }) +/** + * EventStreamResponse + */ +export const zEventStreamResponse = z.string() + /** * FileResponse */ @@ -232,6 +237,17 @@ export const zHealthResponse = z.object({ ok: z.boolean(), }) +/** + * HumanInputFormDefinitionResponse + */ +export const zHumanInputFormDefinitionResponse = z.object({ + expiration_time: z.int().nullish(), + form_content: z.string(), + inputs: z.array(z.record(z.string(), z.unknown())).optional(), + resolved_default_values: z.record(z.string(), z.string()), + user_actions: z.array(z.record(z.string(), z.unknown())).optional(), +}) + /** * ImportStatus */ @@ -619,6 +635,21 @@ export const zAccountResponse = z.object({ workspaces: z.array(zWorkspacePayload).optional().default([]), }) +/** + * DeviceTokenResponse + */ +export const zDeviceTokenResponse = z.object({ + account: zAccountPayload.nullish(), + default_workspace_id: z.string().nullish(), + expires_at: z.string(), + subject_email: z.string().nullish(), + subject_issuer: z.string().nullish(), + subject_type: z.enum(['account', 'external_sso']), + token: z.string(), + token_id: z.string(), + workspaces: z.array(zWorkspacePayload).optional().default([]), +}) + /** * WorkspaceSummaryResponse */ @@ -754,7 +785,7 @@ export const zGetAppsByAppIdFormHumanInputByFormTokenPath = z.object({ /** * Form definition */ -export const zGetAppsByAppIdFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdFormHumanInputByFormTokenResponse = zHumanInputFormDefinitionResponse export const zPostAppsByAppIdFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayload @@ -777,17 +808,22 @@ export const zPostAppsByAppIdRunPath = z.object({ /** * Run result (SSE stream) */ -export const zPostAppsByAppIdRunResponse = z.record(z.string(), z.unknown()) +export const zPostAppsByAppIdRunResponse = zEventStreamResponse export const zGetAppsByAppIdTasksByTaskIdEventsPath = z.object({ app_id: z.string(), task_id: z.string(), }) +export const zGetAppsByAppIdTasksByTaskIdEventsQuery = z.object({ + continue_on_pause: z.boolean().optional().default(false), + include_state_snapshot: z.boolean().optional().default(false), +}) + /** * SSE event stream */ -export const zGetAppsByAppIdTasksByTaskIdEventsResponse = z.record(z.string(), z.unknown()) +export const zGetAppsByAppIdTasksByTaskIdEventsResponse = zEventStreamResponse export const zPostAppsByAppIdTasksByTaskIdStopPath = z.object({ app_id: z.string(), @@ -832,9 +868,9 @@ export const zGetOauthDeviceLookupResponse = zDeviceLookupResponse export const zPostOauthDeviceTokenBody = zDevicePollRequest /** - * Success + * Device token */ -export const zPostOauthDeviceTokenResponse = z.record(z.string(), z.unknown()) +export const zPostOauthDeviceTokenResponse = zDeviceTokenResponse export const zGetPermittedExternalAppsQuery = z.object({ limit: z.int().gte(1).lte(200).optional().default(20), diff --git a/packages/contracts/generated/api/service/orpc.gen.ts b/packages/contracts/generated/api/service/orpc.gen.ts index 940b844d25..518b44e06e 100644 --- a/packages/contracts/generated/api/service/orpc.gen.ts +++ b/packages/contracts/generated/api/service/orpc.gen.ts @@ -36,6 +36,7 @@ import { zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdPath, + zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery, zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery, @@ -94,6 +95,7 @@ import { zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody, zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath, zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, + zPatchDatasetsByDatasetIdDocumentsStatusByActionBody, zPatchDatasetsByDatasetIdDocumentsStatusByActionPath, zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse, zPatchDatasetsByDatasetIdMetadataByMetadataIdBody, @@ -168,8 +170,10 @@ import { zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse, zPostDatasetsByDatasetIdMetadataPath, zPostDatasetsByDatasetIdMetadataResponse, + zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody, zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath, zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse, + zPostDatasetsByDatasetIdPipelineRunBody, zPostDatasetsByDatasetIdPipelineRunPath, zPostDatasetsByDatasetIdPipelineRunResponse, zPostDatasetsByDatasetIdRetrieveBody, @@ -226,16 +230,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Get all feedbacks for the application\nReturns paginated list of all feedback submitted for messages in this app.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppFeedbacks', @@ -258,16 +257,10 @@ 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({ - 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.', + description: 'Get the status of an annotation reply action job', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsAnnotationReplyByActionStatusByJobId', @@ -290,16 +283,10 @@ 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({ - 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.', + description: 'Enable or disable annotation reply feature', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsAnnotationReplyByAction', @@ -424,16 +411,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Convert audio to text using speech-to-text\nAccepts an audio file upload and returns the transcribed text.', inputStructure: 'detailed', method: 'POST', operationId: 'postAudioToText', @@ -479,16 +461,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessages', @@ -536,16 +513,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessages', @@ -565,16 +537,10 @@ 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({ - 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.', + description: 'Rename a conversation or auto-generate a name', inputStructure: 'detailed', method: 'POST', operationId: 'postConversationsByCIdName', @@ -681,16 +647,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'List all conversations for the current user\nSupports pagination using last_id and limit parameters.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversations', @@ -711,16 +672,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Upload a file to a knowledgebase pipeline\nAccepts a single file upload via multipart/form-data.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsPipelineFileUpload', @@ -956,16 +912,10 @@ 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({ - 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.', + description: 'Download selected uploaded documents as a single ZIP archive', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip', @@ -1028,16 +978,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsStatusByAction', @@ -1045,7 +990,12 @@ export const patch2 = oc summary: 'Batch update document status', tags: ['service_api'], }) - .input(z.object({ params: zPatchDatasetsByDatasetIdDocumentsStatusByActionPath })) + .input( + z.object({ + body: zPatchDatasetsByDatasetIdDocumentsStatusByActionBody, + params: zPatchDatasetsByDatasetIdDocumentsStatusByActionPath, + }), + ) .output(zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse) export const byAction2 = { @@ -1425,23 +1375,22 @@ 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({ - 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.', + description: 'Get a specific document by ID', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId', path: '/datasets/{dataset_id}/documents/{document_id}', tags: ['service_api'], }) - .input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdPath })) + .input( + z.object({ + params: zGetDatasetsByDatasetIdDocumentsByDocumentIdPath, + query: zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery.optional(), + }), + ) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse) /** @@ -1508,16 +1457,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdHitTesting', @@ -1682,16 +1626,10 @@ 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({ - 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.', + description: 'List all datasource plugins for a rag pipeline', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdPipelineDatasourcePlugins', @@ -1715,16 +1653,10 @@ 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({ - 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.', + description: 'Run a datasource node for a rag pipeline', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRun', @@ -1732,7 +1664,12 @@ export const post29 = oc summary: 'Resource for getting datasource plugins', tags: ['service_api'], }) - .input(z.object({ params: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath })) + .input( + z.object({ + body: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody, + params: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath, + }), + ) .output(zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse) export const run = { @@ -1755,16 +1692,10 @@ 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({ - 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.', + description: 'Run a datasource node for a rag pipeline', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineRun', @@ -1772,7 +1703,12 @@ export const post30 = oc summary: 'Resource for running a rag pipeline', tags: ['service_api'], }) - .input(z.object({ params: zPostDatasetsByDatasetIdPipelineRunPath })) + .input( + z.object({ + body: zPostDatasetsByDatasetIdPipelineRunBody, + params: zPostDatasetsByDatasetIdPipelineRunPath, + }), + ) .output(zPostDatasetsByDatasetIdPipelineRunResponse) export const run2 = { @@ -1790,16 +1726,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdRetrieve', @@ -1889,16 +1820,10 @@ 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({ - 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.', + description: 'Update an existing dataset', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetId', @@ -1943,16 +1868,10 @@ 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({ - 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.', + description: 'Create a new dataset', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasets', @@ -2030,16 +1949,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + '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.', inputStructure: 'detailed', method: 'GET', operationId: 'getFilesByFileIdPreview', @@ -2070,16 +1984,10 @@ 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({ - 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.', + description: 'Get a paused human input form by token', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -2091,16 +1999,10 @@ 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({ - 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.', + description: 'Submit a paused human input form by token', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', @@ -2214,16 +2116,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'List messages in a conversation\nRetrieves messages with pagination support using first_id.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessages', @@ -2244,16 +2141,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Get application metadata\nReturns metadata about the application including configuration and settings.', inputStructure: 'detailed', method: 'GET', operationId: 'getMeta', @@ -2272,16 +2164,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Retrieve application input parameters and configuration\nReturns the input form parameters and configuration for the application.', inputStructure: 'detailed', method: 'GET', operationId: 'getParameters', @@ -2323,16 +2210,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Convert text to audio using text-to-speech\nConverts the provided text to audio using the specified voice.', inputStructure: 'detailed', method: 'POST', operationId: 'postTextToAudio', @@ -2349,16 +2231,10 @@ 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({ - 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.', + description: 'Get workflow execution events stream after resume', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByTaskIdEvents', @@ -2366,10 +2242,7 @@ export const get30 = oc tags: ['service_api'], }) .input( - z.object({ - params: zGetWorkflowByTaskIdEventsPath, - query: zGetWorkflowByTaskIdEventsQuery.optional(), - }), + z.object({ params: zGetWorkflowByTaskIdEventsPath, query: zGetWorkflowByTaskIdEventsQuery }), ) .output(zGetWorkflowByTaskIdEventsResponse) @@ -2390,16 +2263,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Get workflow execution logs\nReturns paginated workflow execution logs with filtering options.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsLogs', @@ -2419,16 +2287,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Get workflow run details\nReturns detailed information about a specific workflow run.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsRunByWorkflowRunId', @@ -2449,16 +2312,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Execute a workflow\nRuns a workflow with the provided inputs and returns the results.\nSupports both blocking and streaming response modes.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsRun', @@ -2509,16 +2367,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Execute a specific workflow by ID\nExecutes a specific workflow version identified by its ID.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsByWorkflowIdRun', @@ -2554,16 +2407,11 @@ 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.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Get available models by model type\nReturns a list of available models for the specified model type.', 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 f3310887ff..a3cea1127d 100644 --- a/packages/contracts/generated/api/service/types.gen.ts +++ b/packages/contracts/generated/api/service/types.gen.ts @@ -4,6 +4,20 @@ export type ClientOptions = { baseUrl: `${string}://${string}/v1` | (string & {}) } +export type AgentThought = { + chain_id?: string | null + created_at?: number | null + files: Array + id: string + message_id: string + observation?: string | null + position: number + thought?: string | null + tool?: string | null + tool_input?: string | null + tool_labels: JsonValue +} + export type Annotation = { content?: string | null created_at?: number | null @@ -17,6 +31,12 @@ export type AnnotationCreatePayload = { question: string } +export type AnnotationJobStatusResponse = { + error_msg?: string | null + job_id: string + job_status: string +} + export type AnnotationList = { data: Array has_more: boolean @@ -37,6 +57,24 @@ export type AnnotationReplyActionPayload = { score_threshold: number } +export type AppFeedbackListResponse = { + data: Array +} + +export type AppFeedbackResponse = { + app_id: string + content?: string | null + conversation_id: string + created_at: string + from_account_id?: string | null + from_end_user_id?: string | null + from_source: string + id: string + message_id: string + rating: string + updated_at: string +} + export type AppInfoResponse = { author_name: string | null description: string | null @@ -45,6 +83,22 @@ export type AppInfoResponse = { tags: Array } +export type AppMetaResponse = { + tool_icons?: { + [key: string]: unknown + } +} + +export type AudioBinaryResponse = Blob | File + +export type AudioTranscriptResponse = { + text: string +} + +export type BinaryFileResponse = Blob | File + +export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary' + export type ChatRequestPayload = { auto_generate_name?: boolean conversation_id?: string | null @@ -135,6 +189,12 @@ export type Condition = { value?: string | Array | number | number | null } +export type ConversationInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + export type ConversationListQuery = { last_id?: string | null limit?: number @@ -172,6 +232,8 @@ export type ConversationVariablesQuery = { variable_name?: string | null } +export type CustomConfigurationStatus = 'active' | 'no-configure' + export type DatasetBoundTagListResponse = { data: Array total: number @@ -411,6 +473,13 @@ export type DatasetWeightedScoreResponse = { weight_type?: string | null } +export type DatasourceCredentialInfoResponse = { + id?: string | null + is_default?: boolean | null + name?: string | null + type?: string | null +} + export type DatasourceNodeRunPayload = { credential_id?: string | null datasource_type: string @@ -420,6 +489,24 @@ export type DatasourceNodeRunPayload = { is_published: boolean } +export type DatasourcePluginListResponse = Array + +export type DatasourcePluginResponse = { + credentials: Array + datasource_type?: string | null + node_id?: string | null + plugin_id?: string | null + provider_name?: string | null + title?: string | null + user_input_variables?: Array<{ + [key: string]: unknown + }> +} + +export type DatasourcePluginsQuery = { + is_published?: boolean +} + export type DocumentAndBatchResponse = { batch: string document: DocumentResponse @@ -429,6 +516,50 @@ export type DocumentBatchDownloadZipPayload = { document_ids: Array } +export type DocumentDetailResponse = { + archived?: boolean | null + average_segment_length?: number | null + completed_at?: number | null + created_at?: number | null + created_by?: string | null + created_from?: string | null + data_source_info?: { + [key: string]: unknown + } | null + data_source_type?: string | null + dataset_process_rule?: { + [key: string]: unknown + } | null + dataset_process_rule_id?: string | null + disabled_at?: number | null + disabled_by?: string | null + display_status?: string | null + doc_form?: string | null + doc_language?: string | null + doc_metadata?: Array | null + doc_type?: string | null + document_process_rule?: { + [key: string]: unknown + } | null + enabled?: boolean | null + error?: string | null + hit_count?: number | null + id: string + indexing_latency?: number | null + indexing_status?: string | null + name?: string | null + need_summary?: boolean | null + position?: number | null + segment_count?: number | null + summary_index_status?: string | null + tokens?: number | null + updated_at?: number | null +} + +export type DocumentGetQuery = { + metadata?: 'all' | 'only' | 'without' +} + export type DocumentListQuery = { keyword?: string | null limit?: number @@ -488,6 +619,10 @@ export type DocumentStatusListResponse = { data: Array } +export type DocumentStatusPayload = { + document_ids?: Array +} + export type DocumentStatusResponse = { cleaning_completed_at: number | null completed_at: number | null @@ -538,11 +673,34 @@ export type EndUserDetail = { updated_at: string } +export type EventStreamResponse = string + +export type ExecutionContentType = 'human_input' + export type FeedbackListQuery = { limit?: number page?: number } +export type FetchFrom = 'customizable-model' | 'predefined-model' + +export type FileInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + output_variable_name: string + type?: 'file' +} + +export type FileListInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + number_limits?: number + output_variable_name: string + type?: 'file-list' +} + export type FilePreviewQuery = { as_attachment?: boolean } @@ -565,6 +723,26 @@ export type FileResponse = { user_id?: string | null } +export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file' + +export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video' + +export type FormInputConfig + = | ({ + type: 'paragraph' + } & ParagraphInputConfig) + | ({ + type: 'select' + } & SelectInputConfig) + | ({ + type: 'file' + } & FileInputConfig) + | ({ + type: 'file-list' + } & FileListInputConfig) + +export type GeneratedAppResponse = JsonValue + export type HitTestingChildChunk = { content: string id: string @@ -642,20 +820,94 @@ export type HitTestingSegment = { word_count: number } +export type HumanInputContent = { + form_definition?: HumanInputFormDefinition | null + form_submission_data?: HumanInputFormSubmissionData | null + submitted: boolean + type?: ExecutionContentType + workflow_run_id: string +} + +export type HumanInputFormDefinition = { + actions?: Array + display_in_ui?: boolean + expiration_time: number + form_content: string + form_id: string + form_token?: string | null + inputs?: Array + node_id: string + node_title: string + resolved_default_values?: { + [key: string]: unknown + } +} + +export type HumanInputFormDefinitionResponse = { + expiration_time?: number | null + form_content: string + inputs?: Array<{ + [key: string]: unknown + }> + resolved_default_values: { + [key: string]: string + } + user_actions?: Array<{ + [key: string]: unknown + }> +} + +export type HumanInputFormSubmissionData = { + action_id: string + action_text: string + node_id: string + node_title: string + rendered_content: string + submitted_data?: { + [key: string]: JsonValue2 + } | null +} + export type HumanInputFormSubmitPayload = { action: string inputs: { - [key: string]: JsonValue + [key: string]: JsonValue2 } } +export type HumanInputFormSubmitResponse = { + [key: string]: never +} + +export type I18nObject = { + en_US: string + zh_Hans?: string | null +} + export type IndexInfoResponse = { api_version: string server_version: string welcome: string } -export type JsonValue = unknown +export type JsonObject = { + [key: string]: unknown +} + +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + +export type JsonValueType = unknown + +export type JsonValue2 = unknown export type KnowledgeTagListResponse = Array @@ -671,6 +923,43 @@ export type MessageFeedbackPayload = { rating?: 'dislike' | 'like' | null } +export type MessageFile = { + belongs_to?: string | null + filename: string + id: string + mime_type?: string | null + size?: number | null + transfer_method: string + type: string + upload_file_id?: string | null + url?: string | null +} + +export type MessageInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + +export type MessageListItem = { + agent_thoughts: Array + answer: string + conversation_id: string + created_at?: number | null + error?: string | null + extra_contents: Array + feedback?: SimpleFeedback | null + id: string + inputs: { + [key: string]: JsonValueType + } + message_files: Array + parent_message_id?: string | null + query: string + retriever_resources: Array + status: string +} + export type MessageListQuery = { conversation_id: string first_id?: string | null @@ -701,6 +990,62 @@ export type MetadataUpdatePayload = { name: string } +export type ModelFeature + = | 'agent-thought' + | 'audio' + | 'document' + | 'multi-tool-call' + | 'polling' + | 'stream-tool-call' + | 'structured-output' + | 'tool-call' + | 'video' + | 'vision' + +export type ModelPropertyKey + = | 'audio_type' + | 'context_size' + | 'default_voice' + | 'file_upload_limit' + | 'max_characters_per_chunk' + | 'max_chunks' + | 'max_workers' + | 'mode' + | 'supported_file_extensions' + | 'voices' + | 'word_limit' + +export type ModelStatus + = | 'active' + | 'credential-removed' + | 'disabled' + | 'no-configure' + | 'no-permission' + | 'quota-exceeded' + +export type ModelType = 'llm' | 'moderation' | 'rerank' | 'speech2text' | 'text-embedding' | 'tts' + +export type ParagraphInputConfig = { + default?: StringSource | null + output_variable_name: string + type?: 'paragraph' +} + +export type Parameters = { + annotation_reply: JsonObject + file_upload: JsonObject + more_like_this: JsonObject + opening_statement?: string | null + retriever_resource: JsonObject + sensitive_word_avoidance: JsonObject + speech_to_text: JsonObject + suggested_questions: Array + suggested_questions_after_answer: JsonObject + system_parameters: SystemParameters + text_to_speech: JsonObject + user_input_form: Array +} + export type PermissionEnum = 'all_team_members' | 'only_me' | 'partial_members' export type PipelineRunApiEntity = { @@ -716,6 +1061,16 @@ export type PipelineRunApiEntity = { start_node_id: string } +export type PipelineUploadFileResponse = { + created_at?: string | null + created_by: string + extension: string + id: string + mime_type?: string | null + name: string + size: number +} + export type PreProcessingRule = { enabled: boolean id: string @@ -728,6 +1083,35 @@ export type ProcessRule = { export type ProcessRuleMode = 'automatic' | 'custom' | 'hierarchical' +export type ProviderModelWithStatusEntity = { + deprecated?: boolean + features?: Array | null + fetch_from: FetchFrom + has_invalid_load_balancing_configs?: boolean + label: I18nObject + load_balancing_enabled?: boolean + model: string + model_properties: { + [key in ModelPropertyKey]?: unknown + } + model_type: ModelType + status: ModelStatus +} + +export type ProviderWithModelsListResponse = { + data: Array +} + +export type ProviderWithModelsResponse = { + icon_small?: I18nObject | null + icon_small_dark?: I18nObject | null + label: I18nObject + models: Array + provider: string + status: CustomConfigurationStatus + tenant_id: string +} + export type RerankingModel = { reranking_model_name?: string | null reranking_provider_name?: string | null @@ -755,6 +1139,26 @@ export type RetrievalModel = { weights?: WeightModel | null } +export type RetrieverResource = { + content?: string | null + created_at?: number | null + data_source_type?: string | null + dataset_id?: string | null + dataset_name?: string | null + document_id?: string | null + document_name?: string | null + hit_count?: number | null + id?: string + index_node_hash?: string | null + message_id?: string + position: number + score?: number | null + segment_id?: string | null + segment_position?: number | null + summary?: string | null + word_count?: number | null +} + export type Rule = { parent_mode?: 'full-doc' | 'paragraph' | null pre_processing_rules?: Array | null @@ -858,12 +1262,30 @@ export type Segmentation = { separator?: string } +export type SelectInputConfig = { + option_source: StringListSource + output_variable_name: string + type?: 'select' +} + export type SimpleAccount = { email: string id: string name: string } +export type SimpleConversation = { + created_at?: number | null + id: string + inputs: { + [key: string]: JsonValue + } + introduction?: string | null + name: string + status: string + updated_at?: number | null +} + export type SimpleEndUser = { id: string is_anonymous: boolean @@ -871,6 +1293,10 @@ export type SimpleEndUser = { type: string } +export type SimpleFeedback = { + rating?: string | null +} + export type SimpleResultResponse = { result: string } @@ -897,6 +1323,26 @@ export type Site = { use_icon_as_answer_icon: boolean } +export type StringListSource = { + selector?: Array + type: ValueSourceType + value?: Array +} + +export type StringSource = { + selector?: Array + type: ValueSourceType + value?: string +} + +export type SystemParameters = { + audio_file_size_limit: number + file_size_limit: number + image_file_size_limit: number + video_file_size_limit: number + workflow_file_upload_limit: number +} + export type TagBindingPayload = { tag_ids: Array target_id: string @@ -932,6 +1378,14 @@ export type UrlResponse = { url: string } +export type UserActionConfig = { + button_style?: ButtonStyle + id: string + title: string +} + +export type ValueSourceType = 'constant' | 'variable' + export type WeightKeywordSetting = { keyword_weight: number } @@ -976,6 +1430,12 @@ export type WorkflowAppLogPartialResponse = { workflow_run?: WorkflowRunForLogResponse | null } +export type WorkflowEventsQuery = { + continue_on_pause?: boolean + include_state_snapshot?: boolean + user: string +} + export type WorkflowLogQuery = { created_at__after?: string | null created_at__before?: string | null @@ -1037,6 +1497,12 @@ export type WorkflowRunResponse = { workflow_id: string } +export type GeneratedAppResponseWritable = JsonValue + +export type HumanInputFormSubmitResponseWritable = { + [key: string]: never +} + export type SiteWritable = { chat_color_theme?: string | null chat_color_theme_inverted: boolean @@ -1077,17 +1543,11 @@ export type GetAppFeedbacksData = { } export type GetAppFeedbacksErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetAppFeedbacksError = GetAppFeedbacksErrors[keyof GetAppFeedbacksErrors] - export type GetAppFeedbacksResponses = { - 200: { - [key: string]: unknown - } + 200: AppFeedbackListResponse } export type GetAppFeedbacksResponse = GetAppFeedbacksResponses[keyof GetAppFeedbacksResponses] @@ -1102,18 +1562,11 @@ export type PostAppsAnnotationReplyByActionData = { } export type PostAppsAnnotationReplyByActionErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type PostAppsAnnotationReplyByActionError - = PostAppsAnnotationReplyByActionErrors[keyof PostAppsAnnotationReplyByActionErrors] - export type PostAppsAnnotationReplyByActionResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type PostAppsAnnotationReplyByActionResponse @@ -1130,21 +1583,12 @@ export type GetAppsAnnotationReplyByActionStatusByJobIdData = { } export type GetAppsAnnotationReplyByActionStatusByJobIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetAppsAnnotationReplyByActionStatusByJobIdError - = GetAppsAnnotationReplyByActionStatusByJobIdErrors[keyof GetAppsAnnotationReplyByActionStatusByJobIdErrors] - export type GetAppsAnnotationReplyByActionStatusByJobIdResponses = { - 200: { - [key: string]: unknown - } + 200: AnnotationJobStatusResponse } export type GetAppsAnnotationReplyByActionStatusByJobIdResponse @@ -1162,13 +1606,9 @@ export type GetAppsAnnotationsData = { } export type GetAppsAnnotationsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetAppsAnnotationsError = GetAppsAnnotationsErrors[keyof GetAppsAnnotationsErrors] - export type GetAppsAnnotationsResponses = { 200: AnnotationList } @@ -1184,13 +1624,9 @@ export type PostAppsAnnotationsData = { } export type PostAppsAnnotationsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type PostAppsAnnotationsError = PostAppsAnnotationsErrors[keyof PostAppsAnnotationsErrors] - export type PostAppsAnnotationsResponses = { 201: Annotation } @@ -1208,20 +1644,11 @@ export type DeleteAppsAnnotationsByAnnotationIdData = { } export type DeleteAppsAnnotationsByAnnotationIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type DeleteAppsAnnotationsByAnnotationIdError - = DeleteAppsAnnotationsByAnnotationIdErrors[keyof DeleteAppsAnnotationsByAnnotationIdErrors] - export type DeleteAppsAnnotationsByAnnotationIdResponses = { 204: void } @@ -1239,20 +1666,11 @@ export type PutAppsAnnotationsByAnnotationIdData = { } export type PutAppsAnnotationsByAnnotationIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type PutAppsAnnotationsByAnnotationIdError - = PutAppsAnnotationsByAnnotationIdErrors[keyof PutAppsAnnotationsByAnnotationIdErrors] - export type PutAppsAnnotationsByAnnotationIdResponses = { 200: Annotation } @@ -1268,29 +1686,15 @@ export type PostAudioToTextData = { } export type PostAudioToTextErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 413: unknown + 415: unknown + 500: unknown } -export type PostAudioToTextError = PostAudioToTextErrors[keyof PostAudioToTextErrors] - export type PostAudioToTextResponses = { - 200: { - [key: string]: unknown - } + 200: AudioTranscriptResponse } export type PostAudioToTextResponse = PostAudioToTextResponses[keyof PostAudioToTextResponses] @@ -1303,29 +1707,15 @@ export type PostChatMessagesData = { } export type PostChatMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 429: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 429: unknown + 500: unknown } -export type PostChatMessagesError = PostChatMessagesErrors[keyof PostChatMessagesErrors] - export type PostChatMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostChatMessagesResponse = PostChatMessagesResponses[keyof PostChatMessagesResponses] @@ -1340,17 +1730,10 @@ export type PostChatMessagesByTaskIdStopData = { } export type PostChatMessagesByTaskIdStopErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostChatMessagesByTaskIdStopError - = PostChatMessagesByTaskIdStopErrors[keyof PostChatMessagesByTaskIdStopErrors] - export type PostChatMessagesByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -1366,27 +1749,14 @@ export type PostCompletionMessagesData = { } export type PostCompletionMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 500: unknown } -export type PostCompletionMessagesError - = PostCompletionMessagesErrors[keyof PostCompletionMessagesErrors] - export type PostCompletionMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostCompletionMessagesResponse @@ -1402,17 +1772,10 @@ export type PostCompletionMessagesByTaskIdStopData = { } export type PostCompletionMessagesByTaskIdStopErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostCompletionMessagesByTaskIdStopError - = PostCompletionMessagesByTaskIdStopErrors[keyof PostCompletionMessagesByTaskIdStopErrors] - export type PostCompletionMessagesByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -1432,20 +1795,12 @@ export type GetConversationsData = { } export type GetConversationsErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetConversationsError = GetConversationsErrors[keyof GetConversationsErrors] - export type GetConversationsResponses = { - 200: { - [key: string]: unknown - } + 200: ConversationInfiniteScrollPagination } export type GetConversationsResponse = GetConversationsResponses[keyof GetConversationsResponses] @@ -1460,17 +1815,10 @@ export type DeleteConversationsByCIdData = { } export type DeleteConversationsByCIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type DeleteConversationsByCIdError - = DeleteConversationsByCIdErrors[keyof DeleteConversationsByCIdErrors] - export type DeleteConversationsByCIdResponses = { 204: void } @@ -1488,21 +1836,12 @@ export type PostConversationsByCIdNameData = { } export type PostConversationsByCIdNameErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostConversationsByCIdNameError - = PostConversationsByCIdNameErrors[keyof PostConversationsByCIdNameErrors] - export type PostConversationsByCIdNameResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleConversation } export type PostConversationsByCIdNameResponse @@ -1522,17 +1861,10 @@ export type GetConversationsByCIdVariablesData = { } export type GetConversationsByCIdVariablesErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetConversationsByCIdVariablesError - = GetConversationsByCIdVariablesErrors[keyof GetConversationsByCIdVariablesErrors] - export type GetConversationsByCIdVariablesResponses = { 200: ConversationVariableInfiniteScrollPaginationResponse } @@ -1551,20 +1883,11 @@ export type PutConversationsByCIdVariablesByVariableIdData = { } export type PutConversationsByCIdVariablesByVariableIdErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown } -export type PutConversationsByCIdVariablesByVariableIdError - = PutConversationsByCIdVariablesByVariableIdErrors[keyof PutConversationsByCIdVariablesByVariableIdErrors] - export type PutConversationsByCIdVariablesByVariableIdResponses = { 200: ConversationVariableResponse } @@ -1586,13 +1909,9 @@ export type GetDatasetsData = { } export type GetDatasetsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetDatasetsError = GetDatasetsErrors[keyof GetDatasetsErrors] - export type GetDatasetsResponses = { 200: DatasetListResponse } @@ -1607,16 +1926,10 @@ export type PostDatasetsData = { } export type PostDatasetsErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostDatasetsError = PostDatasetsErrors[keyof PostDatasetsErrors] - export type PostDatasetsResponses = { 200: DatasetDetailResponse } @@ -1631,27 +1944,14 @@ export type PostDatasetsPipelineFileUploadData = { } export type PostDatasetsPipelineFileUploadErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 413: unknown + 415: unknown } -export type PostDatasetsPipelineFileUploadError - = PostDatasetsPipelineFileUploadErrors[keyof PostDatasetsPipelineFileUploadErrors] - export type PostDatasetsPipelineFileUploadResponses = { - 201: { - [key: string]: unknown - } + 201: PipelineUploadFileResponse } export type PostDatasetsPipelineFileUploadResponse @@ -1665,16 +1965,10 @@ export type DeleteDatasetsTagsData = { } export type DeleteDatasetsTagsErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type DeleteDatasetsTagsError = DeleteDatasetsTagsErrors[keyof DeleteDatasetsTagsErrors] - export type DeleteDatasetsTagsResponses = { 204: void } @@ -1690,13 +1984,9 @@ export type GetDatasetsTagsData = { } export type GetDatasetsTagsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetDatasetsTagsError = GetDatasetsTagsErrors[keyof GetDatasetsTagsErrors] - export type GetDatasetsTagsResponses = { 200: KnowledgeTagListResponse } @@ -1711,16 +2001,10 @@ export type PatchDatasetsTagsData = { } export type PatchDatasetsTagsErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type PatchDatasetsTagsError = PatchDatasetsTagsErrors[keyof PatchDatasetsTagsErrors] - export type PatchDatasetsTagsResponses = { 200: KnowledgeTagResponse } @@ -1735,16 +2019,10 @@ export type PostDatasetsTagsData = { } export type PostDatasetsTagsErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type PostDatasetsTagsError = PostDatasetsTagsErrors[keyof PostDatasetsTagsErrors] - export type PostDatasetsTagsResponses = { 200: KnowledgeTagResponse } @@ -1759,17 +2037,10 @@ export type PostDatasetsTagsBindingData = { } export type PostDatasetsTagsBindingErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type PostDatasetsTagsBindingError - = PostDatasetsTagsBindingErrors[keyof PostDatasetsTagsBindingErrors] - export type PostDatasetsTagsBindingResponses = { 204: void } @@ -1785,17 +2056,10 @@ export type PostDatasetsTagsUnbindingData = { } export type PostDatasetsTagsUnbindingErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type PostDatasetsTagsUnbindingError - = PostDatasetsTagsUnbindingErrors[keyof PostDatasetsTagsUnbindingErrors] - export type PostDatasetsTagsUnbindingResponses = { 204: void } @@ -1813,20 +2077,11 @@ export type DeleteDatasetsByDatasetIdData = { } export type DeleteDatasetsByDatasetIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 409: { - [key: string]: unknown - } + 401: unknown + 404: unknown + 409: unknown } -export type DeleteDatasetsByDatasetIdError - = DeleteDatasetsByDatasetIdErrors[keyof DeleteDatasetsByDatasetIdErrors] - export type DeleteDatasetsByDatasetIdResponses = { 204: void } @@ -1844,20 +2099,11 @@ export type GetDatasetsByDatasetIdData = { } export type GetDatasetsByDatasetIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type GetDatasetsByDatasetIdError - = GetDatasetsByDatasetIdErrors[keyof GetDatasetsByDatasetIdErrors] - export type GetDatasetsByDatasetIdResponses = { 200: DatasetDetailWithPartialMembersResponse } @@ -1875,20 +2121,11 @@ export type PatchDatasetsByDatasetIdData = { } export type PatchDatasetsByDatasetIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdError - = PatchDatasetsByDatasetIdErrors[keyof PatchDatasetsByDatasetIdErrors] - export type PatchDatasetsByDatasetIdResponses = { 200: DatasetDetailWithPartialMembersResponse } @@ -1909,17 +2146,10 @@ export type PostDatasetsByDatasetIdDocumentCreateByFileData = { } export type PostDatasetsByDatasetIdDocumentCreateByFileErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostDatasetsByDatasetIdDocumentCreateByFileError - = PostDatasetsByDatasetIdDocumentCreateByFileErrors[keyof PostDatasetsByDatasetIdDocumentCreateByFileErrors] - export type PostDatasetsByDatasetIdDocumentCreateByFileResponses = { 200: DocumentAndBatchResponse } @@ -1937,17 +2167,10 @@ export type PostDatasetsByDatasetIdDocumentCreateByTextData = { } export type PostDatasetsByDatasetIdDocumentCreateByTextErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostDatasetsByDatasetIdDocumentCreateByTextError - = PostDatasetsByDatasetIdDocumentCreateByTextErrors[keyof PostDatasetsByDatasetIdDocumentCreateByTextErrors] - export type PostDatasetsByDatasetIdDocumentCreateByTextResponses = { 200: DocumentAndBatchResponse } @@ -1968,17 +2191,10 @@ export type PostDatasetsByDatasetIdDocumentCreateByFile2Data = { } export type PostDatasetsByDatasetIdDocumentCreateByFile2Errors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostDatasetsByDatasetIdDocumentCreateByFile2Error - = PostDatasetsByDatasetIdDocumentCreateByFile2Errors[keyof PostDatasetsByDatasetIdDocumentCreateByFile2Errors] - export type PostDatasetsByDatasetIdDocumentCreateByFile2Responses = { 200: DocumentAndBatchResponse } @@ -1996,17 +2212,10 @@ export type PostDatasetsByDatasetIdDocumentCreateByText2Data = { } export type PostDatasetsByDatasetIdDocumentCreateByText2Errors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostDatasetsByDatasetIdDocumentCreateByText2Error - = PostDatasetsByDatasetIdDocumentCreateByText2Errors[keyof PostDatasetsByDatasetIdDocumentCreateByText2Errors] - export type PostDatasetsByDatasetIdDocumentCreateByText2Responses = { 200: DocumentAndBatchResponse } @@ -2029,17 +2238,10 @@ export type GetDatasetsByDatasetIdDocumentsData = { } export type GetDatasetsByDatasetIdDocumentsErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsError - = GetDatasetsByDatasetIdDocumentsErrors[keyof GetDatasetsByDatasetIdDocumentsErrors] - export type GetDatasetsByDatasetIdDocumentsResponses = { 200: DocumentListResponse } @@ -2057,24 +2259,13 @@ export type PostDatasetsByDatasetIdDocumentsDownloadZipData = { } export type PostDatasetsByDatasetIdDocumentsDownloadZipErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsDownloadZipError - = PostDatasetsByDatasetIdDocumentsDownloadZipErrors[keyof PostDatasetsByDatasetIdDocumentsDownloadZipErrors] - export type PostDatasetsByDatasetIdDocumentsDownloadZipResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type PostDatasetsByDatasetIdDocumentsDownloadZipResponse @@ -2090,17 +2281,10 @@ export type PostDatasetsByDatasetIdDocumentsMetadataData = { } export type PostDatasetsByDatasetIdDocumentsMetadataErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsMetadataError - = PostDatasetsByDatasetIdDocumentsMetadataErrors[keyof PostDatasetsByDatasetIdDocumentsMetadataErrors] - export type PostDatasetsByDatasetIdDocumentsMetadataResponses = { 200: DatasetMetadataActionResponse } @@ -2109,7 +2293,7 @@ export type PostDatasetsByDatasetIdDocumentsMetadataResponse = PostDatasetsByDatasetIdDocumentsMetadataResponses[keyof PostDatasetsByDatasetIdDocumentsMetadataResponses] export type PatchDatasetsByDatasetIdDocumentsStatusByActionData = { - body?: never + body: DocumentStatusPayload path: { action: string dataset_id: string @@ -2119,23 +2303,12 @@ export type PatchDatasetsByDatasetIdDocumentsStatusByActionData = { } export type PatchDatasetsByDatasetIdDocumentsStatusByActionErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdDocumentsStatusByActionError - = PatchDatasetsByDatasetIdDocumentsStatusByActionErrors[keyof PatchDatasetsByDatasetIdDocumentsStatusByActionErrors] - export type PatchDatasetsByDatasetIdDocumentsStatusByActionResponses = { 200: SimpleResultResponse } @@ -2154,17 +2327,10 @@ export type GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusData = { } export type GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusError - = GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusErrors[keyof GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusErrors] - export type GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponses = { 200: DocumentStatusListResponse } @@ -2183,20 +2349,11 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdData = { } export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdError - = DeleteDatasetsByDatasetIdDocumentsByDocumentIdErrors[keyof DeleteDatasetsByDatasetIdDocumentsByDocumentIdErrors] - export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdResponses = { 204: void } @@ -2210,29 +2367,20 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdData = { dataset_id: string document_id: string } - query?: never + query?: { + metadata?: 'all' | 'only' | 'without' + } url: '/datasets/{dataset_id}/documents/{document_id}' } export type GetDatasetsByDatasetIdDocumentsByDocumentIdErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdError - = GetDatasetsByDatasetIdDocumentsByDocumentIdErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdResponses = { - 200: { - [key: string]: unknown - } + 200: DocumentDetailResponse } export type GetDatasetsByDatasetIdDocumentsByDocumentIdResponse @@ -2252,17 +2400,10 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdData = { } export type PatchDatasetsByDatasetIdDocumentsByDocumentIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdDocumentsByDocumentIdError - = PatchDatasetsByDatasetIdDocumentsByDocumentIdErrors[keyof PatchDatasetsByDatasetIdDocumentsByDocumentIdErrors] - export type PatchDatasetsByDatasetIdDocumentsByDocumentIdResponses = { 200: DocumentAndBatchResponse } @@ -2281,20 +2422,11 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadError - = GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponses = { 200: UrlResponse } @@ -2318,17 +2450,10 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsData = { } export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsError - = GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponses = { 200: SegmentListResponse } @@ -2347,20 +2472,11 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsData = { } export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsError - = PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsErrors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponses = { 200: SegmentCreateListResponse } @@ -2380,17 +2496,10 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdDat } export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdError - = DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors[keyof DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors] - export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponses = { 204: void } @@ -2410,17 +2519,10 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdData = } export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdError - = GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponses = { 200: SegmentDetailResponse } @@ -2440,17 +2542,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdData } export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdError - = PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdErrors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponses = { 200: SegmentDetailResponse } @@ -2474,17 +2569,10 @@ export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildC } export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksError - = GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors[keyof GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors] - export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponses = { 200: ChildChunkListResponse } @@ -2504,17 +2592,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChild } export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksError - = PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksErrors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponses = { 200: ChildChunkDetailResponse } @@ -2537,17 +2618,10 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdError - = DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors[keyof DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors] - export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponses = { 204: void @@ -2571,17 +2645,10 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChil export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdError - = PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors[keyof PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdErrors] - export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponses = { 200: ChildChunkDetailResponse @@ -2604,17 +2671,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileData = { } export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileError - = PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileErrors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileErrors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponses = { 200: DocumentAndBatchResponse } @@ -2633,17 +2693,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextData = { } export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextError - = PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextErrors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextErrors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextResponses = { 200: DocumentAndBatchResponse } @@ -2665,17 +2718,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Data = { } export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Errors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Error - = PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Errors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Errors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Responses = { 200: DocumentAndBatchResponse } @@ -2694,17 +2740,10 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Data = { } export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Errors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Error - = PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Errors[keyof PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Errors] - export type PostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Responses = { 200: DocumentAndBatchResponse } @@ -2722,17 +2761,10 @@ export type PostDatasetsByDatasetIdHitTestingData = { } export type PostDatasetsByDatasetIdHitTestingErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdHitTestingError - = PostDatasetsByDatasetIdHitTestingErrors[keyof PostDatasetsByDatasetIdHitTestingErrors] - export type PostDatasetsByDatasetIdHitTestingResponses = { 200: HitTestingResponse } @@ -2750,17 +2782,10 @@ export type GetDatasetsByDatasetIdMetadataData = { } export type GetDatasetsByDatasetIdMetadataErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetDatasetsByDatasetIdMetadataError - = GetDatasetsByDatasetIdMetadataErrors[keyof GetDatasetsByDatasetIdMetadataErrors] - export type GetDatasetsByDatasetIdMetadataResponses = { 200: DatasetMetadataListResponse } @@ -2778,17 +2803,10 @@ export type PostDatasetsByDatasetIdMetadataData = { } export type PostDatasetsByDatasetIdMetadataErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdMetadataError - = PostDatasetsByDatasetIdMetadataErrors[keyof PostDatasetsByDatasetIdMetadataErrors] - export type PostDatasetsByDatasetIdMetadataResponses = { 201: DatasetMetadataResponse } @@ -2806,14 +2824,9 @@ export type GetDatasetsByDatasetIdMetadataBuiltInData = { } export type GetDatasetsByDatasetIdMetadataBuiltInErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetDatasetsByDatasetIdMetadataBuiltInError - = GetDatasetsByDatasetIdMetadataBuiltInErrors[keyof GetDatasetsByDatasetIdMetadataBuiltInErrors] - export type GetDatasetsByDatasetIdMetadataBuiltInResponses = { 200: DatasetMetadataBuiltInFieldsResponse } @@ -2832,17 +2845,10 @@ export type PostDatasetsByDatasetIdMetadataBuiltInByActionData = { } export type PostDatasetsByDatasetIdMetadataBuiltInByActionErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdMetadataBuiltInByActionError - = PostDatasetsByDatasetIdMetadataBuiltInByActionErrors[keyof PostDatasetsByDatasetIdMetadataBuiltInByActionErrors] - export type PostDatasetsByDatasetIdMetadataBuiltInByActionResponses = { 200: DatasetMetadataActionResponse } @@ -2861,17 +2867,10 @@ export type DeleteDatasetsByDatasetIdMetadataByMetadataIdData = { } export type DeleteDatasetsByDatasetIdMetadataByMetadataIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type DeleteDatasetsByDatasetIdMetadataByMetadataIdError - = DeleteDatasetsByDatasetIdMetadataByMetadataIdErrors[keyof DeleteDatasetsByDatasetIdMetadataByMetadataIdErrors] - export type DeleteDatasetsByDatasetIdMetadataByMetadataIdResponses = { 204: void } @@ -2890,17 +2889,10 @@ export type PatchDatasetsByDatasetIdMetadataByMetadataIdData = { } export type PatchDatasetsByDatasetIdMetadataByMetadataIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PatchDatasetsByDatasetIdMetadataByMetadataIdError - = PatchDatasetsByDatasetIdMetadataByMetadataIdErrors[keyof PatchDatasetsByDatasetIdMetadataByMetadataIdErrors] - export type PatchDatasetsByDatasetIdMetadataByMetadataIdResponses = { 200: DatasetMetadataResponse } @@ -2914,31 +2906,24 @@ export type GetDatasetsByDatasetIdPipelineDatasourcePluginsData = { dataset_id: string } query?: { - is_published?: string + is_published?: boolean } url: '/datasets/{dataset_id}/pipeline/datasource-plugins' } export type GetDatasetsByDatasetIdPipelineDatasourcePluginsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetDatasetsByDatasetIdPipelineDatasourcePluginsError - = GetDatasetsByDatasetIdPipelineDatasourcePluginsErrors[keyof GetDatasetsByDatasetIdPipelineDatasourcePluginsErrors] - export type GetDatasetsByDatasetIdPipelineDatasourcePluginsResponses = { - 200: { - [key: string]: unknown - } + 200: DatasourcePluginListResponse } export type GetDatasetsByDatasetIdPipelineDatasourcePluginsResponse = GetDatasetsByDatasetIdPipelineDatasourcePluginsResponses[keyof GetDatasetsByDatasetIdPipelineDatasourcePluginsResponses] export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunData = { - body?: never + body: DatasourceNodeRunPayload path: { dataset_id: string node_id: string @@ -2948,25 +2933,18 @@ export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunData = { } export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunError - = PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunErrors[keyof PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunErrors] - export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse = PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponses[keyof PostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponses] export type PostDatasetsByDatasetIdPipelineRunData = { - body?: never + body: PipelineRunApiEntity path: { dataset_id: string } @@ -2975,18 +2953,11 @@ export type PostDatasetsByDatasetIdPipelineRunData = { } export type PostDatasetsByDatasetIdPipelineRunErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type PostDatasetsByDatasetIdPipelineRunError - = PostDatasetsByDatasetIdPipelineRunErrors[keyof PostDatasetsByDatasetIdPipelineRunErrors] - export type PostDatasetsByDatasetIdPipelineRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostDatasetsByDatasetIdPipelineRunResponse @@ -3002,17 +2973,10 @@ export type PostDatasetsByDatasetIdRetrieveData = { } export type PostDatasetsByDatasetIdRetrieveErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostDatasetsByDatasetIdRetrieveError - = PostDatasetsByDatasetIdRetrieveErrors[keyof PostDatasetsByDatasetIdRetrieveErrors] - export type PostDatasetsByDatasetIdRetrieveResponses = { 200: HitTestingResponse } @@ -3030,14 +2994,9 @@ export type GetDatasetsByDatasetIdTagsData = { } export type GetDatasetsByDatasetIdTagsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetDatasetsByDatasetIdTagsError - = GetDatasetsByDatasetIdTagsErrors[keyof GetDatasetsByDatasetIdTagsErrors] - export type GetDatasetsByDatasetIdTagsResponses = { 200: DatasetBoundTagListResponse } @@ -3055,17 +3014,10 @@ export type GetEndUsersByEndUserIdData = { } export type GetEndUsersByEndUserIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetEndUsersByEndUserIdError - = GetEndUsersByEndUserIdErrors[keyof GetEndUsersByEndUserIdErrors] - export type GetEndUsersByEndUserIdResponses = { 200: EndUserDetail } @@ -3081,22 +3033,12 @@ export type PostFilesUploadData = { } export type PostFilesUploadErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 413: unknown + 415: unknown } -export type PostFilesUploadError = PostFilesUploadErrors[keyof PostFilesUploadErrors] - export type PostFilesUploadResponses = { 201: FileResponse } @@ -3115,24 +3057,13 @@ export type GetFilesByFileIdPreviewData = { } export type GetFilesByFileIdPreviewErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 403: unknown + 404: unknown } -export type GetFilesByFileIdPreviewError - = GetFilesByFileIdPreviewErrors[keyof GetFilesByFileIdPreviewErrors] - export type GetFilesByFileIdPreviewResponses = { - 200: { - [key: string]: unknown - } + 200: BinaryFileResponse } export type GetFilesByFileIdPreviewResponse @@ -3148,24 +3079,13 @@ export type GetFormHumanInputByFormTokenData = { } export type GetFormHumanInputByFormTokenErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 412: { - [key: string]: unknown - } + 401: unknown + 404: unknown + 412: unknown } -export type GetFormHumanInputByFormTokenError - = GetFormHumanInputByFormTokenErrors[keyof GetFormHumanInputByFormTokenErrors] - export type GetFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormDefinitionResponse } export type GetFormHumanInputByFormTokenResponse @@ -3181,27 +3101,14 @@ export type PostFormHumanInputByFormTokenData = { } export type PostFormHumanInputByFormTokenErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 412: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 412: unknown } -export type PostFormHumanInputByFormTokenError - = PostFormHumanInputByFormTokenErrors[keyof PostFormHumanInputByFormTokenErrors] - export type PostFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormSubmitResponse } export type PostFormHumanInputByFormTokenResponse @@ -3215,16 +3122,10 @@ export type GetInfoData = { } export type GetInfoErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetInfoError = GetInfoErrors[keyof GetInfoErrors] - export type GetInfoResponses = { 200: AppInfoResponse } @@ -3243,20 +3144,12 @@ export type GetMessagesData = { } export type GetMessagesErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetMessagesError = GetMessagesErrors[keyof GetMessagesErrors] - export type GetMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: MessageInfiniteScrollPagination } export type GetMessagesResponse = GetMessagesResponses[keyof GetMessagesResponses] @@ -3271,17 +3164,10 @@ export type PostMessagesByMessageIdFeedbacksData = { } export type PostMessagesByMessageIdFeedbacksErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostMessagesByMessageIdFeedbacksError - = PostMessagesByMessageIdFeedbacksErrors[keyof PostMessagesByMessageIdFeedbacksErrors] - export type PostMessagesByMessageIdFeedbacksResponses = { 200: ResultResponse } @@ -3299,23 +3185,12 @@ export type GetMessagesByMessageIdSuggestedData = { } export type GetMessagesByMessageIdSuggestedErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 500: unknown } -export type GetMessagesByMessageIdSuggestedError - = GetMessagesByMessageIdSuggestedErrors[keyof GetMessagesByMessageIdSuggestedErrors] - export type GetMessagesByMessageIdSuggestedResponses = { 200: SimpleResultStringListResponse } @@ -3331,20 +3206,12 @@ export type GetMetaData = { } export type GetMetaErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetMetaError = GetMetaErrors[keyof GetMetaErrors] - export type GetMetaResponses = { - 200: { - [key: string]: unknown - } + 200: AppMetaResponse } export type GetMetaResponse = GetMetaResponses[keyof GetMetaResponses] @@ -3357,20 +3224,12 @@ export type GetParametersData = { } export type GetParametersErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetParametersError = GetParametersErrors[keyof GetParametersErrors] - export type GetParametersResponses = { - 200: { - [key: string]: unknown - } + 200: Parameters } export type GetParametersResponse = GetParametersResponses[keyof GetParametersResponses] @@ -3383,16 +3242,10 @@ export type GetSiteData = { } export type GetSiteErrors = { - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } + 401: unknown + 403: unknown } -export type GetSiteError = GetSiteErrors[keyof GetSiteErrors] - export type GetSiteResponses = { 200: Site } @@ -3407,23 +3260,13 @@ export type PostTextToAudioData = { } export type PostTextToAudioErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 500: unknown } -export type PostTextToAudioError = PostTextToAudioErrors[keyof PostTextToAudioErrors] - export type PostTextToAudioResponses = { - 200: { - [key: string]: unknown - } + 200: AudioBinaryResponse } export type PostTextToAudioResponse = PostTextToAudioResponses[keyof PostTextToAudioResponses] @@ -3433,30 +3276,21 @@ export type GetWorkflowByTaskIdEventsData = { path: { task_id: string } - query?: { - continue_on_pause?: string - include_state_snapshot?: string - user?: string + query: { + continue_on_pause?: boolean + include_state_snapshot?: boolean + user: string } url: '/workflow/{task_id}/events' } export type GetWorkflowByTaskIdEventsErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetWorkflowByTaskIdEventsError - = GetWorkflowByTaskIdEventsErrors[keyof GetWorkflowByTaskIdEventsErrors] - export type GetWorkflowByTaskIdEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetWorkflowByTaskIdEventsResponse @@ -3479,13 +3313,9 @@ export type GetWorkflowsLogsData = { } export type GetWorkflowsLogsErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetWorkflowsLogsError = GetWorkflowsLogsErrors[keyof GetWorkflowsLogsErrors] - export type GetWorkflowsLogsResponses = { 200: WorkflowAppLogPaginationResponse } @@ -3500,29 +3330,15 @@ export type PostWorkflowsRunData = { } export type PostWorkflowsRunErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 429: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 429: unknown + 500: unknown } -export type PostWorkflowsRunError = PostWorkflowsRunErrors[keyof PostWorkflowsRunErrors] - export type PostWorkflowsRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostWorkflowsRunResponse = PostWorkflowsRunResponses[keyof PostWorkflowsRunResponses] @@ -3537,17 +3353,10 @@ export type GetWorkflowsRunByWorkflowRunIdData = { } export type GetWorkflowsRunByWorkflowRunIdErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetWorkflowsRunByWorkflowRunIdError - = GetWorkflowsRunByWorkflowRunIdErrors[keyof GetWorkflowsRunByWorkflowRunIdErrors] - export type GetWorkflowsRunByWorkflowRunIdResponses = { 200: WorkflowRunResponse } @@ -3565,17 +3374,10 @@ export type PostWorkflowsTasksByTaskIdStopData = { } export type PostWorkflowsTasksByTaskIdStopErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type PostWorkflowsTasksByTaskIdStopError - = PostWorkflowsTasksByTaskIdStopErrors[keyof PostWorkflowsTasksByTaskIdStopErrors] - export type PostWorkflowsTasksByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -3593,30 +3395,15 @@ export type PostWorkflowsByWorkflowIdRunData = { } export type PostWorkflowsByWorkflowIdRunErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 429: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown + 429: unknown + 500: unknown } -export type PostWorkflowsByWorkflowIdRunError - = PostWorkflowsByWorkflowIdRunErrors[keyof PostWorkflowsByWorkflowIdRunErrors] - export type PostWorkflowsByWorkflowIdRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostWorkflowsByWorkflowIdRunResponse @@ -3632,18 +3419,11 @@ export type GetWorkspacesCurrentModelsModelTypesByModelTypeData = { } export type GetWorkspacesCurrentModelsModelTypesByModelTypeErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetWorkspacesCurrentModelsModelTypesByModelTypeError - = GetWorkspacesCurrentModelsModelTypesByModelTypeErrors[keyof GetWorkspacesCurrentModelsModelTypesByModelTypeErrors] - export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponses = { - 200: { - [key: string]: unknown - } + 200: ProviderWithModelsListResponse } export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponse diff --git a/packages/contracts/generated/api/service/zod.gen.ts b/packages/contracts/generated/api/service/zod.gen.ts index 93eae18080..ce31666d07 100644 --- a/packages/contracts/generated/api/service/zod.gen.ts +++ b/packages/contracts/generated/api/service/zod.gen.ts @@ -21,6 +21,15 @@ export const zAnnotationCreatePayload = z.object({ question: z.string(), }) +/** + * AnnotationJobStatusResponse + */ +export const zAnnotationJobStatusResponse = z.object({ + error_msg: z.string().nullish(), + job_id: z.string(), + job_status: z.string(), +}) + /** * AnnotationList */ @@ -50,6 +59,30 @@ export const zAnnotationReplyActionPayload = z.object({ score_threshold: z.number(), }) +/** + * AppFeedbackResponse + */ +export const zAppFeedbackResponse = z.object({ + app_id: z.string(), + content: z.string().nullish(), + conversation_id: z.string(), + created_at: z.string(), + from_account_id: z.string().nullish(), + from_end_user_id: z.string().nullish(), + from_source: z.string(), + id: z.string(), + message_id: z.string(), + rating: z.string(), + updated_at: z.string(), +}) + +/** + * AppFeedbackListResponse + */ +export const zAppFeedbackListResponse = z.object({ + data: z.array(zAppFeedbackResponse), +}) + /** * AppInfoResponse */ @@ -61,6 +94,37 @@ export const zAppInfoResponse = z.object({ tags: z.array(z.string()), }) +/** + * AppMetaResponse + */ +export const zAppMetaResponse = z.object({ + tool_icons: z.record(z.string(), z.unknown()).optional(), +}) + +/** + * AudioBinaryResponse + */ +export const zAudioBinaryResponse = z.custom() + +/** + * AudioTranscriptResponse + */ +export const zAudioTranscriptResponse = z.object({ + text: z.string(), +}) + +/** + * BinaryFileResponse + */ +export const zBinaryFileResponse = z.custom() + +/** + * ButtonStyle + * + * Button styles for user actions. + */ +export const zButtonStyle = z.enum(['accent', 'default', 'ghost', 'primary']) + /** * ChatRequestPayload */ @@ -231,6 +295,13 @@ export const zConversationVariablesQuery = z.object({ variable_name: z.string().min(1).max(255).nullish(), }) +/** + * CustomConfigurationStatus + * + * Enum class for custom configuration status. + */ +export const zCustomConfigurationStatus = z.enum(['active', 'no-configure']) + /** * DatasetBoundTagResponse */ @@ -505,6 +576,16 @@ export const zDatasetListResponse = z.object({ total: z.int(), }) +/** + * DatasourceCredentialInfoResponse + */ +export const zDatasourceCredentialInfoResponse = z.object({ + id: z.string().nullish(), + is_default: z.boolean().nullish(), + name: z.string().nullish(), + type: z.string().nullish(), +}) + /** * DatasourceNodeRunPayload */ @@ -515,6 +596,31 @@ export const zDatasourceNodeRunPayload = z.object({ is_published: z.boolean(), }) +/** + * DatasourcePluginResponse + */ +export const zDatasourcePluginResponse = z.object({ + credentials: z.array(zDatasourceCredentialInfoResponse), + datasource_type: z.string().nullish(), + node_id: z.string().nullish(), + plugin_id: z.string().nullish(), + provider_name: z.string().nullish(), + title: z.string().nullish(), + user_input_variables: z.array(z.record(z.string(), z.unknown())).optional(), +}) + +/** + * DatasourcePluginListResponse + */ +export const zDatasourcePluginListResponse = z.array(zDatasourcePluginResponse) + +/** + * DatasourcePluginsQuery + */ +export const zDatasourcePluginsQuery = z.object({ + is_published: z.boolean().optional().default(true), +}) + /** * DocumentBatchDownloadZipPayload * @@ -524,6 +630,13 @@ export const zDocumentBatchDownloadZipPayload = z.object({ document_ids: z.array(z.uuid()).min(1).max(100), }) +/** + * DocumentGetQuery + */ +export const zDocumentGetQuery = z.object({ + metadata: z.enum(['all', 'only', 'without']).optional().default('all'), +}) + /** * DocumentListQuery */ @@ -544,6 +657,43 @@ export const zDocumentMetadataResponse = z.object({ value: z.union([z.string(), z.int(), z.number(), z.boolean()]).nullish(), }) +/** + * DocumentDetailResponse + */ +export const zDocumentDetailResponse = z.object({ + archived: z.boolean().nullish(), + average_segment_length: z.number().nullish(), + completed_at: z.int().nullish(), + created_at: z.int().nullish(), + created_by: z.string().nullish(), + created_from: z.string().nullish(), + data_source_info: z.record(z.string(), z.unknown()).nullish(), + data_source_type: z.string().nullish(), + dataset_process_rule: z.record(z.string(), z.unknown()).nullish(), + dataset_process_rule_id: z.string().nullish(), + disabled_at: z.int().nullish(), + disabled_by: z.string().nullish(), + display_status: z.string().nullish(), + doc_form: z.string().nullish(), + doc_language: z.string().nullish(), + doc_metadata: z.array(zDocumentMetadataResponse).nullish(), + doc_type: z.string().nullish(), + document_process_rule: z.record(z.string(), z.unknown()).nullish(), + enabled: z.boolean().nullish(), + error: z.string().nullish(), + hit_count: z.int().nullish(), + id: z.string(), + indexing_latency: z.number().nullish(), + indexing_status: z.string().nullish(), + name: z.string().nullish(), + need_summary: z.boolean().nullish(), + position: z.int().nullish(), + segment_count: z.int().nullish(), + summary_index_status: z.string().nullish(), + tokens: z.int().nullish(), + updated_at: z.int().nullish(), +}) + /** * DocumentResponse */ @@ -593,6 +743,13 @@ export const zDocumentListResponse = z.object({ total: z.int(), }) +/** + * DocumentStatusPayload + */ +export const zDocumentStatusPayload = z.object({ + document_ids: z.array(z.string()).optional(), +}) + /** * DocumentStatusResponse */ @@ -640,6 +797,16 @@ export const zEndUserDetail = z.object({ updated_at: z.iso.datetime(), }) +/** + * EventStreamResponse + */ +export const zEventStreamResponse = z.string() + +/** + * ExecutionContentType + */ +export const zExecutionContentType = z.enum(['human_input']) + /** * FeedbackListQuery */ @@ -648,6 +815,13 @@ export const zFeedbackListQuery = z.object({ page: z.int().gte(1).optional().default(1), }) +/** + * FetchFrom + * + * Enum class for fetch from. + */ +export const zFetchFrom = z.enum(['customizable-model', 'predefined-model']) + /** * FilePreviewQuery */ @@ -676,6 +850,44 @@ export const zFileResponse = z.object({ user_id: z.string().nullish(), }) +/** + * FileTransferMethod + */ +export const zFileTransferMethod = z.enum([ + 'datasource_file', + 'local_file', + 'remote_url', + 'tool_file', +]) + +/** + * FileType + */ +export const zFileType = z.enum(['audio', 'custom', 'document', 'image', 'video']) + +/** + * FileInputConfig + */ +export const zFileInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + output_variable_name: z.string(), + type: z.literal('file').optional().default('file'), +}) + +/** + * FileListInputConfig + */ +export const zFileListInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + number_limits: z.int().gte(0).optional().default(0), + output_variable_name: z.string(), + type: z.literal('file-list').optional().default('file-list'), +}) + /** * HitTestingChildChunk */ @@ -765,6 +977,32 @@ export const zHitTestingResponse = z.object({ records: z.array(zHitTestingRecord), }) +/** + * HumanInputFormDefinitionResponse + */ +export const zHumanInputFormDefinitionResponse = z.object({ + expiration_time: z.int().nullish(), + form_content: z.string(), + inputs: z.array(z.record(z.string(), z.unknown())).optional(), + resolved_default_values: z.record(z.string(), z.string()), + user_actions: z.array(z.record(z.string(), z.unknown())).optional(), +}) + +/** + * HumanInputFormSubmitResponse + */ +export const zHumanInputFormSubmitResponse = z.record(z.string(), z.never()) + +/** + * I18nObject + * + * Model class for i18n object. + */ +export const zI18nObject = z.object({ + en_US: z.string(), + zh_Hans: z.string().nullish(), +}) + /** * IndexInfoResponse */ @@ -774,14 +1012,63 @@ export const zIndexInfoResponse = z.object({ welcome: z.string(), }) -export const zJsonValue = z.unknown() +export const zJsonObject = z.record(z.string(), z.unknown()) + +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * AgentThought + */ +export const zAgentThought = z.object({ + chain_id: z.string().nullish(), + created_at: z.int().nullish(), + files: z.array(z.string()), + id: z.string(), + message_id: z.string(), + observation: z.string().nullish(), + position: z.int(), + thought: z.string().nullish(), + tool: z.string().nullish(), + tool_input: z.string().nullish(), + tool_labels: zJsonValue, +}) + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue + +export const zJsonValueType = z.unknown() + +export const zJsonValue2 = z.unknown() + +/** + * HumanInputFormSubmissionData + */ +export const zHumanInputFormSubmissionData = z.object({ + action_id: z.string(), + action_text: z.string(), + node_id: z.string(), + node_title: z.string(), + rendered_content: z.string(), + submitted_data: z.record(z.string(), zJsonValue2).nullish(), +}) /** * HumanInputFormSubmitPayload */ export const zHumanInputFormSubmitPayload = z.object({ action: z.string(), - inputs: z.record(z.string(), zJsonValue), + inputs: z.record(z.string(), zJsonValue2), }) /** @@ -807,6 +1094,21 @@ export const zMessageFeedbackPayload = z.object({ rating: z.enum(['dislike', 'like']).nullish(), }) +/** + * MessageFile + */ +export const zMessageFile = z.object({ + belongs_to: z.string().nullish(), + filename: z.string(), + id: z.string(), + mime_type: z.string().nullish(), + size: z.int().nullish(), + transfer_method: z.string(), + type: z.string(), + upload_file_id: z.string().nullish(), + url: z.string().nullish(), +}) + /** * MessageListQuery */ @@ -868,6 +1170,71 @@ export const zMetadataUpdatePayload = z.object({ name: z.string(), }) +/** + * ModelFeature + * + * Enum class for llm feature. + */ +export const zModelFeature = z.enum([ + 'agent-thought', + 'audio', + 'document', + 'multi-tool-call', + 'polling', + 'stream-tool-call', + 'structured-output', + 'tool-call', + 'video', + 'vision', +]) + +/** + * ModelPropertyKey + * + * Enum class for model property key. + */ +export const zModelPropertyKey = z.enum([ + 'audio_type', + 'context_size', + 'default_voice', + 'file_upload_limit', + 'max_characters_per_chunk', + 'max_chunks', + 'max_workers', + 'mode', + 'supported_file_extensions', + 'voices', + 'word_limit', +]) + +/** + * ModelStatus + * + * Enum class for model status. + */ +export const zModelStatus = z.enum([ + 'active', + 'credential-removed', + 'disabled', + 'no-configure', + 'no-permission', + 'quota-exceeded', +]) + +/** + * ModelType + * + * Enum class for model type. + */ +export const zModelType = z.enum([ + 'llm', + 'moderation', + 'rerank', + 'speech2text', + 'text-embedding', + 'tts', +]) + /** * PermissionEnum * @@ -887,6 +1254,19 @@ export const zPipelineRunApiEntity = z.object({ start_node_id: z.string(), }) +/** + * PipelineUploadFileResponse + */ +export const zPipelineUploadFileResponse = z.object({ + created_at: z.string().nullish(), + created_by: z.string(), + extension: z.string(), + id: z.string(), + mime_type: z.string().nullish(), + name: z.string(), + size: z.int(), +}) + /** * PreProcessingRule */ @@ -902,6 +1282,46 @@ export const zPreProcessingRule = z.object({ */ export const zProcessRuleMode = z.enum(['automatic', 'custom', 'hierarchical']) +/** + * ProviderModelWithStatusEntity + * + * Model class for model response. + */ +export const zProviderModelWithStatusEntity = z.object({ + deprecated: z.boolean().optional().default(false), + features: z.array(zModelFeature).nullish(), + fetch_from: zFetchFrom, + has_invalid_load_balancing_configs: z.boolean().optional().default(false), + label: zI18nObject, + load_balancing_enabled: z.boolean().optional().default(false), + model: z.string(), + model_properties: z.record(z.string(), z.unknown()), + model_type: zModelType, + status: zModelStatus, +}) + +/** + * ProviderWithModelsResponse + * + * Model class for provider with models response. + */ +export const zProviderWithModelsResponse = z.object({ + icon_small: zI18nObject.nullish(), + icon_small_dark: zI18nObject.nullish(), + label: zI18nObject, + models: z.array(zProviderModelWithStatusEntity), + provider: z.string(), + status: zCustomConfigurationStatus, + tenant_id: z.string(), +}) + +/** + * ProviderWithModelsListResponse + */ +export const zProviderWithModelsListResponse = z.object({ + data: z.array(zProviderWithModelsResponse), +}) + /** * RerankingModel */ @@ -927,6 +1347,29 @@ export const zRetrievalMethod = z.enum([ 'semantic_search', ]) +/** + * RetrieverResource + */ +export const zRetrieverResource = z.object({ + content: z.string().nullish(), + created_at: z.int().nullish(), + data_source_type: z.string().nullish(), + dataset_id: z.string().nullish(), + dataset_name: z.string().nullish(), + document_id: z.string().nullish(), + document_name: z.string().nullish(), + hit_count: z.int().nullish(), + id: z.string().optional(), + index_node_hash: z.string().nullish(), + message_id: z.string().optional(), + position: z.int(), + score: z.number().nullish(), + segment_id: z.string().nullish(), + segment_position: z.int().nullish(), + summary: z.string().nullish(), + word_count: z.int().nullish(), +}) + /** * SegmentAttachmentResponse */ @@ -1083,6 +1526,28 @@ export const zSimpleAccount = z.object({ name: z.string(), }) +/** + * SimpleConversation + */ +export const zSimpleConversation = z.object({ + created_at: z.int().nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValue), + introduction: z.string().nullish(), + name: z.string(), + status: z.string(), + updated_at: z.int().nullish(), +}) + +/** + * ConversationInfiniteScrollPagination + */ +export const zConversationInfiniteScrollPagination = z.object({ + data: z.array(zSimpleConversation), + has_more: z.boolean(), + limit: z.int(), +}) + /** * SimpleEndUser */ @@ -1093,6 +1558,13 @@ export const zSimpleEndUser = z.object({ type: z.string(), }) +/** + * SimpleFeedback + */ +export const zSimpleFeedback = z.object({ + rating: z.string().nullish(), +}) + /** * SimpleResultResponse */ @@ -1128,6 +1600,35 @@ export const zSite = z.object({ use_icon_as_answer_icon: z.boolean(), }) +/** + * SystemParameters + */ +export const zSystemParameters = z.object({ + audio_file_size_limit: z.int(), + file_size_limit: z.int(), + image_file_size_limit: z.int(), + video_file_size_limit: z.int(), + workflow_file_upload_limit: z.int(), +}) + +/** + * Parameters + */ +export const zParameters = z.object({ + annotation_reply: zJsonObject, + file_upload: zJsonObject, + more_like_this: zJsonObject, + opening_statement: z.string().nullish(), + retriever_resource: zJsonObject, + sensitive_word_avoidance: zJsonObject, + speech_to_text: zJsonObject, + suggested_questions: z.array(z.string()), + suggested_questions_after_answer: zJsonObject, + system_parameters: zSystemParameters, + text_to_speech: zJsonObject, + user_input_form: z.array(zJsonObject), +}) + /** * TagBindingPayload */ @@ -1186,6 +1687,128 @@ export const zUrlResponse = z.object({ url: z.string(), }) +/** + * UserActionConfig + * + * User action configuration. + */ +export const zUserActionConfig = z.object({ + button_style: zButtonStyle.optional().default('default'), + id: z.string().max(20), + title: z.string().max(100), +}) + +/** + * ValueSourceType + * + * ValueSourceType records whether the value comes from a static setting + * in form definiton, or a variable while the workflow is running. + */ +export const zValueSourceType = z.enum(['constant', 'variable']) + +/** + * StringListSource + */ +export const zStringListSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.array(z.string()).optional(), +}) + +/** + * SelectInputConfig + */ +export const zSelectInputConfig = z.object({ + option_source: zStringListSource, + output_variable_name: z.string(), + type: z.literal('select').optional().default('select'), +}) + +/** + * StringSource + * + * Default configuration for form inputs. + */ +export const zStringSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.string().optional().default(''), +}) + +/** + * ParagraphInputConfig + * + * Form input definition. + */ +export const zParagraphInputConfig = z.object({ + default: zStringSource.nullish(), + output_variable_name: z.string(), + type: z.literal('paragraph').optional().default('paragraph'), +}) + +export const zFormInputConfig = z.discriminatedUnion('type', [ + zParagraphInputConfig.extend({ type: z.literal('paragraph') }), + zSelectInputConfig.extend({ type: z.literal('select') }), + zFileInputConfig.extend({ type: z.literal('file') }), + zFileListInputConfig.extend({ type: z.literal('file-list') }), +]) + +/** + * HumanInputFormDefinition + */ +export const zHumanInputFormDefinition = z.object({ + actions: z.array(zUserActionConfig).optional(), + display_in_ui: z.boolean().optional().default(false), + expiration_time: z.int(), + form_content: z.string(), + form_id: z.string(), + form_token: z.string().nullish(), + inputs: z.array(zFormInputConfig).optional(), + node_id: z.string(), + node_title: z.string(), + resolved_default_values: z.record(z.string(), z.unknown()).optional(), +}) + +/** + * HumanInputContent + */ +export const zHumanInputContent = z.object({ + form_definition: zHumanInputFormDefinition.nullish(), + form_submission_data: zHumanInputFormSubmissionData.nullish(), + submitted: z.boolean(), + type: zExecutionContentType.optional().default('human_input'), + workflow_run_id: z.string(), +}) + +/** + * MessageListItem + */ +export const zMessageListItem = z.object({ + agent_thoughts: z.array(zAgentThought), + answer: z.string(), + conversation_id: z.string(), + created_at: z.int().nullish(), + error: z.string().nullish(), + extra_contents: z.array(zHumanInputContent), + feedback: zSimpleFeedback.nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValueType), + message_files: z.array(zMessageFile), + parent_message_id: z.string().nullish(), + query: z.string(), + retriever_resources: z.array(zRetrieverResource), + status: z.string(), +}) + +/** + * MessageInfiniteScrollPagination + */ +export const zMessageInfiniteScrollPagination = z.object({ + data: z.array(zMessageListItem), + has_more: z.boolean(), + limit: z.int(), +}) + /** * WeightKeywordSetting */ @@ -1298,6 +1921,15 @@ export const zHitTestingPayload = z.object({ retrieval_model: zRetrievalModel.nullish(), }) +/** + * WorkflowEventsQuery + */ +export const zWorkflowEventsQuery = z.object({ + continue_on_pause: z.boolean().optional().default(false), + include_state_snapshot: z.boolean().optional().default(false), + user: z.string(), +}) + /** * WorkflowLogQuery */ @@ -1399,6 +2031,16 @@ export const zWorkflowRunResponse = z.object({ workflow_id: z.string(), }) +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponseWritable = zJsonValue + +/** + * HumanInputFormSubmitResponse + */ +export const zHumanInputFormSubmitResponseWritable = z.record(z.string(), z.never()) + /** * Site */ @@ -1431,7 +2073,7 @@ export const zGetAppFeedbacksQuery = z.object({ /** * Feedbacks retrieved successfully */ -export const zGetAppFeedbacksResponse = z.record(z.string(), z.unknown()) +export const zGetAppFeedbacksResponse = zAppFeedbackListResponse export const zPostAppsAnnotationReplyByActionBody = zAnnotationReplyActionPayload @@ -1442,7 +2084,7 @@ export const zPostAppsAnnotationReplyByActionPath = z.object({ /** * Action completed successfully */ -export const zPostAppsAnnotationReplyByActionResponse = z.record(z.string(), z.unknown()) +export const zPostAppsAnnotationReplyByActionResponse = zAnnotationJobStatusResponse export const zGetAppsAnnotationReplyByActionStatusByJobIdPath = z.object({ action: z.string(), @@ -1452,10 +2094,7 @@ export const zGetAppsAnnotationReplyByActionStatusByJobIdPath = z.object({ /** * Job status retrieved successfully */ -export const zGetAppsAnnotationReplyByActionStatusByJobIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetAppsAnnotationReplyByActionStatusByJobIdResponse = zAnnotationJobStatusResponse export const zGetAppsAnnotationsQuery = z.object({ keyword: z.string().optional().default(''), @@ -1498,14 +2137,14 @@ export const zPutAppsAnnotationsByAnnotationIdResponse = zAnnotation /** * Audio successfully transcribed */ -export const zPostAudioToTextResponse = z.record(z.string(), z.unknown()) +export const zPostAudioToTextResponse = zAudioTranscriptResponse export const zPostChatMessagesBody = zChatRequestPayload /** * Message sent successfully */ -export const zPostChatMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostChatMessagesResponse = zGeneratedAppResponse export const zPostChatMessagesByTaskIdStopPath = z.object({ task_id: z.string(), @@ -1521,7 +2160,7 @@ export const zPostCompletionMessagesBody = zCompletionRequestPayload /** * Completion created successfully */ -export const zPostCompletionMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostCompletionMessagesResponse = zGeneratedAppResponse export const zPostCompletionMessagesByTaskIdStopPath = z.object({ task_id: z.string(), @@ -1544,7 +2183,7 @@ export const zGetConversationsQuery = z.object({ /** * Conversations retrieved successfully */ -export const zGetConversationsResponse = z.record(z.string(), z.unknown()) +export const zGetConversationsResponse = zConversationInfiniteScrollPagination export const zDeleteConversationsByCIdPath = z.object({ c_id: z.string(), @@ -1564,7 +2203,7 @@ export const zPostConversationsByCIdNamePath = z.object({ /** * Conversation renamed successfully */ -export const zPostConversationsByCIdNameResponse = z.record(z.string(), z.unknown()) +export const zPostConversationsByCIdNameResponse = zSimpleConversation export const zGetConversationsByCIdVariablesPath = z.object({ c_id: z.string(), @@ -1617,7 +2256,7 @@ export const zPostDatasetsResponse = zDatasetDetailResponse /** * File uploaded successfully */ -export const zPostDatasetsPipelineFileUploadResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsPipelineFileUploadResponse = zPipelineUploadFileResponse export const zDeleteDatasetsTagsBody = zTagDeletePayload @@ -1763,10 +2402,7 @@ export const zPostDatasetsByDatasetIdDocumentsDownloadZipPath = z.object({ /** * ZIP archive generated successfully */ -export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = zBinaryFileResponse export const zPostDatasetsByDatasetIdDocumentsMetadataBody = zMetadataOperationData @@ -1779,6 +2415,8 @@ export const zPostDatasetsByDatasetIdDocumentsMetadataPath = z.object({ */ export const zPostDatasetsByDatasetIdDocumentsMetadataResponse = zDatasetMetadataActionResponse +export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBody = zDocumentStatusPayload + export const zPatchDatasetsByDatasetIdDocumentsStatusByActionPath = z.object({ action: z.string(), dataset_id: z.string(), @@ -1815,13 +2453,14 @@ export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({ document_id: z.string(), }) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery = z.object({ + metadata: z.enum(['all', 'only', 'without']).optional().default('all'), +}) + /** * Document retrieved successfully */ -export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = zDocumentDetailResponse export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdBody = z.object({ data: z.string().optional(), @@ -2119,16 +2758,17 @@ export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath = z.object({ }) export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery = z.object({ - is_published: z.string().optional(), + is_published: z.boolean().optional().default(true), }) /** * Datasource plugins retrieved successfully */ -export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse + = zDatasourcePluginListResponse + +export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody + = zDatasourceNodeRunPayload export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath = z.object({ dataset_id: z.string(), @@ -2138,10 +2778,10 @@ export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath = z. /** * Datasource node run successfully */ -export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse = z.record( - z.string(), - z.unknown(), -) +export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse + = zGeneratedAppResponse + +export const zPostDatasetsByDatasetIdPipelineRunBody = zPipelineRunApiEntity export const zPostDatasetsByDatasetIdPipelineRunPath = z.object({ dataset_id: z.string(), @@ -2150,7 +2790,7 @@ export const zPostDatasetsByDatasetIdPipelineRunPath = z.object({ /** * Pipeline run successfully */ -export const zPostDatasetsByDatasetIdPipelineRunResponse = z.record(z.string(), z.unknown()) +export const zPostDatasetsByDatasetIdPipelineRunResponse = zGeneratedAppResponse export const zPostDatasetsByDatasetIdRetrieveBody = zHitTestingPayload @@ -2197,7 +2837,7 @@ export const zGetFilesByFileIdPreviewQuery = z.object({ /** * File retrieved successfully */ -export const zGetFilesByFileIdPreviewResponse = z.record(z.string(), z.unknown()) +export const zGetFilesByFileIdPreviewResponse = zBinaryFileResponse export const zGetFormHumanInputByFormTokenPath = z.object({ form_token: z.string(), @@ -2206,7 +2846,7 @@ export const zGetFormHumanInputByFormTokenPath = z.object({ /** * Form retrieved successfully */ -export const zGetFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zGetFormHumanInputByFormTokenResponse = zHumanInputFormDefinitionResponse export const zPostFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayload @@ -2217,7 +2857,7 @@ export const zPostFormHumanInputByFormTokenPath = z.object({ /** * Form submitted successfully */ -export const zPostFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zPostFormHumanInputByFormTokenResponse = zHumanInputFormSubmitResponse /** * Application info retrieved successfully @@ -2233,7 +2873,7 @@ export const zGetMessagesQuery = z.object({ /** * Messages retrieved successfully */ -export const zGetMessagesResponse = z.record(z.string(), z.unknown()) +export const zGetMessagesResponse = zMessageInfiniteScrollPagination export const zPostMessagesByMessageIdFeedbacksBody = zMessageFeedbackPayload @@ -2258,12 +2898,12 @@ export const zGetMessagesByMessageIdSuggestedResponse = zSimpleResultStringListR /** * Metadata retrieved successfully */ -export const zGetMetaResponse = z.record(z.string(), z.unknown()) +export const zGetMetaResponse = zAppMetaResponse /** * Parameters retrieved successfully */ -export const zGetParametersResponse = z.record(z.string(), z.unknown()) +export const zGetParametersResponse = zParameters /** * Site configuration retrieved successfully @@ -2275,22 +2915,22 @@ export const zPostTextToAudioBody = zTextToAudioPayload /** * Text successfully converted to audio */ -export const zPostTextToAudioResponse = z.record(z.string(), z.unknown()) +export const zPostTextToAudioResponse = zAudioBinaryResponse export const zGetWorkflowByTaskIdEventsPath = z.object({ task_id: z.string(), }) export const zGetWorkflowByTaskIdEventsQuery = z.object({ - continue_on_pause: z.string().optional(), - include_state_snapshot: z.string().optional(), - user: z.string().optional(), + continue_on_pause: z.boolean().optional().default(false), + include_state_snapshot: z.boolean().optional().default(false), + user: z.string(), }) /** * SSE event stream */ -export const zGetWorkflowByTaskIdEventsResponse = z.record(z.string(), z.unknown()) +export const zGetWorkflowByTaskIdEventsResponse = zEventStreamResponse export const zGetWorkflowsLogsQuery = z.object({ created_at__after: z.string().optional(), @@ -2313,7 +2953,7 @@ export const zPostWorkflowsRunBody = zWorkflowRunPayload /** * Workflow executed successfully */ -export const zPostWorkflowsRunResponse = z.record(z.string(), z.unknown()) +export const zPostWorkflowsRunResponse = zGeneratedAppResponse export const zGetWorkflowsRunByWorkflowRunIdPath = z.object({ workflow_run_id: z.string(), @@ -2342,7 +2982,7 @@ export const zPostWorkflowsByWorkflowIdRunPath = z.object({ /** * Workflow executed successfully */ -export const zPostWorkflowsByWorkflowIdRunResponse = z.record(z.string(), z.unknown()) +export const zPostWorkflowsByWorkflowIdRunResponse = zGeneratedAppResponse export const zGetWorkspacesCurrentModelsModelTypesByModelTypePath = z.object({ model_type: z.string(), @@ -2351,7 +2991,5 @@ export const zGetWorkspacesCurrentModelsModelTypesByModelTypePath = z.object({ /** * Models retrieved successfully */ -export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse = z.record( - z.string(), - z.unknown(), -) +export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse + = zProviderWithModelsListResponse diff --git a/packages/contracts/generated/api/web/orpc.gen.ts b/packages/contracts/generated/api/web/orpc.gen.ts index ee46faf350..f0ef39fd97 100644 --- a/packages/contracts/generated/api/web/orpc.gen.ts +++ b/packages/contracts/generated/api/web/orpc.gen.ts @@ -12,6 +12,7 @@ import { zGetConversationsResponse, zGetFormHumanInputByFormTokenPath, zGetFormHumanInputByFormTokenResponse, + zGetLoginStatusQuery, zGetLoginStatusResponse, zGetMessagesByMessageIdMoreLikeThisPath, zGetMessagesByMessageIdMoreLikeThisQuery, @@ -22,6 +23,7 @@ import { zGetMessagesResponse, zGetMetaResponse, zGetParametersResponse, + zGetPassportQuery, zGetPassportResponse, zGetRemoteFilesByUrlPath, zGetRemoteFilesByUrlResponse, @@ -48,6 +50,7 @@ import { zPostCompletionMessagesByTaskIdStopPath, zPostCompletionMessagesByTaskIdStopResponse, zPostCompletionMessagesResponse, + zPostConversationsByCIdNameBody, zPostConversationsByCIdNamePath, zPostConversationsByCIdNameQuery, zPostConversationsByCIdNameResponse, @@ -62,6 +65,7 @@ import { zPostForgotPasswordResponse, zPostForgotPasswordValidityBody, zPostForgotPasswordValidityResponse, + zPostFormHumanInputByFormTokenBody, zPostFormHumanInputByFormTokenPath, zPostFormHumanInputByFormTokenResponse, zPostFormHumanInputByFormTokenUploadTokenPath, @@ -70,10 +74,13 @@ import { zPostLoginBody, zPostLoginResponse, zPostLogoutResponse, + zPostMessagesByMessageIdFeedbacksBody, zPostMessagesByMessageIdFeedbacksPath, zPostMessagesByMessageIdFeedbacksQuery, zPostMessagesByMessageIdFeedbacksResponse, + zPostRemoteFilesUploadBody, zPostRemoteFilesUploadResponse, + zPostSavedMessagesBody, zPostSavedMessagesQuery, zPostSavedMessagesResponse, zPostTextToAudioBody, @@ -88,16 +95,10 @@ 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({ - 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.', + description: 'Convert audio file to text using speech-to-text service.', inputStructure: 'detailed', method: 'POST', operationId: 'postAudioToText', @@ -136,16 +137,10 @@ 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({ - 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.', + description: 'Create a chat message for conversational applications.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessages', @@ -185,16 +180,10 @@ 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({ - 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.', + description: 'Create a completion message for text generation applications.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessages', @@ -211,16 +200,10 @@ 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({ - 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.', + description: 'Rename a specific conversation with a custom name or auto-generate one.', inputStructure: 'detailed', method: 'POST', operationId: 'postConversationsByCIdName', @@ -229,6 +212,7 @@ export const post6 = oc }) .input( z.object({ + body: zPostConversationsByCIdNameBody, params: zPostConversationsByCIdNamePath, query: zPostConversationsByCIdNameQuery.optional(), }), @@ -302,16 +286,10 @@ 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({ - 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.', + description: 'Retrieve paginated list of conversations for a chat application.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversations', @@ -476,16 +454,10 @@ export const forgotPassword = { * Issue an upload token for a human input form * * POST /api/form/human_input//upload-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 post13 = oc .route({ - deprecated: true, - description: - 'POST /api/form/human_input//upload-token\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + description: 'POST /api/form/human_input//upload-token', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormTokenUploadToken', @@ -504,16 +476,10 @@ export const uploadToken = { * 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({ - 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.', + description: 'GET /api/form/human_input/', inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', @@ -536,16 +502,11 @@ 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 post14 = 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}\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'POST /api/form/human_input/\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}', inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', @@ -553,7 +514,12 @@ export const post14 = oc summary: 'Submit human input form by token', tags: ['web'], }) - .input(z.object({ params: zPostFormHumanInputByFormTokenPath })) + .input( + z.object({ + body: zPostFormHumanInputByFormTokenBody, + params: zPostFormHumanInputByFormTokenPath, + }), + ) .output(zPostFormHumanInputByFormTokenResponse) export const byFormToken = { @@ -605,6 +571,7 @@ export const get3 = oc path: '/login/status', tags: ['web'], }) + .input(z.object({ query: zGetLoginStatusQuery.optional() })) .output(zGetLoginStatusResponse) export const status = { @@ -654,16 +621,10 @@ 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 post18 = oc .route({ - 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.', + description: 'Submit feedback (like/dislike) for a specific message.', inputStructure: 'detailed', method: 'POST', operationId: 'postMessagesByMessageIdFeedbacks', @@ -672,6 +633,7 @@ export const post18 = oc }) .input( z.object({ + body: zPostMessagesByMessageIdFeedbacksBody, params: zPostMessagesByMessageIdFeedbacksPath, query: zPostMessagesByMessageIdFeedbacksQuery.optional(), }), @@ -684,16 +646,10 @@ 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({ - 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.', + description: 'Generate a new completion similar to an existing message (completion apps only).', inputStructure: 'detailed', method: 'GET', operationId: 'getMessagesByMessageIdMoreLikeThis', @@ -739,16 +695,10 @@ 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({ - 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.', + description: 'Retrieve paginated list of messages from a conversation in a chat application.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessages', @@ -767,16 +717,10 @@ 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({ - 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.', + description: 'Retrieve the metadata for a specific app.', inputStructure: 'detailed', method: 'GET', operationId: 'getMeta', @@ -794,16 +738,10 @@ 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({ - 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.', + description: 'Retrieve the parameters for a specific app.', inputStructure: 'detailed', method: 'GET', operationId: 'getParameters', @@ -819,22 +757,17 @@ 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({ - 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.', + description: 'Get authentication passport for web application access', inputStructure: 'detailed', method: 'GET', operationId: 'getPassport', path: '/passport', tags: ['web'], }) + .input(z.object({ query: zGetPassportQuery.optional() })) .output(zGetPassportResponse) export const passport = { @@ -863,16 +796,11 @@ export const passport = { * RemoteFileUploadError: Failed to fetch file from remote URL * FileTooLargeError: File exceeds size limit * UnsupportedFileTypeError: File type not supported - * - * Generated 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: - 'Upload a file from a remote URL\nDownloads a file from the provided remote URL and uploads it\nto the platform storage for use in web applications.\n\nArgs:\n app_model: The associated application model\n end_user: The end user making the request\n\nJSON Parameters:\n url: The remote URL to download the file from (required)\n\nReturns:\n dict: File information including ID, signed URL, and metadata\n int: HTTP status code 201 for success\n\nRaises:\n RemoteFileUploadError: Failed to fetch file from remote URL\n FileTooLargeError: File exceeds size limit\n UnsupportedFileTypeError: File type not supported\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.', + 'Upload a file from a remote URL\nDownloads a file from the provided remote URL and uploads it\nto the platform storage for use in web applications.\n\nArgs:\n app_model: The associated application model\n end_user: The end user making the request\n\nJSON Parameters:\n url: The remote URL to download the file from (required)\n\nReturns:\n dict: File information including ID, signed URL, and metadata\n int: HTTP status code 201 for success\n\nRaises:\n RemoteFileUploadError: Failed to fetch file from remote URL\n FileTooLargeError: File exceeds size limit\n UnsupportedFileTypeError: File type not supported', inputStructure: 'detailed', method: 'POST', operationId: 'postRemoteFilesUpload', @@ -881,6 +809,7 @@ export const post19 = oc summary: 'Upload a file from a remote URL', tags: ['web'], }) + .input(z.object({ body: zPostRemoteFilesUploadBody })) .output(zPostRemoteFilesUploadResponse) export const upload2 = { @@ -950,16 +879,10 @@ 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({ - 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.', + description: 'Retrieve paginated list of saved messages for a completion application.', inputStructure: 'detailed', method: 'GET', operationId: 'getSavedMessages', @@ -971,23 +894,17 @@ 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 post20 = oc .route({ - 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.', + description: 'Save a specific message for later reference.', inputStructure: 'detailed', method: 'POST', operationId: 'postSavedMessages', path: '/saved-messages', tags: ['web'], }) - .input(z.object({ query: zPostSavedMessagesQuery })) + .input(z.object({ body: zPostSavedMessagesBody, query: zPostSavedMessagesQuery })) .output(zPostSavedMessagesResponse) export const savedMessages = { @@ -1000,16 +917,10 @@ 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({ - 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.', + description: 'Retrieve app site information and configuration.', inputStructure: 'detailed', method: 'GET', operationId: 'getSite', @@ -1064,16 +975,10 @@ 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 post21 = oc .route({ - 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.', + description: 'Convert text to audio using text-to-speech service.', inputStructure: 'detailed', method: 'POST', operationId: 'postTextToAudio', @@ -1137,16 +1042,10 @@ 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({ - 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.', + description: 'GET /api/workflow//events\n\nReturns Server-Sent Events stream.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByTaskIdEvents', @@ -1173,16 +1072,10 @@ 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 post22 = oc .route({ - 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.', + description: 'Execute a workflow with provided inputs and files.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsRun', diff --git a/packages/contracts/generated/api/web/types.gen.ts b/packages/contracts/generated/api/web/types.gen.ts index 39c3270219..9d16cb9952 100644 --- a/packages/contracts/generated/api/web/types.gen.ts +++ b/packages/contracts/generated/api/web/types.gen.ts @@ -17,11 +17,82 @@ export type AccessTokenResultResponse = { result: string } +export type AgentThought = { + chain_id?: string | null + created_at?: number | null + files: Array + id: string + message_id: string + observation?: string | null + position: number + thought?: string | null + tool?: string | null + tool_input?: string | null + tool_labels: JsonValue +} + export type AppAccessModeQuery = { appCode?: string | null appId?: string | null } +export type AppMetaResponse = { + tool_icons?: { + [key: string]: unknown + } +} + +export type AppPermissionQuery = { + appId: string +} + +export type AppSiteInfoResponse = { + app_id: string + can_replace_logo: boolean + custom_config?: { + [key: string]: unknown + } | null + enable_site: boolean + end_user_id?: string | null + model_config?: AppSiteModelConfigResponse | null + plan?: string | null + site: AppSiteResponse +} + +export type AppSiteModelConfigResponse = { + model: unknown + more_like_this: unknown + opening_statement?: string | null + pre_prompt?: string | null + suggested_questions: unknown + suggested_questions_after_answer: unknown + user_input_form: unknown +} + +export type AppSiteResponse = { + chat_color_theme?: string | null + chat_color_theme_inverted?: boolean | null + copyright?: string | null + custom_disclaimer?: string | null + default_language?: string | null + description?: string | null + icon?: string | null + icon_background?: string | null + icon_type?: string | null + icon_url?: string | null + privacy_policy?: string | null + prompt_public?: boolean | null + show_workflow_steps?: boolean | null + title?: string | null + use_icon_as_answer_icon?: boolean | null +} + +export type AudioBinaryResponse = Blob | File + +export type AudioTranscriptResponse = { + text: string +} + export type BooleanResultResponse = { result: boolean } @@ -34,6 +105,8 @@ export type BrandingModel = { workspace_logo: string } +export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary' + export type ChatMessagePayload = { conversation_id?: string | null files?: Array<{ @@ -60,6 +133,12 @@ export type CompletionMessagePayload = { retriever_from?: string } +export type ConversationInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + export type ConversationListQuery = { last_id?: string | null limit?: number @@ -83,6 +162,27 @@ export type EmailCodeLoginVerifyPayload = { token: string } +export type EventStreamResponse = string + +export type ExecutionContentType = 'human_input' + +export type FileInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + output_variable_name: string + type?: 'file' +} + +export type FileListInputConfig = { + allowed_file_extensions?: Array + allowed_file_types?: Array + allowed_file_upload_methods?: Array + number_limits?: number + output_variable_name: string + type?: 'file-list' +} + export type FileResponse = { conversation_id?: string | null created_at?: number | null @@ -101,6 +201,10 @@ export type FileResponse = { user_id?: string | null } +export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file' + +export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video' + export type FileWithSignedUrl = { created_at: number | null created_by: string | null @@ -129,15 +233,108 @@ export type ForgotPasswordSendPayload = { language?: string | null } +export type FormInputConfig + = | ({ + type: 'paragraph' + } & ParagraphInputConfig) + | ({ + type: 'select' + } & SelectInputConfig) + | ({ + type: 'file' + } & FileInputConfig) + | ({ + type: 'file-list' + } & FileListInputConfig) + +export type GeneratedAppResponse = JsonValue + +export type HumanInputContent = { + form_definition?: HumanInputFormDefinition | null + form_submission_data?: HumanInputFormSubmissionData | null + submitted: boolean + type?: ExecutionContentType + workflow_run_id: string +} + export type HumanInputFileUploadFormPayload = { url?: string | null } +export type HumanInputFormDefinition = { + actions?: Array + display_in_ui?: boolean + expiration_time: number + form_content: string + form_id: string + form_token?: string | null + inputs?: Array + node_id: string + node_title: string + resolved_default_values?: { + [key: string]: unknown + } +} + +export type HumanInputFormDefinitionResponse = { + expiration_time: number + form_content: unknown + inputs: unknown + resolved_default_values: { + [key: string]: string + } + site?: { + [key: string]: unknown + } | null + user_actions: unknown +} + +export type HumanInputFormSubmissionData = { + action_id: string + action_text: string + node_id: string + node_title: string + rendered_content: string + submitted_data?: { + [key: string]: JsonValue2 + } | null +} + +export type HumanInputFormSubmitPayload = { + action: string + inputs: { + [key: string]: JsonValue2 + } +} + +export type HumanInputFormSubmitResponse = { + [key: string]: never +} + export type HumanInputUploadTokenResponse = { expires_at: number upload_token: string } +export type JsonObject = { + [key: string]: unknown +} + +export type JsonValue + = | string + | number + | number + | boolean + | { + [key: string]: unknown + } + | Array + | null + +export type JsonValueType = unknown + +export type JsonValue2 = unknown + export type LicenseLimitationModel = { enabled: boolean limit: number @@ -157,6 +354,11 @@ export type LoginPayload = { password: string } +export type LoginStatusQuery = { + app_code?: string | null + user_id?: string | null +} + export type LoginStatusResponse = { app_logged_in: boolean logged_in: boolean @@ -167,6 +369,18 @@ export type MessageFeedbackPayload = { rating?: 'dislike' | 'like' | null } +export type MessageFile = { + belongs_to?: string | null + filename: string + id: string + mime_type?: string | null + size?: number | null + transfer_method: string + type: string + upload_file_id?: string | null + url?: string | null +} + export type MessageListQuery = { conversation_id: string first_id?: string | null @@ -177,6 +391,31 @@ export type MessageMoreLikeThisQuery = { response_mode: 'blocking' | 'streaming' } +export type ParagraphInputConfig = { + default?: StringSource | null + output_variable_name: string + type?: 'paragraph' +} + +export type Parameters = { + annotation_reply: JsonObject + file_upload: JsonObject + more_like_this: JsonObject + opening_statement?: string | null + retriever_resource: JsonObject + sensitive_word_avoidance: JsonObject + speech_to_text: JsonObject + suggested_questions: Array + suggested_questions_after_answer: JsonObject + system_parameters: SystemParameters + text_to_speech: JsonObject + user_input_form: Array +} + +export type PassportQuery = { + user_id?: string | null +} + export type PluginInstallationPermissionModel = { plugin_installation_scope: PluginInstallationScope restrict_to_marketplace_only: boolean @@ -205,15 +444,75 @@ export type ResultResponse = { result: string } +export type RetrieverResource = { + content?: string | null + created_at?: number | null + data_source_type?: string | null + dataset_id?: string | null + dataset_name?: string | null + document_id?: string | null + document_name?: string | null + hit_count?: number | null + id?: string + index_node_hash?: string | null + message_id?: string + position: number + score?: number | null + segment_id?: string | null + segment_position?: number | null + summary?: string | null + word_count?: number | null +} + export type SavedMessageCreatePayload = { message_id: string } +export type SavedMessageInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + +export type SavedMessageItem = { + answer: string + created_at?: number | null + feedback?: SimpleFeedback | null + id: string + inputs: { + [key: string]: JsonValueType + } + message_files: Array + query: string +} + export type SavedMessageListQuery = { last_id?: string | null limit?: number } +export type SelectInputConfig = { + option_source: StringListSource + output_variable_name: string + type?: 'select' +} + +export type SimpleConversation = { + created_at?: number | null + id: string + inputs: { + [key: string]: JsonValue + } + introduction?: string | null + name: string + status: string + updated_at?: number | null +} + +export type SimpleFeedback = { + rating?: string | null +} + export type SimpleResultDataResponse = { data: string result: string @@ -223,6 +522,18 @@ export type SimpleResultResponse = { result: string } +export type StringListSource = { + selector?: Array + type: ValueSourceType + value?: Array +} + +export type StringSource = { + selector?: Array + type: ValueSourceType + value?: string +} + export type SuggestedQuestionsResponse = { data: Array } @@ -250,6 +561,14 @@ export type SystemFeatureModel = { webapp_auth: WebAppAuthModel } +export type SystemParameters = { + audio_file_size_limit: number + file_size_limit: number + image_file_size_limit: number + video_file_size_limit: number + workflow_file_upload_limit: number +} + export type TextToAudioPayload = { message_id?: string | null streaming?: boolean | null @@ -257,6 +576,14 @@ export type TextToAudioPayload = { voice?: string | null } +export type UserActionConfig = { + button_style?: ButtonStyle + id: string + title: string +} + +export type ValueSourceType = 'constant' | 'variable' + export type VerificationTokenResponse = { email: string is_valid: boolean @@ -275,6 +602,32 @@ export type WebAppAuthSsoModel = { protocol: string } +export type WebMessageInfiniteScrollPagination = { + data: Array + has_more: boolean + limit: number +} + +export type WebMessageListItem = { + agent_thoughts: Array + answer: string + conversation_id: string + created_at?: number | null + error?: string | null + extra_contents: Array + feedback?: SimpleFeedback | null + id: string + inputs: { + [key: string]: JsonValueType + } + message_files: Array + metadata?: JsonValueType | null + parent_message_id?: string | null + query: string + retriever_resources: Array + status: string +} + export type WorkflowRunPayload = { files?: Array<{ [key: string]: unknown @@ -292,32 +645,16 @@ export type PostAudioToTextData = { } export type PostAudioToTextErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 413: unknown + 415: unknown + 500: unknown } -export type PostAudioToTextError = PostAudioToTextErrors[keyof PostAudioToTextErrors] - export type PostAudioToTextResponses = { - 200: { - [key: string]: unknown - } + 200: AudioTranscriptResponse } export type PostAudioToTextResponse = PostAudioToTextResponses[keyof PostAudioToTextResponses] @@ -330,29 +667,15 @@ export type PostChatMessagesData = { } export type PostChatMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostChatMessagesError = PostChatMessagesErrors[keyof PostChatMessagesErrors] - export type PostChatMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostChatMessagesResponse = PostChatMessagesResponses[keyof PostChatMessagesResponses] @@ -367,26 +690,13 @@ export type PostChatMessagesByTaskIdStopData = { } export type PostChatMessagesByTaskIdStopErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostChatMessagesByTaskIdStopError - = PostChatMessagesByTaskIdStopErrors[keyof PostChatMessagesByTaskIdStopErrors] - export type PostChatMessagesByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -402,30 +712,15 @@ export type PostCompletionMessagesData = { } export type PostCompletionMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostCompletionMessagesError - = PostCompletionMessagesErrors[keyof PostCompletionMessagesErrors] - export type PostCompletionMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostCompletionMessagesResponse @@ -441,26 +736,13 @@ export type PostCompletionMessagesByTaskIdStopData = { } export type PostCompletionMessagesByTaskIdStopErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostCompletionMessagesByTaskIdStopError - = PostCompletionMessagesByTaskIdStopErrors[keyof PostCompletionMessagesByTaskIdStopErrors] - export type PostCompletionMessagesByTaskIdStopResponses = { 200: SimpleResultResponse } @@ -474,36 +756,22 @@ export type GetConversationsData = { query?: { last_id?: string limit?: number - pinned?: 'false' | 'true' + pinned?: boolean sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at' } url: '/conversations' } export type GetConversationsErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetConversationsError = GetConversationsErrors[keyof GetConversationsErrors] - export type GetConversationsResponses = { - 200: { - [key: string]: unknown - } + 200: ConversationInfiniteScrollPagination } export type GetConversationsResponse = GetConversationsResponses[keyof GetConversationsResponses] @@ -518,26 +786,13 @@ export type DeleteConversationsByCIdData = { } export type DeleteConversationsByCIdErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type DeleteConversationsByCIdError - = DeleteConversationsByCIdErrors[keyof DeleteConversationsByCIdErrors] - export type DeleteConversationsByCIdResponses = { 204: void } @@ -546,7 +801,7 @@ export type DeleteConversationsByCIdResponse = DeleteConversationsByCIdResponses[keyof DeleteConversationsByCIdResponses] export type PostConversationsByCIdNameData = { - body?: never + body: ConversationRenamePayload path: { c_id: string } @@ -558,30 +813,15 @@ export type PostConversationsByCIdNameData = { } export type PostConversationsByCIdNameErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostConversationsByCIdNameError - = PostConversationsByCIdNameErrors[keyof PostConversationsByCIdNameErrors] - export type PostConversationsByCIdNameResponses = { - 200: { - [key: string]: unknown - } + 200: SimpleConversation } export type PostConversationsByCIdNameResponse @@ -597,26 +837,13 @@ export type PatchConversationsByCIdPinData = { } export type PatchConversationsByCIdPinErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PatchConversationsByCIdPinError - = PatchConversationsByCIdPinErrors[keyof PatchConversationsByCIdPinErrors] - export type PatchConversationsByCIdPinResponses = { 200: ResultResponse } @@ -634,26 +861,13 @@ export type PatchConversationsByCIdUnpinData = { } export type PatchConversationsByCIdUnpinErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PatchConversationsByCIdUnpinError - = PatchConversationsByCIdUnpinErrors[keyof PatchConversationsByCIdUnpinErrors] - export type PatchConversationsByCIdUnpinResponses = { 200: ResultResponse } @@ -669,16 +883,10 @@ export type PostEmailCodeLoginData = { } export type PostEmailCodeLoginErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 404: unknown } -export type PostEmailCodeLoginError = PostEmailCodeLoginErrors[keyof PostEmailCodeLoginErrors] - export type PostEmailCodeLoginResponses = { 200: SimpleResultDataResponse } @@ -694,20 +902,11 @@ export type PostEmailCodeLoginValidityData = { } export type PostEmailCodeLoginValidityErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown } -export type PostEmailCodeLoginValidityError - = PostEmailCodeLoginValidityErrors[keyof PostEmailCodeLoginValidityErrors] - export type PostEmailCodeLoginValidityResponses = { 200: AccessTokenResultResponse } @@ -723,19 +922,11 @@ export type PostFilesUploadData = { } export type PostFilesUploadErrors = { - 400: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } + 400: unknown + 413: unknown + 415: unknown } -export type PostFilesUploadError = PostFilesUploadErrors[keyof PostFilesUploadErrors] - export type PostFilesUploadResponses = { 201: FileResponse } @@ -750,19 +941,11 @@ export type PostForgotPasswordData = { } export type PostForgotPasswordErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 429: { - [key: string]: unknown - } + 400: unknown + 404: unknown + 429: unknown } -export type PostForgotPasswordError = PostForgotPasswordErrors[keyof PostForgotPasswordErrors] - export type PostForgotPasswordResponses = { 200: SimpleResultDataResponse } @@ -778,20 +961,11 @@ export type PostForgotPasswordResetsData = { } export type PostForgotPasswordResetsErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 404: unknown } -export type PostForgotPasswordResetsError - = PostForgotPasswordResetsErrors[keyof PostForgotPasswordResetsErrors] - export type PostForgotPasswordResetsResponses = { 200: SimpleResultResponse } @@ -807,17 +981,10 @@ export type PostForgotPasswordValidityData = { } export type PostForgotPasswordValidityErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } + 400: unknown + 401: unknown } -export type PostForgotPasswordValidityError - = PostForgotPasswordValidityErrors[keyof PostForgotPasswordValidityErrors] - export type PostForgotPasswordValidityResponses = { 200: VerificationTokenResponse } @@ -835,16 +1002,14 @@ export type GetFormHumanInputByFormTokenData = { } export type GetFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormDefinitionResponse } export type GetFormHumanInputByFormTokenResponse = GetFormHumanInputByFormTokenResponses[keyof GetFormHumanInputByFormTokenResponses] export type PostFormHumanInputByFormTokenData = { - body?: never + body: HumanInputFormSubmitPayload path: { form_token: string } @@ -853,9 +1018,7 @@ export type PostFormHumanInputByFormTokenData = { } export type PostFormHumanInputByFormTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputFormSubmitResponse } export type PostFormHumanInputByFormTokenResponse @@ -871,9 +1034,7 @@ export type PostFormHumanInputByFormTokenUploadTokenData = { } export type PostFormHumanInputByFormTokenUploadTokenResponses = { - 200: { - [key: string]: unknown - } + 200: HumanInputUploadTokenResponse } export type PostFormHumanInputByFormTokenUploadTokenResponse @@ -901,22 +1062,12 @@ export type PostLoginData = { } export type PostLoginErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown } -export type PostLoginError = PostLoginErrors[keyof PostLoginErrors] - export type PostLoginResponses = { 200: AccessTokenResultResponse } @@ -926,18 +1077,17 @@ export type PostLoginResponse = PostLoginResponses[keyof PostLoginResponses] export type GetLoginStatusData = { body?: never path?: never - query?: never + query?: { + app_code?: string + user_id?: string + } url: '/login/status' } export type GetLoginStatusErrors = { - 401: { - [key: string]: unknown - } + 401: unknown } -export type GetLoginStatusError = GetLoginStatusErrors[keyof GetLoginStatusErrors] - export type GetLoginStatusResponses = { 200: LoginStatusResponse } @@ -969,35 +1119,21 @@ export type GetMessagesData = { } export type GetMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetMessagesError = GetMessagesErrors[keyof GetMessagesErrors] - export type GetMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: WebMessageInfiniteScrollPagination } export type GetMessagesResponse = GetMessagesResponses[keyof GetMessagesResponses] export type PostMessagesByMessageIdFeedbacksData = { - body?: never + body: MessageFeedbackPayload path: { message_id: string } @@ -1009,26 +1145,13 @@ export type PostMessagesByMessageIdFeedbacksData = { } export type PostMessagesByMessageIdFeedbacksErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostMessagesByMessageIdFeedbacksError - = PostMessagesByMessageIdFeedbacksErrors[keyof PostMessagesByMessageIdFeedbacksErrors] - export type PostMessagesByMessageIdFeedbacksResponses = { 200: ResultResponse } @@ -1048,30 +1171,15 @@ export type GetMessagesByMessageIdMoreLikeThisData = { } export type GetMessagesByMessageIdMoreLikeThisErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetMessagesByMessageIdMoreLikeThisError - = GetMessagesByMessageIdMoreLikeThisErrors[keyof GetMessagesByMessageIdMoreLikeThisErrors] - export type GetMessagesByMessageIdMoreLikeThisResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type GetMessagesByMessageIdMoreLikeThisResponse @@ -1087,26 +1195,13 @@ export type GetMessagesByMessageIdSuggestedQuestionsData = { } export type GetMessagesByMessageIdSuggestedQuestionsErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetMessagesByMessageIdSuggestedQuestionsError - = GetMessagesByMessageIdSuggestedQuestionsErrors[keyof GetMessagesByMessageIdSuggestedQuestionsErrors] - export type GetMessagesByMessageIdSuggestedQuestionsResponses = { 200: SuggestedQuestionsResponse } @@ -1122,29 +1217,15 @@ export type GetMetaData = { } export type GetMetaErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetMetaError = GetMetaErrors[keyof GetMetaErrors] - export type GetMetaResponses = { - 200: { - [key: string]: unknown - } + 200: AppMetaResponse } export type GetMetaResponse = GetMetaResponses[keyof GetMetaResponses] @@ -1157,29 +1238,15 @@ export type GetParametersData = { } export type GetParametersErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetParametersError = GetParametersErrors[keyof GetParametersErrors] - export type GetParametersResponses = { - 200: { - [key: string]: unknown - } + 200: Parameters } export type GetParametersResponse = GetParametersResponses[keyof GetParametersResponses] @@ -1187,54 +1254,37 @@ export type GetParametersResponse = GetParametersResponses[keyof GetParametersRe export type GetPassportData = { body?: never path?: never - query?: never + query?: { + user_id?: string + } url: '/passport' } export type GetPassportErrors = { - 401: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } + 401: unknown + 404: unknown } -export type GetPassportError = GetPassportErrors[keyof GetPassportErrors] - export type GetPassportResponses = { - 200: { - [key: string]: unknown - } + 200: AccessTokenData } export type GetPassportResponse = GetPassportResponses[keyof GetPassportResponses] export type PostRemoteFilesUploadData = { - body?: never + body: RemoteFileUploadPayload path?: never query?: never url: '/remote-files/upload' } export type PostRemoteFilesUploadErrors = { - 400: { - [key: string]: unknown - } - 413: { - [key: string]: unknown - } - 415: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 413: unknown + 415: unknown + 500: unknown } -export type PostRemoteFilesUploadError - = PostRemoteFilesUploadErrors[keyof PostRemoteFilesUploadErrors] - export type PostRemoteFilesUploadResponses = { 201: FileWithSignedUrl } @@ -1252,19 +1302,11 @@ export type GetRemoteFilesByUrlData = { } export type GetRemoteFilesByUrlErrors = { - 400: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 404: unknown + 500: unknown } -export type GetRemoteFilesByUrlError = GetRemoteFilesByUrlErrors[keyof GetRemoteFilesByUrlErrors] - export type GetRemoteFilesByUrlResponses = { 200: RemoteFileInfo } @@ -1283,35 +1325,21 @@ export type GetSavedMessagesData = { } export type GetSavedMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetSavedMessagesError = GetSavedMessagesErrors[keyof GetSavedMessagesErrors] - export type GetSavedMessagesResponses = { - 200: { - [key: string]: unknown - } + 200: SavedMessageInfiniteScrollPagination } export type GetSavedMessagesResponse = GetSavedMessagesResponses[keyof GetSavedMessagesResponses] export type PostSavedMessagesData = { - body?: never + body: SavedMessageCreatePayload path?: never query: { message_id: string @@ -1320,25 +1348,13 @@ export type PostSavedMessagesData = { } export type PostSavedMessagesErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostSavedMessagesError = PostSavedMessagesErrors[keyof PostSavedMessagesErrors] - export type PostSavedMessagesResponses = { 200: ResultResponse } @@ -1355,26 +1371,13 @@ export type DeleteSavedMessagesByMessageIdData = { } export type DeleteSavedMessagesByMessageIdErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type DeleteSavedMessagesByMessageIdError - = DeleteSavedMessagesByMessageIdErrors[keyof DeleteSavedMessagesByMessageIdErrors] - export type DeleteSavedMessagesByMessageIdResponses = { 204: void } @@ -1390,29 +1393,15 @@ export type GetSiteData = { } export type GetSiteErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type GetSiteError = GetSiteErrors[keyof GetSiteErrors] - export type GetSiteResponses = { - 200: { - [key: string]: unknown - } + 200: AppSiteInfoResponse } export type GetSiteResponse = GetSiteResponses[keyof GetSiteResponses] @@ -1425,13 +1414,9 @@ export type GetSystemFeaturesData = { } export type GetSystemFeaturesErrors = { - 500: { - [key: string]: unknown - } + 500: unknown } -export type GetSystemFeaturesError = GetSystemFeaturesErrors[keyof GetSystemFeaturesErrors] - export type GetSystemFeaturesResponses = { 200: SystemFeatureModel } @@ -1446,26 +1431,14 @@ export type PostTextToAudioData = { } export type PostTextToAudioErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 500: unknown } -export type PostTextToAudioError = PostTextToAudioErrors[keyof PostTextToAudioErrors] - export type PostTextToAudioResponses = { - 200: { - [key: string]: unknown - } + 200: AudioBinaryResponse } export type PostTextToAudioResponse = PostTextToAudioResponses[keyof PostTextToAudioResponses] @@ -1481,16 +1454,10 @@ export type GetWebappAccessModeData = { } export type GetWebappAccessModeErrors = { - 400: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 500: unknown } -export type GetWebappAccessModeError = GetWebappAccessModeErrors[keyof GetWebappAccessModeErrors] - export type GetWebappAccessModeResponses = { 200: AccessModeResponse } @@ -1508,19 +1475,11 @@ export type GetWebappPermissionData = { } export type GetWebappPermissionErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 500: unknown } -export type GetWebappPermissionError = GetWebappPermissionErrors[keyof GetWebappPermissionErrors] - export type GetWebappPermissionResponses = { 200: BooleanResultResponse } @@ -1538,9 +1497,7 @@ export type GetWorkflowByTaskIdEventsData = { } export type GetWorkflowByTaskIdEventsResponses = { - 200: { - [key: string]: unknown - } + 200: EventStreamResponse } export type GetWorkflowByTaskIdEventsResponse @@ -1554,29 +1511,15 @@ export type PostWorkflowsRunData = { } export type PostWorkflowsRunErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostWorkflowsRunError = PostWorkflowsRunErrors[keyof PostWorkflowsRunErrors] - export type PostWorkflowsRunResponses = { - 200: { - [key: string]: unknown - } + 200: GeneratedAppResponse } export type PostWorkflowsRunResponse = PostWorkflowsRunResponses[keyof PostWorkflowsRunResponses] @@ -1591,26 +1534,13 @@ export type PostWorkflowsTasksByTaskIdStopData = { } export type PostWorkflowsTasksByTaskIdStopErrors = { - 400: { - [key: string]: unknown - } - 401: { - [key: string]: unknown - } - 403: { - [key: string]: unknown - } - 404: { - [key: string]: unknown - } - 500: { - [key: string]: unknown - } + 400: unknown + 401: unknown + 403: unknown + 404: unknown + 500: unknown } -export type PostWorkflowsTasksByTaskIdStopError - = PostWorkflowsTasksByTaskIdStopErrors[keyof PostWorkflowsTasksByTaskIdStopErrors] - export type PostWorkflowsTasksByTaskIdStopResponses = { 200: SimpleResultResponse } diff --git a/packages/contracts/generated/api/web/zod.gen.ts b/packages/contracts/generated/api/web/zod.gen.ts index 777237f5f5..cb731344ab 100644 --- a/packages/contracts/generated/api/web/zod.gen.ts +++ b/packages/contracts/generated/api/web/zod.gen.ts @@ -32,6 +32,80 @@ export const zAppAccessModeQuery = z.object({ appId: z.string().nullish(), }) +/** + * AppMetaResponse + */ +export const zAppMetaResponse = z.object({ + tool_icons: z.record(z.string(), z.unknown()).optional(), +}) + +/** + * AppPermissionQuery + */ +export const zAppPermissionQuery = z.object({ + appId: z.string(), +}) + +/** + * AppSiteModelConfigResponse + */ +export const zAppSiteModelConfigResponse = z.object({ + model: z.unknown(), + more_like_this: z.unknown(), + opening_statement: z.string().nullish(), + pre_prompt: z.string().nullish(), + suggested_questions: z.unknown(), + suggested_questions_after_answer: z.unknown(), + user_input_form: z.unknown(), +}) + +/** + * AppSiteResponse + */ +export const zAppSiteResponse = z.object({ + chat_color_theme: z.string().nullish(), + chat_color_theme_inverted: z.boolean().nullish(), + copyright: z.string().nullish(), + custom_disclaimer: z.string().nullish(), + default_language: z.string().nullish(), + description: z.string().nullish(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + icon_type: z.string().nullish(), + icon_url: z.string().nullish(), + privacy_policy: z.string().nullish(), + prompt_public: z.boolean().nullish(), + show_workflow_steps: z.boolean().nullish(), + title: z.string().nullish(), + use_icon_as_answer_icon: z.boolean().nullish(), +}) + +/** + * AppSiteInfoResponse + */ +export const zAppSiteInfoResponse = z.object({ + app_id: z.string(), + can_replace_logo: z.boolean(), + custom_config: z.record(z.string(), z.unknown()).nullish(), + enable_site: z.boolean(), + end_user_id: z.string().nullish(), + model_config: zAppSiteModelConfigResponse.nullish(), + plan: z.string().nullish(), + site: zAppSiteResponse, +}) + +/** + * AudioBinaryResponse + */ +export const zAudioBinaryResponse = z.custom() + +/** + * AudioTranscriptResponse + */ +export const zAudioTranscriptResponse = z.object({ + text: z.string(), +}) + /** * BooleanResultResponse */ @@ -50,6 +124,13 @@ export const zBrandingModel = z.object({ workspace_logo: z.string().default(''), }) +/** + * ButtonStyle + * + * Button styles for user actions. + */ +export const zButtonStyle = z.enum(['accent', 'default', 'ghost', 'primary']) + /** * ChatMessagePayload */ @@ -112,6 +193,16 @@ export const zEmailCodeLoginVerifyPayload = z.object({ token: z.string().min(1), }) +/** + * EventStreamResponse + */ +export const zEventStreamResponse = z.string() + +/** + * ExecutionContentType + */ +export const zExecutionContentType = z.enum(['human_input']) + /** * FileResponse */ @@ -133,6 +224,44 @@ export const zFileResponse = z.object({ user_id: z.string().nullish(), }) +/** + * FileTransferMethod + */ +export const zFileTransferMethod = z.enum([ + 'datasource_file', + 'local_file', + 'remote_url', + 'tool_file', +]) + +/** + * FileType + */ +export const zFileType = z.enum(['audio', 'custom', 'document', 'image', 'video']) + +/** + * FileInputConfig + */ +export const zFileInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + output_variable_name: z.string(), + type: z.literal('file').optional().default('file'), +}) + +/** + * FileListInputConfig + */ +export const zFileListInputConfig = z.object({ + allowed_file_extensions: z.array(z.string()).optional(), + allowed_file_types: z.array(zFileType).optional(), + allowed_file_upload_methods: z.array(zFileTransferMethod).optional(), + number_limits: z.int().gte(0).optional().default(0), + output_variable_name: z.string(), + type: z.literal('file-list').optional().default('file-list'), +}) + /** * FileWithSignedUrl */ @@ -182,6 +311,23 @@ export const zHumanInputFileUploadFormPayload = z.object({ url: z.url().min(1).max(2083).nullish(), }) +/** + * HumanInputFormDefinitionResponse + */ +export const zHumanInputFormDefinitionResponse = z.object({ + expiration_time: z.int(), + form_content: z.unknown(), + inputs: z.unknown(), + resolved_default_values: z.record(z.string(), z.string()), + site: z.record(z.string(), z.unknown()).nullish(), + user_actions: z.unknown(), +}) + +/** + * HumanInputFormSubmitResponse + */ +export const zHumanInputFormSubmitResponse = z.record(z.string(), z.never()) + /** * HumanInputUploadTokenResponse */ @@ -190,6 +336,65 @@ export const zHumanInputUploadTokenResponse = z.object({ upload_token: z.string(), }) +export const zJsonObject = z.record(z.string(), z.unknown()) + +export const zJsonValue = z + .union([ + z.string(), + z.int(), + z.number(), + z.boolean(), + z.record(z.string(), z.unknown()), + z.array(z.unknown()), + ]) + .nullable() + +/** + * AgentThought + */ +export const zAgentThought = z.object({ + chain_id: z.string().nullish(), + created_at: z.int().nullish(), + files: z.array(z.string()), + id: z.string(), + message_id: z.string(), + observation: z.string().nullish(), + position: z.int(), + thought: z.string().nullish(), + tool: z.string().nullish(), + tool_input: z.string().nullish(), + tool_labels: zJsonValue, +}) + +/** + * GeneratedAppResponse + */ +export const zGeneratedAppResponse = zJsonValue + +export const zJsonValueType = z.unknown() + +export const zJsonValue2 = z.unknown() + +/** + * HumanInputFormSubmissionData + */ +export const zHumanInputFormSubmissionData = z.object({ + action_id: z.string(), + action_text: z.string(), + node_id: z.string(), + node_title: z.string(), + rendered_content: z.string(), + submitted_data: z.record(z.string(), zJsonValue2).nullish(), +}) + +/** + * HumanInputFormSubmitPayload + */ +export const zHumanInputFormSubmitPayload = z.object({ + action: z.string(), + inputs: z.record(z.string(), zJsonValue2), +}) + /** * LicenseLimitationModel * @@ -229,6 +434,14 @@ export const zLoginPayload = z.object({ password: z.string(), }) +/** + * LoginStatusQuery + */ +export const zLoginStatusQuery = z.object({ + app_code: z.string().nullish(), + user_id: z.string().nullish(), +}) + /** * LoginStatusResponse */ @@ -245,6 +458,21 @@ export const zMessageFeedbackPayload = z.object({ rating: z.enum(['dislike', 'like']).nullish(), }) +/** + * MessageFile + */ +export const zMessageFile = z.object({ + belongs_to: z.string().nullish(), + filename: z.string(), + id: z.string(), + mime_type: z.string().nullish(), + size: z.int().nullish(), + transfer_method: z.string(), + type: z.string(), + upload_file_id: z.string().nullish(), + url: z.string().nullish(), +}) + /** * MessageListQuery */ @@ -261,6 +489,13 @@ export const zMessageMoreLikeThisQuery = z.object({ response_mode: z.enum(['blocking', 'streaming']), }) +/** + * PassportQuery + */ +export const zPassportQuery = z.object({ + user_id: z.string().nullish(), +}) + /** * PluginInstallationScope */ @@ -308,6 +543,29 @@ export const zResultResponse = z.object({ result: z.string(), }) +/** + * RetrieverResource + */ +export const zRetrieverResource = z.object({ + content: z.string().nullish(), + created_at: z.int().nullish(), + data_source_type: z.string().nullish(), + dataset_id: z.string().nullish(), + dataset_name: z.string().nullish(), + document_id: z.string().nullish(), + document_name: z.string().nullish(), + hit_count: z.int().nullish(), + id: z.string().optional(), + index_node_hash: z.string().nullish(), + message_id: z.string().optional(), + position: z.int(), + score: z.number().nullish(), + segment_id: z.string().nullish(), + segment_position: z.int().nullish(), + summary: z.string().nullish(), + word_count: z.int().nullish(), +}) + /** * SavedMessageCreatePayload */ @@ -323,6 +581,57 @@ export const zSavedMessageListQuery = z.object({ limit: z.int().gte(1).lte(100).optional().default(20), }) +/** + * SimpleConversation + */ +export const zSimpleConversation = z.object({ + created_at: z.int().nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValue), + introduction: z.string().nullish(), + name: z.string(), + status: z.string(), + updated_at: z.int().nullish(), +}) + +/** + * ConversationInfiniteScrollPagination + */ +export const zConversationInfiniteScrollPagination = z.object({ + data: z.array(zSimpleConversation), + has_more: z.boolean(), + limit: z.int(), +}) + +/** + * SimpleFeedback + */ +export const zSimpleFeedback = z.object({ + rating: z.string().nullish(), +}) + +/** + * SavedMessageItem + */ +export const zSavedMessageItem = z.object({ + answer: z.string(), + created_at: z.int().nullish(), + feedback: zSimpleFeedback.nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValueType), + message_files: z.array(zMessageFile), + query: z.string(), +}) + +/** + * SavedMessageInfiniteScrollPagination + */ +export const zSavedMessageInfiniteScrollPagination = z.object({ + data: z.array(zSavedMessageItem), + has_more: z.boolean(), + limit: z.int(), +}) + /** * SimpleResultDataResponse */ @@ -345,6 +654,35 @@ export const zSuggestedQuestionsResponse = z.object({ data: z.array(z.string()), }) +/** + * SystemParameters + */ +export const zSystemParameters = z.object({ + audio_file_size_limit: z.int(), + file_size_limit: z.int(), + image_file_size_limit: z.int(), + video_file_size_limit: z.int(), + workflow_file_upload_limit: z.int(), +}) + +/** + * Parameters + */ +export const zParameters = z.object({ + annotation_reply: zJsonObject, + file_upload: zJsonObject, + more_like_this: zJsonObject, + opening_statement: z.string().nullish(), + retriever_resource: zJsonObject, + sensitive_word_avoidance: zJsonObject, + speech_to_text: zJsonObject, + suggested_questions: z.array(z.string()), + suggested_questions_after_answer: zJsonObject, + system_parameters: zSystemParameters, + text_to_speech: zJsonObject, + user_input_form: z.array(zJsonObject), +}) + /** * TextToAudioPayload */ @@ -355,6 +693,99 @@ export const zTextToAudioPayload = z.object({ voice: z.string().nullish(), }) +/** + * UserActionConfig + * + * User action configuration. + */ +export const zUserActionConfig = z.object({ + button_style: zButtonStyle.optional().default('default'), + id: z.string().max(20), + title: z.string().max(100), +}) + +/** + * ValueSourceType + * + * ValueSourceType records whether the value comes from a static setting + * in form definiton, or a variable while the workflow is running. + */ +export const zValueSourceType = z.enum(['constant', 'variable']) + +/** + * StringListSource + */ +export const zStringListSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.array(z.string()).optional(), +}) + +/** + * SelectInputConfig + */ +export const zSelectInputConfig = z.object({ + option_source: zStringListSource, + output_variable_name: z.string(), + type: z.literal('select').optional().default('select'), +}) + +/** + * StringSource + * + * Default configuration for form inputs. + */ +export const zStringSource = z.object({ + selector: z.array(z.string()).optional(), + type: zValueSourceType, + value: z.string().optional().default(''), +}) + +/** + * ParagraphInputConfig + * + * Form input definition. + */ +export const zParagraphInputConfig = z.object({ + default: zStringSource.nullish(), + output_variable_name: z.string(), + type: z.literal('paragraph').optional().default('paragraph'), +}) + +export const zFormInputConfig = z.discriminatedUnion('type', [ + zParagraphInputConfig.extend({ type: z.literal('paragraph') }), + zSelectInputConfig.extend({ type: z.literal('select') }), + zFileInputConfig.extend({ type: z.literal('file') }), + zFileListInputConfig.extend({ type: z.literal('file-list') }), +]) + +/** + * HumanInputFormDefinition + */ +export const zHumanInputFormDefinition = z.object({ + actions: z.array(zUserActionConfig).optional(), + display_in_ui: z.boolean().optional().default(false), + expiration_time: z.int(), + form_content: z.string(), + form_id: z.string(), + form_token: z.string().nullish(), + inputs: z.array(zFormInputConfig).optional(), + node_id: z.string(), + node_title: z.string(), + resolved_default_values: z.record(z.string(), z.unknown()).optional(), +}) + +/** + * HumanInputContent + */ +export const zHumanInputContent = z.object({ + form_definition: zHumanInputFormDefinition.nullish(), + form_submission_data: zHumanInputFormSubmissionData.nullish(), + submitted: z.boolean(), + type: zExecutionContentType.optional().default('human_input'), + workflow_run_id: z.string(), +}) + /** * VerificationTokenResponse */ @@ -431,6 +862,36 @@ export const zSystemFeatureModel = z.object({ }), }) +/** + * WebMessageListItem + */ +export const zWebMessageListItem = z.object({ + agent_thoughts: z.array(zAgentThought), + answer: z.string(), + conversation_id: z.string(), + created_at: z.int().nullish(), + error: z.string().nullish(), + extra_contents: z.array(zHumanInputContent), + feedback: zSimpleFeedback.nullish(), + id: z.string(), + inputs: z.record(z.string(), zJsonValueType), + message_files: z.array(zMessageFile), + metadata: zJsonValueType.nullish(), + parent_message_id: z.string().nullish(), + query: z.string(), + retriever_resources: z.array(zRetrieverResource), + status: z.string(), +}) + +/** + * WebMessageInfiniteScrollPagination + */ +export const zWebMessageInfiniteScrollPagination = z.object({ + data: z.array(zWebMessageListItem), + has_more: z.boolean(), + limit: z.int(), +}) + /** * WorkflowRunPayload */ @@ -442,14 +903,14 @@ export const zWorkflowRunPayload = z.object({ /** * Success */ -export const zPostAudioToTextResponse = z.record(z.string(), z.unknown()) +export const zPostAudioToTextResponse = zAudioTranscriptResponse export const zPostChatMessagesBody = zChatMessagePayload /** * Success */ -export const zPostChatMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostChatMessagesResponse = zGeneratedAppResponse export const zPostChatMessagesByTaskIdStopPath = z.object({ task_id: z.string(), @@ -465,7 +926,7 @@ export const zPostCompletionMessagesBody = zCompletionMessagePayload /** * Success */ -export const zPostCompletionMessagesResponse = z.record(z.string(), z.unknown()) +export const zPostCompletionMessagesResponse = zGeneratedAppResponse export const zPostCompletionMessagesByTaskIdStopPath = z.object({ task_id: z.string(), @@ -478,8 +939,8 @@ export const zPostCompletionMessagesByTaskIdStopResponse = zSimpleResultResponse export const zGetConversationsQuery = z.object({ last_id: z.string().optional(), - limit: z.int().optional().default(20), - pinned: z.enum(['false', 'true']).optional(), + limit: z.int().gte(1).lte(100).optional().default(20), + pinned: z.boolean().optional(), sort_by: z .enum(['-created_at', '-updated_at', 'created_at', 'updated_at']) .optional() @@ -489,7 +950,7 @@ export const zGetConversationsQuery = z.object({ /** * Success */ -export const zGetConversationsResponse = z.record(z.string(), z.unknown()) +export const zGetConversationsResponse = zConversationInfiniteScrollPagination export const zDeleteConversationsByCIdPath = z.object({ c_id: z.string(), @@ -500,6 +961,8 @@ export const zDeleteConversationsByCIdPath = z.object({ */ export const zDeleteConversationsByCIdResponse = z.void() +export const zPostConversationsByCIdNameBody = zConversationRenamePayload + export const zPostConversationsByCIdNamePath = z.object({ c_id: z.string(), }) @@ -512,7 +975,7 @@ export const zPostConversationsByCIdNameQuery = z.object({ /** * Conversation renamed successfully */ -export const zPostConversationsByCIdNameResponse = z.record(z.string(), z.unknown()) +export const zPostConversationsByCIdNameResponse = zSimpleConversation export const zPatchConversationsByCIdPinPath = z.object({ c_id: z.string(), @@ -579,7 +1042,9 @@ export const zGetFormHumanInputByFormTokenPath = z.object({ /** * Success */ -export const zGetFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zGetFormHumanInputByFormTokenResponse = zHumanInputFormDefinitionResponse + +export const zPostFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayload export const zPostFormHumanInputByFormTokenPath = z.object({ form_token: z.string(), @@ -588,7 +1053,7 @@ export const zPostFormHumanInputByFormTokenPath = z.object({ /** * Success */ -export const zPostFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown()) +export const zPostFormHumanInputByFormTokenResponse = zHumanInputFormSubmitResponse export const zPostFormHumanInputByFormTokenUploadTokenPath = z.object({ form_token: z.string(), @@ -597,7 +1062,7 @@ export const zPostFormHumanInputByFormTokenUploadTokenPath = z.object({ /** * Success */ -export const zPostFormHumanInputByFormTokenUploadTokenResponse = z.record(z.string(), z.unknown()) +export const zPostFormHumanInputByFormTokenUploadTokenResponse = zHumanInputUploadTokenResponse /** * File uploaded successfully @@ -611,6 +1076,11 @@ export const zPostLoginBody = zLoginPayload */ export const zPostLoginResponse = zAccessTokenResultResponse +export const zGetLoginStatusQuery = z.object({ + app_code: z.string().optional(), + user_id: z.string().optional(), +}) + /** * Login status */ @@ -624,13 +1094,15 @@ export const zPostLogoutResponse = zSimpleResultResponse export const zGetMessagesQuery = z.object({ conversation_id: z.string(), first_id: z.string().optional(), - limit: z.int().optional().default(20), + limit: z.int().gte(1).lte(100).optional().default(20), }) /** * Success */ -export const zGetMessagesResponse = z.record(z.string(), z.unknown()) +export const zGetMessagesResponse = zWebMessageInfiniteScrollPagination + +export const zPostMessagesByMessageIdFeedbacksBody = zMessageFeedbackPayload export const zPostMessagesByMessageIdFeedbacksPath = z.object({ message_id: z.string(), @@ -657,7 +1129,7 @@ export const zGetMessagesByMessageIdMoreLikeThisQuery = z.object({ /** * Success */ -export const zGetMessagesByMessageIdMoreLikeThisResponse = z.record(z.string(), z.unknown()) +export const zGetMessagesByMessageIdMoreLikeThisResponse = zGeneratedAppResponse export const zGetMessagesByMessageIdSuggestedQuestionsPath = z.object({ message_id: z.string(), @@ -671,17 +1143,23 @@ export const zGetMessagesByMessageIdSuggestedQuestionsResponse = zSuggestedQuest /** * Success */ -export const zGetMetaResponse = z.record(z.string(), z.unknown()) +export const zGetMetaResponse = zAppMetaResponse /** * Success */ -export const zGetParametersResponse = z.record(z.string(), z.unknown()) +export const zGetParametersResponse = zParameters + +export const zGetPassportQuery = z.object({ + user_id: z.string().optional(), +}) /** * Passport retrieved successfully */ -export const zGetPassportResponse = z.record(z.string(), z.unknown()) +export const zGetPassportResponse = zAccessTokenData + +export const zPostRemoteFilesUploadBody = zRemoteFileUploadPayload /** * Remote file uploaded successfully @@ -699,13 +1177,15 @@ export const zGetRemoteFilesByUrlResponse = zRemoteFileInfo export const zGetSavedMessagesQuery = z.object({ last_id: z.string().optional(), - limit: z.int().optional().default(20), + limit: z.int().gte(1).lte(100).optional().default(20), }) /** * Success */ -export const zGetSavedMessagesResponse = z.record(z.string(), z.unknown()) +export const zGetSavedMessagesResponse = zSavedMessageInfiniteScrollPagination + +export const zPostSavedMessagesBody = zSavedMessageCreatePayload export const zPostSavedMessagesQuery = z.object({ message_id: z.string(), @@ -728,7 +1208,7 @@ export const zDeleteSavedMessagesByMessageIdResponse = z.void() /** * Success */ -export const zGetSiteResponse = z.record(z.string(), z.unknown()) +export const zGetSiteResponse = zAppSiteInfoResponse /** * System features retrieved successfully @@ -740,7 +1220,7 @@ export const zPostTextToAudioBody = zTextToAudioPayload /** * Success */ -export const zPostTextToAudioResponse = z.record(z.string(), z.unknown()) +export const zPostTextToAudioResponse = zAudioBinaryResponse export const zGetWebappAccessModeQuery = z.object({ appCode: z.string().optional(), @@ -766,16 +1246,16 @@ export const zGetWorkflowByTaskIdEventsPath = z.object({ }) /** - * Success + * SSE event stream */ -export const zGetWorkflowByTaskIdEventsResponse = z.record(z.string(), z.unknown()) +export const zGetWorkflowByTaskIdEventsResponse = zEventStreamResponse export const zPostWorkflowsRunBody = zWorkflowRunPayload /** * Success */ -export const zPostWorkflowsRunResponse = z.record(z.string(), z.unknown()) +export const zPostWorkflowsRunResponse = zGeneratedAppResponse export const zPostWorkflowsTasksByTaskIdStopPath = z.object({ task_id: z.string(), diff --git a/packages/contracts/non-json-openapi-responses.md b/packages/contracts/non-json-openapi-responses.md new file mode 100644 index 0000000000..9499ae8cdf --- /dev/null +++ b/packages/contracts/non-json-openapi-responses.md @@ -0,0 +1,98 @@ +# Non-JSON OpenAPI Responses + +Scope: endpoints emitted by `api/dev/generate_swagger_specs.py` into the generated `console`, `openapi`, `service`, and `web` specs. + +The current Flask-RESTX generator still emits these response entries under `application/json`. The schema model names below record the actual runtime response intent so contract generation does not treat them as missing annotations. + +## Binary And Audio + +| Spec | Method | Path | Runtime response | Schema | +| ------- | ------ | ----------------------------------------------------------------------- | ---------------------------------------------- | --------------------- | +| console | POST | `/apps/{app_id}/text-to-audio` | Audio stream, usually `audio/mpeg` | `AudioBinaryResponse` | +| console | POST | `/installed-apps/{installed_app_id}/text-to-audio` | Audio stream, usually `audio/mpeg` | `AudioBinaryResponse` | +| console | POST | `/trial-apps/{app_id}/text-to-audio` | Audio stream, usually `audio/mpeg` | `AudioBinaryResponse` | +| web | POST | `/text-to-audio` | Audio stream, usually `audio/mpeg` | `AudioBinaryResponse` | +| service | POST | `/text-to-audio` | Audio stream, usually `audio/mpeg` | `AudioBinaryResponse` | +| console | POST | `/datasets/{dataset_id}/documents/download-zip` | `application/zip` attachment | `BinaryFileResponse` | +| service | POST | `/datasets/{dataset_id}/documents/download-zip` | `application/zip` attachment | `BinaryFileResponse` | +| service | GET | `/files/{file_id}/preview` | Original file MIME type, optionally attachment | `BinaryFileResponse` | +| console | GET | `/workspaces/current/plugin/icon` | Plugin asset MIME type | `BinaryFileResponse` | +| console | GET | `/workspaces/current/plugin/asset` | `application/octet-stream` | `BinaryFileResponse` | +| console | GET | `/workspaces/current/tool-provider/builtin/{provider}/icon` | Tool icon MIME type | `BinaryFileResponse` | +| console | GET | `/workspaces/current/trigger-provider/{provider}/icon` | Trigger icon response | `BinaryFileResponse` | +| console | GET | `/workspaces/{tenant_id}/model-providers/{provider}/{icon_type}/{lang}` | Model provider icon MIME type | `BinaryFileResponse` | + +## Text File Exports + +| Spec | Method | Path | Runtime response | Schema | +| ------- | ------ | ------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------ | +| console | GET | `/apps/{app_id}/feedbacks/export` | `text/csv` attachment by default; `format=json` returns JSON attachment | `TextFileResponse` | +| console | GET | `/workspaces/current/customized-snippets/{snippet_id}/export` | `application/x-yaml` attachment | `TextFileResponse` | + +## Fixed SSE Streams + +| Spec | Method | Path | Runtime response | Schema | +| ------- | ------ | ---------------------------------------------------------------------- | ------------------- | --------------------- | +| console | GET | `/workflow/{workflow_run_id}/events` | `text/event-stream` | `EventStreamResponse` | +| console | GET | `/apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/events` | `text/event-stream` | `EventStreamResponse` | +| console | GET | `/apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/events` | `text/event-stream` | `EventStreamResponse` | +| openapi | POST | `/apps/{app_id}/run` | `text/event-stream` | `EventStreamResponse` | +| openapi | GET | `/apps/{app_id}/tasks/{task_id}/events` | `text/event-stream` | `EventStreamResponse` | +| service | GET | `/workflow/{task_id}/events` | `text/event-stream` | `EventStreamResponse` | +| web | GET | `/workflow/{task_id}/events` | `text/event-stream` | `EventStreamResponse` | + +## Generated Responses With Streaming Variants + +These endpoints call `helper.compact_generate_response(...)`. They return JSON in blocking mode and `text/event-stream` in streaming mode. Some console/debug paths always pass `streaming=True`. + +| Spec | Method | Path | Streaming behavior | Schema | +| ------- | ------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------- | +| console | POST | `/apps/{app_id}/completion-messages` | `response_mode=streaming` | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/advanced-chat/workflows/draft/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/advanced-chat/workflows/draft/iteration/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/advanced-chat/workflows/draft/loop/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/workflows/draft/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/workflows/draft/iteration/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/workflows/draft/loop/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/workflows/draft/trigger/run` | Returns waiting JSON until an event arrives; then streams workflow events | `GeneratedAppResponse` | +| console | POST | `/apps/{app_id}/workflows/draft/trigger/run-all` | Returns waiting JSON until an event arrives; then streams workflow events | `GeneratedAppResponse` | +| console | GET | `/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this` | `response_mode=streaming` | `GeneratedAppResponse` | +| console | POST | `/installed-apps/{installed_app_id}/completion-messages` | `response_mode=streaming` | `GeneratedAppResponse` | +| console | POST | `/installed-apps/{installed_app_id}/chat-messages` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/installed-apps/{installed_app_id}/workflows/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/trial-apps/{app_id}/chat-messages` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/trial-apps/{app_id}/completion-messages` | `response_mode=streaming` | `GeneratedAppResponse` | +| console | POST | `/trial-apps/{app_id}/workflows/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/snippets/{snippet_id}/workflows/draft/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/snippets/{snippet_id}/workflows/draft/iteration/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/snippets/{snippet_id}/workflows/draft/loop/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/draft/run` | Always streaming | `RagPipelineOpaqueResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/published/run` | `response_mode=streaming` | `RagPipelineOpaqueResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/draft/iteration/nodes/{node_id}/run` | Always streaming | `RagPipelineOpaqueResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/draft/loop/nodes/{node_id}/run` | Always streaming | `RagPipelineOpaqueResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/draft/datasource/nodes/{node_id}/run` | Always streaming | `RagPipelineOpaqueResponse` | +| console | POST | `/rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/run` | Always streaming | `RagPipelineOpaqueResponse` | +| service | POST | `/completion-messages` | `response_mode=streaming` | `GeneratedAppResponse` | +| service | POST | `/chat-messages` | `response_mode=streaming`; agent apps are streaming-only | `GeneratedAppResponse` | +| service | POST | `/workflows/run` | `response_mode=streaming` | `GeneratedAppResponse` | +| service | POST | `/workflows/{workflow_id}/run` | `response_mode=streaming` | `GeneratedAppResponse` | +| service | POST | `/datasets/{dataset_id}/pipeline/run` | `response_mode=streaming` | `GeneratedAppResponse` | +| service | POST | `/datasets/{dataset_id}/pipeline/datasource/nodes/{node_id}/run` | Always streaming | `GeneratedAppResponse` | +| web | POST | `/completion-messages` | `response_mode=streaming` | `GeneratedAppResponse` | +| web | POST | `/chat-messages` | `response_mode=streaming`; agent apps are streaming-only | `GeneratedAppResponse` | +| web | GET | `/messages/{message_id}/more-like-this` | `response_mode=streaming` | `GeneratedAppResponse` | +| web | POST | `/workflows/run` | Always streaming | `GeneratedAppResponse` | + +## Redirects Not Included In Generated Contracts + +These console endpoints are browser redirect flows with no 2xx success response. They are documented in the backend OpenAPI as `302` responses with `RedirectResponse`, but `openapi-ts.api.config.ts` excludes 3xx-only operations from the oRPC contract input because they are not JSON contract operations. + +| Spec | Method | Path | Runtime response | Schema | +| ------- | ------ | ------------------------------------------------- | ------------------------------------------------- | ------------------ | +| console | GET | `/mcp/oauth/callback` | Redirect to console OAuth result page | `RedirectResponse` | +| console | GET | `/oauth/authorize/{provider}` | Redirect to OAuth authorization URL | `RedirectResponse` | +| console | GET | `/oauth/data-source/callback/{provider}` | Redirect to console with data source OAuth result | `RedirectResponse` | +| console | GET | `/oauth/login/{provider}` | Redirect to OAuth authorization URL | `RedirectResponse` | +| console | GET | `/oauth/plugin/{provider_id}/datasource/callback` | Redirect to console OAuth callback page | `RedirectResponse` | +| console | GET | `/oauth/plugin/{provider}/tool/callback` | Redirect to console tool OAuth result page | `RedirectResponse` | +| console | GET | `/oauth/plugin/{provider}/trigger/callback` | Redirect to console trigger OAuth result page | `RedirectResponse` | diff --git a/packages/contracts/openapi-ts.api.config.ts b/packages/contracts/openapi-ts.api.config.ts index 9aae8ab004..26c9e4cef4 100644 --- a/packages/contracts/openapi-ts.api.config.ts +++ b/packages/contracts/openapi-ts.api.config.ts @@ -8,51 +8,15 @@ type JsonObject = Record type SwaggerSchema = JsonObject & { $ref?: string - additionalProperties?: unknown - allOf?: SwaggerSchema[] - anyOf?: SwaggerSchema[] - description?: string - enum?: unknown[] - items?: SwaggerSchema - oneOf?: SwaggerSchema[] - properties?: Record - required?: string[] - type?: string -} - -type OpenApiMediaType = JsonObject & { - schema?: SwaggerSchema -} - -type OpenApiRequestBody = JsonObject & { - content?: Record - description?: string - required?: boolean } type OpenApiComponents = JsonObject & { schemas?: Record } -type SwaggerParameter = JsonObject & { - in?: string - name?: string - required?: boolean - schema?: SwaggerSchema -} - -type SwaggerResponse = JsonObject & { - content?: Record - description?: string -} - type SwaggerOperation = JsonObject & { - deprecated?: boolean - description?: string operationId?: string - parameters?: SwaggerParameter[] - requestBody?: OpenApiRequestBody | null - responses?: Record + responses?: Record } type SwaggerDocument = JsonObject & { @@ -84,26 +48,10 @@ type ApiContractOperation = { path: string } -type ApiReadinessSurfaceStats = { - notReady: number - total: number -} - -type ApiSurface = 'console' | 'service' | 'web' - -type ApiOperationContext = { - method: string - routePath: string - runtimeBodyRequired: boolean -} - const currentDir = path.dirname(fileURLToPath(import.meta.url)) const apiOpenApiDir = path.resolve(currentDir, 'openapi') -const apiControllersDir = path.resolve(currentDir, '../../api/controllers') const operationMethods = new Set(['delete', 'get', 'patch', 'post', 'put']) -const requestBodyMethods = new Set(['delete', 'patch', 'post', 'put']) -const noBodyResponseStatuses = new Set(['204', '205', '304']) const apiSpecs: ApiSpec[] = [ { filename: 'console-openapi.json', name: 'console' }, @@ -112,18 +60,10 @@ const apiSpecs: ApiSpec[] = [ { filename: 'openapi-openapi.json', name: 'openapi' }, ] -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) } -const unknownObjectSchema = (): SwaggerSchema => ({ - additionalProperties: true, - type: 'object', -}) - const toWords = (value: string) => { return value .replace(/[{}]/g, '') @@ -205,203 +145,6 @@ const getDocumentSchemas = (document: SwaggerDocument) => { return components.schemas ??= {} } -const firstContentSchema = ( - content: Record | undefined, - preferredMediaTypes: string[], -) => { - if (!isObject(content)) - return undefined - - for (const mediaType of preferredMediaTypes) { - const media = content[mediaType] - if (isObject(media?.schema)) - return media.schema - } - - for (const media of Object.values(content)) { - if (isObject(media?.schema)) - return media.schema - } - - return undefined -} - -const getRequestBodySchema = (operation: SwaggerOperation) => { - return firstContentSchema(operation.requestBody?.content, ['application/json']) -} - -const getResponseSchema = (response: SwaggerResponse) => { - return firstContentSchema(response.content, ['application/json']) -} - -const apiOperationKey = (surface: string, method: string, routePath: string) => { - return `${surface}:${method.toLowerCase()}:${routePath}` -} - -// Swagger cannot tell whether an undocumented POST/PATCH/PUT/DELETE body is truly absent or -// just missing @expect(). Scan controllers so readiness stays conservative for those routes. -const listPythonFiles = (directory: string): string[] => { - if (!fs.existsSync(directory)) - return [] - - return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { - const entryPath = path.join(directory, entry.name) - if (entry.isDirectory()) - return listPythonFiles(entryPath) - if (entry.isFile() && entry.name.endsWith('.py')) - return [entryPath] - return [] - }) -} - -const leadingWhitespaceLength = (value: string) => { - return value.length - value.trimStart().length -} - -const parenthesesDelta = (value: string) => { - return [...value].reduce((total, char) => { - if (char === '(') - return total + 1 - if (char === ')') - return total - 1 - return total - }, 0) -} - -const collectDecorator = (lines: string[], startIndex: number) => { - const decoratorLines = [lines[startIndex] ?? ''] - let index = startIndex - let balance = parenthesesDelta(decoratorLines[0] ?? '') - - while (balance > 0 && index + 1 < lines.length) { - index += 1 - const line = lines[index] ?? '' - decoratorLines.push(line) - balance += parenthesesDelta(line) - } - - return { - decorator: decoratorLines.join('\n'), - endIndex: index, - } -} - -const routePathFromControllerPath = (controllerPath: string) => { - return controllerPath - .replace(/<(?:[^:<>]+:)?([^<>]+)>/g, '{$1}') - .replace(/\/+/g, '/') -} - -const routePathsFromDecorator = (decorator: string) => { - if (!decorator.includes('.route(')) - return [] - - return [...decorator.matchAll(/(['"])(.*?)\1/g)] - .map(([, , routePath]) => routePath) - .filter((routePath): routePath is string => typeof routePath === 'string' && routePath.startsWith('/')) - .map(routePathFromControllerPath) -} - -const methodBodyFrom = (lines: string[], methodLineIndex: number, methodIndent: number) => { - const bodyLines: string[] = [] - - for (let index = methodLineIndex + 1; index < lines.length; index += 1) { - const line = lines[index] ?? '' - if (line.trim() && leadingWhitespaceLength(line) <= methodIndent) - break - - bodyLines.push(line) - } - - return bodyLines.join('\n') -} - -const usesRuntimeJsonBody = (body: string) => { - return /\b(?:console_ns|service_api_ns|web_ns)\.payload\b/.test(body) - || /\brequest\.get_json\s*\(/.test(body) - || /\brequest\.json\b/.test(body) -} - -const collectRuntimeBodyOperationKeysFromFile = (surface: ApiSurface, filePath: string) => { - const operationKeys = new Set() - const lines = fs.readFileSync(filePath, 'utf8').split(/\r?\n/) - let pendingDecorators: string[] = [] - let currentRoutes: string[] = [] - let currentClassIndent: number | undefined - - for (let index = 0; index < lines.length; index += 1) { - const line = lines[index] ?? '' - const trimmed = line.trim() - - if (!trimmed) - continue - - if (trimmed.startsWith('@')) { - const { decorator, endIndex } = collectDecorator(lines, index) - pendingDecorators.push(decorator) - index = endIndex - continue - } - - const indent = leadingWhitespaceLength(line) - const classMatch = line.match(/^(\s*)class\s+\w+/) - if (classMatch) { - currentClassIndent = indent - currentRoutes = pendingDecorators.flatMap(routePathsFromDecorator) - pendingDecorators = [] - continue - } - - if (currentClassIndent !== undefined && indent <= currentClassIndent) - currentRoutes = [] - - const methodMatch = line.match(/^\s*def\s+(delete|get|patch|post|put)\s*\(/) - if (!methodMatch) { - pendingDecorators = [] - continue - } - - pendingDecorators = [] - - const method = methodMatch[1] - if (!method || !requestBodyMethods.has(method)) - continue - - if (currentRoutes.length === 0) - continue - - const body = methodBodyFrom(lines, index, indent) - if (!usesRuntimeJsonBody(body)) - continue - - for (const routePath of currentRoutes) - operationKeys.add(apiOperationKey(surface, method, routePath)) - } - - return operationKeys -} - -const collectRuntimeBodyOperationKeys = () => { - const surfaces = { - console: path.join(apiControllersDir, 'console'), - service: path.join(apiControllersDir, 'service_api'), - web: path.join(apiControllersDir, 'web'), - } satisfies Record - - const operationKeys = new Set() - - for (const [surface, directory] of Object.entries(surfaces) as [ApiSurface, string][]) { - for (const filePath of listPythonFiles(directory)) { - for (const operationKey of collectRuntimeBodyOperationKeysFromFile(surface, filePath)) - operationKeys.add(operationKey) - } - } - - return operationKeys -} - -const runtimeBodyOperationKeys = collectRuntimeBodyOperationKeys() - const collectSchemaRefs = (value: unknown, refs: Set, visited = new WeakSet()) => { if (!value || typeof value !== 'object') return @@ -427,177 +170,7 @@ const collectSchemaRefs = (value: unknown, refs: Set, visited = new Weak Object.values(objectValue).forEach(item => collectSchemaRefs(item, refs, visited)) } -const isNullSchema = (schema: SwaggerSchema) => { - return schema.type === 'null' -} - -const withoutNullableWrapper = (schema: SwaggerSchema | undefined): SwaggerSchema => { - if (!schema) - return {} - - const nonNullSchema = schema.anyOf?.find(item => item.type !== 'null') - if (!nonNullSchema) - return schema - - const { anyOf: _anyOf, ...rest } = schema - return { - ...rest, - ...nonNullSchema, - } -} - -const normalizeResponses = (operation: SwaggerOperation) => { - const responses = operation.responses ??= {} - - for (const [status, response] of Object.entries(responses)) { - if (noBodyResponseStatuses.has(status)) { - delete response.content - continue - } - - const schema = getResponseSchema(response) ?? unknownObjectSchema() - response.content = { - 'application/json': { - schema, - }, - } - } - - if (!Object.keys(responses).some(status => /^2\d\d$/.test(status))) { - responses['200'] = { - content: { - 'application/json': { - schema: unknownObjectSchema(), - }, - }, - description: 'Success', - } - } -} - -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 -} - -// A field the backend marked deliberately open via the `x-dify-opaque` vendor extension — e.g. a -// JSON Schema document or an app-config blob whose shape is genuinely arbitrary. Such a field is -// intentionally an open object, not an under-annotated one, so the readiness detector must not -// flag it (or its owning operation) as inaccurate. -const isIntentionallyOpaque = (schema: SwaggerSchema) => { - return (schema as { 'x-dify-opaque'?: unknown })['x-dify-opaque'] === true -} - -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, - schemas: Record, - visitedRefs = new Set(), -): boolean => { - if (!schema) - return true - - if (isIntentionallyOpaque(schema)) - return false - - const ref = schema?.$ref - if (ref) { - const refName = schemaNameFromRef(ref) - if (!refName) - return false - - if (visitedRefs.has(refName)) - return false - - return hasLooseSchema(schemas[refName], schemas, 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, schemas, visitedRefs))) - return true - } - - if (normalizedSchema.type === 'array') - return hasLooseSchema(normalizedSchema.items, schemas, visitedRefs) - - if (isLooseObjectSchema(normalizedSchema)) - return true - - if (isObject(normalizedSchema.additionalProperties) && hasLooseSchema(normalizedSchema.additionalProperties, schemas, visitedRefs)) - return true - - return Object.values(normalizedSchema.properties ?? {}) - .some(property => hasLooseSchema(property, schemas, visitedRefs)) -} - -const hasPossiblyInaccurateGeneratedContractTypes = ( - operation: SwaggerOperation, - schemas: Record, - context: ApiOperationContext, -) => { - 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(getResponseSchema(response), schemas))) - return true - - const requestBodySchema = getRequestBodySchema(operation) - const legacyBodyParameter = operation.parameters?.find(parameter => parameter.in === 'body') - - if (context.runtimeBodyRequired && !requestBodySchema && !legacyBodyParameter) - return true - - const bodySchema = requestBodySchema ?? legacyBodyParameter?.schema - return bodySchema ? hasLooseSchema(bodySchema, schemas) : 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 formatPercent = (ready: number, total: number) => { - return total === 0 ? '0.0%' : `${((ready / total) * 100).toFixed(1)}%` -} - -const normalizeOperations = (document: SwaggerDocument, surface: string) => { - const schemas = getDocumentSchemas(document) - +const addOperationIds = (document: SwaggerDocument) => { for (const [routePath, pathItem] of Object.entries(document.paths ?? {})) { for (const [method, operation] of Object.entries(pathItem)) { if (!operationMethods.has(method) || !isObject(operation)) @@ -605,50 +178,37 @@ const normalizeOperations = (document: SwaggerDocument, surface: string) => { const swaggerOperation = operation as SwaggerOperation swaggerOperation.operationId = operationId(method, routePath) - - normalizeResponses(swaggerOperation) - const hasPossiblyInaccurateTypes = hasPossiblyInaccurateGeneratedContractTypes(swaggerOperation, schemas, { - method, - routePath, - runtimeBodyRequired: runtimeBodyOperationKeys.has(apiOperationKey(surface, method, routePath)), - }) - recordApiReadiness(surface, !hasPossiblyInaccurateTypes) - - if (hasPossiblyInaccurateTypes) - markPossiblyInaccurateGeneratedContract(swaggerOperation) } } } -const normalizeApiSwagger = (document: SwaggerDocument, surface: string) => { - normalizeOperations(document, surface) - - return document +const hasSuccessResponse = (operation: SwaggerOperation) => { + return Object.keys(operation.responses ?? {}).some(status => /^2\d\d$/.test(status)) } -const printApiReadinessStats = () => { - const sortedSurfaces = Object.entries(apiReadinessStats) - .sort(([left], [right]) => left.localeCompare(right)) +const filterContractOperations = (document: SwaggerDocument) => { + for (const [routePath, pathItem] of Object.entries(document.paths ?? {})) { + for (const [method, operation] of Object.entries(pathItem)) { + if (!operationMethods.has(method) || !isObject(operation)) + continue - const totals = sortedSurfaces.reduce( - (summary, [, stats]) => { - summary.notReady += stats.notReady - summary.total += stats.total - return summary - }, - { notReady: 0, total: 0 }, - ) - const totalReady = totals.total - totals.notReady - const rows = sortedSurfaces.map(([surface, stats]) => { - const ready = stats.total - stats.notReady - return ` ${surface}: ${ready}/${stats.total} ready (${formatPercent(ready, stats.total)}), ${stats.notReady} not ready` - }) + if (!hasSuccessResponse(operation as SwaggerOperation)) + delete pathItem[method] + } - console.log([ - 'API OpenAPI readiness:', - ...rows, - ` total: ${totalReady}/${totals.total} ready (${formatPercent(totalReady, totals.total)}), ${totals.notReady} not ready`, - ].join('\n')) + const hasOperations = Object.entries(pathItem) + .some(([method, operation]) => operationMethods.has(method) && isObject(operation)) + + if (!hasOperations) + delete document.paths?.[routePath] + } +} + +const normalizeApiSwagger = (document: SwaggerDocument) => { + filterContractOperations(document) + addOperationIds(document) + + return document } const topLevelPathSegment = (routePath: string) => { @@ -673,7 +233,11 @@ const selectReferencedSchemas = ( if (selectedSchemas[refName]) continue - selectedSchemas[refName] = schemas[refName] ?? unknownObjectSchema() + const schema = schemas[refName] + if (!schema) + throw new Error(`Missing referenced schema: ${refName}`) + + selectedSchemas[refName] = schema const nestedRefs = new Set() collectSchemaRefs(selectedSchemas[refName], nestedRefs) @@ -768,7 +332,7 @@ const splitConsoleDocument = (document: SwaggerDocument) => { } const createApiJobs = (spec: ApiSpec): ApiJob[] => { - const document = normalizeApiSwagger(readApiSwagger(spec.filename), spec.name) + const document = normalizeApiSwagger(readApiSwagger(spec.filename)) if (spec.name === 'console') return splitConsoleDocument(document) @@ -782,7 +346,6 @@ const createApiJobs = (spec: ApiSpec): ApiJob[] => { } const apiJobs = apiSpecs.flatMap(createApiJobs) -printApiReadinessStats() const createApiConfig = (job: ApiJob): UserConfig => ({ input: job.document,