发布 v1.10 #5
@@ -597,13 +597,17 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`通过 Public API 可异步执行已发布的工作流并获取执行结果。`);
|
lines.push(`通过 Public API 可异步执行已发布的工作流并获取执行结果。`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`**调用流程**:发起执行 → 轮询查询执行结果 → (若有确认节点)恢复执行`);
|
lines.push(
|
||||||
|
`**调用流程**:发起执行 → 轮询查询执行结果 → (若有确认节点)恢复执行`,
|
||||||
|
);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
|
|
||||||
// ---- 鉴权 ----
|
// ---- 鉴权 ----
|
||||||
lines.push(`## 鉴权`);
|
lines.push(`## 鉴权`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`所有请求需在 Header 中携带访问令牌,访问令牌需开启 **工作流 API 调用授权**。`);
|
lines.push(
|
||||||
|
`所有请求需在 Header 中携带访问令牌,访问令牌需开启 **工作流 API 调用授权**。`,
|
||||||
|
);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push('```');
|
lines.push('```');
|
||||||
lines.push(`ApiKey: <your-api-key>`);
|
lines.push(`ApiKey: <your-api-key>`);
|
||||||
@@ -617,7 +621,9 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(apiUrlLine('POST', `${baseUrl}/runAsync`));
|
lines.push(apiUrlLine('POST', `${baseUrl}/runAsync`));
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`异步执行工作流,立即返回执行 ID。工作流必须已发布且存在发布快照。`);
|
lines.push(
|
||||||
|
`异步执行工作流,立即返回执行 ID。工作流必须已发布且存在发布快照。`,
|
||||||
|
);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`### 请求体`);
|
lines.push(`### 请求体`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
@@ -644,7 +650,9 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(`| --- | --- | --- | --- |`);
|
lines.push(`| --- | --- | --- | --- |`);
|
||||||
for (const f of fields) {
|
for (const f of fields) {
|
||||||
const desc = [f.label, f.description].filter(Boolean).join(' · ');
|
const desc = [f.label, f.description].filter(Boolean).join(' · ');
|
||||||
lines.push(`| ${f.key} | ${f.type} | ${f.required ? '是' : '否'} | ${desc} |`);
|
lines.push(
|
||||||
|
`| ${f.key} | ${f.type} | ${f.required ? '是' : '否'} | ${desc} |`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
}
|
}
|
||||||
@@ -655,7 +663,9 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(buildRunResponseExample());
|
lines.push(buildRunResponseExample());
|
||||||
lines.push('```');
|
lines.push('```');
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`\`data\` 为 **执行 ID**(executeId),后续查询和恢复均需使用此 ID。`);
|
lines.push(
|
||||||
|
`\`data\` 为 **执行 ID**(executeId),后续查询和恢复均需使用此 ID。`,
|
||||||
|
);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`---`);
|
lines.push(`---`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
@@ -745,7 +755,9 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(`### 响应`);
|
lines.push(`### 响应`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push('```json');
|
lines.push('```json');
|
||||||
lines.push(JSON.stringify({ errorCode: 0, message: '成功', data: null }, null, 2));
|
lines.push(
|
||||||
|
JSON.stringify({ errorCode: 0, message: '成功', data: null }, null, 2),
|
||||||
|
);
|
||||||
lines.push('```');
|
lines.push('```');
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`恢复后可继续轮询 \`getChainStatus\` 获取后续执行状态。`);
|
lines.push(`恢复后可继续轮询 \`getChainStatus\` 获取后续执行状态。`);
|
||||||
@@ -756,13 +768,19 @@ const apiDocMarkdown = computed(() => {
|
|||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`## 错误处理`);
|
lines.push(`## 错误处理`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`当请求失败时,\`errorCode\` 不为 0,\`message\` 包含错误原因。常见错误:`);
|
lines.push(
|
||||||
|
`当请求失败时,\`errorCode\` 不为 0,\`message\` 包含错误原因。常见错误:`,
|
||||||
|
);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`| 场景 | 说明 |`);
|
lines.push(`| 场景 | 说明 |`);
|
||||||
lines.push(`| --- | --- |`);
|
lines.push(`| --- | --- |`);
|
||||||
lines.push(`| ApiKey 无效或过期 | 检查访问令牌状态与有效期 |`);
|
lines.push(`| ApiKey 无效或过期 | 检查访问令牌状态与有效期 |`);
|
||||||
lines.push(`| 未授权工作流 API 调用 | 在访问令牌中开启「工作流 API 调用授权」 |`);
|
lines.push(
|
||||||
lines.push(`| 工作流尚未发布 | 仅已发布且存在发布快照的工作流可通过 API 调用 |`);
|
`| 未授权工作流 API 调用 | 在访问令牌中开启「工作流 API 调用授权」 |`,
|
||||||
|
);
|
||||||
|
lines.push(
|
||||||
|
`| 工作流尚未发布 | 仅已发布且存在发布快照的工作流可通过 API 调用 |`,
|
||||||
|
);
|
||||||
|
|
||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user