@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
@@ -19,6 +19,8 @@ var e = {
19
19
  pageInvalidCursor: "page.invalid-cursor",
20
20
  publicationConflict: "publication.conflict",
21
21
  publicationNotFound: "publication.not-found",
22
+ publicationUnsupported: "publication.unsupported",
23
+ publishOperationNotFound: "publication.operation-not-found",
22
24
  routeNotFound: "route.not-found",
23
25
  runConflict: "run.conflict",
24
26
  runEventsExpired: "run.events-expired",
@@ -26,6 +28,7 @@ var e = {
26
28
  runNotFound: "run.not-found",
27
29
  runNotTerminal: "run.not-terminal",
28
30
  runOverloaded: "run.overloaded",
31
+ runWaitNotFound: "run.wait-not-found",
29
32
  triggerKeyInvalid: "trigger-key.invalid",
30
33
  triggerKeyNotFound: "trigger-key.not-found",
31
34
  triggerNotFound: "trigger.not-found",
@@ -52,6 +55,8 @@ var e = {
52
55
  [e.pageInvalidCursor]: { status: 400 },
53
56
  [e.publicationConflict]: { status: 409 },
54
57
  [e.publicationNotFound]: { status: 404 },
58
+ [e.publicationUnsupported]: { status: 409 },
59
+ [e.publishOperationNotFound]: { status: 404 },
55
60
  [e.routeNotFound]: { status: 404 },
56
61
  [e.runConflict]: { status: 409 },
57
62
  [e.runEventsExpired]: { status: 410 },
@@ -59,6 +64,7 @@ var e = {
59
64
  [e.runNotFound]: { status: 404 },
60
65
  [e.runNotTerminal]: { status: 409 },
61
66
  [e.runOverloaded]: { status: 429 },
67
+ [e.runWaitNotFound]: { status: 404 },
62
68
  [e.triggerKeyInvalid]: { status: 409 },
63
69
  [e.triggerKeyNotFound]: { status: 404 },
64
70
  [e.triggerNotFound]: { status: 404 },
@@ -72,7 +78,8 @@ var e = {
72
78
  "indeterminate",
73
79
  "queued",
74
80
  "running",
75
- "starting"
81
+ "starting",
82
+ "waiting"
76
83
  ], r = class extends Error {
77
84
  constructor(e, t, n) {
78
85
  super(n), this.code = t, this.name = "ApiError", this.status = e;
@@ -139,39 +146,45 @@ function p(e, t) {
139
146
  return Object.fromEntries(Object.entries(a(e)).map(([e, n]) => [e, t(n)]));
140
147
  }
141
148
  function m(e) {
142
- let t = a(e), n = t.icon, r = t.defaultConnection != null;
149
+ let t = a(e), n = t.homepageUrl, r = t.icon, c = t.defaultConnection != null;
143
150
  if (s(t, [
144
151
  "actionId",
145
- ...r ? ["defaultConnection"] : [],
152
+ "authenticated",
153
+ ...c ? ["defaultConnection"] : [],
146
154
  "description",
147
- ...n == null ? [] : ["icon"],
155
+ ...n == null ? [] : ["homepageUrl"],
156
+ ...r == null ? [] : ["icon"],
148
157
  "inputs",
149
158
  "name",
150
159
  "outputs",
151
160
  "serviceId",
152
161
  "serviceName"
153
- ]), n != null && typeof n != "string") return i();
154
- let c = {
162
+ ]), n != null && typeof n != "string" || r != null && typeof r != "string") return i();
163
+ let l = {
155
164
  actionId: o(t.actionId),
156
- ...r ? { defaultConnection: u(t.defaultConnection) } : {},
165
+ authenticated: typeof t.authenticated == "boolean" ? t.authenticated : i(),
166
+ ...c ? { defaultConnection: u(t.defaultConnection) } : {},
157
167
  description: typeof t.description == "string" ? t.description : i(),
158
- ...n == null ? {} : { icon: n },
168
+ ...n == null ? {} : { homepageUrl: n },
169
+ ...r == null ? {} : { icon: r },
159
170
  inputs: p(t.inputs, f),
160
171
  name: o(t.name),
161
172
  outputs: p(t.outputs, d),
162
173
  serviceId: o(t.serviceId),
163
174
  serviceName: o(t.serviceName)
164
175
  };
165
- return c.defaultConnection != null && (c.defaultConnection.serviceId != c.serviceId || c.defaultConnection.status != "active") ? i() : c;
176
+ return l.defaultConnection != null && (l.defaultConnection.serviceId != l.serviceId || l.defaultConnection.status != "active") ? i() : l;
166
177
  }
167
178
  function h(e) {
168
- let t = a(e), n = t.icon;
179
+ let t = a(e), n = t.homepageUrl, r = t.icon;
169
180
  return s(t, [
170
181
  "serviceId",
171
182
  "serviceName",
172
- ...n == null ? [] : ["icon"]
173
- ]), n != null && typeof n != "string" ? i() : {
174
- ...n == null ? {} : { icon: n },
183
+ ...n == null ? [] : ["homepageUrl"],
184
+ ...r == null ? [] : ["icon"]
185
+ ]), n != null && typeof n != "string" || r != null && typeof r != "string" ? i() : {
186
+ ...n == null ? {} : { homepageUrl: n },
187
+ ...r == null ? {} : { icon: r },
175
188
  serviceId: o(t.serviceId),
176
189
  serviceName: o(t.serviceName)
177
190
  };
@@ -383,23 +396,11 @@ function M(e) {
383
396
  }
384
397
  function N(e) {
385
398
  let t = a(e);
386
- return t.version == 1 ? t.kind == "snapshot" ? {
399
+ return t.version != 1 || t.kind != "snapshot" ? i() : {
387
400
  draft: j(t.draft),
388
401
  kind: "snapshot",
389
402
  version: 1
390
- } : t.kind != "changes" || !Array.isArray(t.revisions) ? i() : {
391
- kind: "changes",
392
- revisions: t.revisions.map((e) => {
393
- let t = a(e);
394
- if (!Array.isArray(t.operations) || t.operations.length == 0) return i();
395
- for (let e of t.operations) if (typeof a(e).kind != "string") return i();
396
- return {
397
- operations: t.operations,
398
- revision: A(t.revision)
399
- };
400
- }),
401
- version: 1
402
- } : i();
403
+ };
403
404
  }
404
405
  function P(e) {
405
406
  let t = a(e), n = t.operation, r = t.sourcePublicationId;
@@ -419,6 +420,72 @@ function P(e) {
419
420
  };
420
421
  }
421
422
  function F(e) {
423
+ let t = a(e), n = t.status, r = {
424
+ createdAt: o(t.createdAt),
425
+ flowId: o(t.flowId),
426
+ operationId: o(t.operationId),
427
+ revisionId: o(t.revisionId),
428
+ updatedAt: o(t.updatedAt),
429
+ version: 1
430
+ };
431
+ if (t.version != 1) return i();
432
+ switch (n) {
433
+ case "pending": return s(t, [
434
+ "createdAt",
435
+ "flowId",
436
+ "operationId",
437
+ "revisionId",
438
+ "status",
439
+ "updatedAt",
440
+ "version"
441
+ ]), {
442
+ ...r,
443
+ status: n
444
+ };
445
+ case "succeeded": return s(t, [
446
+ "createdAt",
447
+ "flowId",
448
+ "operationId",
449
+ "publicationId",
450
+ "revisionId",
451
+ "status",
452
+ "updatedAt",
453
+ "version"
454
+ ]), {
455
+ ...r,
456
+ publicationId: o(t.publicationId),
457
+ status: n
458
+ };
459
+ case "failed": {
460
+ s(t, [
461
+ "createdAt",
462
+ "flowId",
463
+ "issue",
464
+ "operationId",
465
+ "revisionId",
466
+ "status",
467
+ "updatedAt",
468
+ "version"
469
+ ]);
470
+ let e = a(t.issue), i = e.nodeId;
471
+ return s(e, [
472
+ "code",
473
+ "message",
474
+ ...i == null ? [] : ["nodeId"]
475
+ ]), {
476
+ ...r,
477
+ issue: {
478
+ code: o(e.code),
479
+ message: o(e.message),
480
+ ...i == null ? {} : { nodeId: o(i) }
481
+ },
482
+ status: n
483
+ };
484
+ }
485
+ default: return i();
486
+ }
487
+ }
488
+ function I(e) {
422
489
  let t = a(e), n = t.values == null ? void 0 : a(t.values);
423
490
  return {
424
491
  code: o(t.code),
@@ -429,11 +496,11 @@ function F(e) {
429
496
  ...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : i()])) }
430
497
  };
431
498
  }
432
- function I(e) {
499
+ function L(e) {
433
500
  let t = a(e);
434
501
  return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? i() : {
435
502
  closureDigest: o(t.closureDigest),
436
- diagnostics: t.diagnostics.map(F),
503
+ diagnostics: t.diagnostics.map(I),
437
504
  engineContract: o(t.engineContract),
438
505
  flowId: o(t.flowId),
439
506
  modelVersion: c(t.modelVersion),
@@ -443,7 +510,7 @@ function I(e) {
443
510
  version: 1
444
511
  };
445
512
  }
446
- function L(e) {
513
+ function R(e) {
447
514
  let t = a(e), n = t.status, r = t.publication;
448
515
  return t.version != 1 || typeof t.hasUnpublishedChanges != "boolean" || n != "not-published" && n != "runnable" && n != "suspended" || n == "not-published" && r !== null || n != "not-published" && r === null ? i() : {
449
516
  flowId: o(t.flowId),
@@ -454,7 +521,7 @@ function L(e) {
454
521
  version: 1
455
522
  };
456
523
  }
457
- function R(e) {
524
+ function z(e) {
458
525
  let t = a(e), n = t.nextCursor, r = t.total;
459
526
  return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
460
527
  ...n == null ? {} : { nextCursor: n },
@@ -463,11 +530,11 @@ function R(e) {
463
530
  version: 1
464
531
  };
465
532
  }
466
- var z = new Set(n);
467
- function B(e) {
468
- return typeof e == "string" && z.has(e) ? e : i();
469
- }
533
+ var B = new Set(n);
470
534
  function V(e) {
535
+ return typeof e == "string" && B.has(e) ? e : i();
536
+ }
537
+ function H(e) {
471
538
  let t = a(e), n = t.source, r = t.startedAt, s = t.finishedAt;
472
539
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || s != null && typeof s != "string" ? i() : {
473
540
  createdAt: o(t.createdAt),
@@ -477,34 +544,55 @@ function V(e) {
477
544
  runId: o(t.runId),
478
545
  source: n,
479
546
  ...r == null ? {} : { startedAt: r },
480
- status: B(t.status),
547
+ status: V(t.status),
481
548
  version: 1
482
549
  };
483
550
  }
484
- function H(e) {
485
- let t = a(e), n = V(t), r = t.eventsExpiresAt;
486
- if (r != null && typeof r != "string") return i();
487
- let s = {
551
+ function U(e) {
552
+ let t = a(e);
553
+ s(t, [
554
+ "actions",
555
+ "expiresAt",
556
+ "nodeId",
557
+ "prompt",
558
+ "waitId",
559
+ "waitingSince"
560
+ ]);
561
+ let n = t.actions;
562
+ return !Array.isArray(n) || !(n.length == 1 && n[0] == "continue" || n.length == 2 && n[0] == "approve" && n[1] == "reject") ? i() : {
563
+ actions: n,
564
+ expiresAt: o(t.expiresAt),
565
+ nodeId: o(t.nodeId),
566
+ prompt: o(t.prompt),
567
+ waitId: o(t.waitId),
568
+ waitingSince: o(t.waitingSince)
569
+ };
570
+ }
571
+ function W(e) {
572
+ let t = a(e), n = H(t), r = t.eventsExpiresAt;
573
+ if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return i();
574
+ let s = n.status == "waiting" ? U(t.waiting) : void 0, l = {
488
575
  ...n,
489
576
  closureDigest: o(t.closureDigest),
490
577
  engineContract: o(t.engineContract),
491
578
  engineDigest: o(t.engineDigest),
492
579
  ...r == null ? {} : { eventsExpiresAt: r },
493
580
  modelVersion: c(t.modelVersion),
494
- revisionDigest: o(t.revisionDigest)
581
+ revisionDigest: o(t.revisionDigest),
582
+ ...s == null ? {} : { waiting: s }
495
583
  };
496
584
  switch (n.source) {
497
585
  case "draft": return {
498
- ...s,
586
+ ...l,
499
587
  source: "draft"
500
588
  };
501
589
  case "live": return {
502
- ...s,
590
+ ...l,
503
591
  publicationId: o(t.publicationId),
504
592
  source: "live"
505
593
  };
506
594
  case "trigger": return {
507
- ...s,
595
+ ...l,
508
596
  occurrenceId: o(t.occurrenceId),
509
597
  publicationId: o(t.publicationId),
510
598
  source: "trigger",
@@ -512,16 +600,16 @@ function H(e) {
512
600
  };
513
601
  }
514
602
  }
515
- function U(e) {
603
+ function G(e) {
516
604
  let t = a(e), n = t.nextCursor;
517
605
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
518
606
  flowId: o(t.flowId),
519
607
  ...n == null ? {} : { nextCursor: n },
520
- runs: t.runs.map(V),
608
+ runs: t.runs.map(H),
521
609
  version: 1
522
610
  };
523
611
  }
524
- var W = /* @__PURE__ */ new Set([
612
+ var K = /* @__PURE__ */ new Set([
525
613
  "node.artifact",
526
614
  "node.completed",
527
615
  "node.failed",
@@ -536,11 +624,13 @@ var W = /* @__PURE__ */ new Set([
536
624
  "run.indeterminate",
537
625
  "run.progress",
538
626
  "run.queued",
539
- "run.started"
627
+ "run.resolved",
628
+ "run.started",
629
+ "run.waiting"
540
630
  ]);
541
- function G(e) {
631
+ function q(e) {
542
632
  let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
543
- return typeof n != "string" || !W.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
633
+ return typeof n != "string" || !K.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
544
634
  createdAt: o(t.createdAt),
545
635
  kind: n,
546
636
  payload: a(t.payload),
@@ -548,11 +638,11 @@ function G(e) {
548
638
  ...s == null ? {} : { sourceSequence: s }
549
639
  };
550
640
  }
551
- function K(e) {
641
+ function J(e) {
552
642
  let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
553
643
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? i() : {
554
644
  done: t.done,
555
- events: t.events.map(G),
645
+ events: t.events.map(q),
556
646
  ...n == null ? {} : { eventsExpiresAt: n },
557
647
  historyComplete: t.historyComplete,
558
648
  nextAfter: r,
@@ -560,16 +650,38 @@ function K(e) {
560
650
  version: 1
561
651
  };
562
652
  }
563
- function q(e) {
564
- let t = a(e), n = B(t.status);
565
- return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
653
+ function Y(e) {
654
+ let t = a(e), n = V(t.status);
655
+ return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? i() : {
566
656
  cancelAccepted: t.cancelAccepted,
567
657
  runId: o(t.runId),
568
658
  status: n,
569
659
  version: 1
570
660
  };
571
661
  }
572
- function J(e) {
662
+ function X(e) {
663
+ let t = a(e);
664
+ s(t, [
665
+ "action",
666
+ "resolutionAccepted",
667
+ "resolvedAt",
668
+ "runId",
669
+ "status",
670
+ "version",
671
+ "waitId"
672
+ ]);
673
+ let n = t.action, r = t.resolvedAt;
674
+ return t.version != 1 || typeof t.resolutionAccepted != "boolean" || n !== null && n != "approve" && n != "continue" && n != "reject" || r !== null && typeof r != "string" || n === null != (r === null) || t.resolutionAccepted && n === null ? i() : {
675
+ action: n,
676
+ resolutionAccepted: t.resolutionAccepted,
677
+ resolvedAt: r,
678
+ runId: o(t.runId),
679
+ status: V(t.status),
680
+ version: 1,
681
+ waitId: o(t.waitId)
682
+ };
683
+ }
684
+ function Z(e) {
573
685
  let t = a(e), n = t.status;
574
686
  if (t.version != 1) return i();
575
687
  let r = {
@@ -610,11 +722,11 @@ function J(e) {
610
722
  }
611
723
  return i();
612
724
  }
613
- var Y = encodeURIComponent;
614
- function X(e) {
725
+ var Q = encodeURIComponent;
726
+ function $(e) {
615
727
  return `${e}-${crypto.randomUUID()}`;
616
728
  }
617
- var Z = class {
729
+ var ee = class {
618
730
  constructor(e) {
619
731
  this.requestControl = e;
620
732
  }
@@ -632,16 +744,16 @@ var Z = class {
632
744
  };
633
745
  }
634
746
  async getVariable(e) {
635
- return k(await this.request(`/v1/variables/${Y(e)}`));
747
+ return k(await this.request(`/v1/variables/${Q(e)}`));
636
748
  }
637
749
  async putVariable(e, t) {
638
- return k(await this.request(`/v1/variables/${Y(e)}`, {
750
+ return k(await this.request(`/v1/variables/${Q(e)}`, {
639
751
  body: JSON.stringify({ value: t }),
640
752
  method: "PUT"
641
753
  }));
642
754
  }
643
755
  async deleteVariable(e) {
644
- let t = a(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
756
+ let t = a(await this.request(`/v1/variables/${Q(e)}`, { method: "DELETE" }));
645
757
  if (s(t, ["version"]), t.version != 1) return i();
646
758
  }
647
759
  async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
@@ -655,10 +767,10 @@ var Z = class {
655
767
  }));
656
768
  }
657
769
  async getFlow(e) {
658
- return D(await this.request(`/v1/flows/${Y(e)}`));
770
+ return D(await this.request(`/v1/flows/${Q(e)}`));
659
771
  }
660
772
  async renameFlow(e, t) {
661
- return D(await this.request(`/v1/flows/${Y(e)}`, {
773
+ return D(await this.request(`/v1/flows/${Q(e)}`, {
662
774
  body: JSON.stringify({
663
775
  name: t,
664
776
  version: 1
@@ -667,7 +779,7 @@ var Z = class {
667
779
  }));
668
780
  }
669
781
  async deleteFlow(e) {
670
- return D(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
782
+ return D(await this.request(`/v1/flows/${Q(e)}`, { method: "DELETE" }));
671
783
  }
672
784
  async listTriggerKeys(e) {
673
785
  let t = a(await this.request("/v1/trigger-keys", { signal: e }));
@@ -678,52 +790,51 @@ var Z = class {
678
790
  return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
679
791
  }
680
792
  async getTriggerKey(e, t) {
681
- let n = a(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
793
+ let n = a(await this.request(`/v1/trigger-keys/${Q(e)}`, { signal: t }));
682
794
  return n.version == 1 ? _(n.definition) : i();
683
795
  }
684
796
  async listFlowTriggerBindings(e) {
685
- let t = a(await this.request(`/v1/flows/${Y(e)}/triggers`));
797
+ let t = a(await this.request(`/v1/flows/${Q(e)}/triggers`));
686
798
  return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
687
799
  }
688
800
  async getFlowTriggerBinding(e, t) {
689
- return C(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
801
+ return C(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}`));
690
802
  }
691
803
  async listFlowTriggerActivities(e, t, n = {}) {
692
804
  let r = new URLSearchParams();
693
805
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
694
806
  let i = r.size == 0 ? "" : `?${r}`;
695
- return T(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
807
+ return T(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/activities${i}`));
696
808
  }
697
809
  async pauseFlowTrigger(e, t) {
698
- return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
810
+ return S(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/pause`, {
699
811
  body: JSON.stringify({ version: 1 }),
700
812
  method: "POST"
701
813
  }));
702
814
  }
703
815
  async resumeFlowTrigger(e, t) {
704
- return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
816
+ return S(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/resume`, {
705
817
  body: JSON.stringify({ version: 1 }),
706
818
  method: "POST"
707
819
  }));
708
820
  }
709
821
  async testFlowPollTrigger(e, t) {
710
- return E(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
822
+ return E(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/test`, {
711
823
  body: JSON.stringify({ version: 1 }),
712
824
  method: "POST"
713
825
  }));
714
826
  }
715
827
  async getDraft(e) {
716
- return j(await this.request(`/v1/flows/${Y(e)}/draft`));
828
+ return j(await this.request(`/v1/flows/${Q(e)}/draft`));
717
829
  }
718
- async syncDraft(e, t) {
719
- let n = t == null ? "" : `?fromRevisionId=${Y(t)}`;
720
- return N(await this.request(`/v1/flows/${Y(e)}/draft/sync${n}`));
830
+ async syncDraft(e) {
831
+ return N(await this.request(`/v1/flows/${Q(e)}/draft/sync`));
721
832
  }
722
833
  async getRevision(e, t) {
723
- return j(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
834
+ return j(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}`));
724
835
  }
725
836
  async listConnectorProviders(e, t) {
726
- let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Y(t)}`}`, { signal: e }));
837
+ let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Q(t)}`}`, { signal: e }));
727
838
  return s(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? i() : n.providers.map(h);
728
839
  }
729
840
  async listConnectorActions(e, t, n) {
@@ -739,11 +850,11 @@ var Z = class {
739
850
  }, t);
740
851
  }
741
852
  async getConnectorAction(e, t, n) {
742
- let r = a(await this.request(`/v1/connector/actions/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
853
+ let r = a(await this.request(`/v1/connector/actions/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
743
854
  return s(r, ["action", "version"]), r.version == 1 ? m(r.action) : i();
744
855
  }
745
856
  async listConnectorConnections(e, t, n) {
746
- let r = a(await this.request(`/v1/connector/connections/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
857
+ let r = a(await this.request(`/v1/connector/connections/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
747
858
  return s(r, [
748
859
  "connections",
749
860
  "serviceId",
@@ -751,7 +862,7 @@ var Z = class {
751
862
  ]), r.version != 1 || o(r.serviceId) != e || !Array.isArray(r.connections) ? i() : r.connections.map(u);
752
863
  }
753
864
  async createConnectorConnectionPage(e, t) {
754
- let n = a(await this.request(`/v1/connector/connections/${Y(e)}/page${t == null ? "" : `?flowId=${Y(t)}`}`, {
865
+ let n = a(await this.request(`/v1/connector/connections/${Q(e)}/page${t == null ? "" : `?flowId=${Q(t)}`}`, {
755
866
  body: JSON.stringify({ version: 1 }),
756
867
  method: "POST"
757
868
  }));
@@ -763,18 +874,19 @@ var Z = class {
763
874
  return i();
764
875
  }
765
876
  }
766
- async changeDraft(e, t, n) {
767
- return M(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
877
+ async changeDraft(e, t, n, r = $("change")) {
878
+ return M(await this.request(`/v1/flows/${Q(e)}/draft/changes`, {
768
879
  body: JSON.stringify({
769
880
  expectedRevisionId: t,
770
881
  operations: n,
771
882
  version: 1
772
883
  }),
884
+ headers: { "idempotency-key": r },
773
885
  method: "POST"
774
886
  }));
775
887
  }
776
888
  async checkFlow(e, t) {
777
- return I(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
889
+ return L(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/check`, {
778
890
  body: JSON.stringify({
779
891
  engineContract: "open-flow-engine/v1",
780
892
  version: 1
@@ -783,85 +895,97 @@ var Z = class {
783
895
  }));
784
896
  }
785
897
  async getLive(e) {
786
- return L(await this.request(`/v1/flows/${Y(e)}/live`));
898
+ return R(await this.request(`/v1/flows/${Q(e)}/live`));
787
899
  }
788
900
  async listPublications(e, t = {}) {
789
901
  let n = new URLSearchParams();
790
902
  t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.includeTotal != null && n.set("includeTotal", String(t.includeTotal));
791
903
  let r = n.size == 0 ? "" : `?${n}`;
792
- return R(await this.request(`/v1/flows/${Y(e)}/publications${r}`));
904
+ return z(await this.request(`/v1/flows/${Q(e)}/publications${r}`));
793
905
  }
794
906
  async createDraftRun(e, t, n = {}) {
795
- let r = H(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
907
+ let r = W(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/runs`, {
796
908
  body: JSON.stringify({
797
909
  engineContract: "open-flow-engine/v1",
798
910
  inputs: n.inputs ?? {},
799
911
  version: 1
800
912
  }),
801
- headers: { "idempotency-key": n.idempotencyKey ?? X("run") },
913
+ headers: { "idempotency-key": n.idempotencyKey ?? $("run") },
802
914
  method: "POST"
803
915
  }));
804
916
  return r.source == "draft" ? r : i();
805
917
  }
806
918
  async createLiveRun(e, t = {}) {
807
- let n = H(await this.request("/v1/runs", {
919
+ let n = W(await this.request("/v1/runs", {
808
920
  body: JSON.stringify({
809
921
  inputs: t.inputs ?? {},
810
922
  publicationId: e,
811
923
  version: 1
812
924
  }),
813
- headers: { "idempotency-key": t.idempotencyKey ?? X("run") },
925
+ headers: { "idempotency-key": t.idempotencyKey ?? $("run") },
814
926
  method: "POST"
815
927
  }));
816
928
  return n.source == "live" ? n : i();
817
929
  }
818
930
  async publishFlow(e, t, n, r = {}) {
819
- return P(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
931
+ return F(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/publications`, {
820
932
  body: JSON.stringify({
821
933
  engineContract: "open-flow-engine/v1",
822
934
  expectedLivePublicationId: n,
823
935
  version: 1
824
936
  }),
825
- headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
937
+ headers: { "idempotency-key": r.idempotencyKey ?? $("publication") },
826
938
  method: "POST"
827
939
  }));
828
940
  }
941
+ async getPublishOperation(e, t) {
942
+ return F(await this.request(`/v1/flows/${Q(e)}/publish-operations/${Q(t)}`));
943
+ }
829
944
  async rollbackFlow(e, t, n, r = {}) {
830
- return P(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
945
+ return P(await this.request(`/v1/flows/${Q(e)}/publications/${Q(t)}/rollback`, {
831
946
  body: JSON.stringify({
832
947
  expectedLivePublicationId: n,
833
948
  version: 1
834
949
  }),
835
- headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
950
+ headers: { "idempotency-key": r.idempotencyKey ?? $("publication") },
836
951
  method: "POST"
837
952
  }));
838
953
  }
839
954
  async getRun(e) {
840
- return H(await this.request(`/v1/runs/${Y(e)}`));
955
+ return W(await this.request(`/v1/runs/${Q(e)}`));
841
956
  }
842
957
  async listRuns(e, t = {}) {
843
958
  let n = new URLSearchParams();
844
959
  t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.status != null && n.set("status", t.status);
845
960
  let r = n.size == 0 ? "" : `?${n}`;
846
- return U(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
961
+ return G(await this.request(`/v1/flows/${Q(e)}/runs${r}`));
847
962
  }
848
963
  async getRunEvents(e, t = {}) {
849
964
  let n = new URLSearchParams();
850
965
  t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
851
966
  let r = n.size == 0 ? "" : `?${n}`;
852
- return K(await this.request(`/v1/runs/${Y(e)}/events${r}`));
967
+ return J(await this.request(`/v1/runs/${Q(e)}/events${r}`));
853
968
  }
854
969
  async getRunResult(e) {
855
- return J(await this.request(`/v1/runs/${Y(e)}/result`));
970
+ return Z(await this.request(`/v1/runs/${Q(e)}/result`));
856
971
  }
857
972
  async cancelRun(e) {
858
- return q(await this.request(`/v1/runs/${Y(e)}/cancel`, {
973
+ return Y(await this.request(`/v1/runs/${Q(e)}/cancel`, {
859
974
  body: JSON.stringify({ version: 1 }),
860
975
  method: "POST"
861
976
  }));
862
977
  }
978
+ async resolveRunWait(e, t, n) {
979
+ return X(await this.request(`/v1/runs/${Q(e)}/waits/${Q(t)}/resolve`, {
980
+ body: JSON.stringify({
981
+ action: n,
982
+ version: 1
983
+ }),
984
+ method: "POST"
985
+ }));
986
+ }
863
987
  async connectorActions(e, t) {
864
- let n = Object.entries(e).map(([e, t]) => `${Y(e)}=${Y(t)}`).join("&"), r = n == "" ? "" : `?${n}`, o = a(await this.request(`/v1/connector/actions${r}`, { signal: t }));
988
+ let n = Object.entries(e).map(([e, t]) => `${Q(e)}=${Q(t)}`).join("&"), r = n == "" ? "" : `?${n}`, o = a(await this.request(`/v1/connector/actions${r}`, { signal: t }));
865
989
  return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
866
990
  }
867
991
  async request(e, t = {}) {
@@ -884,4 +1008,4 @@ var Z = class {
884
1008
  }
885
1009
  };
886
1010
  //#endregion
887
- export { r as ApiError, Z as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
1011
+ export { r as ApiError, ee as ControlClient, e as controlErrorCode, t as controlErrorMetadata };