105 lines
4.2 KiB
JSON
105 lines
4.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://hose-use.local/specs/hose-close-api/schemas/workflow-detail.schema.json",
|
|
"title": "Workflow detail (EASO/Piper pipeline)",
|
|
"description": "工作流详情。GET /api/easo/pipelines/{id} 与 PUT /api/easo/pipelines/{id} 使用。PUT 请求体带 inputs,抓包中的响应 data 不返回 inputs。",
|
|
"x-source": [
|
|
"code-derived: src/domains/platform/workflow/models/workflow.ts:49 (WorkflowDetailSchema)",
|
|
"reference: _tmp-captured/raw/PUT-api-easo-pipelines-id.json"
|
|
],
|
|
"type": "object",
|
|
"required": ["id", "tasks"],
|
|
"properties": {
|
|
"id": { "type": "string" },
|
|
"label": { "type": "string", "description": "工作流名称。" },
|
|
"desc": { "type": ["string", "null"] },
|
|
"customDesc": { "type": ["string", "null"] },
|
|
"state": { "type": "number", "description": "0 停用,1 启用。" },
|
|
"debugState": { "type": "number" },
|
|
"runTimes": { "type": "number" },
|
|
"errorTimes": { "type": "number" },
|
|
"staffName": { "type": ["string", "null"] },
|
|
"updateTime": { "type": "string" },
|
|
"updateUser": { "type": ["string", "null"] },
|
|
"dataLimit": { "type": "number" },
|
|
"version": { "type": "string", "description": "产品版本号,例如 26.10.1。" },
|
|
"source": { "type": "number" },
|
|
"queueJobs": { "type": "boolean" },
|
|
"tasksVersion": { "type": "number", "description": "任务版本号,保存节点时递增。" },
|
|
"platformId": { "type": "string", "description": "copy 等场景可能出现。" },
|
|
"tasks": { "type": "array", "items": { "$ref": "#/$defs/Task" } },
|
|
"alarm": {
|
|
"oneOf": [
|
|
{ "$ref": "#/$defs/Alarm" },
|
|
{ "type": "string", "description": "Zod 兼容 JSON 字符串。" },
|
|
{ "type": "null" }
|
|
]
|
|
},
|
|
"inputs": {
|
|
"type": "array",
|
|
"description": "PUT 请求体中出现,例如 [{key:'$platformId',value:'<platformId>'}]。",
|
|
"items": { "$ref": "#/$defs/KeyValue" }
|
|
},
|
|
"$snapshot": {
|
|
"type": "array",
|
|
"description": "文本/表达式内嵌选择器快照补丁,value 是 JSON 字符串。",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["key", "value"],
|
|
"properties": {
|
|
"key": { "type": "string" },
|
|
"value": { "type": "string" }
|
|
},
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": true,
|
|
"$defs": {
|
|
"KeyValue": {
|
|
"type": "object",
|
|
"required": ["key"],
|
|
"properties": {
|
|
"key": { "type": "string" },
|
|
"value": {}
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"Alarm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"alarmUser": { "type": "array", "items": {} },
|
|
"alarmType": { "type": "array", "items": { "type": "string" } },
|
|
"active": { "type": "boolean" },
|
|
"alarmScope": { "type": "string" }
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"Task": {
|
|
"type": "object",
|
|
"description": "递归任务节点。未列出的类型专属字段按 additionalProperties 保留。",
|
|
"required": ["name", "type", "label", "groupName", "orderIndex", "levelIndex", "status"],
|
|
"properties": {
|
|
"name": { "type": "string", "description": "节点唯一名,例如 trigger_1、action_rv232l。" },
|
|
"type": {
|
|
"type": "string",
|
|
"description": "节点类型。代码覆盖:clock、condition、every、stop、http、flow-detail、code、code-js2、ekuaibao-datalink-filter、ekuaibao-datalink-create、data-convert、flow-create-task、task-dynamic-delay、webhook 等。"
|
|
},
|
|
"label": { "type": "string" },
|
|
"displayName": { "type": "string" },
|
|
"desc": { "type": ["string", "null"] },
|
|
"groupName": { "type": "string", "description": "trigger / action / control。" },
|
|
"orderIndex": { "type": "number" },
|
|
"levelIndex": { "type": "array", "items": { "type": "number" } },
|
|
"status": { "type": "string" },
|
|
"tasks": {
|
|
"type": "array",
|
|
"description": "condition/every 等控制节点的子节点。",
|
|
"items": { "$ref": "#/$defs/Task" }
|
|
}
|
|
},
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|