diff --git a/api/controllers/console/app/workflow.py b/api/controllers/console/app/workflow.py index c56bfb63478fbe..2f2f451ed3685e 100644 --- a/api/controllers/console/app/workflow.py +++ b/api/controllers/console/app/workflow.py @@ -6,7 +6,7 @@ from flask import abort, request from flask_restx import Resource, fields -from pydantic import AliasChoices, BaseModel, Field, RootModel, ValidationError, field_validator +from pydantic import AliasChoices, BaseModel, ConfigDict, Field, RootModel, ValidationError, field_validator from sqlalchemy.orm import Session, sessionmaker from werkzeug.exceptions import BadRequest, Forbidden, InternalServerError, NotFound @@ -159,8 +159,71 @@ class ConvertToWorkflowPayload(BaseModel): icon_background: str | None = None +class WorkflowFeatureTogglePayload(BaseModel): + model_config = ConfigDict(extra="allow") + + enabled: bool | None = None + + +class WorkflowSuggestedQuestionsAfterAnswerPayload(WorkflowFeatureTogglePayload): + model: dict[str, Any] | None = None + prompt: str | None = None + + +class WorkflowTextToSpeechPayload(WorkflowFeatureTogglePayload): + language: str | None = None + voice: str | None = None + autoPlay: str | None = None + + +class WorkflowSensitiveWordAvoidancePayload(WorkflowFeatureTogglePayload): + type: str | None = None + config: dict[str, Any] | None = None + + +class WorkflowFileUploadTransferPayload(WorkflowFeatureTogglePayload): + number_limits: int | None = None + transfer_methods: list[str] | None = None + + +class WorkflowFileUploadImagePayload(WorkflowFileUploadTransferPayload): + detail: str | None = None + + +class WorkflowFileUploadPreviewConfigPayload(BaseModel): + mode: str | None = None + file_type_list: list[str] | None = None + + +class WorkflowFileUploadPayload(WorkflowFeatureTogglePayload): + allowed_file_types: list[str] | None = None + allowed_file_extensions: list[str] | None = None + allowed_file_upload_methods: list[str] | None = None + number_limits: int | None = None + image: WorkflowFileUploadImagePayload | None = None + document: WorkflowFileUploadTransferPayload | None = None + audio: WorkflowFileUploadTransferPayload | None = None + video: WorkflowFileUploadTransferPayload | None = None + custom: WorkflowFileUploadTransferPayload | None = None + preview_config: WorkflowFileUploadPreviewConfigPayload | None = None + fileUploadConfig: dict[str, Any] | None = None + + +class WorkflowFeaturesConfigPayload(BaseModel): + model_config = ConfigDict(extra="allow") + + opening_statement: str | None = None + suggested_questions: list[str] | None = None + suggested_questions_after_answer: WorkflowSuggestedQuestionsAfterAnswerPayload | None = None + text_to_speech: WorkflowTextToSpeechPayload | None = None + speech_to_text: WorkflowFeatureTogglePayload | None = None + retriever_resource: WorkflowFeatureTogglePayload | None = None + sensitive_word_avoidance: WorkflowSensitiveWordAvoidancePayload | None = None + file_upload: WorkflowFileUploadPayload | None = None + + class WorkflowFeaturesPayload(BaseModel): - features: dict[str, Any] = Field( + features: WorkflowFeaturesConfigPayload = Field( ..., description="Workflow feature configuration", ) @@ -344,6 +407,15 @@ class DraftWorkflowTriggerRunAllPayload(BaseModel): ConvertToWorkflowPayload, WorkflowListQuery, WorkflowUpdatePayload, + WorkflowFeatureTogglePayload, + WorkflowSuggestedQuestionsAfterAnswerPayload, + WorkflowTextToSpeechPayload, + WorkflowSensitiveWordAvoidancePayload, + WorkflowFileUploadTransferPayload, + WorkflowFileUploadImagePayload, + WorkflowFileUploadPreviewConfigPayload, + WorkflowFileUploadPayload, + WorkflowFeaturesConfigPayload, WorkflowFeaturesPayload, WorkflowOnlineUsersPayload, DraftWorkflowTriggerRunPayload, @@ -1275,7 +1347,7 @@ class WorkflowFeaturesApi(Resource): def post(self, current_user: Account, app_model: App): args = WorkflowFeaturesPayload.model_validate(console_ns.payload or {}) - features = args.features + features = args.features.model_dump(mode="json", exclude_unset=True) workflow_service = WorkflowService() workflow_service.update_draft_workflow_features(app_model=app_model, features=features, account=current_user) diff --git a/api/controllers/console/app/workflow_comment.py b/api/controllers/console/app/workflow_comment.py index c70f00dcfa1c1d..64df78f37485b8 100644 --- a/api/controllers/console/app/workflow_comment.py +++ b/api/controllers/console/app/workflow_comment.py @@ -189,14 +189,14 @@ def _normalize_timestamp(cls, value: datetime | int | None) -> int | None: register_schema_models( console_ns, - AccountWithRole, - WorkflowCommentMentionUsersPayload, WorkflowCommentCreatePayload, WorkflowCommentUpdatePayload, WorkflowCommentReplyPayload, ) register_response_schema_models( console_ns, + AccountWithRole, + WorkflowCommentMentionUsersPayload, WorkflowCommentAccount, WorkflowCommentReply, WorkflowCommentMention, diff --git a/api/controllers/console/app/workflow_draft_variable.py b/api/controllers/console/app/workflow_draft_variable.py index ff82572b87eae9..0ccc67f642d03b 100644 --- a/api/controllers/console/app/workflow_draft_variable.py +++ b/api/controllers/console/app/workflow_draft_variable.py @@ -6,7 +6,7 @@ from flask import Response, request from flask_restx import Resource, fields, marshal, marshal_with -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from sqlalchemy.orm import sessionmaker from controllers.common.errors import InvalidArgumentError, NotFoundError @@ -79,15 +79,33 @@ class WorkflowDraftVariableUpdatePayload(BaseModel): value: Any | None = Field(default=None, description="Variable value") +class WorkflowVariableItemPayload(BaseModel): + model_config = ConfigDict(extra="allow") + + id: str | None = None + name: str | None = None + value_type: str | None = None + value: Any | None = None + description: str | None = None + + +class ConversationVariableItemPayload(WorkflowVariableItemPayload): + pass + + +class EnvironmentVariableItemPayload(WorkflowVariableItemPayload): + pass + + class ConversationVariableUpdatePayload(BaseModel): - conversation_variables: list[dict[str, Any]] = Field( + conversation_variables: list[ConversationVariableItemPayload] = Field( ..., description="Conversation variables for the draft workflow", ) class EnvironmentVariableUpdatePayload(BaseModel): - environment_variables: list[dict[str, Any]] = Field( + environment_variables: list[EnvironmentVariableItemPayload] = Field( ..., description="Environment variables for the draft workflow", ) @@ -114,7 +132,9 @@ class EnvironmentVariableListResponse(ResponseModel): console_ns, WorkflowDraftVariableListQuery, WorkflowDraftVariableUpdatePayload, + ConversationVariableItemPayload, ConversationVariableUpdatePayload, + EnvironmentVariableItemPayload, EnvironmentVariableUpdatePayload, ) register_response_schema_models(console_ns, SimpleResultResponse, EnvironmentVariableListResponse) @@ -615,7 +635,9 @@ def post(self, current_user: Account, app_model: App): workflow_service = WorkflowService() - conversation_variables_list = payload.conversation_variables + conversation_variables_list = [ + variable.model_dump(mode="json", exclude_unset=True) for variable in payload.conversation_variables + ] conversation_variables = [ variable_factory.build_conversation_variable_from_mapping(obj) for obj in conversation_variables_list ] @@ -707,7 +729,9 @@ def post(self, current_user: Account, app_model: App): workflow_service = WorkflowService() - environment_variables_list = payload.environment_variables + environment_variables_list = [ + variable.model_dump(mode="json", exclude_unset=True) for variable in payload.environment_variables + ] environment_variables = [ variable_factory.build_environment_variable_from_mapping(obj) for obj in environment_variables_list ] diff --git a/api/controllers/console/billing/billing.py b/api/controllers/console/billing/billing.py index cd719966e6a9b4..d6974fe129cc4b 100644 --- a/api/controllers/console/billing/billing.py +++ b/api/controllers/console/billing/billing.py @@ -17,6 +17,7 @@ ) from enums.cloud_plan import CloudPlan from extensions.ext_database import db +from fields.base import ResponseModel from libs.login import login_required from models import Account from services.billing_service import BillingService @@ -35,8 +36,12 @@ class BillingResponse(RootModel[dict[str, Any]]): root: dict[str, Any] +class BillingInvoiceResponse(ResponseModel): + url: str + + register_schema_models(console_ns, SubscriptionQuery, PartnerTenantsPayload) -register_response_schema_models(console_ns, BillingResponse) +register_response_schema_models(console_ns, BillingResponse, BillingInvoiceResponse) @console_ns.route("/billing/subscription") @@ -57,7 +62,7 @@ def get(self, current_tenant_id: str, current_user: Account): @console_ns.route("/billing/invoices") class Invoices(Resource): - @console_ns.response(200, "Success", console_ns.models[BillingResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[BillingInvoiceResponse.__name__]) @setup_required @login_required @account_initialization_required diff --git a/api/controllers/console/explore/recommended_app.py b/api/controllers/console/explore/recommended_app.py index 72f797eeb36d76..7e90da5874b1a9 100644 --- a/api/controllers/console/explore/recommended_app.py +++ b/api/controllers/console/explore/recommended_app.py @@ -3,7 +3,7 @@ from flask import request from flask_restx import Resource -from pydantic import BaseModel, Field, RootModel, computed_field, field_validator +from pydantic import BaseModel, Field, computed_field, field_validator from constants.languages import languages from controllers.common.schema import query_params_from_model, register_response_schema_models, register_schema_models @@ -70,8 +70,14 @@ class LearnDifyAppListResponse(ResponseModel): recommended_apps: list[RecommendedAppResponse] -class RecommendedAppDetailResponse(RootModel[dict[str, Any]]): - root: dict[str, Any] +class RecommendedAppDetailResponse(ResponseModel): + id: str + name: str + icon: str | None = None + icon_background: str | None = None + mode: str + export_data: str + can_trial: bool | None = None register_schema_models( diff --git a/api/controllers/console/files.py b/api/controllers/console/files.py index 5197120c135b7b..24c3a5978e1ba5 100644 --- a/api/controllers/console/files.py +++ b/api/controllers/console/files.py @@ -38,6 +38,22 @@ PREVIEW_WORDS_LIMIT = 3000 +_FILE_UPLOAD_PARAMS = { + "file": { + "description": "File to upload", + "in": "formData", + "type": "file", + "required": True, + }, + "source": { + "description": "Optional upload source", + "in": "formData", + "type": "string", + "enum": ["datasets"], + "required": False, + }, +} + @console_ns.route("/files/upload") class FileApi(Resource): @@ -64,6 +80,7 @@ def get(self): @login_required @account_initialization_required @cloud_edition_billing_resource_check("documents") + @console_ns.doc(consumes=["multipart/form-data"], params=_FILE_UPLOAD_PARAMS) @console_ns.response(201, "File uploaded successfully", console_ns.models[FileResponse.__name__]) @with_current_user def post(self, current_user: Account): diff --git a/api/controllers/console/workspace/members.py b/api/controllers/console/workspace/members.py index 3a2e3c923599c9..51a6c9b0f3fb25 100644 --- a/api/controllers/console/workspace/members.py +++ b/api/controllers/console/workspace/members.py @@ -84,8 +84,6 @@ class MemberActionTenantResponse(ResponseModel): register_enum_models(console_ns, TenantAccountRole) register_schema_models( console_ns, - AccountWithRole, - AccountWithRoleList, MemberInvitePayload, MemberRoleUpdatePayload, OwnerTransferEmailPayload, @@ -94,6 +92,8 @@ class MemberActionTenantResponse(ResponseModel): ) register_response_schema_models( console_ns, + AccountWithRole, + AccountWithRoleList, SimpleResultDataResponse, SimpleResultResponse, VerificationTokenResponse, diff --git a/api/controllers/console/workspace/plugin.py b/api/controllers/console/workspace/plugin.py index bcc1bb67459e67..deadf8e470ebeb 100644 --- a/api/controllers/console/workspace/plugin.py +++ b/api/controllers/console/workspace/plugin.py @@ -302,11 +302,28 @@ class PluginListResponse(ResponseModel): class PluginVersionsResponse(ResponseModel): - versions: Any + versions: Mapping[str, PluginService.LatestPluginCache | None] + + +class PluginInstallationItemResponse(ResponseModel): + id: str + created_at: datetime + updated_at: datetime + tenant_id: str + endpoints_setups: int + endpoints_active: int + runtime_type: str + source: PluginInstallationSource + meta: Mapping[str, Any] + plugin_id: str + plugin_unique_identifier: str + version: str + checksum: str + declaration: Mapping[str, Any] class PluginInstallationsResponse(ResponseModel): - plugins: Any + plugins: list[PluginInstallationItemResponse] class PluginManifestResponse(ResponseModel): diff --git a/api/controllers/console/workspace/rbac.py b/api/controllers/console/workspace/rbac.py index be1783dddd0c82..a155bb0cf0be15 100644 --- a/api/controllers/console/workspace/rbac.py +++ b/api/controllers/console/workspace/rbac.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any +from typing import Any, Literal from flask import request from flask_restx import Resource @@ -9,7 +9,7 @@ from werkzeug.exceptions import NotFound from configs import dify_config -from controllers.common.schema import register_response_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 RBACPermission, RBACResourceScope, rbac_permission_required from core.db.session_factory import session_factory @@ -538,6 +538,20 @@ def _coerce_account_ids(cls, value: Any) -> list[str]: return value +class _AccessControlLanguageQuery(BaseModel): + language: Literal["en", "ja", "zh"] | None = Field(default=None, description="Localized policy label language") + + +register_schema_models( + console_ns, + _ResourceAccessScopeRequest, + _ReplaceBindingsRequest, + _DeleteMemberBindingsRequest, + _AccessControlLanguageQuery, + svc.ReplaceUserAccessPolicies, +) + + @console_ns.route("/workspaces/current/rbac/my-permissions") class RBACMyPermissionsApi(Resource): @login_required @@ -557,6 +571,7 @@ def get(self): @console_ns.route("/workspaces/current/rbac/apps//access-policy") class RBACAppMatrixApi(Resource): @login_required + @console_ns.doc(params=query_params_from_model(_AccessControlLanguageQuery)) @console_ns.response(200, "Success", console_ns.models[svc.AppAccessMatrix.__name__]) def get(self, app_id): tenant_id, account_id = _current_ids() @@ -574,6 +589,7 @@ def get(self, app_id): return _dump(svc.RBACService.AppAccess.whitelist(tenant_id, account_id, str(app_id))) @login_required + @console_ns.expect(console_ns.models[_ResourceAccessScopeRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.ResourceWhitelist.__name__]) def put(self, app_id): tenant_id, account_id = _current_ids() @@ -591,6 +607,7 @@ def put(self, app_id): @console_ns.route("/workspaces/current/rbac/apps//user-access-policies") class RBACAppUserAccessPoliciesApi(Resource): @login_required + @console_ns.doc(params=query_params_from_model(_AccessControlLanguageQuery)) @console_ns.response(200, "Success", console_ns.models[svc.ResourceUserAccessPoliciesResponse.__name__]) def get(self, app_id): tenant_id, account_id = _current_ids() @@ -602,6 +619,7 @@ def get(self, app_id): @console_ns.route("/workspaces/current/rbac/apps//users//access-policies") class RBACAppUserAccessPolicyAssignmentApi(Resource): @login_required + @console_ns.expect(console_ns.models[svc.ReplaceUserAccessPolicies.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.ReplaceUserAccessPoliciesResponse.__name__]) def put(self, app_id, target_account_id): tenant_id, account_id = _current_ids() @@ -635,6 +653,7 @@ def get(self, app_id, policy_id): return _dump(svc.RBACService.AppAccess.list_member_bindings(tenant_id, account_id, str(app_id), str(policy_id))) @login_required + @console_ns.expect(console_ns.models[_DeleteMemberBindingsRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.MemberBindingsResponse.__name__]) def delete(self, app_id, policy_id): tenant_id, account_id = _current_ids() @@ -657,6 +676,7 @@ def delete(self, app_id, policy_id): @console_ns.route("/workspaces/current/rbac/datasets//access-policy") class RBACDatasetMatrixApi(Resource): @login_required + @console_ns.doc(params=query_params_from_model(_AccessControlLanguageQuery)) @console_ns.response(200, "Success", console_ns.models[svc.DatasetAccessMatrix.__name__]) def get(self, dataset_id): tenant_id, account_id = _current_ids() @@ -674,6 +694,7 @@ def get(self, dataset_id): return _dump(svc.RBACService.DatasetAccess.whitelist(tenant_id, account_id, str(dataset_id))) @login_required + @console_ns.expect(console_ns.models[_ResourceAccessScopeRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.ResourceWhitelist.__name__]) def put(self, dataset_id): tenant_id, account_id = _current_ids() @@ -691,6 +712,7 @@ def put(self, dataset_id): @console_ns.route("/workspaces/current/rbac/datasets//user-access-policies") class RBACDatasetUserAccessPoliciesApi(Resource): @login_required + @console_ns.doc(params=query_params_from_model(_AccessControlLanguageQuery)) @console_ns.response(200, "Success", console_ns.models[svc.ResourceUserAccessPoliciesResponse.__name__]) def get(self, dataset_id): tenant_id, account_id = _current_ids() @@ -702,6 +724,7 @@ def get(self, dataset_id): @console_ns.route("/workspaces/current/rbac/datasets//users//access-policies") class RBACDatasetUserAccessPolicyAssignmentApi(Resource): @login_required + @console_ns.expect(console_ns.models[svc.ReplaceUserAccessPolicies.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.ReplaceUserAccessPoliciesResponse.__name__]) def put(self, dataset_id, target_account_id): tenant_id, account_id = _current_ids() @@ -741,6 +764,7 @@ def get(self, dataset_id, policy_id): ) @login_required + @console_ns.expect(console_ns.models[_DeleteMemberBindingsRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.MemberBindingsResponse.__name__]) def delete(self, dataset_id, policy_id): tenant_id, account_id = _current_ids() @@ -779,6 +803,7 @@ def get(self, policy_id): @console_ns.route("/workspaces/current/rbac/workspace/apps/access-policies//bindings") class RBACWorkspaceAppBindingsApi(Resource): @login_required + @console_ns.expect(console_ns.models[_ReplaceBindingsRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.AccessMatrixItem.__name__]) def put(self, policy_id): tenant_id, account_id = _current_ids() @@ -826,6 +851,7 @@ def get(self, policy_id): @console_ns.route("/workspaces/current/rbac/workspace/datasets/access-policies//bindings") class RBACWorkspaceDatasetBindingsApi(Resource): @login_required + @console_ns.expect(console_ns.models[_ReplaceBindingsRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.AccessMatrixItem.__name__]) def put(self, policy_id): tenant_id, account_id = _current_ids() @@ -867,6 +893,9 @@ def _coerce_role_ids(cls, value: Any) -> list[str]: return value +register_schema_models(console_ns, _ReplaceMemberRolesRequest) + + @console_ns.route("/workspaces/current/rbac/members//rbac-roles") class RBACMemberRolesApi(Resource): @login_required @@ -876,6 +905,7 @@ def get(self, member_id): return _dump(svc.RBACService.MemberRoles.get(tenant_id, account_id, str(member_id))) @login_required + @console_ns.expect(console_ns.models[_ReplaceMemberRolesRequest.__name__]) @console_ns.response(200, "Success", console_ns.models[svc.MemberRolesResponse.__name__]) def put(self, member_id): tenant_id, account_id = _current_ids() diff --git a/api/controllers/console/workspace/trigger_providers.py b/api/controllers/console/workspace/trigger_providers.py index b960a5eb9c393c..e7e3191f32203e 100644 --- a/api/controllers/console/workspace/trigger_providers.py +++ b/api/controllers/console/workspace/trigger_providers.py @@ -13,9 +13,15 @@ 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 -from core.trigger.entities.entities import SubscriptionBuilderUpdater +from core.trigger.entities.api_entities import ( + SubscriptionBuilderApiEntity, + TriggerProviderApiEntity, + TriggerProviderSubscriptionApiEntity, +) +from core.trigger.entities.entities import RequestLog, SubscriptionBuilderUpdater from core.trigger.trigger_manager import TriggerManager from extensions.ext_database import db +from fields.base import ResponseModel from graphon.model_runtime.utils.encoders import jsonable_encoder from libs.login import login_required from models.account import Account @@ -70,7 +76,7 @@ class TriggerOAuthClientPayload(BaseModel): class TriggerOAuthAuthorizeResponse(BaseModel): authorization_url: str subscription_builder_id: str - subscription_builder: Any + subscription_builder: SubscriptionBuilderApiEntity class TriggerOAuthClientResponse(BaseModel): @@ -87,6 +93,26 @@ class TriggerProviderOpaqueResponse(RootModel[Any]): root: Any +class TriggerProviderListResponse(RootModel[list[TriggerProviderApiEntity]]): + root: list[TriggerProviderApiEntity] + + +class TriggerSubscriptionListResponse(RootModel[list[TriggerProviderSubscriptionApiEntity]]): + root: list[TriggerProviderSubscriptionApiEntity] + + +class TriggerSubscriptionBuilderCreateResponse(ResponseModel): + subscription_builder: SubscriptionBuilderApiEntity + + +class TriggerSubscriptionBuilderVerifyResponse(ResponseModel): + verified: bool + + +class TriggerSubscriptionBuilderLogsResponse(ResponseModel): + logs: list[RequestLog] + + register_schema_models( console_ns, TriggerSubscriptionBuilderCreatePayload, @@ -102,6 +128,15 @@ class TriggerProviderOpaqueResponse(RootModel[Any]): TriggerOAuthAuthorizeResponse, TriggerOAuthClientResponse, TriggerProviderOpaqueResponse, + TriggerProviderApiEntity, + TriggerProviderListResponse, + TriggerProviderSubscriptionApiEntity, + TriggerSubscriptionListResponse, + SubscriptionBuilderApiEntity, + TriggerSubscriptionBuilderCreateResponse, + TriggerSubscriptionBuilderVerifyResponse, + RequestLog, + TriggerSubscriptionBuilderLogsResponse, ) @@ -118,7 +153,7 @@ def get(self, tenant_id: str, provider: str): @console_ns.route("/workspaces/current/triggers") class TriggerProviderListApi(Resource): - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderListResponse.__name__]) @setup_required @login_required @account_initialization_required @@ -130,7 +165,7 @@ def get(self, tenant_id: str): @console_ns.route("/workspaces/current/trigger-provider//info") class TriggerProviderInfoApi(Resource): - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerProviderApiEntity.__name__]) @setup_required @login_required @account_initialization_required @@ -142,7 +177,7 @@ def get(self, tenant_id: str, provider: str): @console_ns.route("/workspaces/current/trigger-provider//subscriptions/list") class TriggerSubscriptionListApi(Resource): - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerSubscriptionListResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -172,7 +207,7 @@ def get(self, tenant_id: str, user: Account, provider: str): ) class TriggerSubscriptionBuilderCreateApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderCreatePayload.__name__]) - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerSubscriptionBuilderCreateResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -202,7 +237,7 @@ def post(self, tenant_id: str, user: Account, provider: str): "/workspaces/current/trigger-provider//subscriptions/builder/", ) class TriggerSubscriptionBuilderGetApi(Resource): - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[SubscriptionBuilderApiEntity.__name__]) @setup_required @login_required @edit_permission_required @@ -220,7 +255,7 @@ def get(self, provider: str, subscription_builder_id: str): ) class TriggerSubscriptionBuilderVerifyApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderVerifyPayload.__name__]) - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerSubscriptionBuilderVerifyResponse.__name__]) @setup_required @login_required @edit_permission_required @@ -253,7 +288,7 @@ def post(self, tenant_id: str, user: Account, provider: str, subscription_builde ) class TriggerSubscriptionBuilderUpdateApi(Resource): @console_ns.expect(console_ns.models[TriggerSubscriptionBuilderUpdatePayload.__name__]) - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[SubscriptionBuilderApiEntity.__name__]) @setup_required @login_required @edit_permission_required @@ -286,7 +321,7 @@ def post(self, tenant_id: str, provider: str, subscription_builder_id: str): "/workspaces/current/trigger-provider//subscriptions/builder/logs/", ) class TriggerSubscriptionBuilderLogsApi(Resource): - @console_ns.response(200, "Success", console_ns.models[TriggerProviderOpaqueResponse.__name__]) + @console_ns.response(200, "Success", console_ns.models[TriggerSubscriptionBuilderLogsResponse.__name__]) @setup_required @login_required @edit_permission_required diff --git a/api/openapi/markdown/console-openapi.md b/api/openapi/markdown/console-openapi.md index 3fe4fde4c157f6..0c113e237bf62b 100644 --- a/api/openapi/markdown/console-openapi.md +++ b/api/openapi/markdown/console-openapi.md @@ -5243,7 +5243,7 @@ Refresh MCP server configuration and regenerate server code | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [BillingResponse](#billingresponse)
| +| 200 | Success | **application/json**: [BillingInvoiceResponse](#billinginvoiceresponse)
| ### [PUT] /billing/partners/{partner_key}/tenants Sync partner tenants bindings @@ -6836,6 +6836,12 @@ Check if dataset is in use | 200 | Success | **application/json**: [UploadConfig](#uploadconfig)
| ### [POST] /files/upload +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **multipart/form-data**: { **"file"**: binary, **"source"**: string,
**Available values:** "datasets" }
| + #### Responses | Code | Description | Schema | @@ -11140,6 +11146,12 @@ Returns permission flags that control workspace features like member invitations | app_id | path | | Yes | string (uuid) | | policy_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_DeleteMemberBindingsRequest](#_deletememberbindingsrequest)
| + #### Responses | Code | Description | Schema | @@ -11179,6 +11191,7 @@ Returns permission flags that control workspace features like member invitations | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| language | query | Localized policy label language | No | string,
**Available values:** "en", "ja", "zh" | | app_id | path | | Yes | string (uuid) | #### Responses @@ -11192,6 +11205,7 @@ Returns permission flags that control workspace features like member invitations | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| language | query | Localized policy label language | No | string,
**Available values:** "en", "ja", "zh" | | app_id | path | | Yes | string (uuid) | #### Responses @@ -11208,6 +11222,12 @@ Returns permission flags that control workspace features like member invitations | app_id | path | | Yes | string (uuid) | | target_account_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [ReplaceUserAccessPolicies](#replaceuseraccesspolicies)
| + #### Responses | Code | Description | Schema | @@ -11234,6 +11254,12 @@ Returns permission flags that control workspace features like member invitations | ---- | ---------- | ----------- | -------- | ------ | | app_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_ResourceAccessScopeRequest](#_resourceaccessscoperequest)
| + #### Responses | Code | Description | Schema | @@ -11248,6 +11274,12 @@ Returns permission flags that control workspace features like member invitations | dataset_id | path | | Yes | string (uuid) | | policy_id | path | | Yes | string | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_DeleteMemberBindingsRequest](#_deletememberbindingsrequest)
| + #### Responses | Code | Description | Schema | @@ -11287,6 +11319,7 @@ Returns permission flags that control workspace features like member invitations | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| language | query | Localized policy label language | No | string,
**Available values:** "en", "ja", "zh" | | dataset_id | path | | Yes | string (uuid) | #### Responses @@ -11300,6 +11333,7 @@ Returns permission flags that control workspace features like member invitations | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | +| language | query | Localized policy label language | No | string,
**Available values:** "en", "ja", "zh" | | dataset_id | path | | Yes | string (uuid) | #### Responses @@ -11316,6 +11350,12 @@ Returns permission flags that control workspace features like member invitations | dataset_id | path | | Yes | string (uuid) | | target_account_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [ReplaceUserAccessPolicies](#replaceuseraccesspolicies)
| + #### Responses | Code | Description | Schema | @@ -11342,6 +11382,12 @@ Returns permission flags that control workspace features like member invitations | ---- | ---------- | ----------- | -------- | ------ | | dataset_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_ResourceAccessScopeRequest](#_resourceaccessscoperequest)
| + #### Responses | Code | Description | Schema | @@ -11368,6 +11414,12 @@ Returns permission flags that control workspace features like member invitations | ---- | ---------- | ----------- | -------- | ------ | | member_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_ReplaceMemberRolesRequest](#_replacememberrolesrequest)
| + #### Responses | Code | Description | Schema | @@ -11488,6 +11540,12 @@ Returns permission flags that control workspace features like member invitations | ---- | ---------- | ----------- | -------- | ------ | | policy_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_ReplaceBindingsRequest](#_replacebindingsrequest)
| + #### Responses | Code | Description | Schema | @@ -11534,6 +11592,12 @@ Returns permission flags that control workspace features like member invitations | ---- | ---------- | ----------- | -------- | ------ | | policy_id | path | | Yes | string (uuid) | +#### Request Body + +| Required | Schema | +| -------- | ------ | +| Yes | **application/json**: [_ReplaceBindingsRequest](#_replacebindingsrequest)
| + #### Responses | Code | Description | Schema | @@ -12110,7 +12174,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerProviderApiEntity](#triggerproviderapientity)
| ### [DELETE] /workspaces/current/trigger-provider/{provider}/oauth/client **Remove custom OAuth client configuration** @@ -12204,7 +12268,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerSubscriptionBuilderCreateResponse](#triggersubscriptionbuildercreateresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/logs/{subscription_builder_id} **Get the request logs for a subscription instance for a trigger provider** @@ -12220,7 +12284,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerSubscriptionBuilderLogsResponse](#triggersubscriptionbuilderlogsresponse)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/update/{subscription_builder_id} **Update a subscription instance for a trigger provider** @@ -12242,7 +12306,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [SubscriptionBuilderApiEntity](#subscriptionbuilderapientity)
| ### [POST] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/verify-and-update/{subscription_builder_id} **Verify and update a subscription instance for a trigger provider** @@ -12264,7 +12328,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerSubscriptionBuilderVerifyResponse](#triggersubscriptionbuilderverifyresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/builder/{subscription_builder_id} **Get a subscription instance for a trigger provider** @@ -12280,7 +12344,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [SubscriptionBuilderApiEntity](#subscriptionbuilderapientity)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/list **List all trigger subscriptions for the current tenant's provider** @@ -12295,7 +12359,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerSubscriptionListResponse](#triggersubscriptionlistresponse)
| ### [GET] /workspaces/current/trigger-provider/{provider}/subscriptions/oauth/authorize **Initiate OAuth authorization flow for a trigger provider** @@ -12377,7 +12441,7 @@ Returns permission flags that control workspace features like member invitations | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | Success | **application/json**: [TriggerProviderOpaqueResponse](#triggerprovideropaqueresponse)
| +| 200 | Success | **application/json**: [TriggerProviderListResponse](#triggerproviderlistresponse)
| ### [POST] /workspaces/custom-config #### Request Body @@ -12682,6 +12746,7 @@ Default namespace | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | avatar | string | | No | +| avatar_url | string | | Yes | | created_at | integer | | No | | email | string | | Yes | | id | string | | Yes | @@ -15016,6 +15081,12 @@ AppMCPServer Status Enum | use_icon_as_answer_icon | boolean | | No | | workflow | [WorkflowPartial](#workflowpartial) | | No | +#### AppSelectorScope + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| AppSelectorScope | string | | | + #### AppSiteResponse | Name | Type | Description | Required | @@ -15179,6 +15250,12 @@ Retrieval settings for Amazon Bedrock knowledge base queries. | score_threshold | number | Minimum relevance score threshold | No | | top_k | integer | Maximum number of results to retrieve | No | +#### BillingInvoiceResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| url | string | | Yes | + #### BillingModel | Name | Type | Description | Required | @@ -15717,6 +15794,16 @@ Enum class for configurate method of provider model. | auto_generate | boolean | Automatically generate the conversation name. When `true`, the `name` field is ignored. | No | | name | string | Conversation name. Required when `auto_generate` is `false`. | No | +#### ConversationVariableItemPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | string | | No | +| id | string | | No | +| name | string | | No | +| value | | | No | +| value_type | string | | No | + #### ConversationVariableResponse | Name | Type | Description | Required | @@ -15733,7 +15820,7 @@ Enum class for configurate method of provider model. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| conversation_variables | [ object ] | Conversation variables for the draft workflow | Yes | +| conversation_variables | [ [ConversationVariableItemPayload](#conversationvariableitempayload) ] | Conversation variables for the draft workflow | Yes | #### ConversationVariablesQuery @@ -17079,6 +17166,16 @@ Request payload for bulk downloading documents as a zip archive. | reason | string | | No | | secret_likely | boolean | | No | +#### EnvironmentVariableItemPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | string | | No | +| id | string | | No | +| name | string | | No | +| value | | | No | +| value_type | string | | No | + #### EnvironmentVariableItemResponse | Name | Type | Description | Required | @@ -17104,7 +17201,7 @@ Request payload for bulk downloading documents as a zip archive. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| environment_variables | [ object ] | Environment variables for the draft workflow | Yes | +| environment_variables | [ [EnvironmentVariableItemPayload](#environmentvariableitempayload) ] | Environment variables for the draft workflow | Yes | #### ErrorDocsResponse @@ -17113,6 +17210,56 @@ Request payload for bulk downloading documents as a zip archive. | data | [ [DocumentStatusResponse](#documentstatusresponse) ] | | Yes | | total | integer | | Yes | +#### EventApiEntity + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| description | [I18nObject](#i18nobject) | The description of the trigger | Yes | +| identity | [EventIdentity](#eventidentity) | The identity of the trigger | Yes | +| name | string | The name of the trigger | Yes | +| output_schema | object | The output schema of the trigger | Yes | +| parameters | [ [EventParameter](#eventparameter) ] | The parameters of the trigger | Yes | + +#### EventIdentity + +The identity of the event + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| author | string | The author of the event | Yes | +| label | [I18nObject](#i18nobject) | The label of the event | Yes | +| name | string | The name of the event | Yes | +| provider | string | The provider of the event | No | + +#### EventParameter + +The parameter of the event + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| auto_generate | [PluginParameterAutoGenerate](#pluginparameterautogenerate) | The auto generate of the parameter | No | +| default | integer
number
string
[ object ] | | No | +| description | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | The label presented to the user | Yes | +| max | number
integer | | No | +| min | number
integer | | No | +| multiple | boolean | Whether the parameter is multiple select, only valid for select or dynamic-select type | No | +| name | string | The name of the parameter | Yes | +| options | [ [PluginParameterOption](#pluginparameteroption) ] | | No | +| precision | integer | | No | +| required | boolean | | No | +| scope | string | | No | +| template | [PluginParameterTemplate](#pluginparametertemplate) | The template of the parameter | No | +| type | [EventParameterType](#eventparametertype) | | Yes | + +#### EventParameterType + +The type of the parameter + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| EventParameterType | string | The type of the parameter | | + #### EventStreamResponse | Name | Type | Description | Required | @@ -17939,6 +18086,17 @@ Enum class for large language model mode. | ---- | ---- | ----------- | -------- | | LLMMode | string | Enum class for large language model mode. | | +#### LatestPluginCache + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| alternative_plugin_id | string | | Yes | +| deprecated_reason | string | | Yes | +| plugin_id | string | | Yes | +| status | string | | Yes | +| unique_identifier | string | | Yes | +| version | string | | Yes | + #### LearnDifyAppListResponse | Name | Type | Description | Required | @@ -18392,6 +18550,12 @@ Enum class for model property key. | ---- | ---- | ----------- | -------- | | payment_link | string | | Yes | +#### ModelSelectorScope + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ModelSelectorScope | string | | | + #### ModelStatus Enum class for model status. @@ -18682,6 +18846,15 @@ Coarse node-level status used by Inspector to pick a banner. | refresh_token | string | | Yes | | token_type | string | | Yes | +#### OAuthSchema + +OAuth schema + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| client_schema | [ [ProviderConfig](#providerconfig) ] | client schema like client_id, client_secret, etc. | No | +| credentials_schema | [ [ProviderConfig](#providerconfig) ] | credentials schema like access_token, refresh_token, etc. | No | + #### OAuthTokenRequest | Name | Type | Description | Required | @@ -18699,6 +18872,13 @@ Coarse node-level status used by Inspector to pick a banner. | ---- | ---- | ----------- | -------- | | OpaqueObjectResponse | object | | | +#### Option + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| label | [I18nObject](#i18nobject) | The label of the option | Yes | +| value | string | The value of the option | Yes | + #### OutputErrorStrategy Per-output failure handling strategy. @@ -19404,6 +19584,25 @@ Shared permission levels for resources (datasets, credentials, etc.) | ---- | ---- | ----------- | -------- | | endpoints | [ object ] | Endpoint information | Yes | +#### PluginInstallationItemResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| checksum | string | | Yes | +| created_at | dateTime | | Yes | +| declaration | object | | Yes | +| endpoints_active | integer | | Yes | +| endpoints_setups | integer | | Yes | +| id | string | | Yes | +| meta | object | | Yes | +| plugin_id | string | | Yes | +| plugin_unique_identifier | string | | Yes | +| runtime_type | string | | Yes | +| source | [PluginInstallationSource](#plugininstallationsource) | | Yes | +| tenant_id | string | | Yes | +| updated_at | dateTime | | Yes | +| version | string | | Yes | + #### PluginInstallationPermissionModel | Name | Type | Description | Required | @@ -19427,7 +19626,7 @@ Shared permission levels for resources (datasets, credentials, etc.) | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| plugins | | | Yes | +| plugins | [ [PluginInstallationItemResponse](#plugininstallationitemresponse) ] | | Yes | #### PluginListResponse @@ -19461,6 +19660,26 @@ Shared permission levels for resources (datasets, credentials, etc.) | message | string | | No | | success | boolean | | Yes | +#### PluginParameterAutoGenerate + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| type | [core__plugin__entities__parameters__PluginParameterAutoGenerate__Type](#core__plugin__entities__parameters__pluginparameterautogenerate__type) | | Yes | + +#### PluginParameterOption + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| icon | string | The icon of the option, can be a url or a base64 encoded image | No | +| label | [I18nObject](#i18nobject) | The label of the option | Yes | +| value | string | The value of the option | Yes | + +#### PluginParameterTemplate + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| enabled | boolean | Whether the parameter is jinja enabled | No | + #### PluginPermissionResponse | Name | Type | Description | Required | @@ -19497,7 +19716,7 @@ Shared permission levels for resources (datasets, credentials, etc.) | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| versions | | | Yes | +| versions | object | | Yes | #### PreProcessingRule @@ -19540,6 +19759,24 @@ Dataset Process Rule Mode | ---- | ---- | ----------- | -------- | | ProcessRuleMode | string | Dataset Process Rule Mode | | +#### ProviderConfig + +Model class for common provider settings like credentials + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| default | integer
string
number
boolean | | No | +| help | [I18nObject](#i18nobject) | | No | +| label | [I18nObject](#i18nobject) | | No | +| multiple | boolean | | No | +| name | string | The name of the credentials | Yes | +| options | [ [Option](#option) ] | | No | +| placeholder | [I18nObject](#i18nobject) | | No | +| required | boolean | | No | +| scope | [AppSelectorScope](#appselectorscope)
[ModelSelectorScope](#modelselectorscope)
[ToolSelectorScope](#toolselectorscope) | | No | +| type | [core__entities__provider_entities__BasicProviderConfig__Type](#core__entities__provider_entities__basicproviderconfig__type) | The type of the credentials | Yes | +| url | string | | No | + #### ProviderCredentialResponse | Name | Type | Description | Required | @@ -19722,6 +19959,14 @@ Model class for provider quota configuration. | ---- | ---- | ----------- | -------- | | QuotaUnit | string | | | +#### RBACResourceWhitelistScope + +Whitelist scopes accepted by RBAC app and dataset access config APIs. + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| RBACResourceWhitelistScope | string | Whitelist scopes accepted by RBAC app and dataset access config APIs. | | + #### RBACRole | Name | Type | Description | Required | @@ -19820,7 +20065,13 @@ Model class for provider quota configuration. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| RecommendedAppDetailResponse | object | | | +| can_trial | boolean | | No | +| export_data | string | | Yes | +| icon | string | | No | +| icon_background | string | | No | +| id | string | | Yes | +| mode | string | | Yes | +| name | string | | Yes | #### RecommendedAppInfoResponse @@ -19906,12 +20157,28 @@ Model class for provider quota configuration. | ---- | ---- | ----------- | -------- | | url | string | URL to fetch | Yes | +#### ReplaceUserAccessPolicies + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| access_policy_ids | [ string ] | | No | + #### ReplaceUserAccessPoliciesResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | access_policies | [ [AccessPolicy](#accesspolicy) ] | | No | +#### RequestLog + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| created_at | dateTime | The created at of the request log | Yes | +| endpoint | string | The endpoint of the request log | Yes | +| id | string | The id of the request log | Yes | +| request | object | The request of the request log | Yes | +| response | object | The response of the request log | Yes | + #### RerankingModel | Name | Type | Description | Required | @@ -20638,6 +20905,29 @@ Default configuration for form inputs. | type | [ValueSourceType](#valuesourcetype) | | Yes | | value | string | | No | +#### SubscriptionBuilderApiEntity + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_type | [CredentialType](#credentialtype) | The credential type of the subscription builder | Yes | +| credentials | object | The credentials of the subscription builder | Yes | +| endpoint | string | The endpoint id of the subscription builder | Yes | +| id | string | The id of the subscription builder | Yes | +| name | string | The name of the subscription builder | Yes | +| parameters | object | The parameters of the subscription builder | Yes | +| properties | object | The properties of the subscription builder | Yes | +| provider | string | The provider id of the subscription builder | Yes | + +#### SubscriptionConstructor + +The subscription constructor of the trigger provider + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credentials_schema | [ [ProviderConfig](#providerconfig) ] | The credentials schema of the subscription constructor | No | +| oauth_schema | [OAuthSchema](#oauthschema) | The OAuth schema of the subscription constructor if OAuth is supported | No | +| parameters | [ [EventParameter](#eventparameter) ] | The parameters schema of the subscription constructor | No | + #### SubscriptionModel | Name | Type | Description | Required | @@ -20953,6 +21243,12 @@ Enum class for tool provider | ---- | ---- | ----------- | -------- | | ToolProviderType | string | Enum class for tool provider | | +#### ToolSelectorScope + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| ToolSelectorScope | string | | | + #### TraceAppConfigResponse | Name | Type | Description | Required | @@ -21189,12 +21485,18 @@ Enum class for tool provider | updated_at | long | | No | | updated_by | string | | No | +#### TriggerCreationMethod + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TriggerCreationMethod | string | | | + #### TriggerOAuthAuthorizeResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | authorization_url | string | | Yes | -| subscription_builder | | | Yes | +| subscription_builder | [SubscriptionBuilderApiEntity](#subscriptionbuilderapientity) | | Yes | | subscription_builder_id | string | | Yes | #### TriggerOAuthClientPayload @@ -21216,18 +21518,68 @@ Enum class for tool provider | redirect_uri | string | | Yes | | system_configured | boolean | | Yes | +#### TriggerProviderApiEntity + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| author | string | The author of the trigger provider | Yes | +| description | [I18nObject](#i18nobject) | The description of the trigger provider | Yes | +| events | [ [EventApiEntity](#eventapientity) ] | The events of the trigger provider | Yes | +| icon | string | The icon of the trigger provider | No | +| icon_dark | string | The dark icon of the trigger provider | No | +| label | [I18nObject](#i18nobject) | The label of the trigger provider | Yes | +| name | string | The name of the trigger provider | Yes | +| plugin_id | string | The plugin id of the tool | No | +| plugin_unique_identifier | string | The unique identifier of the tool | No | +| subscription_constructor | [SubscriptionConstructor](#subscriptionconstructor) | The subscription constructor of the trigger provider | No | +| subscription_schema | [ [ProviderConfig](#providerconfig) ] | The subscription schema of the trigger provider | No | +| supported_creation_methods | [ [TriggerCreationMethod](#triggercreationmethod) ] | Supported creation methods for the trigger provider. like 'OAUTH', 'APIKEY', 'MANUAL'. | No | +| tags | [ string ] | The tags of the trigger provider | No | + +#### TriggerProviderListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TriggerProviderListResponse | array | | | + #### TriggerProviderOpaqueResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | TriggerProviderOpaqueResponse | | | | +#### TriggerProviderSubscriptionApiEntity + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| credential_type | [CredentialType](#credentialtype) | The type of the credential | Yes | +| credentials | object | The credentials of the subscription | Yes | +| endpoint | string | The endpoint of the subscription | Yes | +| id | string | The unique id of the subscription | Yes | +| name | string | The name of the subscription | Yes | +| parameters | object | The parameters of the subscription | Yes | +| properties | object | The properties of the subscription | Yes | +| provider | string | The provider id of the subscription | Yes | +| workflows_in_use | integer | The number of workflows using this subscription | Yes | + #### TriggerSubscriptionBuilderCreatePayload | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | credential_type | string,
**Default:** unauthorized | | No | +#### TriggerSubscriptionBuilderCreateResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| subscription_builder | [SubscriptionBuilderApiEntity](#subscriptionbuilderapientity) | | Yes | + +#### TriggerSubscriptionBuilderLogsResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| logs | [ [RequestLog](#requestlog) ] | | Yes | + #### TriggerSubscriptionBuilderUpdatePayload | Name | Type | Description | Required | @@ -21243,6 +21595,18 @@ Enum class for tool provider | ---- | ---- | ----------- | -------- | | credentials | object | | Yes | +#### TriggerSubscriptionBuilderVerifyResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| verified | boolean | | Yes | + +#### TriggerSubscriptionListResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| TriggerSubscriptionListResponse | array | | | + #### Type | Name | Type | Description | Required | @@ -21866,11 +22230,71 @@ How a workflow node is bound to an Agent. | ---- | ---- | ----------- | -------- | | WorkflowExecutionStatus | string | | | +#### WorkflowFeatureTogglePayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| enabled | boolean | | No | + +#### WorkflowFeaturesConfigPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| file_upload | [WorkflowFileUploadPayload](#workflowfileuploadpayload) | | No | +| opening_statement | string | | No | +| retriever_resource | [WorkflowFeatureTogglePayload](#workflowfeaturetogglepayload) | | No | +| sensitive_word_avoidance | [WorkflowSensitiveWordAvoidancePayload](#workflowsensitivewordavoidancepayload) | | No | +| speech_to_text | [WorkflowFeatureTogglePayload](#workflowfeaturetogglepayload) | | No | +| suggested_questions | [ string ] | | No | +| suggested_questions_after_answer | [WorkflowSuggestedQuestionsAfterAnswerPayload](#workflowsuggestedquestionsafteranswerpayload) | | No | +| text_to_speech | [WorkflowTextToSpeechPayload](#workflowtexttospeechpayload) | | No | + #### WorkflowFeaturesPayload | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| features | object | Workflow feature configuration | Yes | +| features | [WorkflowFeaturesConfigPayload](#workflowfeaturesconfigpayload) | Workflow feature configuration | Yes | + +#### WorkflowFileUploadImagePayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| detail | string | | No | +| enabled | boolean | | No | +| number_limits | integer | | No | +| transfer_methods | [ string ] | | No | + +#### WorkflowFileUploadPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| allowed_file_extensions | [ string ] | | No | +| allowed_file_types | [ string ] | | No | +| allowed_file_upload_methods | [ string ] | | No | +| audio | [WorkflowFileUploadTransferPayload](#workflowfileuploadtransferpayload) | | No | +| custom | [WorkflowFileUploadTransferPayload](#workflowfileuploadtransferpayload) | | No | +| document | [WorkflowFileUploadTransferPayload](#workflowfileuploadtransferpayload) | | No | +| enabled | boolean | | No | +| fileUploadConfig | object | | No | +| image | [WorkflowFileUploadImagePayload](#workflowfileuploadimagepayload) | | No | +| number_limits | integer | | No | +| preview_config | [WorkflowFileUploadPreviewConfigPayload](#workflowfileuploadpreviewconfigpayload) | | No | +| video | [WorkflowFileUploadTransferPayload](#workflowfileuploadtransferpayload) | | No | + +#### WorkflowFileUploadPreviewConfigPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| file_type_list | [ string ] | | No | +| mode | string | | No | + +#### WorkflowFileUploadTransferPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| enabled | boolean | | No | +| number_limits | integer | | No | +| transfer_methods | [ string ] | | No | #### WorkflowGeneratePayload @@ -22208,6 +22632,14 @@ Query parameters for workflow runs. | workflow_run_id | string | | Yes | | workflow_run_status | [WorkflowExecutionStatus](#workflowexecutionstatus) | | Yes | +#### WorkflowSensitiveWordAvoidancePayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| config | object | | No | +| enabled | boolean | | No | +| type | string | | No | + #### WorkflowStatisticQuery | Name | Type | Description | Required | @@ -22215,6 +22647,23 @@ Query parameters for workflow runs. | end | string | End date and time (YYYY-MM-DD HH:MM) | No | | start | string | Start date and time (YYYY-MM-DD HH:MM) | No | +#### WorkflowSuggestedQuestionsAfterAnswerPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| enabled | boolean | | No | +| model | object | | No | +| prompt | string | | No | + +#### WorkflowTextToSpeechPayload + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| autoPlay | string | | No | +| enabled | boolean | | No | +| language | string | | No | +| voice | string | | No | + #### WorkflowToolCreatePayload | Name | Type | Description | Required | @@ -22377,6 +22826,12 @@ Workflow tool configuration | ---- | ---- | ----------- | -------- | | permission_keys | [ string ] | | No | +#### _AccessControlLanguageQuery + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| language | string | Localized policy label language | No | + #### _AccessPolicyList | Name | Type | Description | Required | @@ -22428,6 +22883,12 @@ Workflow tool configuration | model_provider_name | string | | No | | summary_prompt | string | | No | +#### _DeleteMemberBindingsRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| account_ids | [ string ] | | No | + #### _MembersInRoleList | Name | Type | Description | Required | @@ -22449,6 +22910,37 @@ Workflow tool configuration | data | [ [RBACRole](#rbacrole) ] | | No | | pagination | [Pagination](#pagination) | | No | +#### _ReplaceBindingsRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| account_ids | [ string ] | | No | +| role_ids | [ string ] | | No | + +#### _ReplaceMemberRolesRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| role_ids | [ string ],
**Default:** | | No | + +#### _ResourceAccessScopeRequest + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| scope | [RBACResourceWhitelistScope](#rbacresourcewhitelistscope) | | Yes | + +#### core__entities__provider_entities__BasicProviderConfig__Type + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| core__entities__provider_entities__BasicProviderConfig__Type | string | | | + +#### core__plugin__entities__parameters__PluginParameterAutoGenerate__Type + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| core__plugin__entities__parameters__PluginParameterAutoGenerate__Type | string | | | + #### core__tools__entities__common_entities__I18nObject Model class for i18n object. diff --git a/api/tests/unit_tests/commands/test_generate_swagger_specs.py b/api/tests/unit_tests/commands/test_generate_swagger_specs.py index 403fb0e94a4f99..65d4288f955fd2 100644 --- a/api/tests/unit_tests/commands/test_generate_swagger_specs.py +++ b/api/tests/unit_tests/commands/test_generate_swagger_specs.py @@ -46,6 +46,20 @@ def _get_operations(payload): yield operation +def _response_schema(operation, status="200"): + return operation["responses"][status]["content"]["application/json"]["schema"] + + +def _request_schema(operation, content_type="application/json"): + return operation["requestBody"]["content"][content_type]["schema"] + + +def _nullable_schema_ref(schema): + if "$ref" in schema: + return schema["$ref"] + return next(item["$ref"] for item in schema["anyOf"] if "$ref" in item) + + def test_generate_specs_writes_console_web_and_service_openapi_files(tmp_path): module = _load_generate_swagger_specs_module() @@ -166,6 +180,78 @@ def test_generate_specs_include_agent_v2_knowledge_set_schema_and_query_enums(tm assert schemas["AgentKnowledgeQueryMode"]["enum"] == ["generated_query", "user_query"] +def test_generate_specs_include_console_contract_shapes_for_schema_migration(tmp_path): + module = _load_generate_swagger_specs_module() + + written_paths = module.generate_specs(tmp_path) + console_path = next(path for path in written_paths if path.name == "console-openapi.json") + payload = json.loads(console_path.read_text(encoding="utf-8")) + schemas = payload["components"]["schemas"] + paths = payload["paths"] + + file_upload_schema = _request_schema(paths["/files/upload"]["post"], "multipart/form-data") + assert file_upload_schema["required"] == ["file"] + assert file_upload_schema["properties"]["file"]["format"] == "binary" + assert file_upload_schema["properties"]["file"]["type"] == "string" + assert file_upload_schema["properties"]["source"]["enum"] == ["datasets"] + + invoices_schema_ref = _response_schema(paths["/billing/invoices"]["get"])["$ref"].removeprefix( + "#/components/schemas/" + ) + assert schemas[invoices_schema_ref]["properties"]["url"]["type"] == "string" + + app_detail_schema = schemas["RecommendedAppDetailResponse"] + assert app_detail_schema["properties"]["id"]["type"] == "string" + assert app_detail_schema["properties"]["export_data"]["type"] == "string" + assert {"type": "boolean"} in app_detail_schema["properties"]["can_trial"]["anyOf"] + + plugin_versions = schemas["PluginVersionsResponse"]["properties"]["versions"] + assert plugin_versions["additionalProperties"]["anyOf"][0]["$ref"] == "#/components/schemas/LatestPluginCache" + assert plugin_versions["additionalProperties"]["anyOf"][1]["type"] == "null" + plugin_installations = schemas["PluginInstallationsResponse"]["properties"]["plugins"] + assert plugin_installations["items"]["$ref"] == "#/components/schemas/PluginInstallationItemResponse" + + rbac_whitelist_request = _request_schema(paths["/workspaces/current/rbac/apps/{app_id}/whitelist"]["put"]) + assert rbac_whitelist_request["$ref"] == "#/components/schemas/_ResourceAccessScopeRequest" + app_access_policy_params = paths["/workspaces/current/rbac/apps/{app_id}/access-policy"]["get"]["parameters"] + language_param = next(param for param in app_access_policy_params if param["name"] == "language") + assert language_param["schema"]["enum"] == ["en", "ja", "zh"] + + trigger_list_schema = _response_schema(paths["/workspaces/current/triggers"]["get"]) + assert trigger_list_schema["$ref"] == "#/components/schemas/TriggerProviderListResponse" + trigger_builder_create_schema = _response_schema( + paths["/workspaces/current/trigger-provider/{provider}/subscriptions/builder/create"]["post"] + ) + assert trigger_builder_create_schema["$ref"] == "#/components/schemas/TriggerSubscriptionBuilderCreateResponse" + assert ( + schemas["TriggerSubscriptionBuilderCreateResponse"]["properties"]["subscription_builder"]["$ref"] + == "#/components/schemas/SubscriptionBuilderApiEntity" + ) + + conversation_variables = schemas["ConversationVariableUpdatePayload"]["properties"]["conversation_variables"] + assert conversation_variables["items"]["$ref"] == "#/components/schemas/ConversationVariableItemPayload" + workflow_features = schemas["WorkflowFeaturesPayload"]["properties"]["features"] + assert workflow_features["$ref"] == "#/components/schemas/WorkflowFeaturesConfigPayload" + workflow_feature_properties = schemas["WorkflowFeaturesConfigPayload"]["properties"] + assert _nullable_schema_ref(workflow_feature_properties["suggested_questions_after_answer"]) == ( + "#/components/schemas/WorkflowSuggestedQuestionsAfterAnswerPayload" + ) + assert _nullable_schema_ref(workflow_feature_properties["text_to_speech"]) == ( + "#/components/schemas/WorkflowTextToSpeechPayload" + ) + assert _nullable_schema_ref(workflow_feature_properties["sensitive_word_avoidance"]) == ( + "#/components/schemas/WorkflowSensitiveWordAvoidancePayload" + ) + assert {"enabled", "model", "prompt"} <= set(schemas["WorkflowSuggestedQuestionsAfterAnswerPayload"]["properties"]) + assert {"enabled", "language", "voice", "autoPlay"} <= set(schemas["WorkflowTextToSpeechPayload"]["properties"]) + assert {"enabled", "type", "config"} <= set(schemas["WorkflowSensitiveWordAvoidancePayload"]["properties"]) + file_upload = schemas["WorkflowFileUploadPayload"]["properties"] + assert {"document", "audio", "video", "custom", "preview_config"} <= set(file_upload) + assert "detail" in schemas["WorkflowFileUploadImagePayload"]["properties"] + assert {"mode", "file_type_list"} <= set(schemas["WorkflowFileUploadPreviewConfigPayload"]["properties"]) + assert schemas["AccountWithRole"]["properties"]["avatar_url"]["readOnly"] is True + + def test_checked_in_agent_v2_knowledge_openapi_and_generated_contracts_are_in_sync(): api_dir = Path(__file__).resolve().parents[3] repo_root = api_dir.parent diff --git a/packages/contracts/generated/api/console/apps/types.gen.ts b/packages/contracts/generated/api/console/apps/types.gen.ts index 0354f6cde863d5..27b3aa15b3d416 100644 --- a/packages/contracts/generated/api/console/apps/types.gen.ts +++ b/packages/contracts/generated/api/console/apps/types.gen.ts @@ -1011,9 +1011,7 @@ export type WorkflowDraftVariableList = { } export type ConversationVariableUpdatePayload = { - conversation_variables: Array<{ - [key: string]: unknown - }> + conversation_variables: Array } export type EnvironmentVariableListResponse = { @@ -1021,15 +1019,11 @@ export type EnvironmentVariableListResponse = { } export type EnvironmentVariableUpdatePayload = { - environment_variables: Array<{ - [key: string]: unknown - }> + environment_variables: Array } export type WorkflowFeaturesPayload = { - features: { - [key: string]: unknown - } + features: WorkflowFeaturesConfigPayload } export type HumanInputDeliveryTestPayload = { @@ -1816,6 +1810,7 @@ export type WorkflowCommentBasic = { export type AccountWithRole = { avatar?: string | null + readonly avatar_url: string | null created_at?: number | null email: string id: string @@ -1903,6 +1898,15 @@ export type PipelineVariableResponse = { variable: string } +export type ConversationVariableItemPayload = { + description?: string | null + id?: string | null + name?: string | null + value?: unknown | null + value_type?: string | null + [key: string]: unknown +} + export type EnvironmentVariableItemResponse = { description?: string | null editable: boolean @@ -1916,6 +1920,27 @@ export type EnvironmentVariableItemResponse = { visible: boolean } +export type EnvironmentVariableItemPayload = { + description?: string | null + id?: string | null + name?: string | null + value?: unknown | null + value_type?: string | null + [key: string]: unknown +} + +export type WorkflowFeaturesConfigPayload = { + file_upload?: WorkflowFileUploadPayload | null + opening_statement?: string | null + retriever_resource?: WorkflowFeatureTogglePayload | null + sensitive_word_avoidance?: WorkflowSensitiveWordAvoidancePayload | null + speech_to_text?: WorkflowFeatureTogglePayload | null + suggested_questions?: Array | null + suggested_questions_after_answer?: WorkflowSuggestedQuestionsAfterAnswerPayload | null + text_to_speech?: WorkflowTextToSpeechPayload | null + [key: string]: unknown +} + export type AgentConfigSnapshotSummaryResponse = { agent_id?: string | null created_at?: number | null @@ -2259,6 +2284,55 @@ export type WorkflowRunForArchivedLogResponse = { triggered_from?: string | null } +export type WorkflowFileUploadPayload = { + allowed_file_extensions?: Array | null + allowed_file_types?: Array | null + allowed_file_upload_methods?: Array | null + audio?: WorkflowFileUploadTransferPayload | null + custom?: WorkflowFileUploadTransferPayload | null + document?: WorkflowFileUploadTransferPayload | null + enabled?: boolean | null + fileUploadConfig?: { + [key: string]: unknown + } | null + image?: WorkflowFileUploadImagePayload | null + number_limits?: number | null + preview_config?: WorkflowFileUploadPreviewConfigPayload | null + video?: WorkflowFileUploadTransferPayload | null + [key: string]: unknown +} + +export type WorkflowFeatureTogglePayload = { + enabled?: boolean | null + [key: string]: unknown +} + +export type WorkflowSensitiveWordAvoidancePayload = { + config?: { + [key: string]: unknown + } | null + enabled?: boolean | null + type?: string | null + [key: string]: unknown +} + +export type WorkflowSuggestedQuestionsAfterAnswerPayload = { + enabled?: boolean | null + model?: { + [key: string]: unknown + } | null + prompt?: string | null + [key: string]: unknown +} + +export type WorkflowTextToSpeechPayload = { + autoPlay?: string | null + enabled?: boolean | null + language?: string | null + voice?: string | null + [key: string]: unknown +} + export type AgentScope = 'roster' | 'workflow_only' export type AgentSource = 'agent_app' | 'imported' | 'roster' | 'system' | 'workflow' @@ -2505,6 +2579,26 @@ export type FormInputConfig export type JsonValue2 = unknown +export type WorkflowFileUploadTransferPayload = { + enabled?: boolean | null + number_limits?: number | null + transfer_methods?: Array | null + [key: string]: unknown +} + +export type WorkflowFileUploadImagePayload = { + detail?: string | null + enabled?: boolean | null + number_limits?: number | null + transfer_methods?: Array | null + [key: string]: unknown +} + +export type WorkflowFileUploadPreviewConfigPayload = { + file_type_list?: Array | null + mode?: string | null +} + export type AgentFeatureToggleConfig = { enabled?: boolean [key: string]: unknown @@ -2922,6 +3016,10 @@ export type WorkflowCommentBasicListWritable = { data: Array } +export type WorkflowCommentMentionUsersPayloadWritable = { + users: Array +} + export type WorkflowCommentDetailWritable = { content: string created_at?: number | null @@ -3012,6 +3110,21 @@ export type WorkflowCommentBasicWritable = { updated_at?: number | null } +export type AccountWithRoleWritable = { + avatar?: string | null + created_at?: number | null + email: string + id: string + last_active_at?: number | null + last_login_at?: number | null + name: string + role: string + roles?: Array<{ + [key: string]: string + }> + status: string +} + export type WorkflowCommentAccountWritable = { email: string id: string diff --git a/packages/contracts/generated/api/console/apps/zod.gen.ts b/packages/contracts/generated/api/console/apps/zod.gen.ts index bff73e75da9ee9..d15f047f1c7f98 100644 --- a/packages/contracts/generated/api/console/apps/zod.gen.ts +++ b/packages/contracts/generated/api/console/apps/zod.gen.ts @@ -654,27 +654,6 @@ export const zSyncDraftWorkflowResponse = z.object({ updated_at: z.string().optional(), }) -/** - * ConversationVariableUpdatePayload - */ -export const zConversationVariableUpdatePayload = z.object({ - conversation_variables: z.array(z.record(z.string(), z.unknown())), -}) - -/** - * EnvironmentVariableUpdatePayload - */ -export const zEnvironmentVariableUpdatePayload = z.object({ - environment_variables: z.array(z.record(z.string(), z.unknown())), -}) - -/** - * WorkflowFeaturesPayload - */ -export const zWorkflowFeaturesPayload = z.object({ - features: z.record(z.string(), z.unknown()), -}) - /** * HumanInputDeliveryTestPayload */ @@ -1737,6 +1716,7 @@ export const zSandboxUploadResponse = z.object({ */ export const zAccountWithRole = z.object({ avatar: z.string().nullish(), + avatar_url: z.string().nullable(), created_at: z.int().nullish(), email: z.string(), id: z.string(), @@ -1966,6 +1946,24 @@ export const zWorkflowPaginationResponse = z.object({ page: z.int(), }) +/** + * ConversationVariableItemPayload + */ +export const zConversationVariableItemPayload = z.object({ + description: z.string().nullish(), + id: z.string().nullish(), + name: z.string().nullish(), + value: z.unknown().nullish(), + value_type: z.string().nullish(), +}) + +/** + * ConversationVariableUpdatePayload + */ +export const zConversationVariableUpdatePayload = z.object({ + conversation_variables: z.array(zConversationVariableItemPayload), +}) + /** * EnvironmentVariableItemResponse */ @@ -1989,6 +1987,24 @@ export const zEnvironmentVariableListResponse = z.object({ items: z.array(zEnvironmentVariableItemResponse), }) +/** + * EnvironmentVariableItemPayload + */ +export const zEnvironmentVariableItemPayload = z.object({ + description: z.string().nullish(), + id: z.string().nullish(), + name: z.string().nullish(), + value: z.unknown().nullish(), + value_type: z.string().nullish(), +}) + +/** + * EnvironmentVariableUpdatePayload + */ +export const zEnvironmentVariableUpdatePayload = z.object({ + environment_variables: z.array(zEnvironmentVariableItemPayload), +}) + /** * AgentConfigSnapshotSummaryResponse */ @@ -2668,6 +2684,41 @@ export const zWorkflowArchivedLogPaginationResponse = z.object({ total: z.int(), }) +/** + * WorkflowFeatureTogglePayload + */ +export const zWorkflowFeatureTogglePayload = z.object({ + enabled: z.boolean().nullish(), +}) + +/** + * WorkflowSensitiveWordAvoidancePayload + */ +export const zWorkflowSensitiveWordAvoidancePayload = z.object({ + config: z.record(z.string(), z.unknown()).nullish(), + enabled: z.boolean().nullish(), + type: z.string().nullish(), +}) + +/** + * WorkflowSuggestedQuestionsAfterAnswerPayload + */ +export const zWorkflowSuggestedQuestionsAfterAnswerPayload = z.object({ + enabled: z.boolean().nullish(), + model: z.record(z.string(), z.unknown()).nullish(), + prompt: z.string().nullish(), +}) + +/** + * WorkflowTextToSpeechPayload + */ +export const zWorkflowTextToSpeechPayload = z.object({ + autoPlay: z.string().nullish(), + enabled: z.boolean().nullish(), + language: z.string().nullish(), + voice: z.string().nullish(), +}) + /** * AgentScope * @@ -2937,6 +2988,72 @@ export const zHumanInputFormSubmissionData = z.object({ submitted_data: z.record(z.string(), zJsonValue2).nullish(), }) +/** + * WorkflowFileUploadTransferPayload + */ +export const zWorkflowFileUploadTransferPayload = z.object({ + enabled: z.boolean().nullish(), + number_limits: z.int().nullish(), + transfer_methods: z.array(z.string()).nullish(), +}) + +/** + * WorkflowFileUploadImagePayload + */ +export const zWorkflowFileUploadImagePayload = z.object({ + detail: z.string().nullish(), + enabled: z.boolean().nullish(), + number_limits: z.int().nullish(), + transfer_methods: z.array(z.string()).nullish(), +}) + +/** + * WorkflowFileUploadPreviewConfigPayload + */ +export const zWorkflowFileUploadPreviewConfigPayload = z.object({ + file_type_list: z.array(z.string()).nullish(), + mode: z.string().nullish(), +}) + +/** + * WorkflowFileUploadPayload + */ +export const zWorkflowFileUploadPayload = z.object({ + allowed_file_extensions: z.array(z.string()).nullish(), + allowed_file_types: z.array(z.string()).nullish(), + allowed_file_upload_methods: z.array(z.string()).nullish(), + audio: zWorkflowFileUploadTransferPayload.nullish(), + custom: zWorkflowFileUploadTransferPayload.nullish(), + document: zWorkflowFileUploadTransferPayload.nullish(), + enabled: z.boolean().nullish(), + fileUploadConfig: z.record(z.string(), z.unknown()).nullish(), + image: zWorkflowFileUploadImagePayload.nullish(), + number_limits: z.int().nullish(), + preview_config: zWorkflowFileUploadPreviewConfigPayload.nullish(), + video: zWorkflowFileUploadTransferPayload.nullish(), +}) + +/** + * WorkflowFeaturesConfigPayload + */ +export const zWorkflowFeaturesConfigPayload = z.object({ + file_upload: zWorkflowFileUploadPayload.nullish(), + opening_statement: z.string().nullish(), + retriever_resource: zWorkflowFeatureTogglePayload.nullish(), + sensitive_word_avoidance: zWorkflowSensitiveWordAvoidancePayload.nullish(), + speech_to_text: zWorkflowFeatureTogglePayload.nullish(), + suggested_questions: z.array(z.string()).nullish(), + suggested_questions_after_answer: zWorkflowSuggestedQuestionsAfterAnswerPayload.nullish(), + text_to_speech: zWorkflowTextToSpeechPayload.nullish(), +}) + +/** + * WorkflowFeaturesPayload + */ +export const zWorkflowFeaturesPayload = z.object({ + features: zWorkflowFeaturesConfigPayload, +}) + /** * AgentFeatureToggleConfig */ @@ -4017,6 +4134,29 @@ export const zAppDetailWithSiteWritable = z.object({ workflow: zWorkflowPartial.nullish(), }) +/** + * AccountWithRole + */ +export const zAccountWithRoleWritable = z.object({ + avatar: z.string().nullish(), + created_at: z.int().nullish(), + email: z.string(), + id: z.string(), + last_active_at: z.int().nullish(), + last_login_at: z.int().nullish(), + name: z.string(), + role: z.string(), + roles: z.array(z.record(z.string(), z.string())).optional(), + status: z.string(), +}) + +/** + * WorkflowCommentMentionUsersPayload + */ +export const zWorkflowCommentMentionUsersPayloadWritable = z.object({ + users: z.array(zAccountWithRoleWritable), +}) + /** * WorkflowCommentAccount */ diff --git a/packages/contracts/generated/api/console/billing/types.gen.ts b/packages/contracts/generated/api/console/billing/types.gen.ts index ffcc9835b208da..c303947043dd95 100644 --- a/packages/contracts/generated/api/console/billing/types.gen.ts +++ b/packages/contracts/generated/api/console/billing/types.gen.ts @@ -4,14 +4,18 @@ export type ClientOptions = { baseUrl: `${string}://${string}/console/api` | (string & {}) } -export type BillingResponse = { - [key: string]: unknown +export type BillingInvoiceResponse = { + url: string } export type PartnerTenantsPayload = { click_id: string } +export type BillingResponse = { + [key: string]: unknown +} + export type GetBillingInvoicesData = { body?: never path?: never @@ -20,7 +24,7 @@ export type GetBillingInvoicesData = { } export type GetBillingInvoicesResponses = { - 200: BillingResponse + 200: BillingInvoiceResponse } export type GetBillingInvoicesResponse diff --git a/packages/contracts/generated/api/console/billing/zod.gen.ts b/packages/contracts/generated/api/console/billing/zod.gen.ts index 3292612c048e16..a25890905c0f13 100644 --- a/packages/contracts/generated/api/console/billing/zod.gen.ts +++ b/packages/contracts/generated/api/console/billing/zod.gen.ts @@ -3,9 +3,11 @@ import * as z from 'zod' /** - * BillingResponse + * BillingInvoiceResponse */ -export const zBillingResponse = z.record(z.string(), z.unknown()) +export const zBillingInvoiceResponse = z.object({ + url: z.string(), +}) /** * PartnerTenantsPayload @@ -14,10 +16,15 @@ export const zPartnerTenantsPayload = z.object({ click_id: z.string(), }) +/** + * BillingResponse + */ +export const zBillingResponse = z.record(z.string(), z.unknown()) + /** * Success */ -export const zGetBillingInvoicesResponse = zBillingResponse +export const zGetBillingInvoicesResponse = zBillingInvoiceResponse export const zPutBillingPartnersByPartnerKeyTenantsBody = zPartnerTenantsPayload diff --git a/packages/contracts/generated/api/console/explore/types.gen.ts b/packages/contracts/generated/api/console/explore/types.gen.ts index e5980e3c54d759..2fde922e40f112 100644 --- a/packages/contracts/generated/api/console/explore/types.gen.ts +++ b/packages/contracts/generated/api/console/explore/types.gen.ts @@ -14,7 +14,13 @@ export type LearnDifyAppListResponse = { } export type RecommendedAppDetailResponse = { - [key: string]: unknown + can_trial?: boolean | null + export_data: string + icon?: string | null + icon_background?: string | null + id: string + mode: string + name: string } export type BannerListResponse = Array diff --git a/packages/contracts/generated/api/console/explore/zod.gen.ts b/packages/contracts/generated/api/console/explore/zod.gen.ts index fa29f0ac13eda7..fcd7edd0d25039 100644 --- a/packages/contracts/generated/api/console/explore/zod.gen.ts +++ b/packages/contracts/generated/api/console/explore/zod.gen.ts @@ -5,7 +5,15 @@ import * as z from 'zod' /** * RecommendedAppDetailResponse */ -export const zRecommendedAppDetailResponse = z.record(z.string(), z.unknown()) +export const zRecommendedAppDetailResponse = z.object({ + can_trial: z.boolean().nullish(), + export_data: z.string(), + icon: z.string().nullish(), + icon_background: z.string().nullish(), + id: z.string(), + mode: z.string(), + name: z.string(), +}) /** * BannerResponse diff --git a/packages/contracts/generated/api/console/files/orpc.gen.ts b/packages/contracts/generated/api/console/files/orpc.gen.ts index 2ee949edc20cd2..8a5da7a140ed69 100644 --- a/packages/contracts/generated/api/console/files/orpc.gen.ts +++ b/packages/contracts/generated/api/console/files/orpc.gen.ts @@ -8,6 +8,7 @@ import { zGetFilesByFileIdPreviewResponse, zGetFilesSupportTypeResponse, zGetFilesUploadResponse, + zPostFilesUploadBody, zPostFilesUploadResponse, } from './zod.gen' @@ -44,6 +45,7 @@ export const post = oc successStatus: 201, tags: ['console'], }) + .input(z.object({ body: zPostFilesUploadBody })) .output(zPostFilesUploadResponse) export const upload = { diff --git a/packages/contracts/generated/api/console/files/types.gen.ts b/packages/contracts/generated/api/console/files/types.gen.ts index 277300ce7a3c87..9591924ce62bfd 100644 --- a/packages/contracts/generated/api/console/files/types.gen.ts +++ b/packages/contracts/generated/api/console/files/types.gen.ts @@ -71,7 +71,10 @@ export type GetFilesUploadResponses = { export type GetFilesUploadResponse = GetFilesUploadResponses[keyof GetFilesUploadResponses] export type PostFilesUploadData = { - body?: never + body: { + file: Blob | File + source?: 'datasets' + } path?: never query?: never url: '/files/upload' diff --git a/packages/contracts/generated/api/console/files/zod.gen.ts b/packages/contracts/generated/api/console/files/zod.gen.ts index 4454afcdc869ac..c1827572c9d008 100644 --- a/packages/contracts/generated/api/console/files/zod.gen.ts +++ b/packages/contracts/generated/api/console/files/zod.gen.ts @@ -63,6 +63,11 @@ export const zGetFilesSupportTypeResponse = zAllowedExtensionsResponse */ export const zGetFilesUploadResponse = zUploadConfig +export const zPostFilesUploadBody = z.object({ + file: z.custom(), + source: z.enum(['datasets']).optional(), +}) + /** * File uploaded successfully */ diff --git a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts index 7e676564999c84..a5ab691dbd1772 100644 --- a/packages/contracts/generated/api/console/workspaces/orpc.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/orpc.gen.ts @@ -21,8 +21,10 @@ import { zDeleteWorkspacesCurrentModelProvidersByProviderModelsResponse, zDeleteWorkspacesCurrentRbacAccessPoliciesByPolicyIdPath, zDeleteWorkspacesCurrentRbacAccessPoliciesByPolicyIdResponse, + zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsBody, zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsPath, zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsResponse, + zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsBody, zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsPath, zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsResponse, zDeleteWorkspacesCurrentRbacRolesByRoleIdPath, @@ -106,8 +108,10 @@ import { zGetWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdRoleBindingsPath, zGetWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdRoleBindingsResponse, zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyPath, + zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyQuery, zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyResponse, zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesPath, + zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesQuery, zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesResponse, zGetWorkspacesCurrentRbacAppsByAppIdWhitelistPath, zGetWorkspacesCurrentRbacAppsByAppIdWhitelistResponse, @@ -116,8 +120,10 @@ import { zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdRoleBindingsPath, zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdRoleBindingsResponse, zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyPath, + zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyQuery, zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyResponse, zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesPath, + zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesQuery, zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesResponse, zGetWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistPath, zGetWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistResponse, @@ -390,20 +396,27 @@ import { zPutWorkspacesCurrentRbacAccessPolicyBindingsByBindingIdLockResponse, zPutWorkspacesCurrentRbacAccessPolicyBindingsByBindingIdUnlockPath, zPutWorkspacesCurrentRbacAccessPolicyBindingsByBindingIdUnlockResponse, + zPutWorkspacesCurrentRbacAppsByAppIdUsersByTargetAccountIdAccessPoliciesBody, zPutWorkspacesCurrentRbacAppsByAppIdUsersByTargetAccountIdAccessPoliciesPath, zPutWorkspacesCurrentRbacAppsByAppIdUsersByTargetAccountIdAccessPoliciesResponse, + zPutWorkspacesCurrentRbacAppsByAppIdWhitelistBody, zPutWorkspacesCurrentRbacAppsByAppIdWhitelistPath, zPutWorkspacesCurrentRbacAppsByAppIdWhitelistResponse, + zPutWorkspacesCurrentRbacDatasetsByDatasetIdUsersByTargetAccountIdAccessPoliciesBody, zPutWorkspacesCurrentRbacDatasetsByDatasetIdUsersByTargetAccountIdAccessPoliciesPath, zPutWorkspacesCurrentRbacDatasetsByDatasetIdUsersByTargetAccountIdAccessPoliciesResponse, + zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistBody, zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistPath, zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistResponse, + zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesBody, zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesPath, zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesResponse, zPutWorkspacesCurrentRbacRolesByRoleIdPath, zPutWorkspacesCurrentRbacRolesByRoleIdResponse, + zPutWorkspacesCurrentRbacWorkspaceAppsAccessPoliciesByPolicyIdBindingsBody, zPutWorkspacesCurrentRbacWorkspaceAppsAccessPoliciesByPolicyIdBindingsPath, zPutWorkspacesCurrentRbacWorkspaceAppsAccessPoliciesByPolicyIdBindingsResponse, + zPutWorkspacesCurrentRbacWorkspaceDatasetsAccessPoliciesByPolicyIdBindingsBody, zPutWorkspacesCurrentRbacWorkspaceDatasetsAccessPoliciesByPolicyIdBindingsPath, zPutWorkspacesCurrentRbacWorkspaceDatasetsAccessPoliciesByPolicyIdBindingsResponse, zPutWorkspacesCurrentToolProviderMcpBody, @@ -2229,6 +2242,7 @@ export const delete10 = oc }) .input( z.object({ + body: zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsBody, params: zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsPath, }), ) @@ -2290,7 +2304,12 @@ export const get37 = oc path: '/workspaces/current/rbac/apps/{app_id}/access-policy', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyPath, + query: zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentRbacAppsByAppIdAccessPolicyResponse) export const accessPolicy = { @@ -2305,7 +2324,12 @@ export const get38 = oc path: '/workspaces/current/rbac/apps/{app_id}/user-access-policies', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesPath, + query: zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentRbacAppsByAppIdUserAccessPoliciesResponse) export const userAccessPolicies = { @@ -2322,6 +2346,7 @@ export const put7 = oc }) .input( z.object({ + body: zPutWorkspacesCurrentRbacAppsByAppIdUsersByTargetAccountIdAccessPoliciesBody, params: zPutWorkspacesCurrentRbacAppsByAppIdUsersByTargetAccountIdAccessPoliciesPath, }), ) @@ -2358,7 +2383,12 @@ export const put8 = oc path: '/workspaces/current/rbac/apps/{app_id}/whitelist', tags: ['console'], }) - .input(z.object({ params: zPutWorkspacesCurrentRbacAppsByAppIdWhitelistPath })) + .input( + z.object({ + body: zPutWorkspacesCurrentRbacAppsByAppIdWhitelistBody, + params: zPutWorkspacesCurrentRbacAppsByAppIdWhitelistPath, + }), + ) .output(zPutWorkspacesCurrentRbacAppsByAppIdWhitelistResponse) export const whitelist = { @@ -2389,6 +2419,7 @@ export const delete11 = oc }) .input( z.object({ + body: zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsBody, params: zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsPath, }), @@ -2457,7 +2488,12 @@ export const get42 = oc path: '/workspaces/current/rbac/datasets/{dataset_id}/access-policy', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyPath, + query: zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentRbacDatasetsByDatasetIdAccessPolicyResponse) export const accessPolicy2 = { @@ -2472,7 +2508,12 @@ export const get43 = oc path: '/workspaces/current/rbac/datasets/{dataset_id}/user-access-policies', tags: ['console'], }) - .input(z.object({ params: zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesPath })) + .input( + z.object({ + params: zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesPath, + query: zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesQuery.optional(), + }), + ) .output(zGetWorkspacesCurrentRbacDatasetsByDatasetIdUserAccessPoliciesResponse) export const userAccessPolicies2 = { @@ -2489,6 +2530,7 @@ export const put9 = oc }) .input( z.object({ + body: zPutWorkspacesCurrentRbacDatasetsByDatasetIdUsersByTargetAccountIdAccessPoliciesBody, params: zPutWorkspacesCurrentRbacDatasetsByDatasetIdUsersByTargetAccountIdAccessPoliciesPath, }), ) @@ -2525,7 +2567,12 @@ export const put10 = oc path: '/workspaces/current/rbac/datasets/{dataset_id}/whitelist', tags: ['console'], }) - .input(z.object({ params: zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistPath })) + .input( + z.object({ + body: zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistBody, + params: zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistPath, + }), + ) .output(zPutWorkspacesCurrentRbacDatasetsByDatasetIdWhitelistResponse) export const whitelist2 = { @@ -2564,7 +2611,12 @@ export const put11 = oc path: '/workspaces/current/rbac/members/{member_id}/rbac-roles', tags: ['console'], }) - .input(z.object({ params: zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesPath })) + .input( + z.object({ + body: zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesBody, + params: zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesPath, + }), + ) .output(zPutWorkspacesCurrentRbacMembersByMemberIdRbacRolesResponse) export const rbacRoles = { @@ -2751,6 +2803,7 @@ export const put13 = oc }) .input( z.object({ + body: zPutWorkspacesCurrentRbacWorkspaceAppsAccessPoliciesByPolicyIdBindingsBody, params: zPutWorkspacesCurrentRbacWorkspaceAppsAccessPoliciesByPolicyIdBindingsPath, }), ) @@ -2837,6 +2890,7 @@ export const put14 = oc }) .input( z.object({ + body: zPutWorkspacesCurrentRbacWorkspaceDatasetsAccessPoliciesByPolicyIdBindingsBody, params: zPutWorkspacesCurrentRbacWorkspaceDatasetsAccessPoliciesByPolicyIdBindingsPath, }), ) diff --git a/packages/contracts/generated/api/console/workspaces/types.gen.ts b/packages/contracts/generated/api/console/workspaces/types.gen.ts index 29f23567e95612..46715660bc48ee 100644 --- a/packages/contracts/generated/api/console/workspaces/types.gen.ts +++ b/packages/contracts/generated/api/console/workspaces/types.gen.ts @@ -433,11 +433,13 @@ export type ParserLatest = { } export type PluginInstallationsResponse = { - plugins: unknown + plugins: Array } export type PluginVersionsResponse = { - versions: unknown + versions: { + [key: string]: LatestPluginCache | null + } } export type PluginDynamicOptionsResponse = { @@ -530,6 +532,10 @@ export type AccessPolicyBindingState = { is_locked?: boolean } +export type DeleteMemberBindingsRequest = { + account_ids?: Array +} + export type MemberBindingsResponse = { data?: Array } @@ -548,6 +554,10 @@ export type ResourceUserAccessPoliciesResponse = { scope: string } +export type ReplaceUserAccessPolicies = { + access_policy_ids?: Array +} + export type ReplaceUserAccessPoliciesResponse = { access_policies?: Array } @@ -556,6 +566,10 @@ export type ResourceWhitelist = { account_ids?: Array } +export type ResourceAccessScopeRequest = { + scope: RbacResourceWhitelistScope +} + export type DatasetAccessMatrix = { dataset_id?: string items?: Array @@ -566,6 +580,10 @@ export type MemberRolesResponse = { roles?: Array } +export type ReplaceMemberRolesRequest = { + role_ids?: Array +} + export type MyPermissionsResponse = { app?: ResourcePermissionSnapshot dataset?: ResourcePermissionSnapshot @@ -598,6 +616,11 @@ export type MembersInRoleList = { pagination?: Pagination | null } +export type ReplaceBindingsRequest = { + account_ids?: Array + role_ids?: Array +} + export type AccessMatrixItem = { accounts?: Array policy?: AccessPolicy | null @@ -781,7 +804,21 @@ export type WorkflowToolUpdatePayload = { workflow_tool_id: string } -export type TriggerProviderOpaqueResponse = unknown +export type TriggerProviderApiEntity = { + author: string + description: I18nObject + events: Array + icon?: string | null + icon_dark?: string | null + label: I18nObject + name: string + plugin_id?: string | null + plugin_unique_identifier?: string | null + subscription_constructor?: SubscriptionConstructor | null + subscription_schema?: Array + supported_creation_methods?: Array + tags?: Array +} export type TriggerOAuthClientResponse = { configured: boolean @@ -815,22 +852,57 @@ export type TriggerSubscriptionBuilderUpdatePayload = { } | null } +export type TriggerProviderOpaqueResponse = unknown + export type TriggerSubscriptionBuilderCreatePayload = { credential_type?: string } +export type TriggerSubscriptionBuilderCreateResponse = { + subscription_builder: SubscriptionBuilderApiEntity +} + +export type TriggerSubscriptionBuilderLogsResponse = { + logs: Array +} + +export type SubscriptionBuilderApiEntity = { + credential_type: CredentialType + credentials: { + [key: string]: string + } + endpoint: string + id: string + name: string + parameters: { + [key: string]: unknown + } + properties: { + [key: string]: unknown + } + provider: string +} + export type TriggerSubscriptionBuilderVerifyPayload = { credentials: { [key: string]: unknown } } +export type TriggerSubscriptionBuilderVerifyResponse = { + verified: boolean +} + +export type TriggerSubscriptionListResponse = Array + export type TriggerOAuthAuthorizeResponse = { authorization_url: string - subscription_builder: unknown + subscription_builder: SubscriptionBuilderApiEntity subscription_builder_id: string } +export type TriggerProviderListResponse = Array + export type WorkspaceCustomConfigPayload = { remove_webapp_brand?: boolean | null replace_webapp_logo?: string | null @@ -923,6 +995,7 @@ export type AnonymousInlineModel7B8B49Ca164e = { export type AccountWithRole = { avatar?: string | null + readonly avatar_url: string | null created_at?: number | null email: string id: string @@ -1058,6 +1131,36 @@ export type PluginAutoUpgradeSettingsResponseModel = { upgrade_time_of_day: number } +export type PluginInstallationItemResponse = { + checksum: string + created_at: string + declaration: { + [key: string]: unknown + } + endpoints_active: number + endpoints_setups: number + id: string + meta: { + [key: string]: unknown + } + plugin_id: string + plugin_unique_identifier: string + runtime_type: string + source: PluginInstallationSource + tenant_id: string + updated_at: string + version: string +} + +export type LatestPluginCache = { + alternative_plugin_id: string + deprecated_reason: string + plugin_id: string + status: string + unique_identifier: string + version: string +} + export type DebugPermission = 'admins' | 'everyone' | 'noone' export type InstallPermission = 'admins' | 'everyone' | 'noone' @@ -1148,6 +1251,8 @@ export type ResourceUserAccessPolicies = { roles?: Array } +export type RbacResourceWhitelistScope = 'all' | 'only_me' | 'specific' + export type ResourcePermissionSnapshot = { default_permission_keys?: Array overrides?: Array @@ -1198,6 +1303,75 @@ export type WorkflowToolParameterConfiguration = { name: string } +export type I18nObject = { + en_US: string + ja_JP?: string | null + pt_BR?: string | null + zh_Hans?: string | null +} + +export type EventApiEntity = { + description: I18nObject + identity: EventIdentity + name: string + output_schema: { + [key: string]: unknown + } | null + parameters: Array +} + +export type SubscriptionConstructor = { + credentials_schema?: Array + oauth_schema?: OAuthSchema | null + parameters?: Array +} + +export type ProviderConfig = { + default?: number | string | number | boolean | null + help?: I18nObject | null + label?: I18nObject | null + multiple?: boolean + name: string + options?: Array