@oomol-lab/open-flow 0.1.0-beta.1 → 0.1.0-beta.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 (54) hide show
  1. package/dist/browser/DesignerIcon-DjgOMYI5.js +2065 -0
  2. package/dist/browser/{createResourceDialog-DXQz0thK.js → createResourceDialog-DNBueSYZ.js} +161 -160
  3. package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
  4. package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
  5. package/dist/browser/dist-CP0883sY.js +4 -0
  6. package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
  7. package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
  8. package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
  9. package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
  10. package/dist/browser/dist-DxahK_I8.js +2688 -0
  11. package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
  12. package/dist/browser/{esm-DGQbgYoJ.js → esm-yhVU_KbQ.js} +5 -6
  13. package/dist/browser/flow-authoring-module.d.ts +2 -2
  14. package/dist/browser/flow-authoring-node.d.ts +6 -3
  15. package/dist/browser/flow-authoring.d.ts +1 -1
  16. package/dist/browser/flow-authoring.js +509 -209
  17. package/dist/browser/flow-change.d.ts +113 -9
  18. package/dist/browser/flow-change.js +323 -96
  19. package/dist/browser/flow-notifications.d.ts +5 -0
  20. package/dist/browser/flowChanges-B2ttnaj9.js +12265 -0
  21. package/dist/browser/{flowRunInputEditorStore-BeyUSWpO.js → flowRunInputEditorStore-DDidwd8h.js} +728 -719
  22. package/dist/browser/{flowWorkspace-DwyxAOBH.js → flowWorkspace-Dr8-Hut9.js} +40821 -42895
  23. package/dist/browser/{getPseudoElementBounds-ESJExRFX.js → getPseudoElementBounds-5LArT6Xc.js} +1827 -2322
  24. package/dist/browser/icons-KIOgjHpD.js +730 -0
  25. package/dist/browser/{markdownContent-DdlIRN3_.js → markdownContent-DUfLdnUt.js} +1 -1
  26. package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-_TgJ_7Oq.js} +256 -257
  27. package/dist/browser/waitNotificationInputs-BPulOxYt.js +26 -0
  28. package/dist/browser/workbench.css +1 -1
  29. package/dist/browser/workbench.d.ts +3 -1
  30. package/dist/browser/workbench.js +1136 -1038
  31. package/dist/browser/{workbenchSelect-B2s1HV-Y.js → workbenchSelect-CbXrdwxW.js} +479 -478
  32. package/dist/common/control-api-conformance.d.ts +1 -0
  33. package/dist/common/control-api-conformance.js +126 -47
  34. package/dist/common/control-api-errors.d.ts +12 -0
  35. package/dist/common/control-api.d.ts +60 -15
  36. package/dist/common/control-api.js +225 -101
  37. package/dist/common/flow-encoding.js +24 -8
  38. package/dist/common/flow-notifications.d.ts +5 -0
  39. package/dist/common/flow-semantics.d.ts +1 -0
  40. package/dist/common/flow-semantics.js +3464 -1113
  41. package/dist/common/integration-trigger.d.ts +1 -0
  42. package/dist/common/provider-triggers.js +4 -1
  43. package/dist/common/run-events.js +2 -1
  44. package/dist/common/run-lifecycle.d.ts +17 -2
  45. package/dist/common/run-lifecycle.js +53 -2
  46. package/dist/common/runtime-contract.d.ts +1 -1
  47. package/dist/common/runtime-contract.js +27 -0
  48. package/dist/common/scheduler.d.ts +65 -4
  49. package/dist/common/scheduler.js +420 -146
  50. package/dist/index.d.ts +2 -1
  51. package/package.json +1 -1
  52. package/dist/browser/diagnostics-BGoGFvHA.js +0 -9237
  53. package/dist/browser/dist-BpopSHwP.js +0 -1543
  54. package/dist/browser/dist-CUSrALSX.js +0 -1620
@@ -5,6 +5,7 @@ export interface ControlApiConformanceHarness {
5
5
  }
6
6
  export interface ControlApiConformanceCase {
7
7
  readonly name: string;
8
+ readonly runtime?: true;
8
9
  verify(harness: ControlApiConformanceHarness): Promise<void>;
9
10
  }
