@oomol-lab/open-flow 0.1.0-alpha.0 → 0.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/browser/addNodeOptions-BwrMvPQC.js +5230 -0
  2. package/dist/browser/assets/typeScriptWorker-CaA4llbX.js +59850 -0
  3. package/dist/browser/carbon-DMCVsjHo.js +53 -0
  4. package/dist/browser/{project-change.js → change-Cu6pQIit.js} +15 -45
  5. package/dist/browser/createLucideIcon-COMgwa_u.js +5317 -0
  6. package/dist/browser/createResourceDialog-YgMLylQz.js +467 -0
  7. package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
  8. package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
  9. package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
  10. package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
  11. package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
  12. package/dist/browser/dist-C46JByB-.js +252 -0
  13. package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
  14. package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
  15. package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
  16. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  17. package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
  18. package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
  19. package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
  20. package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
  21. package/dist/browser/{esm-DXw7EADW.js → esm-CvAs_mAS.js} +14 -24
  22. package/dist/browser/field-BrEG-7ap.js +312 -0
  23. package/dist/browser/flow-authoring-edge.d.ts +3 -0
  24. package/dist/browser/flow-authoring-module.d.ts +4 -0
  25. package/dist/browser/flow-authoring-node.d.ts +84 -0
  26. package/dist/browser/flow-authoring.d.ts +4 -0
  27. package/dist/browser/flow-authoring.js +522 -0
  28. package/dist/browser/{project-change.d.ts → flow-change.d.ts} +27 -36
  29. package/dist/browser/flow-change.js +231 -0
  30. package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  31. package/dist/browser/flowRunInputEditorStore-DXOyyY7o.js +8219 -0
  32. package/dist/browser/flowWorkspace-X_T_DcQf.js +46003 -0
  33. package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
  34. package/dist/browser/licenses.md +620 -12
  35. package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-BI-2PmDX.js} +4071 -4035
  36. package/dist/browser/typeScriptSession-Dagu_tRs.js +2549 -0
  37. package/dist/browser/workbench-contract.d.ts +4 -5
  38. package/dist/browser/workbench.css +1 -1
  39. package/dist/browser/workbench.d.ts +2 -1
  40. package/dist/browser/workbench.js +3920 -2138
  41. package/dist/common/connector-action.d.ts +6 -0
  42. package/dist/common/connector-action.js +38 -30
  43. package/dist/common/control-api-conformance.js +223 -359
  44. package/dist/common/control-api-errors.d.ts +20 -24
  45. package/dist/common/control-api.d.ts +44 -73
  46. package/dist/common/control-api.js +150 -203
  47. package/dist/common/cron-trigger.d.ts +1 -1
  48. package/dist/common/cron-trigger.js +1 -1
  49. package/dist/common/flow-encoding.d.ts +11 -0
  50. package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
  51. package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  52. package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
  53. package/dist/common/{project-semantics.js → flow-semantics.js} +594 -597
  54. package/dist/common/integration-trigger.d.ts +2 -1
  55. package/dist/common/integration-trigger.js +1 -1
  56. package/dist/common/poll-trigger.d.ts +1 -1
  57. package/dist/common/provider-triggers.js +1057 -948
  58. package/dist/common/run-lifecycle.js +1 -1
  59. package/dist/common/runtime-contract.d.ts +1 -1
  60. package/dist/common/runtime-contract.js +1 -1
  61. package/dist/common/scheduler.d.ts +7 -7
  62. package/dist/common/scheduler.js +237 -232
  63. package/dist/common/webhook-trigger.d.ts +1 -1
  64. package/dist/common/webhook-trigger.js +35 -1
  65. package/package.json +20 -10
  66. package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
  67. package/dist/browser/carbon-nMY84Amv.js +0 -53
  68. package/dist/browser/composite-7VwgfnXx.js +0 -6088
  69. package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
  70. package/dist/browser/dist-n-z5HtaO.js +0 -4
  71. package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
  72. package/dist/common/project-encoding.d.ts +0 -11
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/dequal/lite/index.mjs
1
+ //#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
2
2
  var e = Object.prototype.hasOwnProperty;
