diff --git a/dist/raw-seal-openapi.json b/dist/raw-seal-openapi.json deleted file mode 100644 index ac05242..0000000 --- a/dist/raw-seal-openapi.json +++ /dev/null @@ -1,4550 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Seal AI Downstream Native API", - "version": "1.0.0", - "description": "Raw downstream Seal AI and HoseCloud business API contracts (without seal-use wrapper layer)." - }, - "servers": [ - { - "url": "https://{corpId}.sealai.cc", - "description": "Seal AI 企业租户环境 (例如: https://id01jdq2yidnmr.sealai.cc)", - "variables": { - "corpId": { - "default": "id01jdq2yidnmr", - "description": "合思/Seal 企业租户 ID (小写)" - } - } - } - ], - "security": [ - { - "bearerAuth": [] - } - ], - "tags": [ - { - "name": "Hose Auth & SSO", - "description": "合思开放平台鉴权与免登中转换票 (前置 Token 链路)" - }, - { - "name": "Auth & Session", - "description": "身份验证、当前会话与 SSO 换票" - }, - { - "name": "Approval Rules", - "description": "审批规则草稿、版本快照与发布" - }, - { - "name": "Knowledge Documents", - "description": "知识库规章与文档管理" - }, - { - "name": "Agent & Style Preferences", - "description": "审批偏好、深度策略与 Webhook 集成" - }, - { - "name": "Approval Runs", - "description": "审批记录、AI 决策结果与原始单据" - }, - { - "name": "Simulation & Testing", - "description": "仿真批次、单据模板与材料包测试" - }, - { - "name": "Delegation", - "description": "转授权令牌与协助链接" - }, - { - "name": "Contacts & Users", - "description": "部门架构与用户管理" - }, - { - "name": "HoseCloud OEM Integration", - "description": "合思企业绑定与出站 Webhook 配置" - }, - { - "name": "System, LLM & Billing", - "description": "大模型设置、系统权限与计费套餐" - } - ], - "paths": { - "/api/openapi/v1/auth/getAccessToken": { - "post": { - "tags": [ - "Hose Auth & SSO" - ], - "x-apifox-folder": "原始业务接口/Hose Auth & SSO", - "summary": "合思 OpenAPI 获取企业访问令牌 (Step 1 -> hoseOpenApiToken)", - "description": "调用合思开放平台凭证换取企业级 accessToken,用于后续免登换票操作。", - "operationId": "getHoseOpenapiAccessToken", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "appKey", - "appSecurity" - ], - "properties": { - "appKey": { - "type": "string", - "default": "{{hoseApiKey}}", - "description": "合思 OpenAPI Key" - }, - "appSecurity": { - "type": "string", - "default": "{{hoseApiSecret}}", - "description": "合思 OpenAPI Secret (密钥)" - } - } - }, - "example": { - "appKey": "{{hoseApiKey}}", - "appSecurity": "{{hoseApiSecret}}" - } - } - } - }, - "responses": { - "200": { - "description": "合思企业 AccessToken 响应", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "value": { - "type": "object", - "properties": { - "accessToken": { - "type": "string", - "description": "企业访问令牌" - }, - "corporation": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "staff": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/api/openapi/v1.1/provisional/getProvisionalAuth": { - "post": { - "tags": [ - "Hose Auth & SSO" - ], - "x-apifox-folder": "原始业务接口/Hose Auth & SSO", - "summary": "合思 CloseAPI 获取免登换票令牌 (Step 2 -> hoseProvisionalToken)", - "description": "使用合思企业 AccessToken 与操作人员工 ID,生成免登 Ticket URL,提取 accessToken 用于 Seal SSO 换票。", - "operationId": "getHoseProvisionalAuth", - "parameters": [ - { - "name": "accessToken", - "in": "query", - "required": true, - "example": "{{hoseOpenApiToken}}", - "schema": { - "type": "string", - "default": "{{hoseOpenApiToken}}" - }, - "description": "合思企业级 accessToken" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "uid" - ], - "properties": { - "uid": { - "type": "string", - "default": "{{hoseUserId}}", - "description": "合思员工 ID / StaffId (例如: ID01Jdq2yIDnMr:ID01KsDgHaH5nN)" - }, - "pageType": { - "type": "string", - "default": "home", - "description": "免登落地页类型" - }, - "expireDate": { - "type": "integer", - "default": 7200, - "description": "临时免登凭据有效期(秒)" - } - } - }, - "example": { - "uid": "{{hoseUserId}}", - "pageType": "home", - "expireDate": 7200 - } - } - } - }, - "responses": { - "200": { - "description": "免登中转 URL 响应", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "value": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "带 accessToken 临时中转票据的完整免登 URL" - } - } - } - } - } - } - } - } - } - } - }, - "/api/v1/auth/me": { - "get": { - "tags": [ - "Auth & Session" - ], - "x-apifox-folder": "原始业务接口/Auth & Session", - "summary": "获取当前登录用户与租户信息", - "operationId": "getMe", - "responses": { - "200": { - "description": "当前身份信息", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/auth/get-session": { - "get": { - "tags": [ - "Auth & Session" - ], - "x-apifox-folder": "原始业务接口/Auth & Session", - "summary": "获取当前会话及转授权信息", - "operationId": "getSession", - "responses": { - "200": { - "description": "当前会话数据", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/auth/sms-otp/sign-in-password": { - "post": { - "tags": [ - "Auth & Session" - ], - "x-apifox-folder": "原始业务接口/Auth & Session", - "summary": "手机号与密码登录", - "operationId": "loginWithPhonePassword", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "phone", - "password" - ], - "properties": { - "phone": { - "type": "string", - "description": "手机号" - }, - "password": { - "type": "string", - "description": "登录密码" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "登录结果与 Token", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "user": { - "type": "object" - }, - "session": { - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - } - } - } - } - } - }, - "401": { - "description": "认证失败", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, - "/api/auth/oauth2/session/oem-hosecloud": { - "get": { - "tags": [ - "Hose Auth & SSO", - "Auth & Session" - ], - "x-apifox-folder": "原始业务接口/Hose Auth & SSO", - "summary": "合思 OEM SSO 换取 Seal 会话 Token (Step 3 -> sealToken)", - "description": "使用合思第二层免登 Token(hoseProvisionalToken)向 Seal AI 服务换取会话 Token,并自动保存到环境变量 sealToken 中。", - "operationId": "oauthHosecloudSession", - "parameters": [ - { - "name": "token", - "in": "query", - "required": true, - "example": "{{hoseProvisionalToken}}", - "schema": { - "type": "string", - "default": "{{hoseProvisionalToken}}" - }, - "description": "合思 closeapi 换票 token" - }, - { - "name": "returnToken", - "in": "query", - "example": "1", - "schema": { - "type": "string", - "default": "1" - }, - "description": "是否直接返回 token 字段" - } - ], - "responses": { - "200": { - "description": "换票会话", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "token": { - "type": "string" - }, - "accessToken": { - "type": "string" - } - } - } - } - } - }, - "400": { - "description": "换票失败", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, - "/api/v1/rules": { - "get": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "获取当前草稿规则列表", - "operationId": "listApprovalRules", - "responses": { - "200": { - "description": "规则列表数据", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - }, - "post": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "新增审批规则草稿", - "operationId": "createApprovalRule", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApprovalRuleInput" - } - } - } - }, - "responses": { - "200": { - "description": "创建成功的规则", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/rules/{ruleId}": { - "put": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "修改审批规则草稿", - "operationId": "updateApprovalRule", - "parameters": [ - { - "name": "ruleId", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "规则 ID" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApprovalRuleUpdate" - } - } - } - }, - "responses": { - "200": { - "description": "更新后的规则", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "删除审批规则草稿", - "operationId": "deleteApprovalRule", - "parameters": [ - { - "name": "ruleId", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "规则 ID" - } - ], - "responses": { - "200": { - "description": "删除成功" - } - } - } - }, - "/api/v1/rules/batch-recode": { - "post": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "规则批量重排与重编号", - "operationId": "recodeApprovalRules", - "responses": { - "200": { - "description": "重排结果" - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/api/v1/rule-set-versions/{versionId}": { - "get": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "获取单个已发布规则版本详情", - "operationId": "getApprovalRuleVersion", - "parameters": [ - { - "name": "versionId", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "版本 ID" - } - ], - "responses": { - "200": { - "description": "版本详情", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/rule-set-versions/publish": { - "post": { - "tags": [ - "Approval Rules" - ], - "x-apifox-folder": "原始业务接口/Approval Rules", - "summary": "将当前草稿规则发布为正式版本", - "operationId": "publishApprovalRuleVersion", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "versionName" - ], - "properties": { - "versionName": { - "type": "string", - "description": "新版本名称" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "发布结果", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/knowledge/articles": { - "get": { - "tags": [ - "Knowledge Documents" - ], - "x-apifox-folder": "原始业务接口/Knowledge Documents", - "summary": "获取知识库文档列表", - "operationId": "listApprovalDocuments", - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 20 - } - }, - { - "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": { - "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" - } - } - } - } - } - }, - "post": { - "tags": [ - "Knowledge Documents" - ], - "x-apifox-folder": "原始业务接口/Knowledge Documents", - "summary": "新建知识库文档", - "operationId": "createApprovalDocument", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApprovalDocumentInput" - } - } - } - }, - "responses": { - "200": { - "description": "创建成功的文档", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - }, - "patch": { - "tags": [ - "Knowledge Documents" - ], - "x-apifox-folder": "原始业务接口/Knowledge Documents", - "summary": "修改知识库文档", - "operationId": "updateApprovalDocument", - "parameters": [ - { - "name": "documentId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "attributes": { - "$ref": "#/components/schemas/ApprovalDocumentUpdate" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "更新后的文档", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - }, - "patch": { - "tags": [ - "Agent & Style Preferences" - ], - "x-apifox-folder": "原始业务接口/Agent & Style Preferences", - "summary": "局部更新 AI 审批配置与偏好", - "operationId": "patchApprovalStylePreferences", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "部分偏好字段" - } - } - } - }, - "responses": { - "200": { - "description": "更新后的偏好配置", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - }, - "post": { - "tags": [ - "Agent & Style Preferences" - ], - "x-apifox-folder": "原始业务接口/Agent & Style Preferences", - "summary": "覆盖保存 AI 审批配置与偏好", - "operationId": "saveApprovalStylePreferences", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApprovalStylePreferences" - } - } - } - }, - "responses": { - "200": { - "description": "保存结果" - } - } - } - }, - "/api/v1/integrations/webhook/{webhookId}/document": { - "post": { - "tags": [ - "Agent & Style Preferences" - ], - "x-apifox-folder": "原始业务接口/Agent & Style Preferences", - "summary": "接收外部 Webhook 审批进单", - "operationId": "incomingWebhookDocument", - "parameters": [ - { - "name": "webhookId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "单据原始 payload" - } - } - } - }, - "responses": { - "200": { - "description": "进单响应" - } - } - } - }, - "/api/v1/integrations/webhook/{webhookId}/manual-result": { - "post": { - "tags": [ - "Agent & Style Preferences" - ], - "x-apifox-folder": "原始业务接口/Agent & Style Preferences", - "summary": "接收外部 Webhook 人工终审结果回传", - "operationId": "incomingWebhookManualResult", - "parameters": [ - { - "name": "webhookId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "人工审批结论" - } - } - } - }, - "responses": { - "200": { - "description": "回传响应" - } - } - } - }, - "/api/v1/approvals": { - "get": { - "tags": [ - "Approval Runs" - ], - "x-apifox-folder": "原始业务接口/Approval Runs", - "summary": "查询审批运行记录列表", - "operationId": "listApprovalRuns", - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50 - } - }, - { - "name": "startDate", - "in": "query", - "schema": { - "type": "string" - }, - "description": "开始日期 YYYY-MM-DD" - }, - { - "name": "endDate", - "in": "query", - "schema": { - "type": "string" - }, - "description": "结束日期 YYYY-MM-DD" - }, - { - "name": "status", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "sourceSystem", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "taskMode", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "search", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "sourceDocumentSN", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "sourceDocumentId", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "审批运行记录列表", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/api/v1/simulation/create-batch": { - "post": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "创建合思指定单号/条件仿真测试批次", - "operationId": "createSimulationBatch", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SimulationBatchParams" - } - } - } - }, - "responses": { - "200": { - "description": "创建结果", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/simulation/create-material-pack-batch": { - "post": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "创建材料包仿真测试批次", - "operationId": "createMaterialPackBatch", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SimulationBatchParams" - } - } - } - }, - "responses": { - "200": { - "description": "创建结果", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/api/v1/simulation/batch/{batchId}/data": { - "delete": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "清理仿真批次生成的业务测试数据", - "operationId": "cleanSimulationBatchData", - "parameters": [ - { - "name": "batchId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "清理结果" - } - } - } - }, - "/api/v1/simulation/templates": { - "get": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "获取仿真单据模板列表", - "operationId": "listSimulationTemplates", - "responses": { - "200": { - "description": "模板列表", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/simulation/integration-status": { - "get": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "获取各外部系统仿真对接可用状态", - "operationId": "getSimulationIntegrationStatus", - "responses": { - "200": { - "description": "对接可用性状态", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/api/v1/material-packages/upload": { - "post": { - "tags": [ - "Simulation & Testing" - ], - "x-apifox-folder": "原始业务接口/Simulation & Testing", - "summary": "上传材料包 ZIP 文件", - "operationId": "uploadMaterialPackage", - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "required": [ - "file" - ], - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "材料包压缩文件" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "上传解析结果", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/delegation/list": { - "get": { - "tags": [ - "Delegation" - ], - "x-apifox-folder": "原始业务接口/Delegation", - "summary": "获取转授权/协助令牌列表", - "operationId": "listDelegations", - "responses": { - "200": { - "description": "转授权列表", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/delegation/create": { - "post": { - "tags": [ - "Delegation" - ], - "x-apifox-folder": "原始业务接口/Delegation", - "summary": "创建转授权协助链接", - "operationId": "createDelegation", - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "note": { - "type": "string", - "description": "备注信息" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "创建结果与协助链接", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/api/v1/delegation/revoke": { - "post": { - "tags": [ - "Delegation" - ], - "x-apifox-folder": "原始业务接口/Delegation", - "summary": "作废转授权令牌", - "operationId": "revokeDelegation", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "tokenId" - ], - "properties": { - "tokenId": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "作废结果" - } - } - } - }, - "/api/v1/contacts/departments/root/children": { - "get": { - "tags": [ - "Contacts & Users" - ], - "x-apifox-folder": "原始业务接口/Contacts & Users", - "summary": "获取根部门子部门列表", - "operationId": "getRootDepartmentChildren", - "responses": { - "200": { - "description": "根部门子节点" - } - } - } - }, - "/api/v1/contacts/local/users": { - "post": { - "tags": [ - "Contacts & Users" - ], - "x-apifox-folder": "原始业务接口/Contacts & Users", - "summary": "创建本地用户", - "operationId": "createLocalUser", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name", - "phone" - ], - "properties": { - "name": { - "type": "string", - "description": "姓名" - }, - "phone": { - "type": "string", - "description": "手机号" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - } - }, - "departmentIds": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "创建结果与初始密码", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/api/v1/contacts/local/users/{userId}": { - "delete": { - "tags": [ - "Contacts & Users" - ], - "x-apifox-folder": "原始业务接口/Contacts & Users", - "summary": "删除/离职本地用户", - "operationId": "deleteLocalUser", - "parameters": [ - { - "name": "userId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "操作结果" - } - } - } - }, - "/api/v1/contacts/local/users/{userId}/activate": { - "post": { - "tags": [ - "Contacts & Users" - ], - "x-apifox-folder": "原始业务接口/Contacts & Users", - "summary": "重新激活离职用户", - "operationId": "activateLocalUser", - "parameters": [ - { - "name": "userId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "激活结果" - } - } - } - }, - "/api/hosecloud/corporation": { - "post": { - "tags": [ - "HoseCloud OEM Integration" - ], - "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", - "summary": "验证并获取合思企业 CorporationId", - "operationId": "getHosecloudCorporation", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "apiKey", - "apiSecret" - ], - "properties": { - "apiKey": { - "type": "string" - }, - "apiSecret": { - "type": "string" - }, - "apiOrigin": { - "type": "string", - "default": "production" - }, - "customApiUrl": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "企业 ID", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "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" - } - } - } - } - } - } - }, - "/api/hosecloud/outbound-config/sync": { - "post": { - "tags": [ - "HoseCloud OEM Integration" - ], - "x-apifox-folder": "原始业务接口/HoseCloud OEM Integration", - "summary": "同步合思出站配置与回调 Webhook", - "operationId": "syncHosecloudOutbound", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "signKey", - "webhookUrl", - "completionWebhookUrl", - "messageName", - "mode" - ], - "properties": { - "signKey": { - "type": "string" - }, - "webhookUrl": { - "type": "string" - }, - "completionWebhookUrl": { - "type": "string" - }, - "messageName": { - "type": "string" - }, - "mode": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "同步结果" - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/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": { - "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" - } - } - } - } - } - } - }, - "/api/v1/billing/plans": { - "get": { - "tags": [ - "System, LLM & Billing" - ], - "x-apifox-folder": "原始业务接口/System, LLM & Billing", - "summary": "获取计费套餐列表", - "operationId": "listBillingPlans", - "responses": { - "200": { - "description": "套餐计划列表" - } - } - } - }, - "/api/v1/billing/features": { - "get": { - "tags": [ - "System, LLM & Billing" - ], - "x-apifox-folder": "原始业务接口/System, LLM & Billing", - "summary": "获取计费功能开关与额度", - "operationId": "listBillingFeatures", - "responses": { - "200": { - "description": "功能特性与额度" - } - } - } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT / Session 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" - ], - "properties": { - "staffId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "code": { - "type": "string", - "default": "" - }, - "bindTime": { - "type": "number" - } - } - }, - "SealUser": { - "type": "object", - "required": [ - "id", - "tenantId", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "isAdmin": { - "type": "boolean", - "default": false - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "providerUserId": { - "type": "string" - }, - "hosecloudStaff": { - "$ref": "#/components/schemas/HosecloudStaff" - } - } - }, - "HoseCorpConfig": { - "type": "object", - "properties": { - "apiKey": { - "type": "string" - }, - "corporationId": { - "type": "string" - }, - "corporationName": { - "type": "string" - } - } - }, - "SealTenant": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "tenantSlug": { - "type": "string" - }, - "isDemo": { - "type": "boolean", - "default": false - }, - "logoUrl": { - "type": "string", - "nullable": true - }, - "hoseCorpConfig": { - "$ref": "#/components/schemas/HoseCorpConfig" - } - } - }, - "MeData": { - "type": "object", - "required": [ - "user", - "tenant" - ], - "properties": { - "user": { - "$ref": "#/components/schemas/SealUser" - }, - "tenant": { - "$ref": "#/components/schemas/SealTenant" - } - } - }, - "SealSessionUser": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "email": { - "type": "string", - "nullable": true - }, - "emailVerified": { - "type": "boolean" - }, - "image": { - "type": "string", - "nullable": true - }, - "tenantId": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "providerUserId": { - "type": "string" - }, - "mobile": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "isAdmin": { - "type": "boolean", - "default": false - } - } - }, - "SealSessionInfo": { - "type": "object", - "required": [ - "id", - "expiresAt", - "userId" - ], - "properties": { - "id": { - "type": "string" - }, - "token": { - "type": "string" - }, - "expiresAt": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "ipAddress": { - "type": "string" - }, - "userAgent": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "delegationId": { - "type": "string", - "nullable": true - } - } - }, - "SealSessionData": { - "type": "object", - "required": [ - "user", - "session" - ], - "properties": { - "user": { - "$ref": "#/components/schemas/SealSessionUser" - }, - "session": { - "$ref": "#/components/schemas/SealSessionInfo" - } - } - }, - "ApprovalRule": { - "type": "object", - "required": [ - "id", - "description", - "scope", - "strictness" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "code": { - "type": "number" - }, - "description": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "strictness": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "number" - }, - "updatedAt": { - "type": "number" - } - } - }, - "ApprovalRuleInput": { - "type": "object", - "required": [ - "description", - "scope", - "strictness" - ], - "properties": { - "description": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "strictness": { - "type": "string" - } - } - }, - "ApprovalRuleUpdate": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "strictness": { - "type": "string" - } - } - }, - "ApprovalRulesData": { - "type": "object", - "required": [ - "rules" - ], - "properties": { - "rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApprovalRule" - } - }, - "hasPendingDeletes": { - "type": "boolean", - "default": false - } - } - }, - "PublishedRuleSnapshot": { - "type": "object", - "required": [ - "description", - "scope", - "strictness" - ], - "properties": { - "code": { - "type": "string" - }, - "description": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "strictness": { - "type": "string" - } - } - }, - "RuleSetVersion": { - "type": "object", - "required": [ - "id", - "versionNumber" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "versionNumber": { - "type": "number" - }, - "versionName": { - "type": "string", - "nullable": true - }, - "publishedBy": { - "type": "string", - "nullable": true - }, - "publishedByName": { - "type": "string", - "nullable": true - }, - "rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PublishedRuleSnapshot" - }, - "default": [] - }, - "publishedAt": { - "type": "number" - }, - "createdAt": { - "type": "number" - } - } - }, - "PublishVersionData": { - "type": "object", - "required": [ - "version", - "rulesCount" - ], - "properties": { - "version": { - "$ref": "#/components/schemas/RuleSetVersion" - }, - "rulesCount": { - "type": "number" - } - } - }, - "ApprovalDocument": { - "type": "object", - "required": [ - "id", - "title", - "content" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "title": { - "type": "string" - }, - "purpose": { - "type": "string", - "default": "" - }, - "contentType": { - "type": "string", - "default": "policy" - }, - "content": { - "type": "string" - }, - "status": { - "type": "string", - "default": "published" - }, - "enabled": { - "type": "boolean", - "default": true - }, - "scenarios": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "category": { - "type": "string", - "nullable": true - }, - "categoryTags": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "createdBy": { - "type": "string", - "nullable": true - }, - "createdByName": { - "type": "string", - "nullable": true - }, - "createdAt": { - "type": "number" - }, - "updatedAt": { - "type": "number" - }, - "updatedBy": { - "type": "string", - "nullable": true - }, - "updatedByName": { - "type": "string", - "nullable": true - }, - "isDeleted": { - "type": "boolean", - "default": false - } - } - }, - "ApprovalDocumentInput": { - "type": "object", - "required": [ - "title", - "purpose", - "content" - ], - "properties": { - "title": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "content": { - "type": "string" - }, - "contentType": { - "type": "string", - "default": "policy" - }, - "status": { - "type": "string", - "default": "published" - }, - "scenarios": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - } - } - }, - "ApprovalDocumentUpdate": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "purpose": { - "type": "string" - }, - "content": { - "type": "string" - }, - "contentType": { - "type": "string" - }, - "status": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "scenarios": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ApprovalDocumentListData": { - "type": "object", - "required": [ - "articles" - ], - "properties": { - "articles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApprovalDocument" - } - }, - "total": { - "type": "number" - } - } - }, - "DecisionPreferences": { - "type": "object", - "properties": { - "explicitApprove": { - "type": "string", - "default": "" - }, - "explicitReject": { - "type": "string", - "default": "" - }, - "exemptApprove": { - "type": "string", - "default": "" - }, - "review": { - "type": "string", - "default": "" - } - } - }, - "WebhookEndpoint": { - "type": "object", - "required": [ - "id", - "url" - ], - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "WebhookIntegration": { - "type": "object", - "required": [ - "type", - "id", - "name", - "mode", - "incomingDocumentWebhook", - "outgoingResultWebhook", - "incomingManualResultWebhook", - "secret" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "webhook" - ] - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": [ - "assisted", - "semi_automatic", - "fully_automatic" - ] - }, - "incomingDocumentWebhook": { - "$ref": "#/components/schemas/WebhookEndpoint" - }, - "outgoingResultWebhook": { - "type": "string", - "format": "uri" - }, - "incomingManualResultWebhook": { - "$ref": "#/components/schemas/WebhookEndpoint" - }, - "secret": { - "type": "string" - }, - "autoApprovalRate": { - "type": "integer", - "minimum": 0, - "maximum": 100 - } - } - }, - "ApprovalIntegration": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string" - }, - "signKey": { - "type": "string" - }, - "outboundName": { - "type": "string" - }, - "mode": { - "type": "string" - }, - "autoApprovalRate": { - "type": "number" - }, - "apiKey": { - "type": "string" - }, - "apiSecret": { - "type": "string" - }, - "apiOrigin": { - "type": "string" - }, - "corporationId": { - "type": "string" - } - } - }, - "ApprovalStylePreferences": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "tone": { - "type": "string" - }, - "language": { - "type": "string" - }, - "detailLevel": { - "type": "string" - }, - "outputFormat": { - "type": "string" - }, - "examples": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "prohibitedPhrases": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "customInstructions": { - "type": "string" - }, - "updatedAt": { - "type": "number" - }, - "decisionPreferences": { - "$ref": "#/components/schemas/DecisionPreferences" - }, - "integrationSystem": { - "type": "string" - }, - "integrations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApprovalIntegration" - }, - "default": [] - } - } - }, - "ApprovalRunDocument": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "sn": { - "type": "string" - }, - "title": { - "type": "string" - }, - "name": { - "type": "string" - }, - "fields": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "ApprovalRunSourceExtendData": { - "type": "object", - "properties": { - "_langfuseTraceId": { - "type": "string" - }, - "simulation_batch_id": { - "type": "string" - } - } - }, - "ApprovalRun": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "agentId": { - "type": "string" - }, - "status": { - "type": "string" - }, - "taskMode": { - "type": "string" - }, - "finalExecutionMode": { - "type": "string" - }, - "sourceSystem": { - "type": "string" - }, - "sourceDocumentSN": { - "type": "string" - }, - "sourceDocumentId": { - "type": "string" - }, - "documentId": { - "type": "string" - }, - "document": { - "$ref": "#/components/schemas/ApprovalRunDocument" - }, - "result": { - "type": "object" - }, - "pipelineData": { - "type": "object" - }, - "sourceExtendData": { - "$ref": "#/components/schemas/ApprovalRunSourceExtendData" - }, - "ruleSetVersionNumber": { - "type": "number" - }, - "ruleSetPublishedAt": { - "type": "number" - }, - "ruleSetPublishedByName": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "ApprovalRunListData": { - "type": "object", - "required": [ - "records" - ], - "properties": { - "records": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApprovalRun" - } - }, - "total": { - "type": "number" - }, - "page": { - "type": "number" - }, - "pageSize": { - "type": "number" - } - } - }, - "SealDelegationItem": { - "type": "object", - "required": [ - "id", - "link" - ], - "properties": { - "id": { - "type": "string" - }, - "expiresAt": { - "type": "number", - "nullable": true - }, - "revokedAt": { - "type": "number", - "nullable": true - }, - "createdAt": { - "type": "number", - "nullable": true - }, - "lastUsedAt": { - "type": "number", - "nullable": true - }, - "useCount": { - "type": "number", - "default": 0 - }, - "note": { - "type": "string", - "nullable": true - }, - "link": { - "type": "string" - } - } - }, - "SealDelegationCreateResult": { - "type": "object", - "required": [ - "id", - "token", - "link" - ], - "properties": { - "id": { - "type": "string" - }, - "token": { - "type": "string" - }, - "link": { - "type": "string" - } - } - }, - "SealUserCreateResult": { - "type": "object", - "required": [ - "userId", - "password" - ], - "properties": { - "userId": { - "type": "string" - }, - "password": { - "type": "string" - } - } - }, - "SealUserResetPasswordResult": { - "type": "object", - "required": [ - "password" - ], - "properties": { - "password": { - "type": "string" - } - } - }, - "SealUserDetail": { - "type": "object", - "required": [ - "_id", - "name" - ], - "properties": { - "_id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "email": { - "type": "string" - }, - "departmentIds": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "status": { - "type": "string" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "SealContactSearchResult": { - "type": "object", - "required": [ - "departments", - "users" - ], - "properties": { - "departments": { - "type": "array", - "items": { - "type": "object" - } - }, - "users": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SealUserDetail" - } - } - } - }, - "LlmConfig": { - "type": "object", - "required": [ - "provider" - ], - "properties": { - "provider": { - "type": "string" - }, - "config": { - "type": "object" - } - } - }, - "LlmProvider": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "available": { - "type": "boolean", - "default": true - }, - "fields": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "AvailablePermissionsData": { - "type": "object", - "required": [ - "permissions" - ], - "properties": { - "permissions": { - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "name" - ], - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } - } - }, - "PermissionConfigsData": { - "type": "object", - "required": [ - "configs" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "BillingStatusData": { - "type": "object", - "required": [ - "subscriptions", - "features" - ], - "properties": { - "subscriptions": { - "type": "array", - "items": { - "type": "object" - } - }, - "features": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "SimulationBatchParams": { - "type": "object", - "required": [ - "approvalCode" - ], - "properties": { - "approvalCode": { - "type": "string" - }, - "nodeId": { - "type": "string" - }, - "flowIds": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 100 - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100 - }, - "dataCollectionMode": { - "type": "string" - }, - "signKey": { - "type": "string" - }, - "rejectNodeName": { - "type": "string", - "nullable": true - }, - "skipInvoiceGeneration": { - "type": "boolean" - }, - "skipExpenseExtraction": { - "type": "boolean" - }, - "disableAttachmentCache": { - "type": "boolean" - }, - "thinkingDepthOverride": { - "type": "string", - "enum": [ - "default", - "medium", - "high" - ] - }, - "templateId": { - "type": "string" - }, - "packageIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "packageLabel": { - "type": "string" - }, - "runMode": { - "type": "string" - } - } - }, - "SimulationBatch": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "approvalCode": { - "type": "string" - }, - "nodeId": { - "type": "string" - }, - "sourceSystem": { - "type": "string" - }, - "status": { - "type": "string" - }, - "totalCount": { - "type": "number", - "default": 0 - }, - "processedCount": { - "type": "number", - "default": 0 - }, - "successCount": { - "type": "number", - "default": 0 - }, - "failedCount": { - "type": "number", - "default": 0 - }, - "createdCount": { - "type": "number", - "default": 0 - }, - "createFailedCount": { - "type": "number", - "default": 0 - }, - "params": { - "$ref": "#/components/schemas/SimulationBatchParams" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "SimulationCreateResult": { - "type": "object", - "required": [ - "batchId" - ], - "properties": { - "batchId": { - "type": "string" - } - } - }, - "SimulationTemplate": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "approvalSystem": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "SimulationIntegrationStatus": { - "type": "object", - "required": [ - "hasFeishu", - "hasHosecloud", - "hasWeaver", - "hasHelios", - "hasMaycur", - "hasMaycurStandard" - ], - "properties": { - "hasFeishu": { - "type": "boolean" - }, - "hasHosecloud": { - "type": "boolean" - }, - "hasWeaver": { - "type": "boolean" - }, - "hasHelios": { - "type": "boolean" - }, - "hasMaycur": { - "type": "boolean" - }, - "hasMaycurStandard": { - "type": "boolean" - } - } - }, - "SimulationHosecloudIntegration": { - "type": "object", - "properties": { - "signKey": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "corporationId": { - "type": "string" - } - } - }, - "SimulationSpecification": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - }, - "approvalSystem": { - "type": "string" - } - } - }, - "MaterialPackage": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "tenantId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "templateId": { - "type": "string" - }, - "originalFileName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "documentCount": { - "type": "number" - }, - "attachmentCount": { - "type": "number" - }, - "uploadedBy": { - "type": "string" - } - } - } - } - } -} diff --git a/docs/proposals/plugin-migration-plan.md b/docs/proposals/plugin-migration-plan.md deleted file mode 100644 index 72f295e..0000000 --- a/docs/proposals/plugin-migration-plan.md +++ /dev/null @@ -1,157 +0,0 @@ -# seal-home 插件化改造计划(供 Codex 执行) - -> 状态:代码与发布已完成(2026-08-12)。全局配置改造已先合入 `master`;插件改造已从最新 `master` 分支完成、快进合并并推送。ZCode Settings → Plugin Management 的本地安装与启用由用户手工完成。 -> 本文件记录实际交付结果与验收项。 - -## 1. 背景 - -seal-home 是一个 Bun + TypeScript 的 CLI + MCP server 工具仓库(v0.5.1),skill 文档位于 `skills/seal-home/`,工作区入口 `.agents/skills/seal-home` 为符号链接。目标是把仓库包装成标准的 ZCode 插件,同时保留全局 CLI 能力。 - -**最终形态(混合模式,两条线并存):** - -| 线 | 面向 | 形态 | -|---|---|---| -| 全局 CLI | 客户/脚本/手动 | `seal-home` 二进制(`bun build --compile`),可独立安装、可与其他 shell 命令组合使用,**保留现状** | -| ZCode 插件 | agent | `skills/seal-home/`(知识层)+ MCP server(可选启用,执行层) | - -**插件内的 MCP 采用单工具模式:** 只注册一个 `seal_cli` 工具,接受一个命令行字符串,内部透传到 CLI 的命令分发层。命令知识全部收敛在 skill 文档,工具 schema 只做路由(一句 description 指针),不写教程。 - -## 2. 目标布局 - -``` -seal-home/ # 仓库根即插件根 -├── .zcode-plugin/plugin.json # 插件清单(新增) -├── .mcp.json # MCP server 声明,userConfig 控制 seal_cli(新增) -├── skills/ -│ └── seal-home/ # 从 .agents/skills/seal-home 迁入 -│ ├── SKILL.md -│ └── references/ -├── dist/ -│ ├── bin/seal-home # 全局 CLI 编译产物(已有 build:binary) -│ └── mcp/server.js # MCP server 单文件 bundle(新增) -├── src/ # 源码保留,仓库继续独立开发测试 -├── openapi/ package.json README.md -└── .agents/skills/seal-home # 保留为指向 skills/seal-home 的链接或副本(开发期 workspace 使用) -``` - -## 3. 已定决策(执行时不要更改) - -1. **MCP 工具默认不启用**:`.zcode-plugin/plugin.json` 的 `userConfig.enable_mcp` 默认 `false`,用户需要时在插件详情的配置区打开。 -2. **MCP 单工具 `seal_cli`**:schema 只含 `command: string`;description 用一句话指针(如 "Run seal-home CLI commands. See the seal-home skill for command reference."),具体用法在 SKILL.md。 -3. **CLI 命令语法不变**:MCP 与全局 CLI 共享同一命令分发实现,不允许两套逻辑。 -4. **企业配置不迁移到 userConfig**:`enterprises/*.json` 与 `~/.config/seal-home/enterprises` 的现有加载机制保持不变。 -5. **插件格式**:`.zcode-plugin/plugin.json`(ZCode 原生);如本机验证 ZCode 不识别,再补 `.claude-plugin/plugin.json` 兼容副本。 -6. **版本号**:改造完成后统一升到 `0.5.1`(`package.json`、plugin manifest、SKILL.md frontmatter、marketplace 条目对齐)。 -7. **发布时间**:主功能迭代完成后,在干净的 release 基础上单独开分支执行。 - -## 4. 任务拆解(按序执行) - -### T1 构建产物 - -- 新增 `scripts/build-plugin.mjs`(或扩展 package.json scripts): - - MCP server 单文件 bundle:`bun build src/server.ts --target=node --outfile dist/mcp/server.js`(优先 node target;若因 `@modelcontextprotocol/sdk`/ky 等依赖无法 bundle 成功,退回 `--target=bun` 并在 `.mcp.json` 用 `command: "bun"`)。 - - 保留/复用 `build:binary` 产出 `dist/bin/seal-home`。 - - 若 CLI 运行时读取 `dist/openapi.json` 则随包拷贝,否则不打包(先 grep 确认是否有运行时读取)。 -- `bun run check`、`bun test` 必须通过。 - -### T2 CLI 分发层抽离(MCP 复用的前提) - -- 当前 `src/cli.ts` 是 1441 行的 bin 入口。抽出纯逻辑分发层(如 `src/cli/runner.ts`),导出类似 `runCli(args: string[]): Promise<{ stdout: string; isError: boolean }>` 的可复用函数。 -- **关键约束**:分发层内部禁止 `process.exit`,错误一律通过返回值/异常传播;`src/cli.ts` 变薄为"调 runner + 处理退出码"。 -- 保持 CLI 行为与输出格式(JSON stdout / 诊断走 stderr)完全不变,现有 `cli.test.ts` 全绿。 - -### T3 MCP 单工具改造 - -- `src/server.ts`:从"注册 ~20 个 sealMcpTools"改为只注册 `seal_cli` 一个工具。 - - handler 收到 `command` 字符串后调用 T2 的 `runCli`(同进程调用,不 spawn 子进程、不依赖全局二进制)。 - - 返回 `{ content: [{ type: "text", text: }], isError: <失败标记> }`,透传 CLI 的 JSON 输出。 -- 原 `sealMcpTools` 的逐一注册逻辑可保留在代码中但不再注册(或标记废弃),避免删除时牵连未迁移命令。 - -### T4 skill 迁移 - -- 将 `.agents/skills/seal-home/` 整体迁到 `skills/seal-home/`(根目录 `skills/` 目前为空)。 -- `.agents/skills/seal-home` 改为指向 `skills/seal-home` 的符号链接(或最小副本),保证当前 workspace skill 加载不中断;AGENTS.md 中 `.agents/` authoritative 的约定不受影响(链接不改变内容来源)。 -- SKILL.md 执行路径更新为:**优先 `seal_cli` MCP 工具(若会话中可用),否则回退全局 `seal-home` 命令**;命令语法部分不变。 -- 清理:`~/.agents/skills/seal-home` 若为空目录则删除(先确认无内容);`~/.agents/skills/seal` bundle 与插件 skill 的共存关系保持不变,不做合并。 - -### T5 插件清单与 MCP 声明 - -- `.zcode-plugin/plugin.json`: - ```json - { - "name": "seal-home", - "version": "0.5.1", - "description": "Seal Home tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, search.", - "author": { "name": "yingqing" }, - "license": "MIT", - "skills": "skills", - "mcpServers": "./.mcp.json", - "userConfig": { - "enable_mcp": { - "type": "boolean", - "title": "启用 MCP 服务", - "default": false - } - } - } - ``` -- `.mcp.json`: - ```json - { - "mcpServers": { - "seal-home": { - "type": "stdio", - "command": "node", - "args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js"], - "env": { - "SEAL_HOME_MCP_ENABLED": "${user_config.enable_mcp}" - } - } - } - } - ``` - (若 T1 退化为 bun target,则 `command: "bun"`;变量名以本机 ZCode 支持的插件根变量为准,先查 zcode 文档/已有插件示例再定。) - -### T6 本地安装验证 - -- 通过 ZCode **Settings → Plugin Management** 添加本仓库目录,验证: - 1. 插件 skill 可发现(`seal-home` skill 出现在 skill 列表,来源为插件)。 - 2. 插件配置区显示 `启用 MCP 服务`,默认值为关闭。 - 3. 打开配置并重新连接插件 MCP 后,`seal_cli` 工具可用,端到端跑通一个命令(如 `seal-home corps list`、`seal-home version`)。 - 4. 关闭配置后,MCP 不注册任何工具;全局 CLI 仍可 `bun run build:binary` 并独立使用。 - -### T7 发布(marketplace) - -- 在 `yunyingk/yingqing-plugins` 的 `marketplace.json` 增加 `seal-home` 条目。 -- 优先使用 github source 引用本仓库(参照已有条目 xiaohongshu-skills 的 `source: {source: "github", repo, ref, sha}` 写法 + `skills: "./skills"`);若 marketplace 结构不支持,则退化为把插件 payload(`.zcode-plugin/`、`.mcp.json`、`skills/`、`dist/`、README)镜像到 `plugins/seal-home/` 并同步维护。 -- 三处版本对齐:`package.json` / SKILL.md frontmatter / marketplace.json。 -- 敏感检查:确认发布内容不含 `enterprises/local.json` 等真实凭据(对照 `.gitignore`)。 - -### T8 文档 - -- README 增加"插件安装"小节:marketplace 安装方式、MCP 启用/关闭方式、全局 CLI 安装方式对比。 -- 本计划文件在改造完成后更新状态或归档。 - -## 5. 验收标准 - -- [x] `bun run check`、`bun test` 通过;CLI 输出格式与改造前一致。 -- [x] 仓库根结构符合 §2 目标布局。 -- [ ] 本机插件安装后 skill 可发现、MCP 默认 disabled、启用后 `seal_cli` 端到端可用(待用户在 ZCode Settings → Plugin Management 中手工验收)。 -- [x] 全局 `seal-home` 二进制可独立构建、安装、与 shell 命令组合使用。 -- [x] `.agents/skills/seal-home` 在开发环境中仍可加载(链接生效)。 -- [x] marketplace 条目存在且版本一致,无真实凭据泄漏。 -- [x] skill 文档中 MCP/CLI 双路径指引明确。 - -## 6. 非目标 - -- 不把 MCP 拆成多个细粒度工具(保持单工具)。 -- 不迁移企业配置存储方式、不改 CLI 命令语法。 -- 不合并 `~/.agents/skills/seal` bundle。 -- 不处理主功能迭代中的需求(本计划在其之后执行)。 - -## 7. 风险与注意 - -- **cli.ts 抽离是最大改动面**:1441 行的 bin 入口重构需保证零行为变化,以 `cli.test.ts` + 手工冒烟为准。 -- **[已结案] node target bundle 可行性**:`bun build src/server.ts --target=node` 曾产出**无法启动**的 bundle(`TypeError: ... is not a constructor`)。根因是 zod 的类初始化顺序被 `server.ts ↔ cli/runner ↔ cli/commands/mcp` 与 `http/routes` 两条循环依赖打乱;已通过 `tokenizeCommand` 下沉到 `src/cli/tokenize.ts`、`mcp` 命令改为惰性导入 server 修复,并新增 `packaged MCP bundle` 测试守护。注意:改用 bun target 并不能绕过(实测同样失败),`--compile` 亦同。 -- **[已结案] 插件根变量名**:实测 ZCode 解析器把 `${CLAUDE_PLUGIN_ROOT}` 与 `${ZCODE_PLUGIN_ROOT}` 视为同一别名(均取 `loaded.rootPath`),`${user_config.*}` 亦受支持且缺失时回退 manifest 的 `default`。`.mcp.json` 已改用 ZCode 原生名。 -- **workspace skill 来源变更**:迁移后开发期 workspace 的 seal-home skill 来自符号链接,若 ZCode 不支持链接目录,改用副本并接受双份维护(以 §4 T4 的验证结果为准)。 diff --git a/docs/proposals/sealai-bundle-endpoints.json b/docs/proposals/sealai-bundle-endpoints.json deleted file mode 100644 index 6051270..0000000 --- a/docs/proposals/sealai-bundle-endpoints.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "health": { - "check": "V" - }, - "auth": { - "getCurrentUser": "GET /v1/auth/me", - "logout": "POST /v1/auth/logout", - "changePassword": "POST /v1/auth/change-password", - "updateAvatar": "POST /v1/auth/update-avatar" - }, - "delegation": { - "createDelegationToken": "POST /v1/delegation/create", - "revokeDelegationToken": "POST /v1/delegation/revoke", - "listMyDelegations": "GET /v1/delegation/list", - "previewDelegationToken": "POST /v1/delegation/preview", - "consumeDelegationToken": "POST /v1/delegation/consume" - }, - "personalAccessToken": { - "create": "POST /v1/personal-access-token/create", - "list": "GET /v1/personal-access-token/list", - "revoke": "POST /v1/personal-access-token/revoke", - "revokeTenant": "POST /v1/personal-access-token/revoke-tenant" - }, - "cliAuth": { - "createDeviceAuthorization": "POST /v1/cli-auth/device", - "previewDeviceAuthorization": "GET /v1/cli-auth/device/{userCode}", - "approveDeviceAuthorization": "POST /v1/cli-auth/device/approve", - "pollDeviceAuthorization": "POST /v1/cli-auth/device/token", - "createCliSession": "POST /v1/cli-auth/session", - "revokeCliAccessToken": "POST /v1/cli-auth/revoke" - }, - "feishu": { - "handleWebhook": "POST /v1/integrations/feishu/webhook", - "handleCardCallback": "POST /v1/integrations/feishu/card-callback", - "getApprovalDefinition": "GET /v1/integrations/feishu/approvals/{approvalCode}", - "getSimulationApprovalDefinitions": "GET /v1/integrations/feishu/simulation/approval-definitions" - }, - "feishuStore": { - "getOAuthUrl": "GET /v1/feishu-store/oauth/url", - "handleOAuthCallback": "GET /v1/feishu-store/oauth/callback" - }, - "feishuUsage": { - "getFeishuUsageSummary": "GET /v1/feishu-usage/summary", - "getFeishuUsageRecords": "GET /v1/feishu-usage/records", - "getFeishuPartnerConfig": "GET /v1/feishu-usage/partner-config", - "updateFeishuPartnerConfig": "PUT /v1/feishu-usage/partner-config" - }, - "contacts": { - "syncContacts": "POST /v1/contacts/sync", - "getDepartmentChildren": "GET /v1/contacts/departments/{departmentId}/children", - "getDepartmentById": "GET /v1/contacts/departments/{departmentId}", - "getUsersByDepartment": "GET /v1/contacts/departments/{departmentId}/users", - "getUserById": "GET /v1/contacts/users/{userId}", - "searchContacts": "GET /v1/contacts/search", - "getLastSyncTime": "GET /v1/contacts/last-sync-time", - "bindMobileAndEkuaibao": "PATCH /v1/contacts/me/bind-mobile", - "bindMobileWithVerification": "PATCH /v1/contacts/me/bind-mobile-with-verification", - "resyncCurrentUserStaff": "POST /v1/contacts/me/resync-staff", - "unbindMobile": "DELETE /v1/contacts/me/mobile", - "createLocalUser": "POST /v1/contacts/local/users", - "importLocalUsers": "POST /v1/contacts/local/users/import", - "updateLocalUser": "PATCH /v1/contacts/local/users/{userId}", - "deleteLocalUser": "DELETE /v1/contacts/local/users/{userId}", - "activateLocalUser": "POST /v1/contacts/local/users/{userId}/activate", - "resetLocalUserPassword": "POST /v1/contacts/local/users/{userId}/reset-password", - "createLocalDepartment": "POST /v1/contacts/local/departments", - "updateLocalDepartment": "PATCH /v1/contacts/local/departments/{departmentId}", - "deleteLocalDepartment": "DELETE /v1/contacts/local/departments/{departmentId}", - "moveLocalDepartment": "PATCH /v1/contacts/local/departments/{departmentId}/move" - }, - "sms": { - "sendCode": "POST /v1/sms/send-code", - "verifyCode": "POST /v1/sms/verify-code" - }, - "permissions": { - "getPermissionConfigs": "GET /v1/permissions/configs", - "updatePermissionConfig": "POST /v1/permissions/configs", - "getAvailablePermissions": "GET /v1/permissions/available" - }, - "businessArchive": { - "listPayAccounts": "GET /v1/business-archive/pay-accounts", - "upsertPayAccount": "POST /v1/business-archive/pay-accounts", - "setPayAccountActive": "POST /v1/business-archive/pay-accounts/{id}/active", - "searchPayBankBranches": "GET /v1/business-archive/pay-bank-branches", - "listBusinessArchiveTypes": "GET /v1/business-archive/types", - "upsertBusinessArchiveType": "POST /v1/business-archive/types", - "setBusinessArchiveTypeActive": "POST /v1/business-archive/types/{type}/active", - "listBusinessArchiveRecords": "GET /v1/business-archive/records", - "upsertBusinessArchiveRecord": "POST /v1/business-archive/records", - "setBusinessArchiveRecordActive": "POST /v1/business-archive/records/{id}/active", - "previewBusinessArchiveRecordImport": "POST /v1/business-archive/records/import/preview", - "importBusinessArchiveRecords": "POST /v1/business-archive/records/import" - }, - "webhook": { - "handleIncomingDocument": "POST /v1/integrations/webhook/{webhookId}/document", - "handleManualResult": "POST /v1/integrations/webhook/{webhookId}/manual-result", - "uploadAttachments": "POST /v1/integrations/webhook/{webhookId}/attachments" - }, - "hosecloud": { - "getSpecificationList": "GET /hosecloud/specifications", - "getSpecification": "GET /hosecloud/specifications/{id}", - "getSpecificationsBatch": "POST /hosecloud/specifications/batch", - "getFeeTypeTemplate": "GET /hosecloud/fee-types/{id}", - "getFeeTypeTemplatesBatch": "POST /hosecloud/fee-types/batch", - "syncDocument": "POST /hosecloud/documents/sync", - "calculateDocument": "POST /hosecloud/documents/calculate", - "getCorporationInfo": "POST /hosecloud/corporation", - "bindTenantCorporation": "POST /hosecloud/tenant/bind-corporation", - "toggleIntegrationLock": "POST /hosecloud/tenant/toggle-lock", - "checkConfiguration": "GET /hosecloud/status", - "getDocumentViewUrl": "GET /hosecloud/document-view-url", - "getDraftPreviewUrl": "POST /hosecloud/draft-preview-url", - "receiveOutboundMessage": "POST /hosecloud/outbound", - "handleFlowEvent": "POST /hosecloud/flow/completion", - "syncOutboundMessage": "POST /hosecloud/outbound-config/sync", - "deleteOutboundMessage": "DELETE /hosecloud/outbound-config/{signKey}" - }, - "weaver": { - "approvalWebhook": "POST /weaver/webhook", - "getWorkflows": "GET /weaver/workflows", - "getWorkflowNodes": "GET /weaver/workflows/{workflowId}/nodes", - "testConnection": "POST /weaver/test-connection", - "triggerEsbMdmSync": "GET /weaver/esb-mdm/sync", - "getEsbMdmSyncStatus": "GET /weaver/esb-mdm/status", - "getEsbMdmCache": "GET /weaver/esb-mdm/cache", - "triggerCompanyGroupSync": "GET /weaver/company-group/sync", - "getCompanyGroupSyncStatus": "GET /weaver/company-group/status", - "getCompanyGroupCache": "GET /weaver/company-group/cache", - "triggerCostCenterMappingSync": "GET /weaver/cost-center-mapping/sync", - "getCostCenterMappingSyncStatus": "GET /weaver/cost-center-mapping/status", - "lookupCostCenterMapping": "POST /weaver/cost-center-mapping/lookup" - }, - "maycur": { - "handleWebhook": "POST /v1/integrations/maycur/webhook", - "handleSync": "POST /v1/integrations/maycur/sync", - "testConnection": "POST /maycur/test-connection", - "login": "POST /maycur/auth/login", - "getReimburseDetail": "POST /maycur/reimburse/{formCode}", - "getReimburseAttachments": "POST /maycur/reimburse/{formCode}/attachments", - "testInvoiceVerify": "POST /maycur/invoice-verify/test" - }, - "maycurStandard": { - "handleWebhook": "POST /v1/integrations/maycur-standard/webhook", - "handleSync": "POST /v1/integrations/maycur-standard/sync", - "testConnection": "POST /maycur-standard/test-connection", - "login": "POST /maycur-standard/auth/login", - "getReimburseDetail": "POST /maycur-standard/reimburse/{formCode}", - "getReimburseAttachments": "POST /maycur-standard/reimburse/{formCode}/attachments", - "testInvoiceVerify": "POST /maycur-standard/invoice-verify/test" - }, - "helios": { - "verifyCredentials": "ASe", - "receiveCallback": "ASe" - }, - "rules": { - "getRules": "GET /v1/rules", - "getRuleById": "GET /v1/rules/{id}", - "createRule": "POST /v1/rules", - "updateRule": "PUT /v1/rules/{id}", - "deleteRule": "DELETE /v1/rules/{id}", - "deleteAllRulesForLocalDevelopment": "DELETE /v1/rules/local-development/all", - "batchRecodeRules": "POST /v1/rules/batch-recode", - "exportRulesCSV": "GET /v1/rules/export/csv", - "importRulesCSV": "POST /v1/rules/import/csv", - "previewCSVImport": "POST /v1/rules/import/csv/preview", - "previewAIRuleMerge": "POST /v1/rules/import/ai/preview", - "applyAIRuleMerge": "POST /v1/rules/import/ai/apply" - }, - "ruleSetVersions": { - "publishRuleSet": "POST /v1/rule-set-versions/publish", - "getVersions": "GET /v1/rule-set-versions", - "getLatestVersion": "GET /v1/rule-set-versions/latest", - "getVersionById": "GET /v1/rule-set-versions/{id}" - }, - "approvals": { - "uploadArtifactFile": "POST /v1/approval/artifacts/files", - "createApprovalTask": "POST /v1/approvals", - "createAgentBatch": "POST /v1/approval/create-agent-batch", - "getAgentSubmissionStatus": "POST /v1/approval/agent-submissions/status", - "getApprovalRecords": "GET /v1/approvals", - "getApprovalRecord": "GET /v1/approvals/{recordId}", - "requestExportApprovalRecords": "POST /v1/approvals/export" - }, - "invoice": { - "getInvoiceList": "GET /v1/invoice/list", - "getInvoiceDetail": "GET /v1/invoice/{id}" - }, - "knowledge": { - "createArticle": "POST /v1/knowledge/articles", - "patchArticle": "PATCH /v1/knowledge/articles/{id}", - "getArticle": "GET /v1/knowledge/articles/{id}", - "queryArticles": "GET /v1/knowledge/articles", - "deleteArticle": "DELETE /v1/knowledge/articles/{id}", - "batchDeleteArticles": "POST /v1/knowledge/articles/batch-delete", - "getTags": "GET /v1/knowledge/tags" - }, - "mentions": { - "searchMentions": "POST /v1/mentions/search" - }, - "attachments": { - "generateSignedUrl": "POST /v1/attachments/signed-url", - "generateBatchSignedUrls": "POST /v1/attachments/batch-signed-urls" - }, - "llm": { - "getLLMConfig": "GET /v1/llm/config", - "updateLLMConfig": "PUT /v1/llm/config", - "getAvailableProviders": "GET /v1/llm/providers", - "oauseResearcher": "POST /v1/llm/oause/researcher", - "oauseGenerate": "POST /v1/llm/oause/generate", - "testVisionModel": "POST /v1/llm/test-vision", - "testTextModel": "POST /v1/llm/test-text" - }, - "oause": { - "listRuntimeStates": "GET /v1/oause/runtime-states", - "upsertRuntimeState": "PUT /v1/oause/runtime-nodes/{runtimeNodeId}/state", - "getRuntimeState": "GET /v1/oause/runtime-nodes/{runtimeNodeId}/state", - "saveApprovalScheduledTaskConfig": "POST /v1/oause/approval-scheduled-task-configs", - "getApprovalScheduledTaskConfig": "GET /v1/oause/approval-scheduled-task-configs/{id}", - "listApprovalScheduledTaskConfigs": "GET /v1/oause/approval-scheduled-task-configs", - "deleteApprovalScheduledTaskConfig": "DELETE /v1/oause/approval-scheduled-task-configs/{id}", - "saveApprovalScheduledTaskRun": "POST /v1/oause/approval-scheduled-task-configs/{taskId}/runs", - "appendApprovalScheduledTaskRunEvents": "POST /v1/oause/approval-scheduled-task-configs/{taskId}/runs/{runId}/events", - "listApprovalScheduledTaskRuns": "GET /v1/oause/approval-scheduled-task-configs/{taskId}/runs", - "getApprovalScheduledTaskRun": "GET /v1/oause/approval-scheduled-task-configs/{taskId}/runs/{runId}", - "listSkillProfiles": "GET /v1/oause/skill-profiles", - "listSkillProfileLaunchConfigs": "GET /v1/oause/skill-profiles/launch-configs", - "listSkillProfileRevisions": "GET /v1/oause/skill-profiles/{id}/revisions", - "upsertSkillProfile": "POST /v1/oause/skill-profiles", - "initializeSkillProfile": "POST /v1/oause/skill-profiles/initialize", - "setSkillProfileStatus": "POST /v1/oause/skill-profiles/{id}/status", - "deleteSkillProfile": "DELETE /v1/oause/skill-profiles/{id}", - "resolveSkillProfile": "GET /v1/oause/skill-profiles/resolve" - }, - "insight": { - "getTagStats": "GET /v1/insight/stats", - "getRisksByTag": "GET /v1/insight/risks-by-tag", - "triggerAnalysis": "POST /v1/insight/analyze/{recordId}", - "getPerformanceMetrics": "GET /v1/insight/performance" - }, - "expense": { - "getExpenseList": "GET /v1/expenses/list", - "getExpenseDetail": "GET /v1/expenses/{id}", - "deleteExpensesByDocumentId": "DELETE /v1/expenses/document/{documentId}", - "getExpensesByInvoiceId": "GET /v1/expenses/invoice/{invoiceId}" - }, - "openapi": { - "getExpenseSyncConfig": "GET /v1/openapi/expense-sync/config", - "rotateExpenseSyncSecret": "POST /v1/openapi/expense-sync/rotate-secret", - "getFinanceSkillConfig": "GET /v1/openapi/finance-skill/config", - "setFinanceSkillEnabled": "POST /v1/openapi/finance-skill/enabled", - "getPublicFinanceCapabilities": "GET /v1/openapi/finance/public/capabilities", - "getPublicFinanceGeneralRules": "GET /v1/openapi/finance/public/general-rules", - "getPublicReimbursementGuide": "GET /v1/openapi/finance/public/reimbursement-guide", - "createFinanceGuestReview": "POST /v1/openapi/finance/guest-reviews", - "handleFinanceGuestIntent": "POST /v1/openapi/finance/guest-intents", - "syncExpenses": "POST /v1/openapi/expenses", - "inspectReceipts": "POST /v1/openapi/finance/receipts/inspect", - "startReceiptInspectionJob": "POST /v1/openapi/finance/receipt-inspection-jobs", - "getReceiptInspectionJob": "GET /v1/openapi/finance/receipt-inspection-jobs/{jobId}", - "prepareFinanceAudit": "POST /v1/openapi/finance/audit-rule-sources/prepare", - "startFinanceAuditJob": "POST /v1/openapi/finance/audit-jobs", - "getFinanceAuditJob": "GET /v1/openapi/finance/audit-jobs/{jobId}", - "writeFinanceAuditComment": "POST /v1/openapi/finance/audit-jobs/{jobId}/comment-writebacks" - }, - "lead": { - "createLead": "POST /v1/leads", - "getLeads": "GET /v1/boss/leads", - "updateLeadStatus": "PATCH /v1/boss/leads/{id}/status", - "deleteLead": "DELETE /v1/boss/leads/{id}" - }, - "boss": { - "getOauthUri": "GET /v1/boss/oauth/uri", - "handleOauthCallback": "POST /v1/boss/oauth/callback", - "signInWithPassword": "POST /v1/boss/sign-in-password", - "logout": "POST /v1/boss/logout", - "getCurrentUser": "GET /v1/boss/me", - "getTenants": "GET /v1/boss/tenants", - "getTenantsPage": "GET /v1/boss/tenants/page", - "searchTenants": "GET /v1/boss/tenants/search", - "createTenant": "POST /v1/boss/tenants", - "updateTenantConfig": "PATCH /v1/boss/tenants/{tenantId}/config", - "updateTenantDemo": "PATCH /v1/boss/tenants/{tenantId}/demo", - "updateTenantLogo": "PATCH /v1/boss/tenants/{tenantId}/logo", - "getTenantLogoUrl": "GET /v1/boss/tenants/{tenantId}/logo-url", - "updateTenantIcon": "PATCH /v1/boss/tenants/{tenantId}/icon", - "getTenantIconUrl": "GET /v1/boss/tenants/{tenantId}/icon-url", - "updateTenantBranding": "PATCH /v1/boss/tenants/{tenantId}/branding", - "updateTenantHosecloudCredentials": "PATCH /v1/boss/tenants/{tenantId}/hosecloud-credentials", - "getTenantProviderDefaults": "GET /v1/boss/tenant-provider-defaults/{provider}", - "updateTenantProviderBranding": "PATCH /v1/boss/tenant-provider-defaults/{provider}/branding", - "updateTenantProviderLogo": "PATCH /v1/boss/tenant-provider-defaults/{provider}/logo", - "updateTenantProviderIcon": "PATCH /v1/boss/tenant-provider-defaults/{provider}/icon", - "getTenantProviderLogoUrl": "GET /v1/boss/tenant-provider-defaults/{provider}/logo-url", - "getTenantProviderIconUrl": "GET /v1/boss/tenant-provider-defaults/{provider}/icon-url", - "generateInvitationCode": "POST /v1/boss/invitation-codes/generate", - "getInvitationCodes": "GET /v1/boss/invitation-codes", - "getInvitationCodeDetail": "GET /v1/boss/invitation-codes/{code}/detail", - "getAuditLogs": "GET /v1/boss/audit-logs", - "getZeroBalanceTenants": "GET /v1/boss/quota-alerts/tenants", - "run": "POST /v1/boss/health-check/run", - "runSingle": "POST /v1/boss/health-check/run-single", - "list": "GET /v1/boss/health-check/checkers", - "getLLMInfo": "GET /v1/boss/health-check/llm-info", - "testLLMScene": "POST /v1/boss/health-check/test-llm-scene", - "testLLMModel": "POST /v1/boss/health-check/test-llm-model" - }, - "llmCost": { - "listModels": "GET /v1/boss/llm-cost/models", - "listPriceBooks": "GET /v1/boss/llm-cost/price-books", - "getPriceBook": "GET /v1/boss/llm-cost/price-books/{priceBookId}", - "createPriceBook": "POST /v1/boss/llm-cost/price-books", - "updatePriceBookStatus": "PATCH /v1/boss/llm-cost/price-books/{priceBookId}", - "createPriceVersion": "POST /v1/boss/llm-cost/price-books/{priceBookId}/versions", - "getPriceVersion": "GET /v1/boss/llm-cost/price-versions/{priceVersionId}", - "updatePriceVersion": "PATCH /v1/boss/llm-cost/price-versions/{priceVersionId}", - "copyPriceVersion": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/copies", - "activatePriceVersion": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/activate", - "archivePriceVersion": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/archive", - "deletePriceVersion": "DELETE /v1/boss/llm-cost/price-versions/{priceVersionId}", - "saveBaseRateLines": "PUT /v1/boss/llm-cost/price-versions/{priceVersionId}/base-rate-lines", - "createRateLine": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/rate-lines", - "updateRateLine": "PATCH /v1/boss/llm-cost/rate-lines/{rateLineId}", - "deleteRateLine": "DELETE /v1/boss/llm-cost/rate-lines/{rateLineId}", - "createAdjustment": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/adjustments", - "updateAdjustment": "PATCH /v1/boss/llm-cost/adjustments/{adjustmentId}", - "deleteAdjustment": "DELETE /v1/boss/llm-cost/adjustments/{adjustmentId}", - "trialPriceVersion": "POST /v1/boss/llm-cost/price-versions/{priceVersionId}/trial" - }, - "configChangeRequest": { - "submit": "POST /v1/boss/config-change-requests", - "list": "GET /v1/boss/config-change-requests", - "get": "GET /v1/boss/config-change-requests/{requestId}", - "forceApprove": "POST /v1/boss/config-change-requests/{requestId}/force-approve" - }, - "billing": { - "getBillingStatus": "GET /v1/billing/status", - "getBillingUsage": "GET /v1/billing/usage", - "getBillingCreditPackages": "GET /v1/billing/credit-packages", - "getWebBillingPlans": "GET /v1/billing/plans", - "getWebBillingFeatures": "GET /v1/billing/features" - }, - "simulation": { - "createBatch": "POST /v1/simulation/create-batch", - "getBatch": "GET /v1/simulation/batch/{batchId}", - "getBatches": "GET /v1/simulation/batches", - "deleteBatchData": "DELETE /v1/simulation/batch/{batchId}/data", - "getBatchRecords": "GET /v1/simulation/batch/{batchId}/records", - "getIntegrationStatus": "GET /v1/simulation/integration-status", - "getMaycurPrivateIntegrations": "GET /v1/simulation/maycur-private-integrations", - "getMaycurStandardIntegrations": "GET /v1/simulation/maycur-standard-integrations", - "createMaterialPackBatch": "POST /v1/simulation/create-material-pack-batch", - "getMaterialPackages": "GET /v1/simulation/material-packages", - "getHosecloudSpecifications": "GET /v1/simulation/hosecloud-specifications", - "getHosecloudIntegrations": "GET /v1/simulation/hosecloud-integrations", - "getHosecloudSpecificationsBySignKey": "GET /v1/simulation/hosecloud-specifications-by-sign-key", - "getWeaverFinishedWorkflows": "POST /v1/simulation/weaver-finished-workflows", - "getHeliosExpenseReportBusinessCodes": "POST /v1/simulation/helios-expense-report-business-codes", - "getTemplates": "GET /v1/simulation/templates", - "saveTemplate": "POST /v1/simulation/templates", - "deleteTemplate": "DELETE /v1/simulation/templates/{templateId}" - }, - "aiform": { - "createThread": "POST /v1/aiform/conversation/threads", - "getThreads": "GET /v1/aiform/conversation/threads", - "getActiveThreadIds": "GET /v1/aiform/conversation/threads/active-ids", - "deleteThread": "DELETE /v1/aiform/conversation/threads/{id}", - "cancelChat": "POST /v1/aiform/conversation/threads/{id}/cancel", - "generateThreadTitle": "POST /v1/aiform/conversation/threads/{id}/title/generate", - "getThreadMessages": "GET /v1/aiform/conversation/threads/{id}/messages", - "saveThreadMessage": "POST /v1/aiform/conversation/threads/{id}/messages", - "updateToolResult": "PATCH /v1/aiform/conversation/messages/{messageId}/tool-result", - "getUserMemory": "GET /v1/aiform/conversation/user-memory", - "clearUserMemory": "DELETE /v1/aiform/conversation/user-memory", - "deleteMemoryRule": "DELETE /v1/aiform/conversation/user-memory/rules/{ruleNumber}", - "addMemoryRule": "POST /v1/aiform/conversation/user-memory/rules" - }, - "attachment": { - "upload": "POST /v1/aiform/attachment/upload", - "uploadForSubmit": "POST /v1/aiform/attachment/upload-for-submit", - "unregister": "POST /v1/aiform/attachment/unregister", - "getUploadLimits": "GET /v1/aiform/attachment/upload-limits" - }, - "fillSupplementTask": { - "listPending": "Sc", - "parseInput": "Sc", - "searchPayBankBranches": "Sc", - "searchGeneralArchiveRecords": "Sc", - "searchHosecloudArchiveOptions": "Sc", - "submitGeneralArchive": "Sc", - "submitPayAccount": "Sc", - "submitFieldValues": "Sc", - "submitChoice": "Sc", - "skip": "Sc", - "resumeFill": "Sc", - "resumeWorkflowRun": "Sc", - "reopen": "Sc", - "getWorkflowStatus": "Sc", - "cancel": "Sc" - }, - "dashboard": { - "getDashboardStats": "GET /v1/aiform/dashboard/stats", - "getRecentDrafts": "GET /v1/aiform/dashboard/recent-drafts", - "getDraftLocalPreview": "GET /v1/aiform/dashboard/drafts/local-preview", - "saveDraftEdits": "POST /v1/aiform/dashboard/drafts/{id}/save-edits", - "patchDraftFieldValue": "POST /v1/aiform/dashboard/drafts/{id}/patch-field", - "confirmSubmitDraft": "POST /v1/aiform/dashboard/drafts/{id}/confirm-submit", - "markDraftDeleted": "POST /v1/aiform/dashboard/drafts/{id}/mark-deleted", - "deleteLocalDraft": "POST /v1/aiform/dashboard/drafts/{id}/delete-local", - "getExpenseTimeline": "GET /v1/aiform/dashboard/expense-timeline", - "patchExpenseDate": "POST /v1/aiform/dashboard/expense-timeline/patch-date", - "patchExpenseDescription": "POST /v1/aiform/dashboard/expense-timeline/patch-description" - }, - "fieldTypeMapping": { - "listFieldSemanticConfigs": "GET /v1/aiform/field-type-mapping/configs", - "upsertFieldSemanticConfig": "POST /v1/aiform/field-type-mapping/configs", - "deleteFieldSemanticConfig": "DELETE /v1/aiform/field-type-mapping/configs", - "listFieldGuidanceConfigs": "GET /v1/aiform/field-ai-configs/guidance", - "upsertFieldGuidanceConfig": "POST /v1/aiform/field-ai-configs/guidance", - "deleteFieldGuidanceConfig": "DELETE /v1/aiform/field-ai-configs/guidance" - }, - "context": { - "getUserContext": "GET /v1/aiform/context/user", - "warmup": "POST /v1/aiform/context/warmup" - }, - "autoFill": { - "getSettings": "GET /v1/aiform/auto-fill/settings", - "updateSettings": "POST /v1/aiform/auto-fill/settings" - }, - "adminStats": { - "getAdminStatsSummary": "GET /v1/aiform/admin-stats/summary", - "getAdminStatsEmployees": "GET /v1/aiform/admin-stats/employees", - "getAdminStatsDailyTrend": "GET /v1/aiform/admin-stats/daily-trend", - "getAdminStatsTemplateDistribution": "GET /v1/aiform/admin-stats/template-distribution", - "getAdminStatsFeeTypeDistribution": "GET /v1/aiform/admin-stats/fee-type-distribution" - }, - "mail": { - "getIntegrationStatus": "GET /v1/aiform/mail-integration/status", - "saveIntegration": "POST /v1/aiform/mail-integration/connect", - "testIntegration": "POST /v1/aiform/mail-integration/test", - "listCredentials": "GET /v1/aiform/mail-credentials/list", - "refreshCredentials": "POST /v1/aiform/mail-credentials/refresh", - "importCredentials": "POST /v1/aiform/mail-credentials/import" - }, - "sealaiForms": { - "listForms": "GET /v1/sealai-forms", - "getForm": "GET /v1/sealai-forms/{id}", - "createForm": "POST /v1/sealai-forms", - "updateDraft": "PUT /v1/sealai-forms/{id}/draft", - "publishForm": "POST /v1/sealai-forms/{id}/publish", - "setEnabled": "POST /v1/sealai-forms/{id}/enabled", - "searchIdentityOptions": "GET /v1/sealai-forms/identity-options", - "searchApprovalOptions": "GET /v1/sealai-forms/approval-options", - "uploadFile": "POST /v1/sealai-forms/{id}/files", - "submitForm": "POST /v1/sealai-forms/{id}/submit" - }, - "aifapiao": { - "status": "GET /v1/aifapiao/status", - "invoiceTypes": "GET /v1/aifapiao/invoice-types", - "sendSmsCode": "POST /v1/aifapiao/config/send-sms-code", - "verifySmsAndBind": "POST /v1/aifapiao/config/verify-sms-and-bind", - "listInvoices": "GET /v1/aifapiao/invoices", - "importInvoices": "POST /v1/aifapiao/invoices/import" - }, - "agent": { - "getAiFormConfig": "Js", - "saveAiFormConfig": "Js", - "listAiFormTemplates": "Js", - "listAiFormFeeTypes": "Js", - "syncAiFormData": "Js", - "getAiFormTemplateDetail": "Js", - "getAiFormFeeTypeDetail": "Js", - "getAiApprovalConfig": "Js", - "saveAiApprovalConfig": "Js" - }, - "welcome": { - "validateInvitationCode": "POST /v1/welcome/invitation-codes/validate", - "updateOnboardingProgress": "POST /v1/welcome/invitation-codes/update-progress", - "validateFeishuCredentials": "POST /v1/welcome/validate-credentials", - "checkTenantUniqueness": "POST /v1/welcome/check-uniqueness", - "validateFeishuConfig": "POST /v1/welcome/validate-feishu", - "getFeishuScopeConfig": "GET /v1/welcome/feishu/scope-config", - "createTenantWithInvitationCode": "POST /v1/welcome/tenants", - "saveApaasConfig": "POST /v1/welcome/apaas-config" - }, - "auditBenchmark": { - "benchmarkChat": "POST /benchmark/v1/chat", - "getBenchmarkTaskStatus": "GET /benchmark/v1/task/{taskCode}" - }, - "oemHosecloud": { - "provision": "POST /v1/oem/hosecloud/tenants/provision", - "status": "GET /v1/oem/hosecloud/tenants/status", - "bindLock": "POST /v1/oem/hosecloud/tenants/bind-lock" - }, - "style": { - "opacity": "0", - "margin": "0" - }, - "value": {}, - "pricing": { - "0": "void", - "type": "m", - "amount": "m", - "cycle": "m" - } -} \ No newline at end of file diff --git a/src/domains/seal/simulation.test.ts b/src/domains/seal/capabilities/simulation.test.ts similarity index 99% rename from src/domains/seal/simulation.test.ts rename to src/domains/seal/capabilities/simulation.test.ts index e58fa0b..f627374 100644 --- a/src/domains/seal/simulation.test.ts +++ b/src/domains/seal/capabilities/simulation.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test"; import { KyInstance } from "ky"; -import { CorpConfig } from "../../core/config/types.js"; +import { CorpConfig } from "../../../core/config/types.js"; import { createMaterialPackBatch, createSimulationBatch, @@ -10,15 +10,15 @@ import { listSimulationHosecloudIntegrations, listSimulationTemplates, uploadMaterialPackage -} from "./api.js"; -import { buildSimulationBatchParams, findReusableSimulationBatch, sealCapabilities } from "./capabilities.js"; +} from "../api.js"; +import { buildSimulationBatchParams, findReusableSimulationBatch, sealCapabilities } from "../capabilities.js"; import { MaterialPackageSchema, SimulationBatch, SimulationBatchSchema, SimulationIntegrationStatusSchema, SimulationTemplateSchema -} from "./types.js"; +} from "../types.js"; type CapabilityHandler = ( client: KyInstance,