@oomol-lab/open-flow 0.1.0-beta.3 → 0.1.0-beta.5
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.
- package/dist/browser/DesignerIcon-XKBRy_0Q.js +2066 -0
- package/dist/browser/{createResourceDialog-BkZns-oZ.js → createResourceDialog-Cf7QpXp6.js} +161 -160
- package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
- package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
- package/dist/browser/{esm-C2UUqIUP.js → esm-xWDFFpGd.js} +5 -6
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +5 -2
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +489 -209
- package/dist/browser/flow-change.d.ts +110 -9
- package/dist/browser/flow-change.js +319 -96
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/{diagnostics-SDCyFuxm.js → flowChanges-CeMiiZIO.js} +4234 -3825
- package/dist/browser/{flowRunInputEditorStore-CwvOiIiU.js → flowRunInputEditorStore-DDidwd8h.js} +10 -2
- package/dist/browser/{flowWorkspace-BZ_eiQNR.js → flowWorkspace-VnS8nLMT.js} +35268 -35081
- package/dist/browser/{getPseudoElementBounds-ESJExRFX.js → getPseudoElementBounds-5LArT6Xc.js} +1827 -2322
- package/dist/browser/icons-CRxvozBE.js +726 -0
- package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-Bj2HDFRd.js} +256 -257
- package/dist/browser/waitNotificationInputs-ClCAEIAM.js +26 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +851 -840
- package/dist/browser/{workbenchSelect-B2s1HV-Y.js → workbenchSelect-Cf1zlVm9.js} +479 -478
- package/dist/common/control-api-conformance.d.ts +1 -0
- package/dist/common/control-api-conformance.js +80 -19
- package/dist/common/control-api-errors.d.ts +4 -0
- package/dist/common/control-api.d.ts +26 -14
- package/dist/common/control-api.js +138 -89
- package/dist/common/flow-encoding.js +20 -8
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-semantics.d.ts +1 -0
- package/dist/common/flow-semantics.js +467 -381
- package/dist/common/run-events.js +2 -1
- package/dist/common/run-lifecycle.d.ts +17 -2
- package/dist/common/run-lifecycle.js +53 -2
- package/dist/common/scheduler.d.ts +64 -3
- package/dist/common/scheduler.js +417 -142
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
|
@@ -28,6 +28,7 @@ var e = {
|
|
|
28
28
|
runNotFound: "run.not-found",
|
|
29
29
|
runNotTerminal: "run.not-terminal",
|
|
30
30
|
runOverloaded: "run.overloaded",
|
|
31
|
+
runWaitNotFound: "run.wait-not-found",
|
|
31
32
|
triggerKeyInvalid: "trigger-key.invalid",
|
|
32
33
|
triggerKeyNotFound: "trigger-key.not-found",
|
|
33
34
|
triggerNotFound: "trigger.not-found",
|
|
@@ -63,6 +64,7 @@ var e = {
|
|
|
63
64
|
[e.runNotFound]: { status: 404 },
|
|
64
65
|
[e.runNotTerminal]: { status: 409 },
|
|
65
66
|
[e.runOverloaded]: { status: 429 },
|
|
67
|
+
[e.runWaitNotFound]: { status: 404 },
|
|
66
68
|
[e.triggerKeyInvalid]: { status: 409 },
|
|
67
69
|
[e.triggerKeyNotFound]: { status: 404 },
|
|
68
70
|
[e.triggerNotFound]: { status: 404 },
|
|
@@ -76,7 +78,8 @@ var e = {
|
|
|
76
78
|
"indeterminate",
|
|
77
79
|
"queued",
|
|
78
80
|
"running",
|
|
79
|
-
"starting"
|
|
81
|
+
"starting",
|
|
82
|
+
"waiting"
|
|
80
83
|
], r = class extends Error {
|
|
81
84
|
constructor(e, t, n) {
|
|
82
85
|
super(n), this.code = t, this.name = "ApiError", this.status = e;
|
|
@@ -143,41 +146,45 @@ function p(e, t) {
|
|
|
143
146
|
return Object.fromEntries(Object.entries(a(e)).map(([e, n]) => [e, t(n)]));
|
|
144
147
|
}
|
|
145
148
|
function m(e) {
|
|
146
|
-
let t = a(e), n = t.
|
|
149
|
+
let t = a(e), n = t.homepageUrl, r = t.icon, c = t.defaultConnection != null;
|
|
147
150
|
if (s(t, [
|
|
148
151
|
"actionId",
|
|
149
152
|
"authenticated",
|
|
150
|
-
...
|
|
153
|
+
...c ? ["defaultConnection"] : [],
|
|
151
154
|
"description",
|
|
152
|
-
...n == null ? [] : ["
|
|
155
|
+
...n == null ? [] : ["homepageUrl"],
|
|
156
|
+
...r == null ? [] : ["icon"],
|
|
153
157
|
"inputs",
|
|
154
158
|
"name",
|
|
155
159
|
"outputs",
|
|
156
160
|
"serviceId",
|
|
157
161
|
"serviceName"
|
|
158
|
-
]), n != null && typeof n != "string") return i();
|
|
159
|
-
let
|
|
162
|
+
]), n != null && typeof n != "string" || r != null && typeof r != "string") return i();
|
|
163
|
+
let l = {
|
|
160
164
|
actionId: o(t.actionId),
|
|
161
165
|
authenticated: typeof t.authenticated == "boolean" ? t.authenticated : i(),
|
|
162
|
-
...
|
|
166
|
+
...c ? { defaultConnection: u(t.defaultConnection) } : {},
|
|
163
167
|
description: typeof t.description == "string" ? t.description : i(),
|
|
164
|
-
...n == null ? {} : {
|
|
168
|
+
...n == null ? {} : { homepageUrl: n },
|
|
169
|
+
...r == null ? {} : { icon: r },
|
|
165
170
|
inputs: p(t.inputs, f),
|
|
166
171
|
name: o(t.name),
|
|
167
172
|
outputs: p(t.outputs, d),
|
|
168
173
|
serviceId: o(t.serviceId),
|
|
169
174
|
serviceName: o(t.serviceName)
|
|
170
175
|
};
|
|
171
|
-
return
|
|
176
|
+
return l.defaultConnection != null && (l.defaultConnection.serviceId != l.serviceId || l.defaultConnection.status != "active") ? i() : l;
|
|
172
177
|
}
|
|
173
178
|
function h(e) {
|
|
174
|
-
let t = a(e), n = t.icon;
|
|
179
|
+
let t = a(e), n = t.homepageUrl, r = t.icon;
|
|
175
180
|
return s(t, [
|
|
176
181
|
"serviceId",
|
|
177
182
|
"serviceName",
|
|
178
|
-
...n == null ? [] : ["
|
|
179
|
-
|
|
180
|
-
|
|
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 },
|
|
181
188
|
serviceId: o(t.serviceId),
|
|
182
189
|
serviceName: o(t.serviceName)
|
|
183
190
|
};
|
|
@@ -389,23 +396,11 @@ function M(e) {
|
|
|
389
396
|
}
|
|
390
397
|
function N(e) {
|
|
391
398
|
let t = a(e);
|
|
392
|
-
return t.version
|
|
399
|
+
return t.version != 1 || t.kind != "snapshot" ? i() : {
|
|
393
400
|
draft: j(t.draft),
|
|
394
401
|
kind: "snapshot",
|
|
395
402
|
version: 1
|
|
396
|
-
}
|
|
397
|
-
kind: "changes",
|
|
398
|
-
revisions: t.revisions.map((e) => {
|
|
399
|
-
let t = a(e);
|
|
400
|
-
if (!Array.isArray(t.operations) || t.operations.length == 0) return i();
|
|
401
|
-
for (let e of t.operations) if (typeof a(e).kind != "string") return i();
|
|
402
|
-
return {
|
|
403
|
-
operations: t.operations,
|
|
404
|
-
revision: A(t.revision)
|
|
405
|
-
};
|
|
406
|
-
}),
|
|
407
|
-
version: 1
|
|
408
|
-
} : i();
|
|
403
|
+
};
|
|
409
404
|
}
|
|
410
405
|
function P(e) {
|
|
411
406
|
let t = a(e), n = t.operation, r = t.sourcePublicationId;
|
|
@@ -554,29 +549,50 @@ function H(e) {
|
|
|
554
549
|
};
|
|
555
550
|
}
|
|
556
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) {
|
|
557
572
|
let t = a(e), n = H(t), r = t.eventsExpiresAt;
|
|
558
|
-
if (r != null && typeof r != "string") return i();
|
|
559
|
-
let s = {
|
|
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 = {
|
|
560
575
|
...n,
|
|
561
576
|
closureDigest: o(t.closureDigest),
|
|
562
577
|
engineContract: o(t.engineContract),
|
|
563
578
|
engineDigest: o(t.engineDigest),
|
|
564
579
|
...r == null ? {} : { eventsExpiresAt: r },
|
|
565
580
|
modelVersion: c(t.modelVersion),
|
|
566
|
-
revisionDigest: o(t.revisionDigest)
|
|
581
|
+
revisionDigest: o(t.revisionDigest),
|
|
582
|
+
...s == null ? {} : { waiting: s }
|
|
567
583
|
};
|
|
568
584
|
switch (n.source) {
|
|
569
585
|
case "draft": return {
|
|
570
|
-
...
|
|
586
|
+
...l,
|
|
571
587
|
source: "draft"
|
|
572
588
|
};
|
|
573
589
|
case "live": return {
|
|
574
|
-
...
|
|
590
|
+
...l,
|
|
575
591
|
publicationId: o(t.publicationId),
|
|
576
592
|
source: "live"
|
|
577
593
|
};
|
|
578
594
|
case "trigger": return {
|
|
579
|
-
...
|
|
595
|
+
...l,
|
|
580
596
|
occurrenceId: o(t.occurrenceId),
|
|
581
597
|
publicationId: o(t.publicationId),
|
|
582
598
|
source: "trigger",
|
|
@@ -584,7 +600,7 @@ function U(e) {
|
|
|
584
600
|
};
|
|
585
601
|
}
|
|
586
602
|
}
|
|
587
|
-
function
|
|
603
|
+
function G(e) {
|
|
588
604
|
let t = a(e), n = t.nextCursor;
|
|
589
605
|
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
|
|
590
606
|
flowId: o(t.flowId),
|
|
@@ -593,7 +609,7 @@ function W(e) {
|
|
|
593
609
|
version: 1
|
|
594
610
|
};
|
|
595
611
|
}
|
|
596
|
-
var
|
|
612
|
+
var K = /* @__PURE__ */ new Set([
|
|
597
613
|
"node.artifact",
|
|
598
614
|
"node.completed",
|
|
599
615
|
"node.failed",
|
|
@@ -608,11 +624,13 @@ var G = /* @__PURE__ */ new Set([
|
|
|
608
624
|
"run.indeterminate",
|
|
609
625
|
"run.progress",
|
|
610
626
|
"run.queued",
|
|
611
|
-
"run.
|
|
627
|
+
"run.resolved",
|
|
628
|
+
"run.started",
|
|
629
|
+
"run.waiting"
|
|
612
630
|
]);
|
|
613
|
-
function
|
|
631
|
+
function q(e) {
|
|
614
632
|
let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
|
|
615
|
-
return typeof n != "string" || !
|
|
633
|
+
return typeof n != "string" || !K.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
|
|
616
634
|
createdAt: o(t.createdAt),
|
|
617
635
|
kind: n,
|
|
618
636
|
payload: a(t.payload),
|
|
@@ -620,11 +638,11 @@ function K(e) {
|
|
|
620
638
|
...s == null ? {} : { sourceSequence: s }
|
|
621
639
|
};
|
|
622
640
|
}
|
|
623
|
-
function
|
|
641
|
+
function J(e) {
|
|
624
642
|
let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
|
|
625
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() : {
|
|
626
644
|
done: t.done,
|
|
627
|
-
events: t.events.map(
|
|
645
|
+
events: t.events.map(q),
|
|
628
646
|
...n == null ? {} : { eventsExpiresAt: n },
|
|
629
647
|
historyComplete: t.historyComplete,
|
|
630
648
|
nextAfter: r,
|
|
@@ -632,16 +650,38 @@ function q(e) {
|
|
|
632
650
|
version: 1
|
|
633
651
|
};
|
|
634
652
|
}
|
|
635
|
-
function
|
|
653
|
+
function Y(e) {
|
|
636
654
|
let t = a(e), n = V(t.status);
|
|
637
|
-
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
|
|
655
|
+
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? i() : {
|
|
638
656
|
cancelAccepted: t.cancelAccepted,
|
|
639
657
|
runId: o(t.runId),
|
|
640
658
|
status: n,
|
|
641
659
|
version: 1
|
|
642
660
|
};
|
|
643
661
|
}
|
|
644
|
-
function
|
|
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) {
|
|
645
685
|
let t = a(e), n = t.status;
|
|
646
686
|
if (t.version != 1) return i();
|
|
647
687
|
let r = {
|
|
@@ -682,11 +722,11 @@ function Y(e) {
|
|
|
682
722
|
}
|
|
683
723
|
return i();
|
|
684
724
|
}
|
|
685
|
-
var
|
|
686
|
-
function
|
|
725
|
+
var Q = encodeURIComponent;
|
|
726
|
+
function $(e) {
|
|
687
727
|
return `${e}-${crypto.randomUUID()}`;
|
|
688
728
|
}
|
|
689
|
-
var
|
|
729
|
+
var ee = class {
|
|
690
730
|
constructor(e) {
|
|
691
731
|
this.requestControl = e;
|
|
692
732
|
}
|
|
@@ -704,16 +744,16 @@ var Q = class {
|
|
|
704
744
|
};
|
|
705
745
|
}
|
|
706
746
|
async getVariable(e) {
|
|
707
|
-
return k(await this.request(`/v1/variables/${
|
|
747
|
+
return k(await this.request(`/v1/variables/${Q(e)}`));
|
|
708
748
|
}
|
|
709
749
|
async putVariable(e, t) {
|
|
710
|
-
return k(await this.request(`/v1/variables/${
|
|
750
|
+
return k(await this.request(`/v1/variables/${Q(e)}`, {
|
|
711
751
|
body: JSON.stringify({ value: t }),
|
|
712
752
|
method: "PUT"
|
|
713
753
|
}));
|
|
714
754
|
}
|
|
715
755
|
async deleteVariable(e) {
|
|
716
|
-
let t = a(await this.request(`/v1/variables/${
|
|
756
|
+
let t = a(await this.request(`/v1/variables/${Q(e)}`, { method: "DELETE" }));
|
|
717
757
|
if (s(t, ["version"]), t.version != 1) return i();
|
|
718
758
|
}
|
|
719
759
|
async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
|
|
@@ -727,10 +767,10 @@ var Q = class {
|
|
|
727
767
|
}));
|
|
728
768
|
}
|
|
729
769
|
async getFlow(e) {
|
|
730
|
-
return D(await this.request(`/v1/flows/${
|
|
770
|
+
return D(await this.request(`/v1/flows/${Q(e)}`));
|
|
731
771
|
}
|
|
732
772
|
async renameFlow(e, t) {
|
|
733
|
-
return D(await this.request(`/v1/flows/${
|
|
773
|
+
return D(await this.request(`/v1/flows/${Q(e)}`, {
|
|
734
774
|
body: JSON.stringify({
|
|
735
775
|
name: t,
|
|
736
776
|
version: 1
|
|
@@ -739,7 +779,7 @@ var Q = class {
|
|
|
739
779
|
}));
|
|
740
780
|
}
|
|
741
781
|
async deleteFlow(e) {
|
|
742
|
-
return D(await this.request(`/v1/flows/${
|
|
782
|
+
return D(await this.request(`/v1/flows/${Q(e)}`, { method: "DELETE" }));
|
|
743
783
|
}
|
|
744
784
|
async listTriggerKeys(e) {
|
|
745
785
|
let t = a(await this.request("/v1/trigger-keys", { signal: e }));
|
|
@@ -750,52 +790,51 @@ var Q = class {
|
|
|
750
790
|
return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
|
|
751
791
|
}
|
|
752
792
|
async getTriggerKey(e, t) {
|
|
753
|
-
let n = a(await this.request(`/v1/trigger-keys/${
|
|
793
|
+
let n = a(await this.request(`/v1/trigger-keys/${Q(e)}`, { signal: t }));
|
|
754
794
|
return n.version == 1 ? _(n.definition) : i();
|
|
755
795
|
}
|
|
756
796
|
async listFlowTriggerBindings(e) {
|
|
757
|
-
let t = a(await this.request(`/v1/flows/${
|
|
797
|
+
let t = a(await this.request(`/v1/flows/${Q(e)}/triggers`));
|
|
758
798
|
return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
|
|
759
799
|
}
|
|
760
800
|
async getFlowTriggerBinding(e, t) {
|
|
761
|
-
return C(await this.request(`/v1/flows/${
|
|
801
|
+
return C(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}`));
|
|
762
802
|
}
|
|
763
803
|
async listFlowTriggerActivities(e, t, n = {}) {
|
|
764
804
|
let r = new URLSearchParams();
|
|
765
805
|
n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
|
|
766
806
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
767
|
-
return T(await this.request(`/v1/flows/${
|
|
807
|
+
return T(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/activities${i}`));
|
|
768
808
|
}
|
|
769
809
|
async pauseFlowTrigger(e, t) {
|
|
770
|
-
return S(await this.request(`/v1/flows/${
|
|
810
|
+
return S(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/pause`, {
|
|
771
811
|
body: JSON.stringify({ version: 1 }),
|
|
772
812
|
method: "POST"
|
|
773
813
|
}));
|
|
774
814
|
}
|
|
775
815
|
async resumeFlowTrigger(e, t) {
|
|
776
|
-
return S(await this.request(`/v1/flows/${
|
|
816
|
+
return S(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/resume`, {
|
|
777
817
|
body: JSON.stringify({ version: 1 }),
|
|
778
818
|
method: "POST"
|
|
779
819
|
}));
|
|
780
820
|
}
|
|
781
821
|
async testFlowPollTrigger(e, t) {
|
|
782
|
-
return E(await this.request(`/v1/flows/${
|
|
822
|
+
return E(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/test`, {
|
|
783
823
|
body: JSON.stringify({ version: 1 }),
|
|
784
824
|
method: "POST"
|
|
785
825
|
}));
|
|
786
826
|
}
|
|
787
827
|
async getDraft(e) {
|
|
788
|
-
return j(await this.request(`/v1/flows/${
|
|
828
|
+
return j(await this.request(`/v1/flows/${Q(e)}/draft`));
|
|
789
829
|
}
|
|
790
|
-
async syncDraft(e
|
|
791
|
-
|
|
792
|
-
return N(await this.request(`/v1/flows/${X(e)}/draft/sync${n}`));
|
|
830
|
+
async syncDraft(e) {
|
|
831
|
+
return N(await this.request(`/v1/flows/${Q(e)}/draft/sync`));
|
|
793
832
|
}
|
|
794
833
|
async getRevision(e, t) {
|
|
795
|
-
return j(await this.request(`/v1/flows/${
|
|
834
|
+
return j(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}`));
|
|
796
835
|
}
|
|
797
836
|
async listConnectorProviders(e, t) {
|
|
798
|
-
let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${
|
|
837
|
+
let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Q(t)}`}`, { signal: e }));
|
|
799
838
|
return s(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? i() : n.providers.map(h);
|
|
800
839
|
}
|
|
801
840
|
async listConnectorActions(e, t, n) {
|
|
@@ -811,11 +850,11 @@ var Q = class {
|
|
|
811
850
|
}, t);
|
|
812
851
|
}
|
|
813
852
|
async getConnectorAction(e, t, n) {
|
|
814
|
-
let r = a(await this.request(`/v1/connector/actions/${
|
|
853
|
+
let r = a(await this.request(`/v1/connector/actions/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
|
|
815
854
|
return s(r, ["action", "version"]), r.version == 1 ? m(r.action) : i();
|
|
816
855
|
}
|
|
817
856
|
async listConnectorConnections(e, t, n) {
|
|
818
|
-
let r = a(await this.request(`/v1/connector/connections/${
|
|
857
|
+
let r = a(await this.request(`/v1/connector/connections/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
|
|
819
858
|
return s(r, [
|
|
820
859
|
"connections",
|
|
821
860
|
"serviceId",
|
|
@@ -823,7 +862,7 @@ var Q = class {
|
|
|
823
862
|
]), r.version != 1 || o(r.serviceId) != e || !Array.isArray(r.connections) ? i() : r.connections.map(u);
|
|
824
863
|
}
|
|
825
864
|
async createConnectorConnectionPage(e, t) {
|
|
826
|
-
let n = a(await this.request(`/v1/connector/connections/${
|
|
865
|
+
let n = a(await this.request(`/v1/connector/connections/${Q(e)}/page${t == null ? "" : `?flowId=${Q(t)}`}`, {
|
|
827
866
|
body: JSON.stringify({ version: 1 }),
|
|
828
867
|
method: "POST"
|
|
829
868
|
}));
|
|
@@ -835,18 +874,19 @@ var Q = class {
|
|
|
835
874
|
return i();
|
|
836
875
|
}
|
|
837
876
|
}
|
|
838
|
-
async changeDraft(e, t, n) {
|
|
839
|
-
return M(await this.request(`/v1/flows/${
|
|
877
|
+
async changeDraft(e, t, n, r = $("change")) {
|
|
878
|
+
return M(await this.request(`/v1/flows/${Q(e)}/draft/changes`, {
|
|
840
879
|
body: JSON.stringify({
|
|
841
880
|
expectedRevisionId: t,
|
|
842
881
|
operations: n,
|
|
843
882
|
version: 1
|
|
844
883
|
}),
|
|
884
|
+
headers: { "idempotency-key": r },
|
|
845
885
|
method: "POST"
|
|
846
886
|
}));
|
|
847
887
|
}
|
|
848
888
|
async checkFlow(e, t) {
|
|
849
|
-
return L(await this.request(`/v1/flows/${
|
|
889
|
+
return L(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/check`, {
|
|
850
890
|
body: JSON.stringify({
|
|
851
891
|
engineContract: "open-flow-engine/v1",
|
|
852
892
|
version: 1
|
|
@@ -855,88 +895,97 @@ var Q = class {
|
|
|
855
895
|
}));
|
|
856
896
|
}
|
|
857
897
|
async getLive(e) {
|
|
858
|
-
return R(await this.request(`/v1/flows/${
|
|
898
|
+
return R(await this.request(`/v1/flows/${Q(e)}/live`));
|
|
859
899
|
}
|
|
860
900
|
async listPublications(e, t = {}) {
|
|
861
901
|
let n = new URLSearchParams();
|
|
862
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));
|
|
863
903
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
864
|
-
return z(await this.request(`/v1/flows/${
|
|
904
|
+
return z(await this.request(`/v1/flows/${Q(e)}/publications${r}`));
|
|
865
905
|
}
|
|
866
906
|
async createDraftRun(e, t, n = {}) {
|
|
867
|
-
let r =
|
|
907
|
+
let r = W(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/runs`, {
|
|
868
908
|
body: JSON.stringify({
|
|
869
909
|
engineContract: "open-flow-engine/v1",
|
|
870
910
|
inputs: n.inputs ?? {},
|
|
871
911
|
version: 1
|
|
872
912
|
}),
|
|
873
|
-
headers: { "idempotency-key": n.idempotencyKey ??
|
|
913
|
+
headers: { "idempotency-key": n.idempotencyKey ?? $("run") },
|
|
874
914
|
method: "POST"
|
|
875
915
|
}));
|
|
876
916
|
return r.source == "draft" ? r : i();
|
|
877
917
|
}
|
|
878
918
|
async createLiveRun(e, t = {}) {
|
|
879
|
-
let n =
|
|
919
|
+
let n = W(await this.request("/v1/runs", {
|
|
880
920
|
body: JSON.stringify({
|
|
881
921
|
inputs: t.inputs ?? {},
|
|
882
922
|
publicationId: e,
|
|
883
923
|
version: 1
|
|
884
924
|
}),
|
|
885
|
-
headers: { "idempotency-key": t.idempotencyKey ??
|
|
925
|
+
headers: { "idempotency-key": t.idempotencyKey ?? $("run") },
|
|
886
926
|
method: "POST"
|
|
887
927
|
}));
|
|
888
928
|
return n.source == "live" ? n : i();
|
|
889
929
|
}
|
|
890
930
|
async publishFlow(e, t, n, r = {}) {
|
|
891
|
-
return F(await this.request(`/v1/flows/${
|
|
931
|
+
return F(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/publications`, {
|
|
892
932
|
body: JSON.stringify({
|
|
893
933
|
engineContract: "open-flow-engine/v1",
|
|
894
934
|
expectedLivePublicationId: n,
|
|
895
935
|
version: 1
|
|
896
936
|
}),
|
|
897
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
937
|
+
headers: { "idempotency-key": r.idempotencyKey ?? $("publication") },
|
|
898
938
|
method: "POST"
|
|
899
939
|
}));
|
|
900
940
|
}
|
|
901
941
|
async getPublishOperation(e, t) {
|
|
902
|
-
return F(await this.request(`/v1/flows/${
|
|
942
|
+
return F(await this.request(`/v1/flows/${Q(e)}/publish-operations/${Q(t)}`));
|
|
903
943
|
}
|
|
904
944
|
async rollbackFlow(e, t, n, r = {}) {
|
|
905
|
-
return P(await this.request(`/v1/flows/${
|
|
945
|
+
return P(await this.request(`/v1/flows/${Q(e)}/publications/${Q(t)}/rollback`, {
|
|
906
946
|
body: JSON.stringify({
|
|
907
947
|
expectedLivePublicationId: n,
|
|
908
948
|
version: 1
|
|
909
949
|
}),
|
|
910
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
950
|
+
headers: { "idempotency-key": r.idempotencyKey ?? $("publication") },
|
|
911
951
|
method: "POST"
|
|
912
952
|
}));
|
|
913
953
|
}
|
|
914
954
|
async getRun(e) {
|
|
915
|
-
return
|
|
955
|
+
return W(await this.request(`/v1/runs/${Q(e)}`));
|
|
916
956
|
}
|
|
917
957
|
async listRuns(e, t = {}) {
|
|
918
958
|
let n = new URLSearchParams();
|
|
919
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);
|
|
920
960
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
921
|
-
return
|
|
961
|
+
return G(await this.request(`/v1/flows/${Q(e)}/runs${r}`));
|
|
922
962
|
}
|
|
923
963
|
async getRunEvents(e, t = {}) {
|
|
924
964
|
let n = new URLSearchParams();
|
|
925
965
|
t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
|
|
926
966
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
927
|
-
return
|
|
967
|
+
return J(await this.request(`/v1/runs/${Q(e)}/events${r}`));
|
|
928
968
|
}
|
|
929
969
|
async getRunResult(e) {
|
|
930
|
-
return
|
|
970
|
+
return Z(await this.request(`/v1/runs/${Q(e)}/result`));
|
|
931
971
|
}
|
|
932
972
|
async cancelRun(e) {
|
|
933
|
-
return
|
|
973
|
+
return Y(await this.request(`/v1/runs/${Q(e)}/cancel`, {
|
|
934
974
|
body: JSON.stringify({ version: 1 }),
|
|
935
975
|
method: "POST"
|
|
936
976
|
}));
|
|
937
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
|
+
}
|
|
938
987
|
async connectorActions(e, t) {
|
|
939
|
-
let n = Object.entries(e).map(([e, 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 }));
|
|
940
989
|
return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
|
|
941
990
|
}
|
|
942
991
|
async request(e, t = {}) {
|
|
@@ -959,4 +1008,4 @@ var Q = class {
|
|
|
959
1008
|
}
|
|
960
1009
|
};
|
|
961
1010
|
//#endregion
|
|
962
|
-
export { r as ApiError,
|
|
1011
|
+
export { r as ApiError, ee as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
|
|
@@ -89,19 +89,31 @@ function d(e) {
|
|
|
89
89
|
kind: e.kind,
|
|
90
90
|
subflowId: e.subflowId
|
|
91
91
|
};
|
|
92
|
-
case "task":
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
case "task": {
|
|
93
|
+
let n = e.task == null ? Object.assign({}, t, {
|
|
94
|
+
kind: e.kind,
|
|
95
|
+
taskId: e.taskId
|
|
96
|
+
}) : Object.assign({}, t, {
|
|
97
|
+
kind: e.kind,
|
|
98
|
+
task: m(e.task)
|
|
99
|
+
});
|
|
100
|
+
return e.additionalInputs != null && (n.additionalInputs = s(e.additionalInputs)), n;
|
|
101
|
+
}
|
|
102
|
+
case "value": return {
|
|
97
103
|
...t,
|
|
98
104
|
kind: e.kind,
|
|
99
|
-
|
|
105
|
+
values: s(e.values)
|
|
100
106
|
};
|
|
101
|
-
case "
|
|
107
|
+
case "wait": return {
|
|
102
108
|
...t,
|
|
109
|
+
actions: e.actions,
|
|
103
110
|
kind: e.kind,
|
|
104
|
-
|
|
111
|
+
...e.notification == null ? {} : { notification: {
|
|
112
|
+
inputs: l(e.notification.inputs),
|
|
113
|
+
messageHandle: e.notification.messageHandle,
|
|
114
|
+
taskId: e.notification.taskId
|
|
115
|
+
} },
|
|
116
|
+
prompt: e.prompt
|
|
105
117
|
};
|
|
106
118
|
}
|
|
107
119
|
}
|
|
@@ -11,6 +11,7 @@ export interface SemanticClosure {
|
|
|
11
11
|
};
|
|
12
12
|
readonly digest: string;
|
|
13
13
|
}
|
|
14
|
+
export declare function flowDependencies(content: RevisionContent): SemanticClosure['dependencies'];
|
|
14
15
|
export declare function flowClosure(content: RevisionContent): Promise<SemanticClosure>;
|
|
15
16
|
export declare function variableBindings(revision: RevisionContent, bindingIds: Iterable<string>): Readonly<Record<string, string>>;
|
|
16
17
|
export interface Diagnostic {
|