From 571c3d176debf8017809d63111e28024bf98237f Mon Sep 17 00:00:00 2001 From: yunyingk Date: Wed, 26 Aug 2026 11:41:34 +0800 Subject: [PATCH] Refine raw OpenAPI with response data envelope and tenant server --- dist/raw-seal-openapi.json | 1319 +++++++++++++++++++++++++++++-- scripts/generate-raw-openapi.ts | 622 +++++---------- 2 files changed, 1456 insertions(+), 485 deletions(-) diff --git a/dist/raw-seal-openapi.json b/dist/raw-seal-openapi.json index 716a207..3f01acd 100644 --- a/dist/raw-seal-openapi.json +++ b/dist/raw-seal-openapi.json @@ -7,8 +7,14 @@ }, "servers": [ { - "url": "https://seal.example.com", - "description": "Downstream Seal AI server root" + "url": "https://{corpId}.sealai.cc", + "description": "Seal AI 企业租户环境 (例如: https://id01jdq2yidnmr.sealai.cc)", + "variables": { + "corpId": { + "default": "id01jdq2yidnmr", + "description": "合思/Seal 企业租户 ID (小写)" + } + } } ], "security": [ @@ -64,6 +70,7 @@ "tags": [ "Auth & Session" ], + "x-apifox-folder": "原始业务接口/Auth & Session", "summary": "获取当前登录用户与租户信息", "operationId": "getMe", "responses": { @@ -72,7 +79,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MeData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/MeData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -85,6 +120,7 @@ "tags": [ "Auth & Session" ], + "x-apifox-folder": "原始业务接口/Auth & Session", "summary": "获取当前会话及转授权信息", "operationId": "getSession", "responses": { @@ -93,7 +129,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealSessionData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealSessionData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -106,6 +170,7 @@ "tags": [ "Auth & Session" ], + "x-apifox-folder": "原始业务接口/Auth & Session", "summary": "手机号与密码登录", "operationId": "loginWithPhonePassword", "requestBody": { @@ -155,6 +220,16 @@ } } } + }, + "401": { + "description": "认证失败", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -164,6 +239,7 @@ "tags": [ "Auth & Session" ], + "x-apifox-folder": "原始业务接口/Auth & Session", "summary": "合思 OEM SSO 换取 Seal 会话 Token", "operationId": "oauthHosecloudSession", "parameters": [ @@ -204,6 +280,16 @@ } } } + }, + "400": { + "description": "换票失败", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -213,6 +299,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "获取当前草稿规则列表", "operationId": "listApprovalRules", "responses": { @@ -221,7 +308,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalRulesData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalRulesData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -232,6 +347,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "新增审批规则草稿", "operationId": "createApprovalRule", "requestBody": { @@ -250,7 +366,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalRule" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalRule" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -263,6 +407,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "修改审批规则草稿", "operationId": "updateApprovalRule", "parameters": [ @@ -292,7 +437,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalRule" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalRule" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -303,6 +476,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "删除审批规则草稿", "operationId": "deleteApprovalRule", "parameters": [ @@ -328,6 +502,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "规则批量重排与重编号", "operationId": "recodeApprovalRules", "responses": { @@ -342,6 +517,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "获取已发布规则版本列表", "operationId": "listApprovalRuleVersions", "responses": { @@ -350,13 +526,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RuleSetVersion" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RuleSetVersion" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -366,6 +570,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "获取单个已发布规则版本详情", "operationId": "getApprovalRuleVersion", "parameters": [ @@ -385,7 +590,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleSetVersion" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/RuleSetVersion" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -398,6 +631,7 @@ "tags": [ "Approval Rules" ], + "x-apifox-folder": "原始业务接口/Approval Rules", "summary": "将当前草稿规则发布为正式版本", "operationId": "publishApprovalRuleVersion", "requestBody": { @@ -425,7 +659,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublishVersionData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/PublishVersionData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -438,6 +700,7 @@ "tags": [ "Knowledge Documents" ], + "x-apifox-folder": "原始业务接口/Knowledge Documents", "summary": "获取知识库文档列表", "operationId": "listApprovalDocuments", "parameters": [ @@ -484,7 +747,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalDocumentListData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalDocumentListData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -495,6 +786,7 @@ "tags": [ "Knowledge Documents" ], + "x-apifox-folder": "原始业务接口/Knowledge Documents", "summary": "新建知识库文档", "operationId": "createApprovalDocument", "requestBody": { @@ -513,7 +805,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalDocument" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalDocument" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -526,6 +846,7 @@ "tags": [ "Knowledge Documents" ], + "x-apifox-folder": "原始业务接口/Knowledge Documents", "summary": "获取单个知识文档详情", "operationId": "getApprovalDocument", "parameters": [ @@ -544,7 +865,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalDocument" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalDocument" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -555,6 +904,7 @@ "tags": [ "Knowledge Documents" ], + "x-apifox-folder": "原始业务接口/Knowledge Documents", "summary": "修改知识库文档", "operationId": "updateApprovalDocument", "parameters": [ @@ -588,7 +938,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalDocument" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalDocument" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -601,6 +979,7 @@ "tags": [ "Agent & Style Preferences" ], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", "summary": "获取 AI 审批配置与偏好", "operationId": "getApprovalStylePreferences", "responses": { @@ -609,7 +988,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalStylePreferences" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalStylePreferences" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -620,6 +1027,7 @@ "tags": [ "Agent & Style Preferences" ], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", "summary": "局部更新 AI 审批配置与偏好", "operationId": "patchApprovalStylePreferences", "requestBody": { @@ -639,7 +1047,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalStylePreferences" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalStylePreferences" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -650,6 +1086,7 @@ "tags": [ "Agent & Style Preferences" ], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", "summary": "覆盖保存 AI 审批配置与偏好", "operationId": "saveApprovalStylePreferences", "requestBody": { @@ -674,6 +1111,7 @@ "tags": [ "Agent & Style Preferences" ], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", "summary": "接收外部 Webhook 审批进单", "operationId": "incomingWebhookDocument", "parameters": [ @@ -709,6 +1147,7 @@ "tags": [ "Agent & Style Preferences" ], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", "summary": "接收外部 Webhook 人工终审结果回传", "operationId": "incomingWebhookManualResult", "parameters": [ @@ -744,6 +1183,7 @@ "tags": [ "Approval Runs" ], + "x-apifox-folder": "原始业务接口/Approval Runs", "summary": "查询审批运行记录列表", "operationId": "listApprovalRuns", "parameters": [ @@ -828,7 +1268,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalRunListData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalRunListData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -841,6 +1309,7 @@ "tags": [ "Approval Runs" ], + "x-apifox-folder": "原始业务接口/Approval Runs", "summary": "获取单条审批运行记录详情", "operationId": "getApprovalRun", "parameters": [ @@ -859,7 +1328,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApprovalRun" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ApprovalRun" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -872,6 +1369,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "创建合思指定单号/条件仿真测试批次", "operationId": "createSimulationBatch", "requestBody": { @@ -890,7 +1388,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SimulationCreateResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SimulationCreateResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -903,6 +1429,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "创建材料包仿真测试批次", "operationId": "createMaterialPackBatch", "requestBody": { @@ -921,7 +1448,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SimulationCreateResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SimulationCreateResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -934,6 +1489,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取仿真测试批次列表", "operationId": "listSimulationBatches", "parameters": [ @@ -952,13 +1508,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SimulationBatch" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationBatch" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -968,6 +1552,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取单个仿真测试批次详情", "operationId": "getSimulationBatch", "parameters": [ @@ -986,7 +1571,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SimulationBatch" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SimulationBatch" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -999,6 +1612,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取仿真批次产生的审批记录", "operationId": "listSimulationBatchRecords", "parameters": [ @@ -1017,13 +1631,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApprovalRun" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApprovalRun" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1033,6 +1675,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "清理仿真批次生成的业务测试数据", "operationId": "cleanSimulationBatchData", "parameters": [ @@ -1057,6 +1700,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取仿真单据模板列表", "operationId": "listSimulationTemplates", "responses": { @@ -1065,13 +1709,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SimulationTemplate" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationTemplate" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1081,6 +1753,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取各外部系统仿真对接可用状态", "operationId": "getSimulationIntegrationStatus", "responses": { @@ -1089,7 +1762,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SimulationIntegrationStatus" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SimulationIntegrationStatus" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1102,6 +1803,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取合思企业集成实例列表", "operationId": "listSimulationHosecloudIntegrations", "responses": { @@ -1110,13 +1812,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SimulationHosecloudIntegration" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationHosecloudIntegration" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1126,6 +1856,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "获取合思审批流规格列表", "operationId": "listSimulationSpecifications", "responses": { @@ -1134,13 +1865,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SimulationSpecification" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationSpecification" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1150,6 +1909,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "按 signKey 获取合思审批流规格", "operationId": "listSimulationSpecificationsBySignKey", "parameters": [ @@ -1168,13 +1928,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SimulationSpecification" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationSpecification" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1184,6 +1972,7 @@ "tags": [ "Simulation & Testing" ], + "x-apifox-folder": "原始业务接口/Simulation & Testing", "summary": "上传材料包 ZIP 文件", "operationId": "uploadMaterialPackage", "requestBody": { @@ -1212,7 +2001,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MaterialPackage" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/MaterialPackage" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1225,6 +2042,7 @@ "tags": [ "Delegation" ], + "x-apifox-folder": "原始业务接口/Delegation", "summary": "获取转授权/协助令牌列表", "operationId": "listDelegations", "responses": { @@ -1233,13 +2051,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SealDelegationItem" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SealDelegationItem" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1249,6 +2095,7 @@ "tags": [ "Delegation" ], + "x-apifox-folder": "原始业务接口/Delegation", "summary": "创建转授权协助链接", "operationId": "createDelegation", "requestBody": { @@ -1273,7 +2120,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealDelegationCreateResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealDelegationCreateResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1286,6 +2161,7 @@ "tags": [ "Delegation" ], + "x-apifox-folder": "原始业务接口/Delegation", "summary": "作废转授权令牌", "operationId": "revokeDelegation", "requestBody": { @@ -1318,6 +2194,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "获取根部门子部门列表", "operationId": "getRootDepartmentChildren", "responses": { @@ -1332,6 +2209,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "创建本地用户", "operationId": "createLocalUser", "requestBody": { @@ -1376,7 +2254,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealUserCreateResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealUserCreateResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1389,6 +2295,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "重置本地用户密码", "operationId": "resetUserPassword", "parameters": [ @@ -1407,7 +2314,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealUserResetPasswordResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealUserResetPasswordResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1420,6 +2355,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "获取用户详情", "operationId": "getUserDetail", "parameters": [ @@ -1438,7 +2374,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealUserDetail" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealUserDetail" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1451,6 +2415,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "按关键字或手机号搜索用户/部门", "operationId": "searchUsers", "parameters": [ @@ -1468,7 +2433,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SealContactSearchResult" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/SealContactSearchResult" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1481,6 +2474,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "删除/离职本地用户", "operationId": "deleteLocalUser", "parameters": [ @@ -1505,6 +2499,7 @@ "tags": [ "Contacts & Users" ], + "x-apifox-folder": "原始业务接口/Contacts & Users", "summary": "重新激活离职用户", "operationId": "activateLocalUser", "parameters": [ @@ -1529,6 +2524,7 @@ "tags": [ "HoseCloud OEM Integration" ], + "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", "summary": "验证并获取合思企业 CorporationId", "operationId": "getHosecloudCorporation", "requestBody": { @@ -1567,14 +2563,42 @@ "application/json": { "schema": { "type": "object", + "required": [ + "data" + ], "properties": { - "corporationId": { - "type": "string" + "data": { + "type": "object", + "properties": { + "corporationId": { + "type": "string" + } + } } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1584,6 +2608,7 @@ "tags": [ "HoseCloud OEM Integration" ], + "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", "summary": "同步合思出站配置与回调 Webhook", "operationId": "syncHosecloudOutbound", "requestBody": { @@ -1632,6 +2657,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取当前租户大模型配置", "operationId": "getLlmConfig", "responses": { @@ -1640,7 +2666,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LlmConfig" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/LlmConfig" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1653,6 +2707,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取系统支持的大模型提供商列表", "operationId": "listLlmProviders", "responses": { @@ -1661,13 +2716,41 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LlmProvider" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LlmProvider" + } + } } } } } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } @@ -1677,6 +2760,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取系统可用权限列表", "operationId": "listAvailablePermissions", "responses": { @@ -1685,7 +2769,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AvailablePermissionsData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/AvailablePermissionsData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1698,6 +2810,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取系统权限配置", "operationId": "listPermissionConfigs", "responses": { @@ -1706,7 +2819,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionConfigsData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/PermissionConfigsData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1719,6 +2860,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取租户订阅与计费状态", "operationId": "getBillingStatus", "responses": { @@ -1727,7 +2869,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BillingStatusData" + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/BillingStatusData" + } + } + } + } + } + }, + "400": { + "description": "请求参数错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "未授权或 Token 无效", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1740,6 +2910,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取计费套餐列表", "operationId": "listBillingPlans", "responses": { @@ -1754,6 +2925,7 @@ "tags": [ "System, LLM & Billing" ], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", "summary": "获取计费功能开关与额度", "operationId": "listBillingFeatures", "responses": { @@ -1770,10 +2942,35 @@ "type": "http", "scheme": "bearer", "bearerFormat": "JWT / Session Token", - "description": "Seal AI 下游原生 Bearer 认证 Token" + "description": "Seal AI 下游原生 Bearer 认证 Token (Authorization: Bearer )" } }, "schemas": { + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "错误标识码 (例如: error:auth:invalid-token)" + }, + "message": { + "type": "string", + "description": "错误详细描述" + } + } + } + } + }, "HosecloudStaff": { "type": "object", "required": [ diff --git a/scripts/generate-raw-openapi.ts b/scripts/generate-raw-openapi.ts index 03510e6..1957f10 100644 --- a/scripts/generate-raw-openapi.ts +++ b/scripts/generate-raw-openapi.ts @@ -5,6 +5,41 @@ import { dirname, resolve } from "node:path"; const outputFile = resolve("dist/raw-seal-openapi.json"); +function dataResponse(description: string, dataSchema: any) { + return { + "200": { + description, + content: { + "application/json": { + schema: { + type: "object", + required: ["data"], + properties: { + data: dataSchema + } + } + } + } + }, + "401": { + description: "未授权或 Token 无效", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ErrorResponse" } + } + } + }, + "400": { + description: "请求参数错误", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ErrorResponse" } + } + } + } + }; +} + const spec = { openapi: "3.1.0", info: { @@ -14,8 +49,14 @@ const spec = { }, servers: [ { - url: "https://seal.example.com", - description: "Downstream Seal AI server root" + url: "https://{corpId}.sealai.cc", + description: "Seal AI 企业租户环境 (例如: https://id01jdq2yidnmr.sealai.cc)", + variables: { + corpId: { + default: "id01jdq2yidnmr", + description: "合思/Seal 企业租户 ID (小写)" + } + } } ], security: [ @@ -39,40 +80,25 @@ const spec = { "/api/v1/auth/me": { get: { tags: ["Auth & Session"], + "x-apifox-folder": "原始业务接口/Auth & Session", summary: "获取当前登录用户与租户信息", operationId: "getMe", - responses: { - "200": { - description: "当前身份信息", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/MeData" } - } - } - } - } + responses: dataResponse("当前身份信息", { $ref: "#/components/schemas/MeData" }) } }, "/api/auth/get-session": { get: { tags: ["Auth & Session"], + "x-apifox-folder": "原始业务接口/Auth & Session", summary: "获取当前会话及转授权信息", operationId: "getSession", - responses: { - "200": { - description: "当前会话数据", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealSessionData" } - } - } - } - } + responses: dataResponse("当前会话数据", { $ref: "#/components/schemas/SealSessionData" }) } }, "/api/auth/sms-otp/sign-in-password": { post: { tags: ["Auth & Session"], + "x-apifox-folder": "原始业务接口/Auth & Session", summary: "手机号与密码登录", operationId: "loginWithPhonePassword", requestBody: { @@ -109,6 +135,14 @@ const spec = { } } } + }, + "401": { + description: "认证失败", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ErrorResponse" } + } + } } } } @@ -116,6 +150,7 @@ const spec = { "/api/auth/oauth2/session/oem-hosecloud": { get: { tags: ["Auth & Session"], + "x-apifox-folder": "原始业务接口/Auth & Session", summary: "合思 OEM SSO 换取 Seal 会话 Token", operationId: "oauthHosecloudSession", parameters: [ @@ -147,6 +182,14 @@ const spec = { } } } + }, + "400": { + description: "换票失败", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ErrorResponse" } + } + } } } } @@ -154,21 +197,14 @@ const spec = { "/api/v1/rules": { get: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "获取当前草稿规则列表", operationId: "listApprovalRules", - responses: { - "200": { - description: "规则列表数据", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalRulesData" } - } - } - } - } + responses: dataResponse("规则列表数据", { $ref: "#/components/schemas/ApprovalRulesData" }) }, post: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "新增审批规则草稿", operationId: "createApprovalRule", requestBody: { @@ -179,21 +215,13 @@ const spec = { } } }, - responses: { - "200": { - description: "创建成功的规则", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalRule" } - } - } - } - } + responses: dataResponse("创建成功的规则", { $ref: "#/components/schemas/ApprovalRule" }) } }, "/api/v1/rules/{ruleId}": { put: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "修改审批规则草稿", operationId: "updateApprovalRule", parameters: [ @@ -213,19 +241,11 @@ const spec = { } } }, - responses: { - "200": { - description: "更新后的规则", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalRule" } - } - } - } - } + responses: dataResponse("更新后的规则", { $ref: "#/components/schemas/ApprovalRule" }) }, delete: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "删除审批规则草稿", operationId: "deleteApprovalRule", parameters: [ @@ -247,6 +267,7 @@ const spec = { "/api/v1/rules/batch-recode": { post: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "规则批量重排与重编号", operationId: "recodeApprovalRules", responses: { @@ -259,26 +280,19 @@ const spec = { "/api/v1/rule-set-versions": { get: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "获取已发布规则版本列表", operationId: "listApprovalRuleVersions", - responses: { - "200": { - description: "已发布规则版本列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/RuleSetVersion" } - } - } - } - } - } + responses: dataResponse("已发布规则版本列表", { + type: "array", + items: { $ref: "#/components/schemas/RuleSetVersion" } + }) } }, "/api/v1/rule-set-versions/{versionId}": { get: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "获取单个已发布规则版本详情", operationId: "getApprovalRuleVersion", parameters: [ @@ -290,21 +304,13 @@ const spec = { description: "版本 ID" } ], - responses: { - "200": { - description: "版本详情", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/RuleSetVersion" } - } - } - } - } + responses: dataResponse("版本详情", { $ref: "#/components/schemas/RuleSetVersion" }) } }, "/api/v1/rule-set-versions/publish": { post: { tags: ["Approval Rules"], + "x-apifox-folder": "原始业务接口/Approval Rules", summary: "将当前草稿规则发布为正式版本", operationId: "publishApprovalRuleVersion", requestBody: { @@ -321,21 +327,13 @@ const spec = { } } }, - responses: { - "200": { - description: "发布结果", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/PublishVersionData" } - } - } - } - } + responses: dataResponse("发布结果", { $ref: "#/components/schemas/PublishVersionData" }) } }, "/api/v1/knowledge/articles": { get: { tags: ["Knowledge Documents"], + "x-apifox-folder": "原始业务接口/Knowledge Documents", summary: "获取知识库文档列表", operationId: "listApprovalDocuments", parameters: [ @@ -344,19 +342,11 @@ const spec = { { name: "sortBy", in: "query", schema: { type: "string", default: "createdAt" } }, { name: "sortOrder", in: "query", schema: { type: "string", enum: ["asc", "desc"], default: "desc" } } ], - responses: { - "200": { - description: "知识文档列表", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalDocumentListData" } - } - } - } - } + responses: dataResponse("知识文档列表", { $ref: "#/components/schemas/ApprovalDocumentListData" }) }, post: { tags: ["Knowledge Documents"], + "x-apifox-folder": "原始业务接口/Knowledge Documents", summary: "新建知识库文档", operationId: "createApprovalDocument", requestBody: { @@ -367,39 +357,23 @@ const spec = { } } }, - responses: { - "200": { - description: "创建成功的文档", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalDocument" } - } - } - } - } + responses: dataResponse("创建成功的文档", { $ref: "#/components/schemas/ApprovalDocument" }) } }, "/api/v1/knowledge/articles/{documentId}": { get: { tags: ["Knowledge Documents"], + "x-apifox-folder": "原始业务接口/Knowledge Documents", summary: "获取单个知识文档详情", operationId: "getApprovalDocument", parameters: [ { name: "documentId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "知识文档详情", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalDocument" } - } - } - } - } + responses: dataResponse("知识文档详情", { $ref: "#/components/schemas/ApprovalDocument" }) }, patch: { tags: ["Knowledge Documents"], + "x-apifox-folder": "原始业务接口/Knowledge Documents", summary: "修改知识库文档", operationId: "updateApprovalDocument", parameters: [ @@ -418,36 +392,20 @@ const spec = { } } }, - responses: { - "200": { - description: "更新后的文档", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalDocument" } - } - } - } - } + responses: dataResponse("更新后的文档", { $ref: "#/components/schemas/ApprovalDocument" }) } }, "/api/v1/agent/ai-approval/config": { get: { tags: ["Agent & Style Preferences"], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", summary: "获取 AI 审批配置与偏好", operationId: "getApprovalStylePreferences", - responses: { - "200": { - description: "AI 审批偏好配置", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalStylePreferences" } - } - } - } - } + responses: dataResponse("AI 审批偏好配置", { $ref: "#/components/schemas/ApprovalStylePreferences" }) }, patch: { tags: ["Agent & Style Preferences"], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", summary: "局部更新 AI 审批配置与偏好", operationId: "patchApprovalStylePreferences", requestBody: { @@ -458,19 +416,11 @@ const spec = { } } }, - responses: { - "200": { - description: "更新后的偏好配置", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalStylePreferences" } - } - } - } - } + responses: dataResponse("更新后的偏好配置", { $ref: "#/components/schemas/ApprovalStylePreferences" }) }, post: { tags: ["Agent & Style Preferences"], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", summary: "覆盖保存 AI 审批配置与偏好", operationId: "saveApprovalStylePreferences", requestBody: { @@ -491,6 +441,7 @@ const spec = { "/api/v1/integrations/webhook/{webhookId}/document": { post: { tags: ["Agent & Style Preferences"], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", summary: "接收外部 Webhook 审批进单", operationId: "incomingWebhookDocument", parameters: [ @@ -514,6 +465,7 @@ const spec = { "/api/v1/integrations/webhook/{webhookId}/manual-result": { post: { tags: ["Agent & Style Preferences"], + "x-apifox-folder": "原始业务接口/Agent & Style Preferences", summary: "接收外部 Webhook 人工终审结果回传", operationId: "incomingWebhookManualResult", parameters: [ @@ -537,6 +489,7 @@ const spec = { "/api/v1/approvals": { get: { tags: ["Approval Runs"], + "x-apifox-folder": "原始业务接口/Approval Runs", summary: "查询审批运行记录列表", operationId: "listApprovalRuns", parameters: [ @@ -551,41 +504,25 @@ const spec = { { name: "sourceDocumentSN", in: "query", schema: { type: "string" } }, { name: "sourceDocumentId", in: "query", schema: { type: "string" } } ], - responses: { - "200": { - description: "审批运行记录列表", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalRunListData" } - } - } - } - } + responses: dataResponse("审批运行记录列表", { $ref: "#/components/schemas/ApprovalRunListData" }) } }, "/api/v1/approvals/{runId}": { get: { tags: ["Approval Runs"], + "x-apifox-folder": "原始业务接口/Approval Runs", summary: "获取单条审批运行记录详情", operationId: "getApprovalRun", parameters: [ { name: "runId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "审批运行详情", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/ApprovalRun" } - } - } - } - } + responses: dataResponse("审批运行详情", { $ref: "#/components/schemas/ApprovalRun" }) } }, "/api/v1/simulation/create-batch": { post: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "创建合思指定单号/条件仿真测试批次", operationId: "createSimulationBatch", requestBody: { @@ -596,21 +533,13 @@ const spec = { } } }, - responses: { - "200": { - description: "创建结果", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SimulationCreateResult" } - } - } - } - } + responses: dataResponse("创建结果", { $ref: "#/components/schemas/SimulationCreateResult" }) } }, "/api/v1/simulation/create-material-pack-batch": { post: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "创建材料包仿真测试批次", operationId: "createMaterialPackBatch", requestBody: { @@ -621,87 +550,55 @@ const spec = { } } }, - responses: { - "200": { - description: "创建结果", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SimulationCreateResult" } - } - } - } - } + responses: dataResponse("创建结果", { $ref: "#/components/schemas/SimulationCreateResult" }) } }, "/api/v1/simulation/batches": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取仿真测试批次列表", operationId: "listSimulationBatches", parameters: [ { name: "limit", in: "query", schema: { type: "integer", default: 50 } } ], - responses: { - "200": { - description: "仿真批次列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SimulationBatch" } - } - } - } - } - } + responses: dataResponse("仿真批次列表", { + type: "array", + items: { $ref: "#/components/schemas/SimulationBatch" } + }) } }, "/api/v1/simulation/batch/{batchId}": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取单个仿真测试批次详情", operationId: "getSimulationBatch", parameters: [ { name: "batchId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "仿真批次详情", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SimulationBatch" } - } - } - } - } + responses: dataResponse("仿真批次详情", { $ref: "#/components/schemas/SimulationBatch" }) } }, "/api/v1/simulation/batch/{batchId}/records": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取仿真批次产生的审批记录", operationId: "listSimulationBatchRecords", parameters: [ { name: "batchId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "审批记录列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/ApprovalRun" } - } - } - } - } - } + responses: dataResponse("审批记录列表", { + type: "array", + items: { $ref: "#/components/schemas/ApprovalRun" } + }) } }, "/api/v1/simulation/batch/{batchId}/data": { delete: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "清理仿真批次生成的业务测试数据", operationId: "cleanSimulationBatchData", parameters: [ @@ -717,106 +614,67 @@ const spec = { "/api/v1/simulation/templates": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取仿真单据模板列表", operationId: "listSimulationTemplates", - responses: { - "200": { - description: "模板列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SimulationTemplate" } - } - } - } - } - } + responses: dataResponse("模板列表", { + type: "array", + items: { $ref: "#/components/schemas/SimulationTemplate" } + }) } }, "/api/v1/simulation/integration-status": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取各外部系统仿真对接可用状态", operationId: "getSimulationIntegrationStatus", - responses: { - "200": { - description: "对接可用性状态", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SimulationIntegrationStatus" } - } - } - } - } + responses: dataResponse("对接可用性状态", { $ref: "#/components/schemas/SimulationIntegrationStatus" }) } }, "/api/v1/simulation/hosecloud-integrations": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取合思企业集成实例列表", operationId: "listSimulationHosecloudIntegrations", - responses: { - "200": { - description: "合思集成实例列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SimulationHosecloudIntegration" } - } - } - } - } - } + responses: dataResponse("合思集成实例列表", { + type: "array", + items: { $ref: "#/components/schemas/SimulationHosecloudIntegration" } + }) } }, "/api/v1/simulation/hosecloud-specifications": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "获取合思审批流规格列表", operationId: "listSimulationSpecifications", - responses: { - "200": { - description: "审批流规格列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SimulationSpecification" } - } - } - } - } - } + responses: dataResponse("审批流规格列表", { + type: "array", + items: { $ref: "#/components/schemas/SimulationSpecification" } + }) } }, "/api/v1/simulation/hosecloud-specifications-by-sign-key": { get: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "按 signKey 获取合思审批流规格", operationId: "listSimulationSpecificationsBySignKey", parameters: [ { name: "signKey", in: "query", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "审批流规格列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SimulationSpecification" } - } - } - } - } - } + responses: dataResponse("审批流规格列表", { + type: "array", + items: { $ref: "#/components/schemas/SimulationSpecification" } + }) } }, "/api/v1/material-packages/upload": { post: { tags: ["Simulation & Testing"], + "x-apifox-folder": "原始业务接口/Simulation & Testing", summary: "上传材料包 ZIP 文件", operationId: "uploadMaterialPackage", requestBody: { @@ -833,41 +691,25 @@ const spec = { } } }, - responses: { - "200": { - description: "上传解析结果", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/MaterialPackage" } - } - } - } - } + responses: dataResponse("上传解析结果", { $ref: "#/components/schemas/MaterialPackage" }) } }, "/api/v1/delegation/list": { get: { tags: ["Delegation"], + "x-apifox-folder": "原始业务接口/Delegation", summary: "获取转授权/协助令牌列表", operationId: "listDelegations", - responses: { - "200": { - description: "转授权列表", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/SealDelegationItem" } - } - } - } - } - } + responses: dataResponse("转授权列表", { + type: "array", + items: { $ref: "#/components/schemas/SealDelegationItem" } + }) } }, "/api/v1/delegation/create": { post: { tags: ["Delegation"], + "x-apifox-folder": "原始业务接口/Delegation", summary: "创建转授权协助链接", operationId: "createDelegation", requestBody: { @@ -883,21 +725,13 @@ const spec = { } } }, - responses: { - "200": { - description: "创建结果与协助链接", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealDelegationCreateResult" } - } - } - } - } + responses: dataResponse("创建结果与协助链接", { $ref: "#/components/schemas/SealDelegationCreateResult" }) } }, "/api/v1/delegation/revoke": { post: { tags: ["Delegation"], + "x-apifox-folder": "原始业务接口/Delegation", summary: "作废转授权令牌", operationId: "revokeDelegation", requestBody: { @@ -924,6 +758,7 @@ const spec = { "/api/v1/contacts/departments/root/children": { get: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "获取根部门子部门列表", operationId: "getRootDepartmentChildren", responses: { @@ -936,6 +771,7 @@ const spec = { "/api/v1/contacts/local/users": { post: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "创建本地用户", operationId: "createLocalUser", requestBody: { @@ -955,81 +791,49 @@ const spec = { } } }, - responses: { - "200": { - description: "创建结果与初始密码", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealUserCreateResult" } - } - } - } - } + responses: dataResponse("创建结果与初始密码", { $ref: "#/components/schemas/SealUserCreateResult" }) } }, "/api/v1/contacts/local/users/{userId}/reset-password": { post: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "重置本地用户密码", operationId: "resetUserPassword", parameters: [ { name: "userId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "重置后的临时密码", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealUserResetPasswordResult" } - } - } - } - } + responses: dataResponse("重置后的临时密码", { $ref: "#/components/schemas/SealUserResetPasswordResult" }) } }, "/api/v1/contacts/users/{userId}": { get: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "获取用户详情", operationId: "getUserDetail", parameters: [ { name: "userId", in: "path", required: true, schema: { type: "string" } } ], - responses: { - "200": { - description: "用户详情", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealUserDetail" } - } - } - } - } + responses: dataResponse("用户详情", { $ref: "#/components/schemas/SealUserDetail" }) } }, "/api/v1/contacts/search": { get: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "按关键字或手机号搜索用户/部门", operationId: "searchUsers", parameters: [ { name: "query", in: "query", schema: { type: "string" } } ], - responses: { - "200": { - description: "搜索命中结果", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/SealContactSearchResult" } - } - } - } - } + responses: dataResponse("搜索命中结果", { $ref: "#/components/schemas/SealContactSearchResult" }) } }, "/api/v1/contacts/local/users/{userId}": { delete: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "删除/离职本地用户", operationId: "deleteLocalUser", parameters: [ @@ -1045,6 +849,7 @@ const spec = { "/api/v1/contacts/local/users/{userId}/activate": { post: { tags: ["Contacts & Users"], + "x-apifox-folder": "原始业务接口/Contacts & Users", summary: "重新激活离职用户", operationId: "activateLocalUser", parameters: [ @@ -1060,6 +865,7 @@ const spec = { "/api/hosecloud/corporation": { post: { tags: ["HoseCloud OEM Integration"], + "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", summary: "验证并获取合思企业 CorporationId", operationId: "getHosecloudCorporation", requestBody: { @@ -1079,26 +885,18 @@ const spec = { } } }, - responses: { - "200": { - description: "企业 ID", - content: { - "application/json": { - schema: { - type: "object", - properties: { - corporationId: { type: "string" } - } - } - } - } + responses: dataResponse("企业 ID", { + type: "object", + properties: { + corporationId: { type: "string" } } - } + }) } }, "/api/hosecloud/outbound-config/sync": { post: { tags: ["HoseCloud OEM Integration"], + "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", summary: "同步合思出站配置与回调 Webhook", operationId: "syncHosecloudOutbound", requestBody: { @@ -1129,94 +927,55 @@ const spec = { "/api/v1/llm/config": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取当前租户大模型配置", operationId: "getLlmConfig", - responses: { - "200": { - description: "大模型配置", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/LlmConfig" } - } - } - } - } + responses: dataResponse("大模型配置", { $ref: "#/components/schemas/LlmConfig" }) } }, "/api/v1/llm/providers": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取系统支持的大模型提供商列表", operationId: "listLlmProviders", - responses: { - "200": { - description: "大模型提供商", - content: { - "application/json": { - schema: { - type: "array", - items: { $ref: "#/components/schemas/LlmProvider" } - } - } - } - } - } + responses: dataResponse("大模型提供商", { + type: "array", + items: { $ref: "#/components/schemas/LlmProvider" } + }) } }, "/api/v1/permissions/available": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取系统可用权限列表", operationId: "listAvailablePermissions", - responses: { - "200": { - description: "可用权限列表", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/AvailablePermissionsData" } - } - } - } - } + responses: dataResponse("可用权限列表", { $ref: "#/components/schemas/AvailablePermissionsData" }) } }, "/api/v1/permissions/configs": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取系统权限配置", operationId: "listPermissionConfigs", - responses: { - "200": { - description: "权限配置", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/PermissionConfigsData" } - } - } - } - } + responses: dataResponse("权限配置", { $ref: "#/components/schemas/PermissionConfigsData" }) } }, "/api/v1/billing/status": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取租户订阅与计费状态", operationId: "getBillingStatus", - responses: { - "200": { - description: "计费状态", - content: { - "application/json": { - schema: { $ref: "#/components/schemas/BillingStatusData" } - } - } - } - } + responses: dataResponse("计费状态", { $ref: "#/components/schemas/BillingStatusData" }) } }, "/api/v1/billing/plans": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取计费套餐列表", operationId: "listBillingPlans", responses: { @@ -1229,6 +988,7 @@ const spec = { "/api/v1/billing/features": { get: { tags: ["System, LLM & Billing"], + "x-apifox-folder": "原始业务接口/System, LLM & Billing", summary: "获取计费功能开关与额度", operationId: "listBillingFeatures", responses: { @@ -1245,10 +1005,24 @@ const spec = { type: "http", scheme: "bearer", bearerFormat: "JWT / Session Token", - description: "Seal AI 下游原生 Bearer 认证 Token" + description: "Seal AI 下游原生 Bearer 认证 Token (Authorization: Bearer )" } }, schemas: { + ErrorResponse: { + type: "object", + required: ["error"], + properties: { + error: { + type: "object", + required: ["code", "message"], + properties: { + code: { type: "string", description: "错误标识码 (例如: error:auth:invalid-token)" }, + message: { type: "string", description: "错误详细描述" } + } + } + } + }, HosecloudStaff: { type: "object", required: ["staffId"],