基线:鉴权会话+工作组+工作台三区修复+编排工作区+产品设计文档

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
2026-07-27 20:43:35 +08:00
co-authored by Claude Fable 5
parent 61fe181678
commit ac85ecf2ea
119 changed files with 16634 additions and 1246 deletions
+485
View File
@@ -474,22 +474,30 @@ export declare const listProcessPackagesRoute: {
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
@@ -515,9 +523,12 @@ export declare const listProcessPackagesRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
@@ -570,9 +581,12 @@ export declare const listProcessPackagesRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
@@ -584,11 +598,15 @@ export declare const listProcessPackagesRoute: {
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
@@ -617,6 +635,10 @@ export declare const listProcessPackagesRoute: {
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -624,10 +646,427 @@ export declare const listProcessPackagesRoute: {
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 画图即校验 —— 与前端画布同源的闭合校验 */
/**
* 保存流程包(编排工作区的落笔)。
* **保存 ≠ 发布**:落的是这一版的定义(草稿可反复存);已发布版本不可回改 ——
* 后端按 (id, version, state) 判:published 版拒存,提示另起新版本。
* 返回连同闭合报告:画图即校验,每次落笔都知道离「可发布」还差几条。
*/
export declare const saveProcessRoute: {
readonly method: "PUT";
readonly path: "/api/gov/process";
readonly body: z.ZodObject<{
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
draft: "draft";
published: "published";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
strategy: z.ZodDefault<z.ZodEnum<{
assigned: "assigned";
sole: "sole";
rotation: "rotation";
"follow-source": "follow-source";
}>>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
failure: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"reroute">;
edgeId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"escalate">;
approvalNodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
approver: z.ZodObject<{
position: z.ZodString;
strategy: z.ZodDefault<z.ZodEnum<{
assigned: "assigned";
sole: "sole";
rotation: "rotation";
"follow-source": "follow-source";
}>>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
target: z.ZodString;
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
from: z.ZodLiteral<"output-port">;
port: z.ZodString;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"workflow-var">;
name: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"initiation">;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"constant">;
value: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"expression">;
sfeel: z.ZodString;
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
gateway: z.ZodEnum<{
parallel: "parallel";
exclusive: "exclusive";
}>;
mode: z.ZodEnum<{
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
target: z.ZodString;
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
from: z.ZodLiteral<"output-port">;
port: z.ZodString;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"workflow-var">;
name: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"initiation">;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"constant">;
value: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"expression">;
sfeel: z.ZodString;
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
pkg: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "out">;
name: z.ZodString;
version: z.ZodNumber;
state: z.ZodEnum<{
draft: "draft";
published: "published";
retired: "retired";
}>;
callInterface: z.ZodObject<{
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
strategy: z.ZodDefault<z.ZodEnum<{
assigned: "assigned";
sole: "sole";
rotation: "rotation";
"follow-source": "follow-source";
}>>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
failure: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"reroute">;
edgeId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"escalate">;
approvalNodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"tolerate">;
}, z.core.$strip>], "kind">>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
approver: z.ZodObject<{
position: z.ZodString;
strategy: z.ZodDefault<z.ZodEnum<{
assigned: "assigned";
sole: "sole";
rotation: "rotation";
"follow-source": "follow-source";
}>>;
staffId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
reject: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"reopen">;
nodeId: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
target: z.ZodString;
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
from: z.ZodLiteral<"output-port">;
port: z.ZodString;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"workflow-var">;
name: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"initiation">;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"constant">;
value: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"expression">;
sfeel: z.ZodString;
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"terminate">;
}, z.core.$strip>], "kind">;
nudge: z.ZodOptional<z.ZodObject<{
deadline: z.ZodString;
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
after: z.ZodString;
action: z.ZodEnum<{
nudge: "nudge";
escalate: "escalate";
}>;
}, z.core.$strip>>>;
}, z.core.$strip>>;
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
gateway: z.ZodEnum<{
parallel: "parallel";
exclusive: "exclusive";
}>;
mode: z.ZodEnum<{
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
id: z.ZodString;
from: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
to: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
condition: z.ZodOptional<z.ZodString>;
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
target: z.ZodString;
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
from: z.ZodLiteral<"output-port">;
port: z.ZodString;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"workflow-var">;
name: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"initiation">;
path: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"constant">;
value: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
from: z.ZodLiteral<"expression">;
sfeel: z.ZodString;
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
name: z.ZodString;
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
report: z.ZodObject<{
publishable: z.ZodBoolean;
violations: z.ZodArray<z.ZodObject<{
kind: z.ZodEnum<{
"edge-unmapped": "edge-unmapped";
"required-unmapped": "required-unmapped";
"type-conflict": "type-conflict";
"dangling-node": "dangling-node";
"gateway-unbalanced": "gateway-unbalanced";
"join-ambiguous-source": "join-ambiguous-source";
"tolerate-required-dependency": "tolerate-required-dependency";
"unknown-activity": "unknown-activity";
"missing-owner-position": "missing-owner-position";
}>;
nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
edgeId: z.ZodOptional<z.ZodString>;
field: z.ZodOptional<z.ZodString>;
message: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>;
};
export declare const validateProcessRoute: {
readonly method: "POST";
readonly path: "/api/gov/process/validate";
@@ -649,22 +1088,30 @@ export declare const validateProcessRoute: {
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
@@ -690,9 +1137,12 @@ export declare const validateProcessRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
@@ -745,9 +1195,12 @@ export declare const validateProcessRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
@@ -759,11 +1212,15 @@ export declare const validateProcessRoute: {
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
@@ -792,6 +1249,10 @@ export declare const validateProcessRoute: {
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -799,6 +1260,7 @@ export declare const validateProcessRoute: {
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
@@ -1091,22 +1553,30 @@ export declare const govWorkflowRoute: {
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
@@ -1132,9 +1602,12 @@ export declare const govWorkflowRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
@@ -1187,9 +1660,12 @@ export declare const govWorkflowRoute: {
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
@@ -1201,11 +1677,15 @@ export declare const govWorkflowRoute: {
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
@@ -1234,6 +1714,10 @@ export declare const govWorkflowRoute: {
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1241,6 +1725,7 @@ export declare const govWorkflowRoute: {
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
instances: z.ZodArray<z.ZodObject<{
nodeId: z.ZodString;
+1 -1
View File
@@ -5,7 +5,7 @@
* **禁止 Hono RPC 客户端** —— 它要求前端 import 后端类型,违反 §5.1。
*/
import type { z } from 'zod';
export declare const HTTP_METHODS: readonly ["GET", "POST", "PATCH", "DELETE"];
export declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
export type HttpMethod = (typeof HTTP_METHODS)[number];
/**
* 一条路由契约。`path` 用 `:name` 表示路径参数,与 `params` 的键一一对应。
+321 -4
View File
@@ -3,6 +3,7 @@
* 工作台五要素:任务 / 审批 / 消息 / 纪要 / 汇报 —— 同一份过程事实的五种投影。
*/
import { z } from 'zod';
/** 我是谁 —— 无会话即 401,前端据此落登录页(ADR-010) */
export declare const sessionRoute: {
readonly method: "GET";
readonly path: "/api/session";
@@ -55,6 +56,74 @@ export declare const sessionRoute: {
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 登录 —— 单组织 cookie session(编码规范 §4 / ADR-010)。
* 成功即种 `jcai_session`(HttpOnly);失败只回一句话,不区分账号不存在还是口令错。
*/
export declare const loginRoute: {
readonly method: "POST";
readonly path: "/api/login";
readonly body: z.ZodObject<{
account: z.ZodString;
password: z.ZodString;
}, z.core.$strip>;
readonly output: z.ZodObject<{
staff: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
account: z.ZodString;
name: z.ZodString;
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
state: z.ZodDefault<z.ZodEnum<{
active: "active";
disabled: "disabled";
}>>;
}, z.core.$strip>;
position: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
code: z.ZodString;
name: z.ZodString;
note: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
grants: z.ZodArray<z.ZodObject<{
positionId: z.core.$ZodBranded<z.ZodString, "PositionId", "out">;
object: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"data">;
domain: z.ZodString;
object: z.ZodString;
field: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"governance">;
function: z.ZodEnum<{
data: "data";
task: "task";
trigger: "trigger";
system: "system";
tool: "tool";
activity: "activity";
staff: "staff";
process: "process";
memory: "memory";
}>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"task">;
activityId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
action: z.ZodEnum<{
read: "read";
write: "write";
govern: "govern";
}>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
/** 登出 —— 服务端会话立刻作废,不等 cookie 到期 */
export declare const logoutRoute: {
readonly method: "POST";
readonly path: "/api/logout";
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
export declare const healthRoute: {
readonly method: "GET";
readonly path: "/api/health";
@@ -137,6 +206,26 @@ export declare const listTasksRoute: {
}, z.core.$strip>>;
}, z.core.$strip>;
};
/**
* 流程链上的一环 —— 「一条 = 一个活动的一次运行」之外,人还要看见自己在整条流程的哪儿。
* 别人负责的节点也在链上(只读),但不进任务清单。
*/
export declare const chainNodeSchema: z.ZodObject<{
nodeId: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
approval: "approval";
}>;
ownerName: z.ZodString;
ownerRole: z.ZodString;
state: z.ZodEnum<{
done: "done";
current: "current";
todo: "todo";
}>;
}, z.core.$strip>;
export type ChainNode = z.infer<typeof chainNodeSchema>;
/** 任务详情 —— 工作区与对话区的服务端投影(前端零过程状态,刷新即重建) */
export declare const taskDetailSchema: z.ZodObject<{
card: z.ZodObject<{
@@ -171,6 +260,25 @@ export declare const taskDetailSchema: z.ZodObject<{
startedAt: z.ZodString;
}, z.core.$strip>;
goal: z.ZodString;
owner: z.ZodObject<{
name: z.ZodString;
role: z.ZodString;
}, z.core.$strip>;
chain: z.ZodArray<z.ZodObject<{
nodeId: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
approval: "approval";
}>;
ownerName: z.ZodString;
ownerRole: z.ZodString;
state: z.ZodEnum<{
done: "done";
current: "current";
todo: "todo";
}>;
}, z.core.$strip>>;
budget: z.ZodObject<{
steps: z.ZodString;
tokens: z.ZodString;
@@ -290,6 +398,10 @@ export declare const taskDetailSchema: z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -359,6 +471,10 @@ export declare const taskDetailSchema: z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -396,6 +512,43 @@ export declare const taskDetailSchema: z.ZodObject<{
}>;
at: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
results: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
at: z.ZodOptional<z.ZodString>;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
workOrders: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
mode: z.ZodLiteral<"execution">;
preset: z.ZodOptional<z.ZodEnum<{
@@ -507,6 +660,10 @@ export declare const taskDetailSchema: z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -576,6 +733,10 @@ export declare const taskDetailSchema: z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -644,7 +805,12 @@ export declare const taskDetailSchema: z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
@@ -708,7 +874,12 @@ export declare const taskDetailSchema: z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>], "mode">>;
@@ -902,6 +1073,10 @@ export declare const taskDetailSchema: z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -971,6 +1146,10 @@ export declare const taskDetailSchema: z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1055,6 +1234,25 @@ export declare const taskDetailRoute: {
startedAt: z.ZodString;
}, z.core.$strip>;
goal: z.ZodString;
owner: z.ZodObject<{
name: z.ZodString;
role: z.ZodString;
}, z.core.$strip>;
chain: z.ZodArray<z.ZodObject<{
nodeId: z.ZodString;
label: z.ZodString;
kind: z.ZodEnum<{
activity: "activity";
approval: "approval";
}>;
ownerName: z.ZodString;
ownerRole: z.ZodString;
state: z.ZodEnum<{
done: "done";
current: "current";
todo: "todo";
}>;
}, z.core.$strip>>;
budget: z.ZodObject<{
steps: z.ZodString;
tokens: z.ZodString;
@@ -1174,6 +1372,10 @@ export declare const taskDetailRoute: {
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1243,6 +1445,10 @@ export declare const taskDetailRoute: {
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1280,6 +1486,43 @@ export declare const taskDetailRoute: {
}>;
at: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
results: z.ZodArray<z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
at: z.ZodOptional<z.ZodString>;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"excel">;
name: z.ZodString;
sheet: z.ZodString;
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"word">;
name: z.ZodString;
blocks: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
t: z.ZodEnum<{
h1: "h1";
h2: "h2";
p: "p";
}>;
text: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"ul">;
items: z.ZodArray<z.ZodString>;
}, z.core.$strip>]>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"pdf">;
name: z.ZodString;
src: z.ZodString;
}, z.core.$strip>], "kind">;
}, z.core.$strip>>;
workOrders: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
mode: z.ZodLiteral<"execution">;
preset: z.ZodOptional<z.ZodEnum<{
@@ -1391,6 +1634,10 @@ export declare const taskDetailRoute: {
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1460,6 +1707,10 @@ export declare const taskDetailRoute: {
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1528,7 +1779,12 @@ export declare const taskDetailRoute: {
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
@@ -1592,7 +1848,12 @@ export declare const taskDetailRoute: {
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>], "mode">>;
@@ -1786,6 +2047,10 @@ export declare const taskDetailRoute: {
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1855,6 +2120,10 @@ export declare const taskDetailRoute: {
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1912,6 +2181,20 @@ export declare const replyWorkOrderRoute: {
producesCompletion: z.ZodBoolean;
}, z.core.$strip>;
};
/**
* 对话卡回传(决策 / 补全 / 评价)—— 与后端回传校验**同 schema**。
* 对话流是一切回环输入的唯一入口(OS 4.1):卡就长在对话流上,答也就地答。
*/
export declare const replyChatCardRoute: {
readonly method: "POST";
readonly path: "/api/desk/chat-cards/reply";
readonly body: z.ZodObject<{
reply: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
}, z.core.$strip>;
};
/** 负责人的自由输入 —— 人事件的第二形态 */
export declare const sayRoute: {
readonly method: "POST";
@@ -2582,3 +2865,37 @@ export declare const decideApprovalRoute: {
}, z.core.$strip>;
};
export type ListApprovalsForMeOutput = z.infer<typeof listApprovalsForMeRoute.output>;
/**
* 「登记触发 —— 人工起单的统一形态:登记人选择流程包、按调用接口 schema 填写输入
* (表单由 schema 自动渲染)、提交即起单。」**登记人即来源**。
*/
export declare const listRegistrationTriggersRoute: {
readonly method: "GET";
readonly path: "/api/triggers/registration";
readonly output: z.ZodObject<{
triggers: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
processPackageId: z.ZodString;
enabled: z.ZodBoolean;
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>;
}, z.core.$strip>;
};
export declare const fireRegistrationRoute: {
readonly method: "POST";
readonly path: "/api/triggers/:triggerId/register";
readonly params: z.ZodObject<{
triggerId: z.ZodString;
}, z.core.$strip>;
readonly body: z.ZodObject<{
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
ok: z.ZodBoolean;
workflowId: z.ZodOptional<z.ZodString>;
skipped: z.ZodOptional<z.ZodString>;
missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
};
export type ListRegistrationTriggersOutput = z.infer<typeof listRegistrationTriggersRoute.output>;
+81 -5
View File
@@ -76,6 +76,10 @@ export declare const formFieldSchema: z.ZodObject<{
}, z.core.$strip>;
export type FormField = z.infer<typeof formFieldSchema>;
declare const fileDocSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -207,6 +211,10 @@ export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -276,6 +284,10 @@ export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -434,6 +446,10 @@ export declare const deliverableSchema: z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -503,6 +519,10 @@ export declare const deliverableSchema: z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -548,11 +568,31 @@ export declare const workOrderModeSchema: z.ZodEnum<{
}>;
export type WorkOrderMode = z.infer<typeof workOrderModeSchema>;
export declare const WORK_ORDER_MODE_LABEL: Readonly<Record<WorkOrderMode, string>>;
/**
* 办结口径:执行件只有「已提交」,验收件是放行三选一 —— 与回传协议同一套标识符。
* 界面文案由字典给出(与原型逐字一致),不在组件里散落中文。
*/
export declare const WORK_ORDER_RESULTS: readonly ["submitted", "pass", "redo", "revise"];
export declare const workOrderResultSchema: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
export type WorkOrderResult = z.infer<typeof workOrderResultSchema>;
export declare const WORK_ORDER_RESULT_LABEL: Readonly<Record<WorkOrderResult, string>>;
/** 驳回两式 —— 退回即重来,判定处只此一处 */
export declare function isRejection(result: WorkOrderResult): boolean;
/** 完成回传:谁、何时、答了什么(回传即留痕) */
export declare const workDoneSchema: z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>;
export type WorkDone = z.infer<typeof workDoneSchema>;
@@ -668,6 +708,10 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -737,6 +781,10 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -805,7 +853,12 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>;
@@ -895,7 +948,12 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>;
@@ -1011,6 +1069,10 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
name: z.ZodString;
meta: z.ZodOptional<z.ZodString>;
file: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1080,6 +1142,10 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
label: z.ZodString;
desc: z.ZodString;
file: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"html">;
name: z.ZodString;
html: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"markdown">;
name: z.ZodString;
md: z.ZodString;
@@ -1148,7 +1214,12 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
@@ -1212,7 +1283,12 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
done: z.ZodOptional<z.ZodObject<{
at: z.ZodISODateTime;
by: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
result: z.ZodString;
result: z.ZodEnum<{
redo: "redo";
revise: "revise";
submitted: "submitted";
pass: "pass";
}>;
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, z.core.$strip>>;
}, z.core.$strip>], "mode">;
+17
View File
@@ -174,3 +174,20 @@ export declare const sessionSchema: z.ZodObject<{
}, z.core.$strip>>;
}, z.core.$strip>;
export type Session = z.infer<typeof sessionSchema>;
/**
* 工作组 —— 一组「岗位 → 员工」的绑定,起单时装载、随工作流走。
*
* **不是第五种负责人策略**(OS 03「策略封闭四选」不动):
* 四策略回答的是「这个岗位该派给谁」,工作组直接给出了答案,策略于是无从发问。
* 键是**岗位 code**(BD / PM / FAE …),与流程包 `owner.position` 同一口径。
*/
export declare const workGroupSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
ownerId: z.core.$ZodBranded<z.ZodString, "StaffId", "out">;
members: z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
}, z.core.$strip>;
export type WorkGroup = z.infer<typeof workGroupSchema>;
/** 装进工作流的**快照**:改组不改已起的单(留痕不被改写) */
export declare const workGroupBindingSchema: z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "StaffId", "out">>;
export type WorkGroupBinding = z.infer<typeof workGroupBindingSchema>;
+45
View File
@@ -97,6 +97,10 @@ export declare const edgeSchema: z.ZodObject<{
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
export type Edge = z.infer<typeof edgeSchema>;
@@ -135,22 +139,30 @@ export declare const processNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
@@ -176,9 +188,12 @@ export declare const processNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
@@ -231,9 +246,12 @@ export declare const processNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
@@ -245,11 +263,15 @@ export declare const processNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">;
export type ProcessNode = z.infer<typeof processNodeSchema>;
@@ -282,22 +304,30 @@ export declare const processPackageSchema: z.ZodObject<{
kind: z.ZodLiteral<"start">;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"end">;
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"activity">;
activityId: z.core.$ZodBranded<z.ZodString, "ActivityId", "out">;
in: z.ZodOptional<z.ZodArray<z.ZodString>>;
out: z.ZodOptional<z.ZodArray<z.ZodString>>;
activityVersion: z.ZodOptional<z.ZodString>;
owner: z.ZodObject<{
position: z.ZodString;
@@ -323,9 +353,12 @@ export declare const processPackageSchema: z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"approval">;
@@ -378,9 +411,12 @@ export declare const processPackageSchema: z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"gateway">;
@@ -392,11 +428,15 @@ export declare const processPackageSchema: z.ZodObject<{
join: "join";
fork: "fork";
}>;
basis: z.ZodOptional<z.ZodString>;
id: z.core.$ZodBranded<z.ZodString, "NodeId", "out">;
label: z.ZodString;
sub: z.ZodOptional<z.ZodString>;
layout: z.ZodOptional<z.ZodObject<{
row: z.ZodNumber;
col: z.ZodNumber;
x: z.ZodOptional<z.ZodNumber>;
y: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
}, z.core.$strip>], "kind">>;
edges: z.ZodArray<z.ZodObject<{
@@ -425,6 +465,10 @@ export declare const processPackageSchema: z.ZodObject<{
}, z.core.$strip>], "from">;
}, z.core.$strip>>>;
label: z.ZodOptional<z.ZodString>;
tone: z.ZodOptional<z.ZodEnum<{
ok: "ok";
bad: "bad";
}>>;
reopen: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -432,6 +476,7 @@ export declare const processPackageSchema: z.ZodObject<{
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodString>;
diagram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
export type ProcessPackage = z.infer<typeof processPackageSchema>;
export declare const CLOSURE_VIOLATION_KINDS: readonly ["edge-unmapped", "required-unmapped", "type-conflict", "dangling-node", "gateway-unbalanced", "join-ambiguous-source", "tolerate-required-dependency", "unknown-activity", "missing-owner-position"];