3
3
  function t(n, r) {
4
4
  var i, a;
@@ -35,70 +35,22 @@ function o(e, t) {
35
35
  function s(e, t) {
36
36
  return (typeof e != "string" || e.length == 0) && r(`${t}: expected a non-empty string.`), e;
37
37
  }
38
- function c(e, t, n) {
39
- i(Object.keys(e).toSorted(), [...t].toSorted(), `${n} fields`);
40
- }
41
- function l(e, t) {
42
- let n = a(e, t);
43
- return c(n, [
44
- "connectionId",
45
- "displayName",
46
- "isDefault",
47
- "serviceId",
48
- "status"
49
- ], t), s(n.connectionId, `${t} connectionId`), s(n.displayName, `${t} displayName`), s(n.serviceId, `${t} serviceId`), typeof n.isDefault != "boolean" && r(`${t} isDefault: expected a boolean.`), [
50
- "active",
51
- "disconnected",
52
- "error",
53
- "reauth_required"
54
- ].includes(String(n.status)) || r(`${t} status: invalid status.`), n;
55
- }
56
- function u(e, t, n) {
57
- let i = a(e, n), o = Object.hasOwn(i, "description"), s = t && Object.hasOwn(i, "value");
58
- c(i, [
59
- "jsonSchema",
60
- "nullable",
61
- ...o ? ["description"] : [],
62
- ...s ? ["value"] : []
63
- ], n), typeof i.nullable != "boolean" && r(`${n} nullable: expected a boolean.`), o && typeof i.description != "string" && r(`${n} description: expected a string.`);
64
- }
65
- function d(e, t) {
66
- let n = a(e, t), o = Object.hasOwn(n, "defaultConnection"), d = Object.hasOwn(n, "icon");
67
- c(n, [
68
- "actionId",
69
- ...o ? ["defaultConnection"] : [],
70
- "description",
71
- ...d ? ["icon"] : [],
72
- "inputs",
73
- "name",
74
- "outputs",
75
- "serviceId",
76
- "serviceName"
77
- ], t), s(n.actionId, `${t} actionId`), s(n.name, `${t} name`), s(n.serviceId, `${t} serviceId`), s(n.serviceName, `${t} serviceName`), typeof n.description != "string" && r(`${t} description: expected a string.`), d && s(n.icon, `${t} icon`);
78
- for (let [e, r] of Object.entries(a(n.inputs, `${t} inputs`))) u(r, !0, `${t} input ${e}`);
79
- for (let [e, r] of Object.entries(a(n.outputs, `${t} outputs`))) u(r, !1, `${t} output ${e}`);
80
- if (o) {
81
- let e = l(n.defaultConnection, `${t} default Connection`);
82
- i(e.serviceId, n.serviceId, `${t} default Connection serviceId`), i(e.status, "active", `${t} default Connection status`);
83
- }
84
- return n;
85
- }
86
- async function f(e, t, n) {
38
+ async function c(e, t, n) {
87
39
  return i(e.status, t, `${n} status`), a(await e.json().catch(() => r(`${n} body: expected JSON.`)), `${n} body`);
88
40
  }
89
- async function p(e, t, n, r) {
90
- let o = await f(e, t, r);
41
+ async function l(e, t, n, r) {
42
+ let o = await c(e, t, r);
91
43
  i(a(o.error, `${r} error`).code, n, `${r} error code`), i(o.version, 1, `${r} version`);
92
44
  }
93
- function m(e, t, n = {}) {
45
+ function u(e, t, n = {}) {
94
46
  let r = new Headers(n.headers);
95
47
  return n.body != null && !r.has("content-type") && r.set("content-type", "application/json"), e.request(new Request(new URL(t, e.origin), {
96
48
  ...n,
97
49
  headers: r
98
50
  }));
99
51
  }
100
- function h(e, t, n) {
101
- return m(e, "/v1/projects", {
52
+ function d(e, t, n) {
53
+ return u(e, "/v1/flows", {
102
54
  body: JSON.stringify({
103
55
  name: t,
104
56
  version: 1
@@ -107,116 +59,123 @@ function h(e, t, n) {
107
59
  method: "POST"
108
60
  });
109
61
  }
110
- async function g(e, t, n) {
111
- return await f(await h(e, t, n), 201, "Create Project");
62
+ async function f(e, t, n) {
63
+ return c(await d(e, t, n), 201, "Create Flow");
112
64
  }
113
- function _(e, t, n, r) {
114
- return m(e, `/v1/projects/${encodeURIComponent(t)}/draft/changes`, {
65
+ function p(e, t, n, r) {
66
+ return u(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
115
67
  body: JSON.stringify({
116
68
  expectedRevisionId: n,
117
- operations: [{
118
- flow: {
119
- graph: { nodes: {} },
120
- name: "Main"
121
- },
122
- flowId: r,
123
- kind: "flow.create"
124
- }],
69
+ operations: r,
125
70
  version: 1
126
71
  }),
127
72
  method: "POST"
128
73
  });
129
74
  }
130
- async function v(e, t, n, r = "main") {
131
- return await f(await _(e, t, n, r), 200, "Create Flow Revision");
75
+ function m(e, t, n, r = "marker") {
76
+ return p(e, t, n, [{
77
+ kind: "graph.node.create",
78
+ node: {
79
+ concurrency: 1,
80
+ inputs: {},
81
+ kind: "value",
82
+ values: [{
83
+ handle: "ready",
84
+ jsonSchema: { type: "boolean" },
85
+ nullable: !1,
86
+ value: !0
87
+ }]
88
+ },
89
+ nodeId: r,
90
+ target: { kind: "flow" }
91
+ }]);
132
92
  }
133
- function y(e, t) {
93
+ function h(e, t) {
134
94
  return s(a(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
135
95
  }
136
- function b(e, t, n, r) {
137
- return m(e, `/v1/projects/${encodeURIComponent(t)}/draft/changes`, {
138
- body: JSON.stringify({
139
- expectedRevisionId: n,
140
- operations: r,
141
- version: 1
142
- }),
143
- method: "POST"
144
- });
145
- }
146
- function x(e, t, r, i, a, o) {
147
- return m(e, `/v1/projects/${encodeURIComponent(t)}/revisions/${encodeURIComponent(r)}/flows/${encodeURIComponent(i)}/publications`, {
96
+ function g(e, t, r, i, a) {
97
+ return u(e, `/v1/flows/${encodeURIComponent(t)}/revisions/${encodeURIComponent(r)}/publications`, {
148
98
  body: JSON.stringify({
149
99
  engineContract: n,
150
- expectedLivePublicationId: a,
100
+ expectedLivePublicationId: i,
151
101
  version: 1
152
102
  }),
153
- headers: { "idempotency-key": o },
103
+ headers: { "idempotency-key": a },
154
104
  method: "POST"
155
105
  });
156
106
  }
157
- function S(e, t, n, r, i, a) {
158
- return m(e, `/v1/projects/${encodeURIComponent(t)}/flows/${encodeURIComponent(n)}/publications/${encodeURIComponent(r)}/rollback`, {
107
+ function _(e, t, n, r, i) {
108
+ return u(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
159
109
  body: JSON.stringify({
160
- expectedLivePublicationId: i,
110
+ expectedLivePublicationId: r,
161
111
  version: 1
162
112
  }),
163
- headers: { "idempotency-key": a },
113
+ headers: { "idempotency-key": i },
164
114
  method: "POST"
165
115
  });
166
116
  }
167
- function C(e, t, n, r, i = {}) {
168
- return m(e, `/v1/projects/${encodeURIComponent(t)}/flows/${encodeURIComponent(n)}/runs`, {
117
+ function v(e, t, n) {
118
+ return u(e, "/v1/runs", {
169
119
  body: JSON.stringify({
170
- inputs: i,
120
+ inputs: {},
121
+ publicationId: t,
171
122
  version: 1
172
123
  }),
173
- headers: { "idempotency-key": r },
124
+ headers: { "idempotency-key": n },
174
125
  method: "POST"
175
126
  });
176
127
  }
177
- function w(e, t) {
178
- return s(e.publicationId, `${t} publicationId`);
179
- }
180
- var T = [
128
+ var y = [
181
129
  {
182
- name: "creates, replays, lists, reads, and retires a Project",
130
+ name: "creates, replays, lists, reads, renames, and retires a Flow",
183
131
  async verify(e) {
184
- let t = await g(e, "Control project", "project-lifecycle"), n = s(t.projectId, "Created Project projectId"), r = s(t.draftRevisionId, "Created Project draftRevisionId");
185
- i(t.name, "Control project", "Created Project name"), i(t.status, "active", "Created Project status"), i(t.version, 1, "Created Project version"), i(await f(await h(e, "Control project", "project-lifecycle"), 200, "Replay Project"), t, "Replayed Project"), await p(await h(e, "Different project", "project-lifecycle"), 409, "project.conflict", "Conflicting Project"), i(await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Project"), t, "Read Project");
186
- let a = await f(await m(e, "/v1/projects?includeTotal=true"), 200, "List Projects");
187
- i(a.projects, [t], "Listed Projects"), i(a.total, 1, "Project total");
188
- let o = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft`), 200, "Read initial Draft");
189
- i(o.revisionId, r, "Initial Draft revisionId"), i(o.projectId, n, "Initial Draft projectId");
190
- let c = () => m(e, `/v1/projects/${encodeURIComponent(n)}`, { method: "DELETE" }), l = await f(await c(), 202, "Retire Project");
191
- i(l.status, "retiring", "Retired Project status"), i(l.projectId, n, "Retired Project projectId"), i(await f(await c(), 202, "Replay Project retirement"), l, "Replayed Project retirement"), await p(await _(e, n, r, "rejected"), 409, "project.busy", "Mutation after retirement");
132
+ let t = await f(e, "Control flow", "flow-lifecycle"), n = s(t.flowId, "Created Flow flowId"), r = s(t.draftRevisionId, "Created Flow draftRevisionId");
133
+ i(t.name, "Control flow", "Created Flow name"), i(t.status, "active", "Created Flow status"), i(await c(await d(e, "Control flow", "flow-lifecycle"), 200, "Replay Flow"), t, "Replayed Flow"), await l(await d(e, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow"), i(await c(await u(e, `/v1/flows/${n}`), 200, "Read Flow"), t, "Read Flow");
134
+ let a = await c(await u(e, "/v1/flows?includeTotal=true"), 200, "List Flows");
135
+ i(a.flows, [t], "Listed Flows"), i(a.total, 1, "Flow total");
136
+ let o = await f(e, "Second control flow", "flow-lifecycle-second"), p = await c(await u(e, "/v1/flows?limit=1"), 200, "List first Flow page");
137
+ i(p.flows, [t], "First Flow page");
138
+ let h = s(p.nextCursor, "Flow cursor");
139
+ i((await c(await u(e, `/v1/flows?limit=1&cursor=${encodeURIComponent(h)}`), 200, "List second Flow page")).flows, [o], "Second Flow page"), i((await c(await u(e, `/v1/flows/${n}`, {
140
+ body: JSON.stringify({
141
+ name: "Renamed flow",
142
+ version: 1
143
+ }),
144
+ method: "PATCH"
145
+ }), 200, "Rename Flow")).name, "Renamed flow", "Renamed Flow name"), i((await c(await u(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow")).status, "retiring", "Retired Flow status"), await l(await m(e, n, r), 409, "flow.busy", "Mutation after retirement");
192
146
  }
193
147
  },
194
148
  {
195
- name: "commits immutable Draft Revisions and projects the current Flows",
149
+ name: "commits immutable Draft Revisions for one Flow",
196
150
  async verify(e) {
197
- let t = await g(e, "Draft project", "draft-project"), n = s(t.projectId, "Draft Project projectId"), c = s(t.draftRevisionId, "Draft Project revisionId"), l = await v(e, n, c), u = y(l, "Changed Draft");
198
- u == c && r("Changed Draft must advance the Revision identity."), i(a(l.revision, "Changed Draft revision").parentRevisionId, c, "Changed Draft parentRevisionId"), await p(await _(e, n, c, "stale"), 412, "project.revision-conflict", "Stale Draft change"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read changed Project")).draftRevisionId, u, "Current Project Draft head"), i(a(a((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/revisions/${encodeURIComponent(c)}`), 200, "Read immutable Revision")).content, "Old Revision content").document, "Old Revision document").flows, {}, "Old Revision Flows");
199
- let d = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft`), 200, "Read current Draft");
200
- i(d.revisionId, u, "Current Draft revisionId");
201
- let h = a(a(d.content, "Current Draft content").document, "Current Draft document").flows;
202
- i(Object.keys(a(h, "Current Draft Flows")), ["main"], "Current Draft Flow ids");
203
- let b = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft/sync`), 200, "Sync Draft snapshot");
204
- i(b.kind, "snapshot", "Draft snapshot kind"), i(a(b.draft, "Draft snapshot").revisionId, u, "Draft snapshot revisionId");
205
- let x = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft/sync?fromRevisionId=${encodeURIComponent(c)}`), 200, "Sync Draft from parent");
206
- x.kind == "snapshot" ? i(a(x.draft, "Draft sync snapshot").revisionId, u, "Draft sync snapshot revisionId") : x.kind == "changes" ? i(a(a(o(x.revisions, "Draft sync revisions").at(-1), "Last Draft sync revision").revision, "Last Draft sync revision metadata").revisionId, u, "Last Draft sync revisionId") : r(`Draft sync kind: expected changes or snapshot, received ${JSON.stringify(x.kind)}.`);
207
- let S = o((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/flows`), 200, "List Draft Flows")).flows, "Projected Flows"), C = a(S[0], "Projected Flow");
208
- i(S.length, 1, "Projected Flow count"), i(C.flowId, "main", "Projected Flow id"), i(a(C.draft, "Projected Flow Draft").revisionId, u, "Projected Flow Revision");
151
+ let t = await f(e, "Draft flow", "draft-flow"), n = s(t.flowId, "Draft Flow flowId"), r = s(t.draftRevisionId, "Draft Flow revisionId"), o = await c(await m(e, n, r), 200, "Change Draft"), d = h(o, "Changed Draft");
152
+ i(a(o.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), await l(await p(e, n, d, [{
153
+ kind: "graph.node.replace",
154
+ node: {
155
+ concurrency: 1,
156
+ inputs: {},
157
+ kind: "value",
158
+ values: [{
159
+ handle: "ready",
160
+ jsonSchema: { type: "boolean" },
161
+ nullable: !1,
162
+ value: !0
163
+ }]
164
+ },
165
+ nodeId: "marker",
166
+ target: { kind: "flow" }
167
+ }]), 400, "flow.invalid", "No-op Draft change"), await l(await m(e, n, r, "stale"), 412, "flow.revision-conflict", "Stale Draft change"), i(a(a(a(a((await c(await u(e, `/v1/flows/${n}/revisions/${r}`), 200, "Read old Revision")).content, "Old content").document, "Old document").graph, "Old graph").nodes, "Old nodes"), {}, "Old Revision nodes"), i((await c(await u(e, `/v1/flows/${n}/draft`), 200, "Read Draft")).revisionId, d, "Draft revisionId");
168
+ let g = await c(await u(e, `/v1/flows/${n}/draft/sync?fromRevisionId=${r}`), 200, "Sync Draft");
169
+ i(g.kind, "snapshot", "Draft sync kind"), i(a(g.draft, "Draft snapshot").revisionId, d, "Draft snapshot revisionId");
209
170
  }
210
171
  },
211
172
  {
212
173
  name: "keeps Presentation CAS independent from the Draft head",
213
174
  async verify(e) {
214
- let t = await g(e, "Presentation project", "presentation-project"), n = s(t.projectId, "Presentation Project projectId"), r = s(t.draftRevisionId, "Presentation Project Draft head"), a = `/v1/projects/${encodeURIComponent(n)}/presentation`;
215
- i((await f(await m(e, a), 200, "Read initial Presentation")).revision, 1, "Initial Presentation revision");
216
- let o = { nodes: { task: {
175
+ let t = await f(e, "Presentation flow", "presentation-flow"), n = s(t.flowId, "Presentation Flow flowId"), r = s(t.draftRevisionId, "Presentation Flow revisionId"), a = `/v1/flows/${n}/presentation`, o = { nodes: { task: {
217
176
  x: 120,
218
177
  y: 80
219
- } } }, c = await f(await m(e, a, {
178
+ } } }, d = await c(await u(e, a, {
220
179
  body: JSON.stringify({
221
180
  expectedRevision: 1,
222
181
  value: o,
@@ -224,295 +183,200 @@ var T = [
224
183
  }),
225
184
  method: "PUT"
226
185
  }), 200, "Update Presentation");
227
- i(c.revision, 2, "Updated Presentation revision"), i(c.value, o, "Updated Presentation value"), i(await f(await m(e, a), 200, "Read updated Presentation"), c, "Persisted Presentation"), await p(await m(e, a, {
186
+ i(d.revision, 2, "Presentation revision"), i(d.value, o, "Presentation value"), await l(await u(e, a, {
228
187
  body: JSON.stringify({
229
188
  expectedRevision: 1,
230
189
  value: {},
231
190
  version: 1
232
191
  }),
233
192
  method: "PUT"
234
- }), 412, "project.presentation-conflict", "Stale Presentation update"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Presentation Project")).draftRevisionId, r, "Draft head after Presentation update");
193
+ }), 412, "flow.presentation-conflict", "Stale Presentation update"), i((await c(await u(e, a), 200, "Read Presentation")).value, o, "Presentation value after conflict"), await c(await u(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Presentation Flow"), await l(await u(e, a, {
194
+ body: JSON.stringify({
195
+ expectedRevision: 2,
196
+ value: {},
197
+ version: 1
198
+ }),
199
+ method: "PUT"
200
+ }), 409, "flow.busy", "Update retired Presentation"), i((await c(await u(e, `/v1/flows/${n}`), 200, "Read Flow")).draftRevisionId, r, "Draft head");
235
201
  }
236
202
  },
237
203
  {
238
- name: "validates one Flow from a fixed ProjectRevision",
204
+ name: "validates, admits, lists, and cancels one Draft Run",
239
205
  async verify(e) {
240
- let t = await g(e, "Validation project", "validation-project"), r = s(t.projectId, "Validation Project projectId"), o = await v(e, r, s(t.draftRevisionId, "Validation Project Draft head")), c = y(o, "Validation Revision"), l = a(o.revision, "Validation Revision"), u = `/v1/projects/${encodeURIComponent(r)}/revisions/${encodeURIComponent(c)}/flows`, d = await f(await m(e, `${u}/main/check`, {
206
+ let t = await f(e, "Run flow", "run-flow"), r = s(t.flowId, "Run Flow flowId"), d = s(t.draftRevisionId, "Run Flow revisionId");
207
+ i((await c(await u(e, `/v1/flows/${r}/revisions/${d}/check`, {
241
208
  body: JSON.stringify({
242
209
  engineContract: n,
243
210
  version: 1
244
211
  }),
245
212
  method: "POST"
246
- }), 200, "Check Flow");
247
- i(d.projectId, r, "Flow check projectId"), i(d.revisionId, c, "Flow check revisionId"), i(d.revisionDigest, l.digest, "Flow check revision digest"), i(d.flowId, "main", "Flow check flowId"), i(d.engineContract, n, "Flow check Engine Contract"), i(d.modelVersion, 1, "Flow check model version"), i(d.valid, !0, "Flow check validity"), s(d.closureDigest, "Flow check closure digest"), await p(await m(e, `${u}/missing/check`, {
213
+ }), 200, "Check Flow")).valid, !0, "Flow validity");
214
+ let p = `/v1/flows/${r}/revisions/${d}/runs`, m = () => u(e, p, {
248
215
  body: JSON.stringify({
249
216
  engineContract: n,
217
+ inputs: {},
250
218
  version: 1
251
219
  }),
220
+ headers: { "idempotency-key": "draft-run" },
252
221
  method: "POST"
253
- }), 404, "flow.not-found", "Missing Flow check");
254
- }
255
- },
256
- {
257
- name: "admits, observes, and cancels one fixed Draft Run",
258
- async verify(e) {
259
- let t = await g(e, "Run project", "run-project"), r = s(t.projectId, "Run Project projectId"), c = y(await v(e, r, s(t.draftRevisionId, "Run Project Draft head")), "Run Revision"), l = `/v1/projects/${encodeURIComponent(r)}/revisions/${encodeURIComponent(c)}/flows/main/runs`, u = () => m(e, l, {
222
+ }), h = await c(await m(), 202, "Create Draft Run"), g = s(h.runId, "Draft Run runId");
223
+ i(await c(await m(), 200, "Replay Draft Run"), h, "Replayed Draft Run"), await l(await u(e, `/v1/runs/${g}/result`), 409, "run.not-terminal", "Read queued Run result");
224
+ let _ = await c(await u(e, p, {
260
225
  body: JSON.stringify({
261
226
  engineContract: n,
262
227
  inputs: {},
263
228
  version: 1
264
229
  }),
265
- headers: { "idempotency-key": "draft-run" },
230
+ headers: { "idempotency-key": "draft-run-second" },
266
231
  method: "POST"
267
- }), d = await f(await u(), 202, "Create Draft Run"), h = s(d.runId, "Draft Run runId");
268
- i(d.projectId, r, "Draft Run projectId"), i(d.revisionId, c, "Draft Run revisionId"), i(d.flowId, "main", "Draft Run flowId"), i(d.source, "draft", "Draft Run source"), i(d.status, "queued", "Draft Run status"), i(await f(await u(), 200, "Replay Draft Run"), d, "Replayed Draft Run");
269
- let _ = `/v1/projects/${encodeURIComponent(r)}/runs/${encodeURIComponent(h)}`;
270
- i(await f(await m(e, _), 200, "Read Draft Run"), d, "Read Draft Run");
271
- let b = await f(await m(e, `/v1/projects/${encodeURIComponent(r)}/runs`), 200, "List Draft Runs");
272
- i(b.projectId, r, "Run list projectId"), i(o(b.runs, "Listed Runs").map((e) => a(e, "Listed Run").runId), [h], "Listed Run ids");
273
- let x = await f(await m(e, `${_}/events`), 200, "Read queued Run events"), [S] = o(x.events, "Queued Run events");
274
- i(a(S, "Queued Run event").kind, "run.queued", "Queued Run event kind"), i(x.done, !1, "Queued Run events done"), await p(await m(e, `${_}/result`), 409, "run.not-terminal", "Read pending Run result");
275
- let C = await g(e, "Other project", "other-run-project");
276
- await p(await m(e, `/v1/projects/${encodeURIComponent(s(C.projectId, "Other Project projectId"))}/runs/${encodeURIComponent(h)}`), 404, "run.not-found", "Read Run through another Project");
277
- let w = () => m(e, `${_}/cancel`, {
232
+ }), 202, "Create second Draft Run"), v = await c(await u(e, `/v1/flows/${r}/runs?limit=1`), 200, "List Runs");
233
+ i(o(v.runs, "Runs").map((e) => a(e, "Run").runId), [g], "Listed Runs"), s(v.nextCursor, "Run cursor"), i((await c(await u(e, `/v1/runs/${g}/cancel`, {
278
234
  body: JSON.stringify({ version: 1 }),
279
235
  method: "POST"
280
- });
281
- i(await f(await w(), 200, "Cancel Draft Run"), {
282
- cancelAccepted: !0,
283
- runId: h,
284
- status: "canceled",
285
- version: 1
286
- }, "Canceled Draft Run");
287
- let T = await f(await m(e, `${_}/result`), 200, "Read canceled Run result");
288
- i(T.runId, h, "Canceled Run result runId"), i(T.status, "canceled", "Canceled Run result status"), s(T.finishedAt, "Canceled Run result finishedAt");
289
- let E = await f(await m(e, `${_}/events?after=1`), 200, "Read terminal Run events"), [D] = o(E.events, "Terminal Run events");
290
- i(a(D, "Terminal Run event").kind, "run.canceled", "Terminal Run event kind"), i(E.done, !0, "Terminal Run events done"), i(await f(await w(), 200, "Replay Run cancellation"), {
291
- cancelAccepted: !1,
292
- runId: h,
293
- status: "canceled",
294
- version: 1
295
- }, "Replayed cancellation");
296
- }
297
- }
298
- ], E = [
299
- {
300
- name: "publishes one immutable Flow with idempotent Live CAS",
301
- async verify(e) {
302
- let t = await g(e, "Publication project", "publication-project"), r = s(t.projectId, "Publication Project projectId"), c = a((await v(e, r, s(t.draftRevisionId, "Publication Project Draft head"))).revision, "Publication Revision"), l = s(c.revisionId, "Publication Revision revisionId"), u = `/v1/projects/${encodeURIComponent(r)}/flows/main`, d = await f(await m(e, `${u}/live`), 200, "Read unpublished Live");
303
- i(d.projectId, r, "Unpublished Live projectId"), i(d.flowId, "main", "Unpublished Live flowId"), i(d.publication, null, "Unpublished Live Publication"), i(d.revision, 0, "Unpublished Live revision"), i(d.status, "not-published", "Unpublished Live status"), i(d.hasUnpublishedChanges, !0, "Unpublished Live Draft state"), await p(await C(e, r, "main", "missing-live-run"), 404, "live.not-found", "Run unpublished Live");
304
- let h = () => x(e, r, l, "main", null, "publication-first"), _ = await f(await h(), 201, "Publish Flow"), y = w(_, "Published Flow");
305
- i(_.projectId, r, "Publication projectId"), i(_.flowId, "main", "Publication flowId"), i(_.revisionId, l, "Publication revisionId"), i(_.revisionDigest, c.digest, "Publication revision digest"), i(_.engineContract, n, "Publication Engine Contract"), i(_.modelVersion, 1, "Publication model version"), i(_.operation, "publish", "Publication operation"), i(_.sourcePublicationId, void 0, "Publication source"), i(_.version, 1, "Publication version"), s(_.actorId, "Publication actorId"), s(_.closureDigest, "Publication closure digest"), s(_.createdAt, "Publication createdAt"), i(await f(await h(), 200, "Replay Publish"), _, "Replayed Publication"), await p(await x(e, r, l, "main", y, "publication-first"), 409, "publication.conflict", "Conflicting Publish replay"), await p(await x(e, r, l, "main", null, "publication-stale-live"), 412, "live.conflict", "Stale Publish Live precondition");
306
- let b = await f(await m(e, `${u}/live`), 200, "Read published Live");
307
- i(b.publication, _, "Live Publication"), i(b.revision, 1, "Published Live revision"), i(b.status, "runnable", "Published Live status"), i(b.hasUnpublishedChanges, !1, "Published Live Draft state");
308
- let [S] = o((await f(await m(e, `/v1/projects/${encodeURIComponent(r)}/flows`), 200, "List published Flows")).flows, "Published Flow projection"), T = a(S, "Published Flow");
309
- i(a(a(T.live, "Published Flow Live").publication, "Published Flow Publication"), _, "Projected Publication"), i(a(T.live, "Published Flow Live").revision, 1, "Projected Live revision"), i(T.hasUnpublishedChanges, !1, "Projected unpublished state");
310
- let E = await f(await m(e, `${u}/publications?includeTotal=true`), 200, "List Publication history");
311
- i(E.publications, [_], "Publication history"), i(E.total, 1, "Publication history total");
236
+ }), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), i((await c(await u(e, `/v1/runs/${g}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), i((await c(await u(e, `/v1/runs/${g}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), i((await c(await u(e, `/v1/runs/${s(_.runId, "Second Draft Run")}/cancel`, {
237
+ body: JSON.stringify({ version: 1 }),
238
+ method: "POST"
239
+ }), 200, "Cancel second Draft Run")).status, "canceled", "Second canceled Run status");
312
240
  }
313
241
  },
314
242
  {
315
- name: "rolls back immutable history and fixes a Live Run target",
243
+ name: "rejects invalid and missing Flow control targets",
316
244
  async verify(e) {
317
- let t = await g(e, "Rollback project", "rollback-project"), n = s(t.projectId, "Rollback Project projectId"), a = y(await v(e, n, s(t.draftRevisionId, "Rollback Project Draft head")), "First Rollback Revision"), o = await f(await x(e, n, a, "main", null, "rollback-publish-first"), 201, "Publish first Rollback Revision"), c = w(o, "First Rollback Publication"), l = y(await f(await b(e, n, a, [{
318
- kind: "graph.node.create",
319
- node: {
320
- concurrency: 1,
245
+ let t = "00000000-0000-7000-8000-000000000001", r = "00000000-0000-7000-8000-000000000002", i = "00000000-0000-7000-8000-000000000003";
246
+ await l(await u(e, `/v1/flows/${t}`), 404, "flow.not-found", "Read missing Flow"), await l(await u(e, `/v1/flows/${t}`, {
247
+ body: JSON.stringify({
248
+ name: "Missing",
249
+ version: 1
250
+ }),
251
+ method: "PATCH"
252
+ }), 404, "flow.not-found", "Rename missing Flow"), await l(await u(e, `/v1/flows/${t}`, { method: "DELETE" }), 404, "flow.not-found", "Retire missing Flow"), await l(await u(e, `/v1/flows/${t}/draft`), 404, "flow.not-found", "Read missing Draft"), await l(await u(e, `/v1/flows/${t}/revisions/${r}`), 404, "flow.not-found", "Read missing Revision"), await l(await u(e, `/v1/flows/${t}/presentation`), 404, "flow.not-found", "Read missing Presentation"), await l(await u(e, `/v1/flows/${t}/presentation`, {
253
+ body: JSON.stringify({
254
+ expectedRevision: 1,
255
+ value: {},
256
+ version: 1
257
+ }),
258
+ method: "PUT"
259
+ }), 404, "flow.not-found", "Update missing Presentation"), await l(await u(e, `/v1/flows/${t}/runs`), 404, "flow.not-found", "List missing Flow Runs"), await l(await u(e, `/v1/runs/${i}`), 404, "run.not-found", "Read missing Run"), await l(await u(e, `/v1/runs/${i}/events`), 404, "run.not-found", "Read missing Run events"), await l(await u(e, `/v1/runs/${i}/result`), 404, "run.not-found", "Read missing Run result"), await l(await u(e, `/v1/runs/${i}/cancel`, {
260
+ body: JSON.stringify({ version: 1 }),
261
+ method: "POST"
262
+ }), 404, "run.not-found", "Cancel missing Run");
263
+ let a = await f(e, "Invalid targets", "invalid-targets"), o = s(a.flowId, "Invalid targets Flow"), c = s(a.draftRevisionId, "Invalid targets Revision"), d = (t, n) => u(e, `/v1/flows/${o}/revisions/${t}/check`, {
264
+ body: JSON.stringify({
265
+ engineContract: n,
266
+ version: 1
267
+ }),
268
+ method: "POST"
269
+ });
270
+ await l(await d(c, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine"), await l(await d(r, n), 404, "flow.not-found", "Check missing Revision");
271
+ let p = (t, n, r) => u(e, `/v1/flows/${o}/revisions/${t}/runs`, {
272
+ body: JSON.stringify({
273
+ engineContract: n,
321
274
  inputs: {},
322
- kind: "value",
323
- values: { ready: {
324
- jsonSchema: { type: "boolean" },
325
- nullable: !1,
326
- value: !0
327
- } }
328
- },
329
- nodeId: "marker",
330
- target: {
331
- id: "main",
332
- kind: "flow"
333
- }
334
- }]), 200, "Create second Rollback Revision"), "Second Rollback Revision"), u = await f(await x(e, n, l, "main", c, "rollback-publish-second"), 201, "Publish second Rollback Revision"), d = w(u, "Second Rollback Publication"), h = () => S(e, n, "main", c, d, "rollback-first"), _ = await f(await h(), 201, "Rollback Flow"), T = w(_, "Rollback Publication");
335
- (T == c || T == d) && r("Rollback must create a new Publication identity."), i(_.operation, "rollback", "Rollback operation"), i(_.sourcePublicationId, c, "Rollback source Publication"), i(_.revisionId, o.revisionId, "Rollback fixed Revision"), i(_.revisionDigest, o.revisionDigest, "Rollback fixed Revision digest"), i(_.closureDigest, o.closureDigest, "Rollback fixed closure digest"), i(_.engineContract, o.engineContract, "Rollback fixed Engine Contract"), i(await f(await h(), 200, "Replay Rollback"), _, "Replayed Rollback"), await p(await S(e, n, "main", c, T, "rollback-first"), 409, "publication.conflict", "Conflicting Rollback replay");
336
- let E = `/v1/projects/${encodeURIComponent(n)}/flows/main`, D = await f(await m(e, `${E}/live`), 200, "Read rolled back Live");
337
- i(D.publication, _, "Rolled back Live Publication"), i(D.revision, 3, "Rolled back Live revision"), i(D.hasUnpublishedChanges, !0, "Rolled back Live Draft state"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Rollback Project")).draftRevisionId, l, "Draft head after Rollback");
338
- let O = await f(await m(e, `${E}/publications?includeTotal=true&limit=2`), 200, "List first Publication page");
339
- i(O.publications, [_, u], "First Publication page"), i(O.total, 3, "Publication page total");
340
- let k = s(O.nextCursor, "Publication next cursor"), A = await f(await m(e, `${E}/publications?cursor=${encodeURIComponent(k)}&limit=2`), 200, "List second Publication page");
341
- i(A.publications, [o], "Second Publication page"), i(A.nextCursor, void 0, "Final Publication cursor");
342
- let j = () => C(e, n, "main", "rollback-live-run"), M = await f(await j(), 202, "Create rolled back Live Run"), N = s(M.runId, "Rolled back Live Run runId");
343
- i(M.projectId, n, "Live Run projectId"), i(M.flowId, "main", "Live Run flowId"), i(M.publicationId, T, "Live Run Publication"), i(M.revisionId, a, "Live Run fixed Revision"), i(M.source, "live", "Live Run source"), i(M.status, "queued", "Live Run status"), i(await f(await j(), 200, "Replay Live Run"), M, "Replayed Live Run"), await p(await C(e, n, "main", "rollback-live-run", { changed: {} }), 409, "run.conflict", "Conflicting Live Run replay"), await f(await x(e, n, l, "main", T, "rollback-publish-current"), 201, "Move Live after Run admission"), i(await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/runs/${encodeURIComponent(N)}`), 200, "Read fixed Live Run"), M, "Live Run after Live moved");
344
- }
345
- },
346
- {
347
- name: "retires Live when its Flow or Project is retired",
348
- async verify(e) {
349
- let t = await g(e, "Deleted Flow project", "deleted-flow-project"), n = s(t.projectId, "Deleted Flow Project projectId"), r = y(await v(e, n, s(t.draftRevisionId, "Deleted Flow Project Draft head")), "Deleted Flow Revision"), a = await f(await x(e, n, r, "main", null, "deleted-flow-publish"), 201, "Publish deleted Flow");
350
- await f(await b(e, n, r, [{
351
- flowId: "main",
352
- kind: "flow.delete"
353
- }]), 200, "Delete published Flow");
354
- let o = `/v1/projects/${encodeURIComponent(n)}/flows/main`, c = await f(await m(e, `${o}/live`), 200, "Read deleted Flow Live");
355
- i(c.publication, null, "Deleted Flow Live Publication"), i(c.revision, 0, "Deleted Flow Live revision"), i(c.status, "not-published", "Deleted Flow Live status"), i(c.hasUnpublishedChanges, !1, "Deleted Flow unpublished state"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/flows`), 200, "List deleted Flows")).flows, [], "Deleted Flow projection");
356
- let l = await f(await m(e, `${o}/publications?includeTotal=true`), 200, "List deleted Flow history");
357
- i(l.publications, [a], "Deleted Flow Publication history"), i(l.total, 1, "Deleted Flow Publication total"), await p(await C(e, n, "main", "deleted-flow-run"), 404, "live.not-found", "Run deleted Flow Live");
358
- let u = await g(e, "Retired Live project", "retired-live-project"), d = s(u.projectId, "Retired Live Project projectId"), h = y(await v(e, d, s(u.draftRevisionId, "Retired Live Project Draft head")), "Retired Live Revision"), _ = await f(await x(e, d, h, "main", null, "retired-live-publish"), 201, "Publish retiring Project Flow"), T = w(_, "Retired Live Publication");
359
- await f(await m(e, `/v1/projects/${encodeURIComponent(d)}`, { method: "DELETE" }), 202, "Retire Live Project");
360
- let E = `/v1/projects/${encodeURIComponent(d)}/flows/main`, D = await f(await m(e, `${E}/live`), 200, "Read retired Project Live");
361
- i(D.publication, null, "Retired Project Live Publication"), i(D.revision, 0, "Retired Project Live revision"), i(D.status, "not-published", "Retired Project Live status");
362
- let O = await f(await m(e, `${E}/publications?includeTotal=true`), 200, "List retired Publication history");
363
- i(O.publications, [_], "Retired Publication history"), i(O.total, 1, "Retired Publication total"), await p(await C(e, d, "main", "retired-live-run"), 409, "project.busy", "Run retired Live"), await p(await x(e, d, h, "main", null, "retired-live-republish"), 409, "project.busy", "Publish retired Project"), await p(await S(e, d, "main", T, T, "retired-live-rollback"), 409, "project.busy", "Rollback retired Project");
275
+ version: 1
276
+ }),
277
+ headers: { "idempotency-key": r },
278
+ method: "POST"
279
+ });
280
+ await l(await p(c, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine"), await l(await p(r, n, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
364
281
  }
365
282
  }
366
- ], D = [{
283
+ ], b = [{
284
+ name: "publishes one immutable Flow with idempotent Live CAS",
285
+ async verify(e) {
286
+ let t = await f(e, "Publication flow", "publication-flow"), n = s(t.flowId, "Publication Flow flowId"), r = s(t.draftRevisionId, "Publication Flow revisionId");
287
+ i((await c(await u(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
288
+ let a = () => g(e, n, r, null, "publication-first"), o = await c(await a(), 201, "Publish Flow"), d = s(o.publicationId, "Publication id");
289
+ i(await c(await a(), 200, "Replay Publish"), o, "Replayed Publication"), await l(await g(e, n, r, d, "publication-first"), 409, "publication.conflict", "Conflicting replay"), i((await c(await u(e, `/v1/flows/${n}/live`), 200, "Read published Live")).publication, o, "Live Publication");
290
+ let p = await c(await u(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
291
+ i(p.publications, [o], "Publication history"), i(p.total, 1, "Publication total"), await l(await u(e, `/v1/flows/${n}/revisions/${r}/publications`, {
292
+ body: JSON.stringify({
293
+ engineContract: "unsupported-engine/v1",
294
+ expectedLivePublicationId: d,
295
+ version: 1
296
+ }),
297
+ headers: { "idempotency-key": "unsupported-publication" },
298
+ method: "POST"
299
+ }), 409, "engine.unsupported", "Publish unsupported Engine"), await l(await g(e, n, "00000000-0000-7000-8000-000000000002", d, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await l(await _(e, n, "00000000-0000-7000-8000-000000000004", d, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await l(await v(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
300
+ }
301
+ }, {
302
+ name: "rolls back immutable history and fixes a Live Run target",
303
+ async verify(e) {
304
+ let t = await f(e, "Rollback flow", "rollback-flow"), n = s(t.flowId, "Rollback Flow flowId"), r = s(t.draftRevisionId, "Rollback Flow revisionId"), a = s((await c(await g(e, n, r, null, "publish-first"), 201, "Publish first Revision")).publicationId, "First Publication"), o = s((await c(await g(e, n, h(await c(await m(e, n, r), 200, "Change Draft"), "Second Revision"), a, "publish-second"), 201, "Publish second Revision")).publicationId, "Second Publication");
305
+ await l(await v(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
306
+ let d = () => _(e, n, a, o, "rollback-first"), p = await c(await d(), 201, "Rollback Flow"), y = s(p.publicationId, "Rollback Publication");
307
+ i(p.operation, "rollback", "Rollback operation"), i(p.sourcePublicationId, a, "Rollback source"), i(await c(await d(), 200, "Replay Rollback"), p, "Replayed Rollback");
308
+ let b = await c(await v(e, y, "rollback-run"), 202, "Create Live Run");
309
+ i(b.flowId, n, "Live Run flowId"), i(b.revisionId, r, "Live Run revisionId"), await c(await u(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await l(await v(e, y, "retired-run"), 409, "flow.busy", "Run retired Flow");
310
+ }
311
+ }], x = [{
367
312
  name: "exposes one deployment-scoped Trigger Key catalog",
368
313
  async verify(e) {
369
- let t = await f(await m(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await f(await m(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), c = o(t.keys, "Trigger Key summaries").map((e) => a(e, "Trigger Key summary")), l = o(n.definitions, "Trigger definitions").map((e) => a(e, "Trigger definition"));
370
- i(t.version, 1, "Trigger Key summaries version"), i(n.version, 1, "Trigger definitions version"), i(c.map((e) => s(e.key, "Trigger Key summary key")), l.map((e) => s(e.key, "Trigger definition key")), "Trigger catalog identities");
371
- for (let [t, n] of c.entries()) {
372
- let a = l[t], o = n.type;
373
- o != "integration" && o != "poll" && r(`Trigger Key summary type: expected integration or poll, received ${JSON.stringify(o)}.`), i(a.type, o, "Trigger definition type"), typeof n.description != "string" && r(`Trigger Key summary description: expected string, received ${JSON.stringify(n.description)}.`), s(n.displayName, "Trigger Key summary displayName"), s(n.name, "Trigger Key summary name"), s(n.provider, "Trigger Key summary provider");
374
- let c = s(n.key, "Trigger Key summary key"), u = await f(await m(e, `/v1/trigger-keys/${encodeURIComponent(c)}`), 200, "Read Trigger Key");
375
- i(u.definition, a, "Trigger Key detail"), i(u.version, 1, "Trigger Key detail version");
314
+ let t = await c(await u(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await c(await u(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), r = o(t.keys, "Trigger Keys").map((e) => a(e, "Trigger Key")), d = o(n.definitions, "Trigger definitions").map((e) => a(e, "Trigger definition"));
315
+ i(r.map((e) => e.key), d.map((e) => e.key), "Trigger catalog identities");
316
+ for (let [t, n] of r.entries()) {
317
+ let r = s(n.key, "Trigger Key");
318
+ i((await c(await u(e, `/v1/trigger-keys/${encodeURIComponent(r)}`), 200, "Read Trigger Key")).definition, d[t], "Trigger detail");
376
319
  }
377
- await p(await m(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Read missing Trigger Key");
320
+ await l(await u(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Missing Trigger Key");
378
321
  }
379
322
  }, {
380
- name: "operates and retires one Live Trigger binding without creating another execution history",
323
+ name: "operates and retires one Live Trigger binding",
381
324
  async verify(e) {
382
- let t = await g(e, "Trigger project", "trigger-project"), n = s(t.projectId, "Trigger Project projectId"), r = y(await f(await b(e, n, s(t.draftRevisionId, "Trigger Project Draft head"), [{
383
- flow: {
384
- graph: { nodes: {
385
- cron: {
386
- cronTimes: [{
387
- type: "every",
388
- unit: "hour",
389
- value: 1
390
- }],
391
- kind: "cron",
392
- name: "Scheduled"
393
- },
394
- webhook: {
395
- inputsDef: [],
396
- kind: "webhook",
397
- name: "Incoming"
398
- }
399
- } },
400
- name: "Triggered"
325
+ let t = await f(e, "Trigger flow", "trigger-flow"), n = s(t.flowId, "Trigger Flow flowId"), r = h(await c(await p(e, n, s(t.draftRevisionId, "Trigger Flow revisionId"), [{
326
+ kind: "graph.node.create",
327
+ node: {
328
+ cronTimes: [{
329
+ type: "every",
330
+ unit: "hour",
331
+ value: 1
332
+ }],
333
+ kind: "cron",
334
+ name: "Scheduled"
401
335
  },
402
- flowId: "main",
403
- kind: "flow.create"
404
- }]), 200, "Create Trigger Flow"), "Trigger Revision"), c = w(await f(await x(e, n, r, "main", null, "trigger-publication-1"), 201, "Publish Trigger Flow"), "First Trigger Publication"), l = `/v1/projects/${encodeURIComponent(n)}/flows/main/triggers`, u = await f(await m(e, l), 200, "List Trigger bindings");
405
- i(u.projectId, n, "Trigger binding list projectId"), i(u.flowId, "main", "Trigger binding list flowId"), i(u.version, 1, "Trigger binding list version");
406
- let d = o(u.bindings, "Trigger bindings").map((e) => a(e, "Trigger binding"));
407
- i(d.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
408
- for (let e of d) i(e.currentPublicationId, c, "Trigger binding current Publication"), i(e.currentRevisionId, r, "Trigger binding current Revision"), i(e.operatorState, "active", "Trigger binding operator state"), i(e.health, "healthy", "Trigger binding health"), i(e.runtimeVersion, 1, "Initial Trigger runtime version"), i(e.endpointUrl, void 0, "Trigger list endpoint URL"), i(e.version, 1, "Trigger binding version"), s(e.updatedAt, "Trigger binding updatedAt");
409
- let h = `${l}/webhook`, _ = await f(await m(e, h), 200, "Read Webhook binding"), v = a(_.binding, "Webhook binding detail"), S = s(v.endpointUrl, "Webhook endpoint URL");
410
- i(v.kind, "webhook", "Webhook binding kind"), i(_.version, 1, "Webhook binding detail version"), i(a((await f(await m(e, `${l}/cron`), 200, "Read Cron binding")).binding, "Cron binding detail").endpointUrl, void 0, "Cron endpoint URL");
411
- let C = (t) => m(e, `${h}/${t}`, {
412
- body: JSON.stringify({ version: 1 }),
413
- method: "POST"
414
- }), T = await f(await C("pause"), 200, "Pause Webhook binding");
415
- i(T.operatorState, "paused", "Paused Webhook operator state"), i(T.runtimeVersion, 2, "Paused Webhook runtime version"), i(await f(await C("pause"), 200, "Replay Webhook pause"), T, "Replayed Webhook pause"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Paused Webhook callback status");
416
- let E = w(await f(await x(e, n, r, "main", c, "trigger-publication-2"), 201, "Republish paused Trigger Flow"), "Second Trigger Publication"), D = a((await f(await m(e, h), 200, "Read paused republished binding")).binding, "Paused binding");
417
- i(D.currentPublicationId, E, "Paused binding current Publication"), i(D.operatorState, "paused", "Paused binding state after Publish"), i(D.runtimeVersion, 3, "Paused binding runtime after Publish"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Republished paused Webhook callback status");
418
- let O = await f(await C("resume"), 200, "Resume Webhook binding");
419
- i(O.operatorState, "active", "Resumed Webhook operator state"), i(O.runtimeVersion, 4, "Resumed Webhook runtime version"), i((await e.request(new Request(S, { method: "POST" }))).status, 200, "Resumed Webhook callback status"), await p(await m(e, `${h}/test`, {
336
+ nodeId: "cron",
337
+ target: { kind: "flow" }
338
+ }, {
339
+ kind: "graph.node.create",
340
+ node: {
341
+ inputsDef: [],
342
+ kind: "webhook",
343
+ name: "Incoming"
344
+ },
345
+ nodeId: "webhook",
346
+ target: { kind: "flow" }
347
+ }]), 200, "Create Trigger nodes"), "Trigger Revision"), l = s((await c(await g(e, n, r, null, "trigger-publication"), 201, "Publish Trigger Flow")).publicationId, "Trigger Publication"), d = `/v1/flows/${n}/triggers`, m = o((await c(await u(e, d), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => a(e, "Trigger binding"));
348
+ i(m.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
349
+ for (let e of m) i(e.currentPublicationId, l, "Trigger Publication");
350
+ let _ = `${d}/webhook`, v = s(a((await c(await u(e, _), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), y = (t) => u(e, `${_}/${t}`, {
420
351
  body: JSON.stringify({ version: 1 }),
421
352
  method: "POST"
422
- }), 404, "trigger.not-found", "Test non-Poll binding");
423
- let k = await f(await m(e, `${h}/activities?limit=1`), 200, "List first Trigger Activity"), A = a(o(k.activities, "First Trigger Activity page")[0], "First Trigger Activity");
424
- i(A.kind, "operator.resumed", "First Trigger Activity kind"), s(A.activityId, "First Trigger Activity id"), s(A.createdAt, "First Trigger Activity createdAt");
425
- let j = s(k.nextCursor, "First Trigger Activity cursor"), M = await f(await m(e, `${h}/activities?cursor=${encodeURIComponent(j)}&limit=1`), 200, "List second Trigger Activity");
426
- i(a(o(M.activities, "Second Trigger Activity page")[0], "Second Trigger Activity").kind, "operator.paused", "Second Trigger Activity kind"), i(M.nextCursor, void 0, "Last Trigger Activity cursor"), await p(await m(e, `${l}/cron/activities?cursor=${encodeURIComponent(j)}`), 400, "page.invalid-cursor", "Cross-binding Trigger Activity cursor"), await f(await x(e, n, y(await f(await b(e, n, r, [{
353
+ });
354
+ i((await c(await y("pause"), 200, "Pause Webhook")).operatorState, "paused", "Paused state"), i((await e.request(new Request(v, { method: "POST" }))).status, 404, "Paused callback"), i((await c(await y("resume"), 200, "Resume Webhook")).operatorState, "active", "Resumed state"), i((await e.request(new Request(v, { method: "POST" }))).status, 200, "Resumed callback"), await c(await g(e, n, h(await c(await p(e, n, r, [{
427
355
  kind: "graph.node.delete",
428
356
  nodeId: "webhook",
429
- target: {
430
- id: "main",
431
- kind: "flow"
432
- }
433
- }]), 200, "Delete Webhook Trigger"), "Retired Trigger Revision"), "main", E, "trigger-publication-3"), 201, "Publish retired Webhook Trigger");
434
- let N = a((await f(await m(e, h), 200, "Read retired Webhook binding")).binding, "Retired Webhook binding");
435
- i(N.currentPublicationId, void 0, "Retired Webhook current Publication"), i(N.currentRevisionId, void 0, "Retired Webhook current Revision"), i(N.endpointUrl, void 0, "Retired Webhook endpoint URL"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Retired Webhook callback status"), await p(await C("pause"), 404, "trigger.not-found", "Pause retired Webhook binding"), i(o((await f(await m(e, `${h}/activities`), 200, "Read retired Trigger Activities")).activities, "Retired Trigger Activities").length, 2, "Retired Trigger Activity count");
357
+ target: { kind: "flow" }
358
+ }]), 200, "Delete Webhook"), "Retired Trigger Revision"), l, "retire-trigger"), 201, "Publish retired Trigger"), i(a((await c(await u(e, _), 200, "Read retired Webhook")).binding, "Retired Webhook").currentPublicationId, void 0, "Retired Publication");
436
359
  }
437
- }], O = [{
438
- name: "projects one Connector catalog and its authorized Connections",
360
+ }], S = [{
361
+ name: "projects the deployment Connector catalog and authorized Connections",
439
362
  async verify(e) {
440
- let t = s((await g(e, "Connector project", "connector-project")).projectId, "Connector Project projectId"), n = `/v1/projects/${encodeURIComponent(t)}/connector`, u = await f(await m(e, `${n}/providers`), 200, "List Connector Providers");
441
- c(u, [
442
- "projectId",
443
- "providers",
444
- "version"
445
- ], "Connector Provider page"), i(u.projectId, t, "Connector Provider page projectId"), i(u.version, 1, "Connector Provider page version");
446
- let p = o(u.providers, "Connector Providers").map((e, t) => {
447
- let n = a(e, `Connector Provider ${t}`), r = Object.hasOwn(n, "icon");
448
- return c(n, [
449
- "serviceId",
450
- "serviceName",
451
- ...r ? ["icon"] : []
452
- ], `Connector Provider ${t}`), s(n.serviceId, `Connector Provider ${t} serviceId`), s(n.serviceName, `Connector Provider ${t} serviceName`), r && s(n.icon, `Connector Provider ${t} icon`), n;
453
- });
454
- p.length == 0 && r("Connector conformance deployment must expose at least one Provider.");
455
- let h = await f(await m(e, `${n}/actions`), 200, "List all Connector Actions");
456
- c(h, [
457
- "actions",
458
- "projectId",
459
- "version"
460
- ], "Complete Connector Action page"), i(h.projectId, t, "Complete Connector Action page projectId"), i(h.version, 1, "Complete Connector Action page version");
461
- let _ = o(h.actions, "Complete Connector Actions").map((e, t) => d(e, `Complete Connector Action ${t}`));
462
- _.length == 0 && r("Connector conformance deployment must expose at least one Action.");
463
- let v = _[0], y = s(v.serviceId, "Selected Connector Action serviceId");
464
- p.some((e) => e.serviceId == y) || r("Selected Connector Action must refer to a listed Provider.");
465
- let b = await f(await m(e, `${n}/actions?service=${encodeURIComponent(y)}`), 200, "List Provider Connector Actions");
466
- c(b, [
467
- "actions",
468
- "projectId",
469
- "version"
470
- ], "Provider Connector Action page"), i(b.projectId, t, "Provider Connector Action page projectId"), i(b.version, 1, "Provider Connector Action page version"), o(b.actions, "Provider Connector Actions").map((e, t) => d(e, `Provider Connector Action ${t}`)).some((e) => e.actionId == v.actionId) || r("Provider Action list must include the selected Action.");
471
- let x = s(v.name, "Selected Connector Action name"), S = await f(await m(e, `${n}/actions?q=${encodeURIComponent(x)}`), 200, "Search Connector Actions");
472
- c(S, [
473
- "actions",
474
- "projectId",
475
- "version"
476
- ], "Searched Connector Action page"), i(S.projectId, t, "Searched Connector Action page projectId"), i(S.version, 1, "Searched Connector Action page version"), o(S.actions, "Searched Connector Actions").map((e, t) => d(e, `Searched Connector Action ${t}`)).some((e) => e.actionId == v.actionId) || r("Connector Action search must include an exact name match.");
477
- let C = s(v.actionId, "Selected Connector Action actionId"), w = await f(await m(e, `${n}/actions/${encodeURIComponent(C)}`), 200, "Read Connector Action");
478
- c(w, [
479
- "action",
480
- "projectId",
481
- "version"
482
- ], "Connector Action detail"), i(d(w.action, "Connector Action detail Action"), v, "Connector Action detail"), i(w.projectId, t, "Connector Action detail projectId"), i(w.version, 1, "Connector Action detail version");
483
- let T = await f(await m(e, `${n}/connections/${encodeURIComponent(y)}`), 200, "List Connector Connections");
484
- c(T, [
485
- "connections",
486
- "projectId",
487
- "serviceId",
488
- "version"
489
- ], "Connector Connection page"), i(T.projectId, t, "Connector Connection page projectId"), i(T.serviceId, y, "Connector Connection page serviceId"), i(T.version, 1, "Connector Connection page version");
490
- let E = o(T.connections, "Connector Connections").map((e, t) => l(e, `Connector Connection ${t}`)), D = Object.hasOwn(v, "defaultConnection") ? l(v.defaultConnection, "Selected Connector Action default Connection") : void 0;
491
- D != null && !E.some((e) => e.connectionId == D.connectionId) && r("Connector Action default Connection must be present in the service Connection list.");
492
- let O = await f(await m(e, `${n}/connections/${encodeURIComponent(y)}/page`, {
493
- body: JSON.stringify({
494
- returnUrl: "https://workbench.example/projects/connector",
495
- version: 1
496
- }),
363
+ let t = o((await c(await u(e, "/v1/connector/providers"), 200, "List Connector Providers")).providers, "Connector Providers").map((e) => a(e, "Connector Provider")), n = o((await c(await u(e, "/v1/connector/actions"), 200, "List Connector Actions")).actions, "Connector Actions").map((e) => a(e, "Connector Action"));
364
+ (t.length == 0 || n.length == 0) && r("Connector conformance deployment must expose a Provider and Action.");
365
+ let l = n[0], d = s(l.actionId, "Connector Action id"), f = s(l.serviceId, "Connector Action serviceId");
366
+ t.some((e) => e.serviceId == f) || r("Connector Action must refer to a listed Provider."), i((await c(await u(e, `/v1/connector/actions/${encodeURIComponent(d)}`), 200, "Read Connector Action")).action, l, "Connector Action detail");
367
+ let p = await c(await u(e, `/v1/connector/connections/${encodeURIComponent(f)}`), 200, "List Connector Connections");
368
+ Array.isArray(p.connections) || r("Connector Connections must be an array.");
369
+ let m = await c(await u(e, `/v1/connector/connections/${encodeURIComponent(f)}/page`, {
370
+ body: JSON.stringify({ version: 1 }),
497
371
  method: "POST"
498
- }), 200, "Create Connector Connection page");
499
- c(O, ["url", "version"], "Connector Connection external page");
500
- let k = new URL(s(O.url, "Connector Connection external page URL"));
501
- k.protocol != "http:" && k.protocol != "https:" && r("Connector Connection external page URL must use HTTP."), i(O.version, 1, "Connector Connection external page version");
372
+ }), 200, "Create Connector Connection page"), h = new URL(s(m.url, "Connector Connection page URL"));
373
+ h.protocol != "http:" && h.protocol != "https:" && r("Connector Connection page URL must use HTTP.");
502
374
  }
503
375
  }, {
504
- name: "rejects invalid or out-of-scope Connector discovery requests",
376
+ name: "rejects invalid Connector discovery requests",
505
377
  async verify(e) {
506
- let t = s((await g(e, "Connector validation", "connector-validation")).projectId, "Connector validation Project projectId"), n = `/v1/projects/${encodeURIComponent(t)}/connector`;
507
- await p(await m(e, `${n}/actions?service=mail&q=send`), 400, "project.invalid", "Conflicting Connector Action query"), await p(await m(e, `${n}/actions?q=%20%20`), 400, "project.invalid", "Empty Connector Action query"), await p(await m(e, `${n}/actions?q=${"a".repeat(257)}`), 400, "project.invalid", "Oversized Connector Action query"), await p(await m(e, `${n}/connections/${"a".repeat(257)}`), 400, "project.invalid", "Oversized Connector service"), await p(await m(e, `${n}/connections/mail/page`, {
508
- body: JSON.stringify({
509
- extra: !0,
510
- returnUrl: "https://workbench.example",
511
- version: 1
512
- }),
513
- method: "POST"
514
- }), 400, "project.invalid", "Malformed Connector Connection page"), await p(await m(e, "/v1/projects/00000000-0000-7000-8000-000000000000/connector/providers"), 404, "project.not-found", "Out-of-scope Connector Project"), await p(await m(e, `${n}/actions/conformance.missing`), 404, "connector.action-not-found", "Missing Connector Action");
378
+ await l(await u(e, "/v1/connector/actions?service=mail&q=send"), 400, "flow.invalid", "Conflicting Connector query"), await l(await u(e, "/v1/connector/actions?q=%20%20"), 400, "flow.invalid", "Empty Connector query"), await l(await u(e, `/v1/connector/connections/${"a".repeat(257)}`), 400, "flow.invalid", "Oversized Connector service"), await l(await u(e, "/v1/connector/actions/conformance.missing"), 404, "connector.action-not-found", "Missing Connector Action");
515
379
  }
516
380
  }];
517
381
  //#endregion
518
- export { O as connectorControlApiConformanceCases, T as controlApiConformanceCases, E as publicationControlApiConformanceCases, D as triggerControlApiConformanceCases };
382
+ export { S as connectorControlApiConformanceCases, y as controlApiConformanceCases, b as publicationControlApiConformanceCases, x as triggerControlApiConformanceCases };