10
11
  export declare const controlApiConformanceCases: readonly ControlApiConformanceCase[];
@@ -38,9 +38,11 @@ function s(e, t) {
38
38
  async function c(e, t, n) {
39
39
  return i(e.status, t, `${n} status`), a(await e.json().catch(() => r(`${n} body: expected JSON.`)), `${n} body`);
40
40
  }
41
- async function l(e, t, n, r) {
42
- let o = await c(e, t, r);
43
- i(a(o.error, `${r} error`).code, n, `${r} error code`), i(o.version, 1, `${r} version`);
41
+ async function l(e, t, n, o, l) {
42
+ let u = await c(e, t, o), d = a(u.error, `${o} error`);
43
+ i(d.code, n, `${o} error code`);
44
+ let f = s(d.message, `${o} error message`);
45
+ l != null && !f.includes(l) && r(`${o} error message: expected ${JSON.stringify(l)} in ${JSON.stringify(f)}.`), i(u.version, 1, `${o} version`);
44
46
  }
45
47
  function u(e, t, n = {}) {
46
48
  let r = new Headers(n.headers);
@@ -62,17 +64,18 @@ function d(e, t, n) {
62
64
  async function f(e, t, n) {
63
65
  return c(await d(e, t, n), 201, "Create Flow");
64
66
  }
65
- function p(e, t, n, r) {
67
+ function p(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
66
68
  return u(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
67
69
  body: JSON.stringify({
68
70
  expectedRevisionId: n,
69
71
  operations: r,
70
72
  version: 1
71
73
  }),
74
+ headers: { "idempotency-key": i },
72
75
  method: "POST"
73
76
  });
74
77
  }
75
- function m(e, t, n, r = "marker") {
78
+ function m(e, t, n, r = "marker", i) {
76
79
  return p(e, t, n, [{
77
80
  kind: "graph.node.create",
78
81
  node: {
@@ -88,7 +91,7 @@ function m(e, t, n, r = "marker") {
88
91
  },
89
92
  nodeId: r,
90
93
  target: { kind: "flow" }
91
- }]);
94
+ }], i);
92
95
  }
93
96
  function h(e, t) {
94
97
  return s(a(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
@@ -104,7 +107,17 @@ function g(e, t, r, i, a) {
104
107
  method: "POST"
105
108
  });
106
109
  }
107
- function _(e, t, n, r, i) {
110
+ async function _(e, t, n, r) {
111
+ let o = await c(t, n, r), l = s(o.operationId, `${r} operationId`);
112
+ for (let t = 0; o.status == "pending" && t < 100; t += 1) await new Promise((e) => setTimeout(e, 10)), o = await c(await u(e, `/v1/flows/${s(o.flowId, `${r} flowId`)}/publish-operations/${l}`), 200, `${r} operation`);
113
+ i(o.status, "succeeded", `${r} terminal status`);
114
+ let d = s(o.publicationId, `${r} publicationId`), f = a((await c(await u(e, `/v1/flows/${s(o.flowId, `${r} flowId`)}/live`), 200, `${r} Live`)).publication, `${r} Publication`);
115
+ return i(f.publicationId, d, `${r} Live Publication`), {
116
+ operation: o,
117
+ publication: f
118
+ };
119
+ }
120
+ function v(e, t, n, r, i) {
108
121
  return u(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
109
122
  body: JSON.stringify({
110
123
  expectedLivePublicationId: r,
@@ -114,7 +127,7 @@ function _(e, t, n, r, i) {
114
127
  method: "POST"
115
128
  });
116
129
  }
117
- function v(e, t, n) {
130
+ function y(e, t, n) {
118
131
  return u(e, "/v1/runs", {
119
132
  body: JSON.stringify({
120
133
  inputs: {},
@@ -125,7 +138,7 @@ function v(e, t, n) {
125
138
  method: "POST"
126
139
  });
127
140
  }
128
- var y = [
141
+ var b = [
129
142
  {
130
143
  name: "manages deployment Variables with stable limits and exact-case identity",
131
144
  async verify(e) {
@@ -187,24 +200,25 @@ var y = [
187
200
  {
188
201
  name: "commits immutable Draft Revisions for one Flow",
189
202
  async verify(e) {
190
- 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");
191
- i(a(o.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), await l(await p(e, n, d, [{
192
- kind: "graph.node.replace",
193
- node: {
194
- concurrency: 1,
195
- inputs: {},
196
- kind: "value",
197
- values: [{
198
- handle: "ready",
199
- jsonSchema: { type: "boolean" },
200
- nullable: !1,
201
- value: !0
202
- }]
203
- },
203
+ 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, "marker", "draft-change"), 200, "Change Draft"), d = h(o, "Changed Draft");
204
+ i(a(o.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), i(await c(await m(e, n, r, "marker", "draft-change"), 200, "Replay Draft change"), o, "Replayed Draft change"), await l(await m(e, n, r, "another-marker", "draft-change"), 409, "flow.conflict", "Conflicting Draft change replay"), await l(await m(e, n, d, "marker"), 400, "flow.invalid", "Duplicate Draft Node", "A Node with this ID already exists"), await l(await p(e, n, d, [{
205
+ before: [{
206
+ handle: "ready",
207
+ jsonSchema: { type: "boolean" },
208
+ nullable: !1,
209
+ value: !0
210
+ }],
211
+ kind: "graph.node.values.set",
204
212
  nodeId: "marker",
205
- target: { kind: "flow" }
213
+ target: { kind: "flow" },
214
+ value: [{
215
+ handle: "ready",
216
+ jsonSchema: { type: "boolean" },
217
+ nullable: !1,
218
+ value: !0
219
+ }]
206
220
  }]), 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");
207
- let g = await c(await u(e, `/v1/flows/${n}/draft/sync?fromRevisionId=${r}`), 200, "Sync Draft");
221
+ let g = await c(await u(e, `/v1/flows/${n}/draft/sync`), 200, "Sync Draft");
208
222
  i(g.kind, "snapshot", "Draft sync kind"), i(a(g.draft, "Draft snapshot").revisionId, d, "Draft snapshot revisionId");
209
223
  }
210
224
  },
@@ -280,6 +294,71 @@ var y = [
280
294
  }), 200, "Cancel second Draft Run")).status, "canceled", "Second canceled Run status");
281
295
  }
282
296
  },
297
+ {
298
+ name: "pauses, resolves, resumes, and cancels waiting Draft Runs",
299
+ runtime: !0,
300
+ async verify(e) {
301
+ let t = await f(e, "Wait flow", "wait-flow"), d = s(t.flowId, "Wait Flow flowId"), m = `/v1/flows/${d}/revisions/${h(await c(await p(e, d, s(t.draftRevisionId, "Wait Flow revisionId"), [{
302
+ kind: "graph.node.create",
303
+ node: {
304
+ actions: ["approve", "reject"],
305
+ concurrency: 1,
306
+ input: {
307
+ handle: "value",
308
+ jsonSchema: {},
309
+ nullable: !0,
310
+ value: null
311
+ },
312
+ inputs: { value: {
313
+ kind: "value",
314
+ value: { request: 1 }
315
+ } },
316
+ kind: "wait",
317
+ prompt: "Approve request 1?"
318
+ },
319
+ nodeId: "approval",
320
+ target: { kind: "flow" }
321
+ }]), 200, "Create Wait"), "Wait Revision")}/runs`, g = async (t, r) => c(await u(e, m, {
322
+ body: JSON.stringify({
323
+ engineContract: n,
324
+ inputs: {},
325
+ version: 1
326
+ }),
327
+ headers: { "idempotency-key": t },
328
+ method: "POST"
329
+ }), 202, r), _ = await g("wait-run", "Create Wait Run"), v = s(_.runId, "Wait Run runId"), y = _;
330
+ for (let t = 0; y.status != "waiting" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), y = await c(await u(e, `/v1/runs/${v}`), 200, "Read Wait Run");
331
+ i(y.status, "waiting", "Wait Run status");
332
+ let b = a(y.waiting, "Active Wait");
333
+ i(b.actions, ["approve", "reject"], "Wait actions"), i(b.nodeId, "approval", "Wait node"), i(b.prompt, "Approve request 1?", "Wait prompt"), s(b.expiresAt, "Wait expiry"), s(b.waitingSince, "Wait start");
334
+ let x = s(b.waitId, "Wait id");
335
+ i(o((await c(await u(e, `/v1/flows/${d}/runs?status=waiting`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => a(e, "Waiting Run").runId), [v], "Waiting Run list");
336
+ let S = await c(await u(e, `/v1/runs/${v}/events`), 200, "Read waiting Run events");
337
+ i(S.done, !1, "Waiting events done"), o(S.events, "Waiting events").some((e) => a(e, "Waiting event").kind == "run.waiting") || r("Waiting Run must contain run.waiting."), await l(await u(e, `/v1/runs/${v}/result`), 409, "run.not-terminal", "Read waiting Run result");
338
+ let C = `/v1/runs/${v}/waits/${x}/resolve`, w = (t) => u(e, C, {
339
+ body: JSON.stringify({
340
+ action: t,
341
+ version: 1
342
+ }),
343
+ method: "POST"
344
+ });
345
+ await l(await w("continue"), 400, "run.invalid", "Reject unsupported Wait action");
346
+ let T = await c(await w("approve"), 200, "Approve Wait");
347
+ i(T.action, "approve", "Approved action"), i(T.resolutionAccepted, !0, "Approved resolution"), i(T.status, "queued", "Resolved Run status"), s(T.resolvedAt, "Wait resolution time");
348
+ let E = await c(await w("reject"), 200, "Reject resolved Wait");
349
+ i(E.action, "approve", "Winning action"), i(E.resolutionAccepted, !1, "Competing resolution");
350
+ for (let t = 0; y.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), y = await c(await u(e, `/v1/runs/${v}`), 200, "Read resumed Run");
351
+ i(y.status, "completed", "Resumed Run status"), i(y.waiting, void 0, "Completed Wait projection");
352
+ let D = await c(await w("approve"), 200, "Replay approved Wait");
353
+ i(D.resolutionAccepted, !0, "Replayed resolution"), i(D.status, "completed", "Replayed terminal status"), i(o((await c(await u(e, `/v1/runs/${v}/events`), 200, "Read resumed Run events")).events, "Completed events").filter((e) => a(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
354
+ let O = await g("wait-run-cancel", "Create cancelable Wait Run"), k = s(O.runId, "Cancelable Wait Run id"), A = O;
355
+ for (let t = 0; A.status != "waiting" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), A = await c(await u(e, `/v1/runs/${k}`), 200, "Read cancelable Wait Run");
356
+ i(A.status, "waiting", "Cancelable Wait status"), i((await c(await u(e, `/v1/runs/${k}/cancel`, {
357
+ body: JSON.stringify({ version: 1 }),
358
+ method: "POST"
359
+ }), 200, "Cancel waiting Run")).status, "canceled", "Canceled waiting Run status");
360
+ }
361
+ },
283
362
  {
284
363
  name: "rejects invalid and missing Flow control targets",
285
364
  async verify(e) {
@@ -321,35 +400,35 @@ var y = [
321
400
  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");
322
401
  }
323
402
  }
324
- ], b = [{
403
+ ], x = [{
325
404
  name: "publishes one immutable Flow with idempotent Live CAS",
326
405
  async verify(e) {
327
406
  let t = await f(e, "Publication flow", "publication-flow"), n = s(t.flowId, "Publication Flow flowId"), r = s(t.draftRevisionId, "Publication Flow revisionId");
328
407
  i((await c(await u(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
329
- let a = () => g(e, n, r, null, "publication-first"), o = await c(await a(), 201, "Publish Flow"), d = s(o.publicationId, "Publication id");
330
- 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");
331
- let p = await c(await u(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
332
- i(p.publications, [o], "Publication history"), i(p.total, 1, "Publication total"), await l(await u(e, `/v1/flows/${n}/revisions/${r}/publications`, {
408
+ let a = () => g(e, n, r, null, "publication-first"), o = await _(e, await a(), 202, "Publish Flow"), d = o.publication, p = s(d.publicationId, "Publication id");
409
+ i(await c(await a(), 202, "Replay Publish"), o.operation, "Replayed Publish operation"), await l(await g(e, n, r, p, "publication-first"), 409, "publication.conflict", "Conflicting replay"), i((await c(await u(e, `/v1/flows/${n}/live`), 200, "Read published Live")).publication, d, "Live Publication");
410
+ let m = await c(await u(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
411
+ i(m.publications, [d], "Publication history"), i(m.total, 1, "Publication total"), await l(await u(e, `/v1/flows/${n}/revisions/${r}/publications`, {
333
412
  body: JSON.stringify({
334
413
  engineContract: "unsupported-engine/v1",
335
- expectedLivePublicationId: d,
414
+ expectedLivePublicationId: p,
336
415
  version: 1
337
416
  }),
338
417
  headers: { "idempotency-key": "unsupported-publication" },
339
418
  method: "POST"
340
- }), 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");
419
+ }), 409, "engine.unsupported", "Publish unsupported Engine"), await l(await g(e, n, "00000000-0000-7000-8000-000000000002", p, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await l(await v(e, n, "00000000-0000-7000-8000-000000000004", p, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await l(await y(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
341
420
  }
342
421
  }, {
343
422
  name: "rolls back immutable history and fixes a Live Run target",
344
423
  async verify(e) {
345
- 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");
346
- await l(await v(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
347
- let d = () => _(e, n, a, o, "rollback-first"), p = await c(await d(), 201, "Rollback Flow"), y = s(p.publicationId, "Rollback Publication");
348
- i(p.operation, "rollback", "Rollback operation"), i(p.sourcePublicationId, a, "Rollback source"), i(await c(await d(), 200, "Replay Rollback"), p, "Replayed Rollback");
349
- let b = await c(await v(e, y, "rollback-run"), 202, "Create Live Run");
350
- 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");
424
+ let t = await f(e, "Rollback flow", "rollback-flow"), n = s(t.flowId, "Rollback Flow flowId"), r = s(t.draftRevisionId, "Rollback Flow revisionId"), a = (await _(e, await g(e, n, r, null, "publish-first"), 202, "Publish first Revision")).publication, o = s(a.publicationId, "First Publication"), d = (await _(e, await g(e, n, h(await c(await m(e, n, r), 200, "Change Draft"), "Second Revision"), o, "publish-second"), 202, "Publish second Revision")).publication, p = s(d.publicationId, "Second Publication");
425
+ await l(await y(e, o, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
426
+ let b = () => v(e, n, o, p, "rollback-first"), x = await c(await b(), 201, "Rollback Flow"), S = s(x.publicationId, "Rollback Publication");
427
+ i(x.operation, "rollback", "Rollback operation"), i(x.sourcePublicationId, o, "Rollback source"), i(await c(await b(), 200, "Replay Rollback"), x, "Replayed Rollback");
428
+ let C = await c(await y(e, S, "rollback-run"), 202, "Create Live Run");
429
+ i(C.flowId, n, "Live Run flowId"), i(C.revisionId, r, "Live Run revisionId"), await c(await u(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await l(await y(e, S, "retired-run"), 409, "flow.busy", "Run retired Flow");
351
430
  }
352
- }], x = [{
431
+ }], S = [{
353
432
  name: "exposes one deployment-scoped Trigger Key catalog",
354
433
  async verify(e) {
355
434
  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"));
@@ -385,20 +464,20 @@ var y = [
385
464
  },
386
465
  nodeId: "webhook",
387
466
  target: { kind: "flow" }
388
- }]), 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"));
389
- i(m.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
390
- for (let e of m) i(e.currentPublicationId, l, "Trigger Publication");
391
- let _ = `${d}/webhook`, v = s(a((await c(await u(e, _), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), y = (t) => u(e, `${_}/${t}`, {
467
+ }]), 200, "Create Trigger nodes"), "Trigger Revision"), l = (await _(e, await g(e, n, r, null, "trigger-publication"), 202, "Publish Trigger Flow")).publication, d = s(l.publicationId, "Trigger Publication"), m = `/v1/flows/${n}/triggers`, v = o((await c(await u(e, m), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => a(e, "Trigger binding"));
468
+ i(v.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
469
+ for (let e of v) i(e.currentPublicationId, d, "Trigger Publication");
470
+ let y = `${m}/webhook`, b = s(a((await c(await u(e, y), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), x = (t) => u(e, `${y}/${t}`, {
392
471
  body: JSON.stringify({ version: 1 }),
393
472
  method: "POST"
394
473
  });
395
- 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, [{
474
+ i((await c(await x("pause"), 200, "Pause Webhook")).operatorState, "paused", "Paused state"), i((await e.request(new Request(b, { method: "POST" }))).status, 404, "Paused callback"), i((await c(await x("resume"), 200, "Resume Webhook")).operatorState, "active", "Resumed state"), i((await e.request(new Request(b, { method: "POST" }))).status, 200, "Resumed callback"), await _(e, await g(e, n, h(await c(await p(e, n, r, [{
396
475
  kind: "graph.node.delete",
397
476
  nodeId: "webhook",
398
477
  target: { kind: "flow" }
399
- }]), 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");
478
+ }]), 200, "Delete Webhook"), "Retired Trigger Revision"), d, "retire-trigger"), 202, "Publish retired Trigger"), i(a((await c(await u(e, y), 200, "Read retired Webhook")).binding, "Retired Webhook").currentPublicationId, void 0, "Retired Publication");
400
479
  }
401
- }], S = [{
480
+ }], C = [{
402
481
  name: "projects the deployment Connector catalog and authorized Connections",
403
482
  async verify(e) {
404
483
  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"));
@@ -420,4 +499,4 @@ var y = [
420
499
  }
421
500
  }];
422
501
  //#endregion
423
- export { S as connectorControlApiConformanceCases, y as controlApiConformanceCases, b as publicationControlApiConformanceCases, x as triggerControlApiConformanceCases };
502
+ export { C as connectorControlApiConformanceCases, b as controlApiConformanceCases, x as publicationControlApiConformanceCases, S as triggerControlApiConformanceCases };
@@ -18,6 +18,8 @@ export declare const controlErrorCode: {
18
18
  readonly pageInvalidCursor: 'page.invalid-cursor';
19
19
  readonly publicationConflict: 'publication.conflict';
20
20
  readonly publicationNotFound: 'publication.not-found';
21
+ readonly publicationUnsupported: 'publication.unsupported';
22
+ readonly publishOperationNotFound: 'publication.operation-not-found';
21
23
  readonly routeNotFound: 'route.not-found';
22
24
  readonly runConflict: 'run.conflict';
23
25
  readonly runEventsExpired: 'run.events-expired';
@@ -25,6 +27,7 @@ export declare const controlErrorCode: {
25
27
  readonly runNotFound: 'run.not-found';
26
28
  readonly runNotTerminal: 'run.not-terminal';
27
29
  readonly runOverloaded: 'run.overloaded';
30
+ readonly runWaitNotFound: 'run.wait-not-found';
28
31
  readonly triggerKeyInvalid: 'trigger-key.invalid';
29
32
  readonly triggerKeyNotFound: 'trigger-key.not-found';
30
33
  readonly triggerNotFound: 'trigger.not-found';
@@ -91,6 +94,12 @@ export declare const controlErrorMetadata: {
91
94
  readonly "publication.not-found": {
92
95
  readonly status: 404;
93
96
  };
97
+ readonly "publication.unsupported": {
98
+ readonly status: 409;
99
+ };
100
+ readonly "publication.operation-not-found": {
101
+ readonly status: 404;
102
+ };
94
103
  readonly "route.not-found": {
95
104
  readonly status: 404;
96
105
  };
@@ -112,6 +121,9 @@ export declare const controlErrorMetadata: {
112
121
  readonly "run.overloaded": {
113
122
  readonly status: 429;
114
123
  };
124
+ readonly "run.wait-not-found": {
125
+ readonly status: 404;
126
+ };
115
127
  readonly "trigger-key.invalid": {
116
128
  readonly status: 409;
117
129
  };
@@ -1,6 +1,6 @@
1
1
  import type { RunStatus } from './run-lifecycle.js';
2
- import type { ChangeOperation, InputPortDefinition, JsonValue, PortDefinition, RevisionContent, TriggerKeySnapshot } from '../browser/flow-change.js';
3
- export type { JsonValue, TriggerKeySnapshot } from '../browser/flow-change.js';
2
+ import type { ChangeOperation, InputPortDefinition, JsonValue, PortDefinition, RevisionContent, TriggerKeySnapshot, WaitAction } from '../browser/flow-change.js';
3
+ export type { JsonValue, TriggerKeySnapshot, WaitAction } from '../browser/flow-change.js';
4
4
  export type { RunStatus } from './run-lifecycle.js';
5
5
  export { controlErrorCode, controlErrorMetadata, type ControlErrorCode } from './control-api-errors.js';
6
6
  export type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
@@ -80,8 +80,10 @@ export interface ConnectorConnection {
80
80
  }
81
81
  export interface ConnectorAction {
82
82
  readonly actionId: string;
83
+ readonly authenticated: boolean;
83
84
  readonly defaultConnection?: ConnectorConnection;
84
85
  readonly description: string;
86
+ readonly homepageUrl?: string;
85
87
  readonly icon?: string;
86
88
  readonly inputs: Readonly<Record<string, InputPortDefinition>>;
87
89
  readonly name: string;
@@ -90,6 +92,7 @@ export interface ConnectorAction {
90
92
  readonly serviceName: string;
91
93
  }
92
94
  export interface ConnectorProvider {
95
+ readonly homepageUrl?: string;
93
96
  readonly icon?: string;
94
97
  readonly serviceId: string;
95
98
  readonly serviceName: string;
@@ -111,18 +114,11 @@ export interface DraftChange {
111
114
  readonly revision: RevisionMetadata;
112
115
  readonly version: 1;
113
116
  }
114
- export type DraftSync = {
115
- readonly kind: 'changes';
116
- readonly revisions: readonly {
117
- readonly operations: readonly ChangeOperation[];
118
- readonly revision: RevisionMetadata;
119
- }[];
120
- readonly version: 1;
121
- } | {
117
+ export interface DraftSync {
122
118
  readonly draft: Draft;
123
119
  readonly kind: 'snapshot';
124
120
  readonly version: 1;
125
- };
121
+ }
126
122
  export interface Publication {
127
123
  readonly actorId: string;
128
124
  readonly closureDigest: string;
@@ -137,6 +133,37 @@ export interface Publication {
137
133
  readonly sourcePublicationId?: string;
138
134
  readonly version: 1;
139
135
  }
136
+ export type PublishOperation = {
137
+ readonly createdAt: string;
138
+ readonly flowId: string;
139
+ readonly operationId: string;
140
+ readonly revisionId: string;
141
+ readonly status: 'pending';
142
+ readonly updatedAt: string;
143
+ readonly version: 1;
144
+ } | {
145
+ readonly createdAt: string;
146
+ readonly flowId: string;
147
+ readonly operationId: string;
148
+ readonly publicationId: string;
149
+ readonly revisionId: string;
150
+ readonly status: 'succeeded';
151
+ readonly updatedAt: string;
152
+ readonly version: 1;
153
+ } | {
154
+ readonly createdAt: string;
155
+ readonly flowId: string;
156
+ readonly issue: {
157
+ readonly code: string;
158
+ readonly message: string;
159
+ readonly nodeId?: string;
160
+ };
161
+ readonly operationId: string;
162
+ readonly revisionId: string;
163
+ readonly status: 'failed';
164
+ readonly updatedAt: string;
165
+ readonly version: 1;
166
+ };
140
167
  export interface Diagnostic {
141
168
  readonly code: string;
142
169
  readonly column: number;
@@ -188,6 +215,14 @@ interface RunDetailsBase extends Run {
188
215
  readonly eventsExpiresAt?: string;
189
216
  readonly modelVersion: number;
190
217
  readonly revisionDigest: string;
218
+ readonly waiting?: {
219
+ readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
220
+ readonly expiresAt: string;
221
+ readonly nodeId: string;
222
+ readonly prompt: string;
223
+ readonly waitId: string;
224
+ readonly waitingSince: string;
225
+ };
191
226
  }
192
227
  export type DraftRun = RunDetailsBase & {
193
228
  readonly source: 'draft';
@@ -209,7 +244,7 @@ export interface RunPage {
209
244
  readonly runs: readonly Run[];
210
245
  readonly version: 1;
211
246
  }
212
- export type RunEventKind = 'node.artifact' | 'node.completed' | 'node.failed' | 'node.log' | 'node.output' | 'node.progress' | 'node.started' | 'run.canceled' | 'run.completed' | 'run.events-truncated' | 'run.failed' | 'run.indeterminate' | 'run.progress' | 'run.queued' | 'run.started';
247
+ export type RunEventKind = 'node.artifact' | 'node.completed' | 'node.failed' | 'node.log' | 'node.output' | 'node.progress' | 'node.started' | 'run.canceled' | 'run.completed' | 'run.events-truncated' | 'run.failed' | 'run.indeterminate' | 'run.progress' | 'run.queued' | 'run.resolved' | 'run.started' | 'run.waiting';
213
248
  export interface RunEvent {
214
249
  readonly createdAt: string;
215
250
  readonly kind: RunEventKind;
@@ -297,7 +332,7 @@ export declare class ControlClient {
297
332
  resumeFlowTrigger(flowId: string, triggerNodeId: string): Promise<TriggerBinding>;
298
333
  testFlowPollTrigger(flowId: string, triggerNodeId: string): Promise<PollTriggerTestResult>;
299
334
  getDraft(flowId: string): Promise<Draft>;
300
- syncDraft(flowId: string, fromRevisionId?: string): Promise<DraftSync>;
335
+ syncDraft(flowId: string): Promise<DraftSync>;
301
336
  getRevision(flowId: string, revisionId: string): Promise<Draft>;
302
337
  listConnectorProviders(signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorProvider[]>;
303
338
  listConnectorActions(serviceId?: string, signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorAction[]>;
@@ -305,7 +340,7 @@ export declare class ControlClient {
305
340
  getConnectorAction(actionId: string, signal?: AbortSignal, flowId?: string): Promise<ConnectorAction>;
306
341
  listConnectorConnections(serviceId: string, signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorConnection[]>;
307
342
  createConnectorConnectionPage(serviceId: string, flowId?: string): Promise<string>;
308
- changeDraft(flowId: string, expectedRevisionId: string, operations: readonly ChangeOperation[]): Promise<DraftChange>;
343
+ changeDraft(flowId: string, expectedRevisionId: string, operations: readonly ChangeOperation[], changeId?: string): Promise<DraftChange>;
309
344
  checkFlow(flowId: string, revisionId: string): Promise<FlowCheck>;
310
345
  getLive(flowId: string): Promise<Live>;
311
346
  listPublications(flowId: string, options?: {
@@ -315,7 +350,8 @@ export declare class ControlClient {
315
350
  }): Promise<PublicationPage>;
316
351
  createDraftRun(flowId: string, revisionId: string, options?: RunOptions): Promise<DraftRun>;
317
352
  createLiveRun(publicationId: string, options?: RunOptions): Promise<LiveRun>;
318
- publishFlow(flowId: string, revisionId: string, expectedLivePublicationId: string | null, options?: PublicationOptions): Promise<Publication>;
353
+ publishFlow(flowId: string, revisionId: string, expectedLivePublicationId: string | null, options?: PublicationOptions): Promise<PublishOperation>;
354
+ getPublishOperation(flowId: string, operationId: string): Promise<PublishOperation>;
319
355
  rollbackFlow(flowId: string, publicationId: string, expectedLivePublicationId: string, options?: PublicationOptions): Promise<Publication>;
320
356
  getRun(runId: string): Promise<RunDetails>;
321
357
  listRuns(flowId: string, options?: {
@@ -329,6 +365,15 @@ export declare class ControlClient {
329
365
  }): Promise<RunEvents>;
330
366
  getRunResult(runId: string): Promise<RunResult>;
331
367
  cancelRun(runId: string): Promise<RunCancellation>;
368
+ resolveRunWait(runId: string, waitId: string, action: WaitAction): Promise<{
369
+ readonly action: WaitAction | null;
370
+ readonly resolutionAccepted: boolean;
371
+ readonly resolvedAt: string | null;
372
+ readonly runId: string;
373
+ readonly status: RunStatus;
374
+ readonly version: 1;
375
+ readonly waitId: string;
376
+ }>;
332
377
  private connectorActions;
333
378
  protected request<Value = unknown>(path: string, init?: RequestInit): Promise<Value>;
334
379
  }