三面拆分⑥:触发器 upsert 路由 —— 定义面的 HTTP 口(启停仍走 toggle)

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 21:12:44 +08:00
co-authored by Claude Fable 5
parent 19108af6fa
commit de283acbdb
3 changed files with 143 additions and 0 deletions
+113
View File
@@ -1380,6 +1380,119 @@ export declare const toggleTriggerRoute: {
ok: z.ZodBoolean;
}, z.core.$strip>;
};
/**
* 调起规则的**定义面**(设计中心):新建 / 改规则 / 改起单装配。
*
* 与 `toggleTriggerRoute` 分开是有意的:定义归设计,启停归运营 ——
* 同一个触发器,「它按什么规则调起」和「今天开不开」是两个人在两个台面上做的两件事。
* 触发器与流程包平级:改它**不动任何包版本**。
*/
export declare const upsertTriggerRoute: {
readonly method: "PUT";
readonly path: "/api/gov/triggers";
readonly body: z.ZodObject<{
trigger: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TriggerId", "out">;
name: z.ZodString;
enabled: z.ZodDefault<z.ZodBoolean>;
processPackageId: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "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>>>;
spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"periodic-calendar">;
calendar: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"periodic-data">;
domain: z.ZodString;
object: z.ZodString;
dateField: z.ZodString;
offset: z.ZodString;
filter: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"registration">;
formHint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
}, z.core.$strip>;
}, z.core.$strip>;
readonly output: z.ZodObject<{
trigger: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "TriggerId", "out">;
name: z.ZodString;
enabled: z.ZodDefault<z.ZodBoolean>;
processPackageId: z.core.$ZodBranded<z.ZodString, "ProcessPackageId", "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>>>;
spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"periodic-calendar">;
calendar: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"periodic-data">;
domain: z.ZodString;
object: z.ZodString;
dateField: z.ZodString;
offset: z.ZodString;
filter: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{
kind: z.ZodLiteral<"registration">;
formHint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "kind">;
}, z.core.$strip>;
}, z.core.$strip>;
};
export declare const listActivitiesRoute: {
readonly method: "GET";
readonly path: "/api/gov/activities";