@oomol-lab/open-flow 0.1.0-beta.1 → 0.1.0-beta.2
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/{createResourceDialog-DXQz0thK.js → createResourceDialog-BkZns-oZ.js} +1 -1
- package/dist/browser/{diagnostics-BGoGFvHA.js → diagnostics-giPSzyMo.js} +678 -569
- package/dist/browser/{esm-DGQbgYoJ.js → esm-B_PbUobB.js} +1 -1
- package/dist/browser/flow-authoring-node.d.ts +1 -1
- package/dist/browser/flow-authoring.js +14 -4
- package/dist/browser/{flowWorkspace-DwyxAOBH.js → flowWorkspace-DAMLVMcF.js} +9580 -9611
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +2 -1
- package/dist/browser/workbench.js +500 -500
- package/dist/common/control-api-conformance.js +35 -25
- package/dist/common/control-api-errors.d.ts +8 -0
- package/dist/common/control-api.d.ts +34 -1
- package/dist/common/control-api.js +139 -64
- package/dist/common/flow-semantics.js +2 -9
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/provider-triggers.js +4 -1
- package/package.json +1 -1
|
@@ -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",
|
|
@@ -52,6 +54,8 @@ var e = {
|
|
|
52
54
|
[e.pageInvalidCursor]: { status: 400 },
|
|
53
55
|
[e.publicationConflict]: { status: 409 },
|
|
54
56
|
[e.publicationNotFound]: { status: 404 },
|
|
57
|
+
[e.publicationUnsupported]: { status: 409 },
|
|
58
|
+
[e.publishOperationNotFound]: { status: 404 },
|
|
55
59
|
[e.routeNotFound]: { status: 404 },
|
|
56
60
|
[e.runConflict]: { status: 409 },
|
|
57
61
|
[e.runEventsExpired]: { status: 410 },
|
|
@@ -142,6 +146,7 @@ function m(e) {
|
|
|
142
146
|
let t = a(e), n = t.icon, r = t.defaultConnection != null;
|
|
143
147
|
if (s(t, [
|
|
144
148
|
"actionId",
|
|
149
|
+
"authenticated",
|
|
145
150
|
...r ? ["defaultConnection"] : [],
|
|
146
151
|
"description",
|
|
147
152
|
...n == null ? [] : ["icon"],
|
|
@@ -153,6 +158,7 @@ function m(e) {
|
|
|
153
158
|
]), n != null && typeof n != "string") return i();
|
|
154
159
|
let c = {
|
|
155
160
|
actionId: o(t.actionId),
|
|
161
|
+
authenticated: typeof t.authenticated == "boolean" ? t.authenticated : i(),
|
|
156
162
|
...r ? { defaultConnection: u(t.defaultConnection) } : {},
|
|
157
163
|
description: typeof t.description == "string" ? t.description : i(),
|
|
158
164
|
...n == null ? {} : { icon: n },
|
|
@@ -419,6 +425,72 @@ function P(e) {
|
|
|
419
425
|
};
|
|
420
426
|
}
|
|
421
427
|
function F(e) {
|
|
428
|
+
let t = a(e), n = t.status, r = {
|
|
429
|
+
createdAt: o(t.createdAt),
|
|
430
|
+
flowId: o(t.flowId),
|
|
431
|
+
operationId: o(t.operationId),
|
|
432
|
+
revisionId: o(t.revisionId),
|
|
433
|
+
updatedAt: o(t.updatedAt),
|
|
434
|
+
version: 1
|
|
435
|
+
};
|
|
436
|
+
if (t.version != 1) return i();
|
|
437
|
+
switch (n) {
|
|
438
|
+
case "pending": return s(t, [
|
|
439
|
+
"createdAt",
|
|
440
|
+
"flowId",
|
|
441
|
+
"operationId",
|
|
442
|
+
"revisionId",
|
|
443
|
+
"status",
|
|
444
|
+
"updatedAt",
|
|
445
|
+
"version"
|
|
446
|
+
]), {
|
|
447
|
+
...r,
|
|
448
|
+
status: n
|
|
449
|
+
};
|
|
450
|
+
case "succeeded": return s(t, [
|
|
451
|
+
"createdAt",
|
|
452
|
+
"flowId",
|
|
453
|
+
"operationId",
|
|
454
|
+
"publicationId",
|
|
455
|
+
"revisionId",
|
|
456
|
+
"status",
|
|
457
|
+
"updatedAt",
|
|
458
|
+
"version"
|
|
459
|
+
]), {
|
|
460
|
+
...r,
|
|
461
|
+
publicationId: o(t.publicationId),
|
|
462
|
+
status: n
|
|
463
|
+
};
|
|
464
|
+
case "failed": {
|
|
465
|
+
s(t, [
|
|
466
|
+
"createdAt",
|
|
467
|
+
"flowId",
|
|
468
|
+
"issue",
|
|
469
|
+
"operationId",
|
|
470
|
+
"revisionId",
|
|
471
|
+
"status",
|
|
472
|
+
"updatedAt",
|
|
473
|
+
"version"
|
|
474
|
+
]);
|
|
475
|
+
let e = a(t.issue), i = e.nodeId;
|
|
476
|
+
return s(e, [
|
|
477
|
+
"code",
|
|
478
|
+
"message",
|
|
479
|
+
...i == null ? [] : ["nodeId"]
|
|
480
|
+
]), {
|
|
481
|
+
...r,
|
|
482
|
+
issue: {
|
|
483
|
+
code: o(e.code),
|
|
484
|
+
message: o(e.message),
|
|
485
|
+
...i == null ? {} : { nodeId: o(i) }
|
|
486
|
+
},
|
|
487
|
+
status: n
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
default: return i();
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
function I(e) {
|
|
422
494
|
let t = a(e), n = t.values == null ? void 0 : a(t.values);
|
|
423
495
|
return {
|
|
424
496
|
code: o(t.code),
|
|
@@ -429,11 +501,11 @@ function F(e) {
|
|
|
429
501
|
...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : i()])) }
|
|
430
502
|
};
|
|
431
503
|
}
|
|
432
|
-
function
|
|
504
|
+
function L(e) {
|
|
433
505
|
let t = a(e);
|
|
434
506
|
return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? i() : {
|
|
435
507
|
closureDigest: o(t.closureDigest),
|
|
436
|
-
diagnostics: t.diagnostics.map(
|
|
508
|
+
diagnostics: t.diagnostics.map(I),
|
|
437
509
|
engineContract: o(t.engineContract),
|
|
438
510
|
flowId: o(t.flowId),
|
|
439
511
|
modelVersion: c(t.modelVersion),
|
|
@@ -443,7 +515,7 @@ function I(e) {
|
|
|
443
515
|
version: 1
|
|
444
516
|
};
|
|
445
517
|
}
|
|
446
|
-
function
|
|
518
|
+
function R(e) {
|
|
447
519
|
let t = a(e), n = t.status, r = t.publication;
|
|
448
520
|
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
521
|
flowId: o(t.flowId),
|
|
@@ -454,7 +526,7 @@ function L(e) {
|
|
|
454
526
|
version: 1
|
|
455
527
|
};
|
|
456
528
|
}
|
|
457
|
-
function
|
|
529
|
+
function z(e) {
|
|
458
530
|
let t = a(e), n = t.nextCursor, r = t.total;
|
|
459
531
|
return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
|
|
460
532
|
...n == null ? {} : { nextCursor: n },
|
|
@@ -463,11 +535,11 @@ function R(e) {
|
|
|
463
535
|
version: 1
|
|
464
536
|
};
|
|
465
537
|
}
|
|
466
|
-
var
|
|
467
|
-
function B(e) {
|
|
468
|
-
return typeof e == "string" && z.has(e) ? e : i();
|
|
469
|
-
}
|
|
538
|
+
var B = new Set(n);
|
|
470
539
|
function V(e) {
|
|
540
|
+
return typeof e == "string" && B.has(e) ? e : i();
|
|
541
|
+
}
|
|
542
|
+
function H(e) {
|
|
471
543
|
let t = a(e), n = t.source, r = t.startedAt, s = t.finishedAt;
|
|
472
544
|
return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || s != null && typeof s != "string" ? i() : {
|
|
473
545
|
createdAt: o(t.createdAt),
|
|
@@ -477,12 +549,12 @@ function V(e) {
|
|
|
477
549
|
runId: o(t.runId),
|
|
478
550
|
source: n,
|
|
479
551
|
...r == null ? {} : { startedAt: r },
|
|
480
|
-
status:
|
|
552
|
+
status: V(t.status),
|
|
481
553
|
version: 1
|
|
482
554
|
};
|
|
483
555
|
}
|
|
484
|
-
function
|
|
485
|
-
let t = a(e), n =
|
|
556
|
+
function U(e) {
|
|
557
|
+
let t = a(e), n = H(t), r = t.eventsExpiresAt;
|
|
486
558
|
if (r != null && typeof r != "string") return i();
|
|
487
559
|
let s = {
|
|
488
560
|
...n,
|
|
@@ -512,16 +584,16 @@ function H(e) {
|
|
|
512
584
|
};
|
|
513
585
|
}
|
|
514
586
|
}
|
|
515
|
-
function
|
|
587
|
+
function W(e) {
|
|
516
588
|
let t = a(e), n = t.nextCursor;
|
|
517
589
|
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
|
|
518
590
|
flowId: o(t.flowId),
|
|
519
591
|
...n == null ? {} : { nextCursor: n },
|
|
520
|
-
runs: t.runs.map(
|
|
592
|
+
runs: t.runs.map(H),
|
|
521
593
|
version: 1
|
|
522
594
|
};
|
|
523
595
|
}
|
|
524
|
-
var
|
|
596
|
+
var G = /* @__PURE__ */ new Set([
|
|
525
597
|
"node.artifact",
|
|
526
598
|
"node.completed",
|
|
527
599
|
"node.failed",
|
|
@@ -538,9 +610,9 @@ var W = /* @__PURE__ */ new Set([
|
|
|
538
610
|
"run.queued",
|
|
539
611
|
"run.started"
|
|
540
612
|
]);
|
|
541
|
-
function
|
|
613
|
+
function K(e) {
|
|
542
614
|
let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
|
|
543
|
-
return typeof n != "string" || !
|
|
615
|
+
return typeof n != "string" || !G.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
|
|
544
616
|
createdAt: o(t.createdAt),
|
|
545
617
|
kind: n,
|
|
546
618
|
payload: a(t.payload),
|
|
@@ -548,11 +620,11 @@ function G(e) {
|
|
|
548
620
|
...s == null ? {} : { sourceSequence: s }
|
|
549
621
|
};
|
|
550
622
|
}
|
|
551
|
-
function
|
|
623
|
+
function q(e) {
|
|
552
624
|
let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
|
|
553
625
|
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
626
|
done: t.done,
|
|
555
|
-
events: t.events.map(
|
|
627
|
+
events: t.events.map(K),
|
|
556
628
|
...n == null ? {} : { eventsExpiresAt: n },
|
|
557
629
|
historyComplete: t.historyComplete,
|
|
558
630
|
nextAfter: r,
|
|
@@ -560,8 +632,8 @@ function K(e) {
|
|
|
560
632
|
version: 1
|
|
561
633
|
};
|
|
562
634
|
}
|
|
563
|
-
function
|
|
564
|
-
let t = a(e), n =
|
|
635
|
+
function J(e) {
|
|
636
|
+
let t = a(e), n = V(t.status);
|
|
565
637
|
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
|
|
566
638
|
cancelAccepted: t.cancelAccepted,
|
|
567
639
|
runId: o(t.runId),
|
|
@@ -569,7 +641,7 @@ function q(e) {
|
|
|
569
641
|
version: 1
|
|
570
642
|
};
|
|
571
643
|
}
|
|
572
|
-
function
|
|
644
|
+
function Y(e) {
|
|
573
645
|
let t = a(e), n = t.status;
|
|
574
646
|
if (t.version != 1) return i();
|
|
575
647
|
let r = {
|
|
@@ -610,11 +682,11 @@ function J(e) {
|
|
|
610
682
|
}
|
|
611
683
|
return i();
|
|
612
684
|
}
|
|
613
|
-
var
|
|
614
|
-
function
|
|
685
|
+
var X = encodeURIComponent;
|
|
686
|
+
function Z(e) {
|
|
615
687
|
return `${e}-${crypto.randomUUID()}`;
|
|
616
688
|
}
|
|
617
|
-
var
|
|
689
|
+
var Q = class {
|
|
618
690
|
constructor(e) {
|
|
619
691
|
this.requestControl = e;
|
|
620
692
|
}
|
|
@@ -632,16 +704,16 @@ var Z = class {
|
|
|
632
704
|
};
|
|
633
705
|
}
|
|
634
706
|
async getVariable(e) {
|
|
635
|
-
return k(await this.request(`/v1/variables/${
|
|
707
|
+
return k(await this.request(`/v1/variables/${X(e)}`));
|
|
636
708
|
}
|
|
637
709
|
async putVariable(e, t) {
|
|
638
|
-
return k(await this.request(`/v1/variables/${
|
|
710
|
+
return k(await this.request(`/v1/variables/${X(e)}`, {
|
|
639
711
|
body: JSON.stringify({ value: t }),
|
|
640
712
|
method: "PUT"
|
|
641
713
|
}));
|
|
642
714
|
}
|
|
643
715
|
async deleteVariable(e) {
|
|
644
|
-
let t = a(await this.request(`/v1/variables/${
|
|
716
|
+
let t = a(await this.request(`/v1/variables/${X(e)}`, { method: "DELETE" }));
|
|
645
717
|
if (s(t, ["version"]), t.version != 1) return i();
|
|
646
718
|
}
|
|
647
719
|
async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
|
|
@@ -655,10 +727,10 @@ var Z = class {
|
|
|
655
727
|
}));
|
|
656
728
|
}
|
|
657
729
|
async getFlow(e) {
|
|
658
|
-
return D(await this.request(`/v1/flows/${
|
|
730
|
+
return D(await this.request(`/v1/flows/${X(e)}`));
|
|
659
731
|
}
|
|
660
732
|
async renameFlow(e, t) {
|
|
661
|
-
return D(await this.request(`/v1/flows/${
|
|
733
|
+
return D(await this.request(`/v1/flows/${X(e)}`, {
|
|
662
734
|
body: JSON.stringify({
|
|
663
735
|
name: t,
|
|
664
736
|
version: 1
|
|
@@ -667,7 +739,7 @@ var Z = class {
|
|
|
667
739
|
}));
|
|
668
740
|
}
|
|
669
741
|
async deleteFlow(e) {
|
|
670
|
-
return D(await this.request(`/v1/flows/${
|
|
742
|
+
return D(await this.request(`/v1/flows/${X(e)}`, { method: "DELETE" }));
|
|
671
743
|
}
|
|
672
744
|
async listTriggerKeys(e) {
|
|
673
745
|
let t = a(await this.request("/v1/trigger-keys", { signal: e }));
|
|
@@ -678,52 +750,52 @@ var Z = class {
|
|
|
678
750
|
return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
|
|
679
751
|
}
|
|
680
752
|
async getTriggerKey(e, t) {
|
|
681
|
-
let n = a(await this.request(`/v1/trigger-keys/${
|
|
753
|
+
let n = a(await this.request(`/v1/trigger-keys/${X(e)}`, { signal: t }));
|
|
682
754
|
return n.version == 1 ? _(n.definition) : i();
|
|
683
755
|
}
|
|
684
756
|
async listFlowTriggerBindings(e) {
|
|
685
|
-
let t = a(await this.request(`/v1/flows/${
|
|
757
|
+
let t = a(await this.request(`/v1/flows/${X(e)}/triggers`));
|
|
686
758
|
return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
|
|
687
759
|
}
|
|
688
760
|
async getFlowTriggerBinding(e, t) {
|
|
689
|
-
return C(await this.request(`/v1/flows/${
|
|
761
|
+
return C(await this.request(`/v1/flows/${X(e)}/triggers/${X(t)}`));
|
|
690
762
|
}
|
|
691
763
|
async listFlowTriggerActivities(e, t, n = {}) {
|
|
692
764
|
let r = new URLSearchParams();
|
|
693
765
|
n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
|
|
694
766
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
695
|
-
return T(await this.request(`/v1/flows/${
|
|
767
|
+
return T(await this.request(`/v1/flows/${X(e)}/triggers/${X(t)}/activities${i}`));
|
|
696
768
|
}
|
|
697
769
|
async pauseFlowTrigger(e, t) {
|
|
698
|
-
return S(await this.request(`/v1/flows/${
|
|
770
|
+
return S(await this.request(`/v1/flows/${X(e)}/triggers/${X(t)}/pause`, {
|
|
699
771
|
body: JSON.stringify({ version: 1 }),
|
|
700
772
|
method: "POST"
|
|
701
773
|
}));
|
|
702
774
|
}
|
|
703
775
|
async resumeFlowTrigger(e, t) {
|
|
704
|
-
return S(await this.request(`/v1/flows/${
|
|
776
|
+
return S(await this.request(`/v1/flows/${X(e)}/triggers/${X(t)}/resume`, {
|
|
705
777
|
body: JSON.stringify({ version: 1 }),
|
|
706
778
|
method: "POST"
|
|
707
779
|
}));
|
|
708
780
|
}
|
|
709
781
|
async testFlowPollTrigger(e, t) {
|
|
710
|
-
return E(await this.request(`/v1/flows/${
|
|
782
|
+
return E(await this.request(`/v1/flows/${X(e)}/triggers/${X(t)}/test`, {
|
|
711
783
|
body: JSON.stringify({ version: 1 }),
|
|
712
784
|
method: "POST"
|
|
713
785
|
}));
|
|
714
786
|
}
|
|
715
787
|
async getDraft(e) {
|
|
716
|
-
return j(await this.request(`/v1/flows/${
|
|
788
|
+
return j(await this.request(`/v1/flows/${X(e)}/draft`));
|
|
717
789
|
}
|
|
718
790
|
async syncDraft(e, t) {
|
|
719
|
-
let n = t == null ? "" : `?fromRevisionId=${
|
|
720
|
-
return N(await this.request(`/v1/flows/${
|
|
791
|
+
let n = t == null ? "" : `?fromRevisionId=${X(t)}`;
|
|
792
|
+
return N(await this.request(`/v1/flows/${X(e)}/draft/sync${n}`));
|
|
721
793
|
}
|
|
722
794
|
async getRevision(e, t) {
|
|
723
|
-
return j(await this.request(`/v1/flows/${
|
|
795
|
+
return j(await this.request(`/v1/flows/${X(e)}/revisions/${X(t)}`));
|
|
724
796
|
}
|
|
725
797
|
async listConnectorProviders(e, t) {
|
|
726
|
-
let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${
|
|
798
|
+
let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${X(t)}`}`, { signal: e }));
|
|
727
799
|
return s(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? i() : n.providers.map(h);
|
|
728
800
|
}
|
|
729
801
|
async listConnectorActions(e, t, n) {
|
|
@@ -739,11 +811,11 @@ var Z = class {
|
|
|
739
811
|
}, t);
|
|
740
812
|
}
|
|
741
813
|
async getConnectorAction(e, t, n) {
|
|
742
|
-
let r = a(await this.request(`/v1/connector/actions/${
|
|
814
|
+
let r = a(await this.request(`/v1/connector/actions/${X(e)}${n == null ? "" : `?flowId=${X(n)}`}`, { signal: t }));
|
|
743
815
|
return s(r, ["action", "version"]), r.version == 1 ? m(r.action) : i();
|
|
744
816
|
}
|
|
745
817
|
async listConnectorConnections(e, t, n) {
|
|
746
|
-
let r = a(await this.request(`/v1/connector/connections/${
|
|
818
|
+
let r = a(await this.request(`/v1/connector/connections/${X(e)}${n == null ? "" : `?flowId=${X(n)}`}`, { signal: t }));
|
|
747
819
|
return s(r, [
|
|
748
820
|
"connections",
|
|
749
821
|
"serviceId",
|
|
@@ -751,7 +823,7 @@ var Z = class {
|
|
|
751
823
|
]), r.version != 1 || o(r.serviceId) != e || !Array.isArray(r.connections) ? i() : r.connections.map(u);
|
|
752
824
|
}
|
|
753
825
|
async createConnectorConnectionPage(e, t) {
|
|
754
|
-
let n = a(await this.request(`/v1/connector/connections/${
|
|
826
|
+
let n = a(await this.request(`/v1/connector/connections/${X(e)}/page${t == null ? "" : `?flowId=${X(t)}`}`, {
|
|
755
827
|
body: JSON.stringify({ version: 1 }),
|
|
756
828
|
method: "POST"
|
|
757
829
|
}));
|
|
@@ -764,7 +836,7 @@ var Z = class {
|
|
|
764
836
|
}
|
|
765
837
|
}
|
|
766
838
|
async changeDraft(e, t, n) {
|
|
767
|
-
return M(await this.request(`/v1/flows/${
|
|
839
|
+
return M(await this.request(`/v1/flows/${X(e)}/draft/changes`, {
|
|
768
840
|
body: JSON.stringify({
|
|
769
841
|
expectedRevisionId: t,
|
|
770
842
|
operations: n,
|
|
@@ -774,7 +846,7 @@ var Z = class {
|
|
|
774
846
|
}));
|
|
775
847
|
}
|
|
776
848
|
async checkFlow(e, t) {
|
|
777
|
-
return
|
|
849
|
+
return L(await this.request(`/v1/flows/${X(e)}/revisions/${X(t)}/check`, {
|
|
778
850
|
body: JSON.stringify({
|
|
779
851
|
engineContract: "open-flow-engine/v1",
|
|
780
852
|
version: 1
|
|
@@ -783,85 +855,88 @@ var Z = class {
|
|
|
783
855
|
}));
|
|
784
856
|
}
|
|
785
857
|
async getLive(e) {
|
|
786
|
-
return
|
|
858
|
+
return R(await this.request(`/v1/flows/${X(e)}/live`));
|
|
787
859
|
}
|
|
788
860
|
async listPublications(e, t = {}) {
|
|
789
861
|
let n = new URLSearchParams();
|
|
790
862
|
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
863
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
792
|
-
return
|
|
864
|
+
return z(await this.request(`/v1/flows/${X(e)}/publications${r}`));
|
|
793
865
|
}
|
|
794
866
|
async createDraftRun(e, t, n = {}) {
|
|
795
|
-
let r =
|
|
867
|
+
let r = U(await this.request(`/v1/flows/${X(e)}/revisions/${X(t)}/runs`, {
|
|
796
868
|
body: JSON.stringify({
|
|
797
869
|
engineContract: "open-flow-engine/v1",
|
|
798
870
|
inputs: n.inputs ?? {},
|
|
799
871
|
version: 1
|
|
800
872
|
}),
|
|
801
|
-
headers: { "idempotency-key": n.idempotencyKey ??
|
|
873
|
+
headers: { "idempotency-key": n.idempotencyKey ?? Z("run") },
|
|
802
874
|
method: "POST"
|
|
803
875
|
}));
|
|
804
876
|
return r.source == "draft" ? r : i();
|
|
805
877
|
}
|
|
806
878
|
async createLiveRun(e, t = {}) {
|
|
807
|
-
let n =
|
|
879
|
+
let n = U(await this.request("/v1/runs", {
|
|
808
880
|
body: JSON.stringify({
|
|
809
881
|
inputs: t.inputs ?? {},
|
|
810
882
|
publicationId: e,
|
|
811
883
|
version: 1
|
|
812
884
|
}),
|
|
813
|
-
headers: { "idempotency-key": t.idempotencyKey ??
|
|
885
|
+
headers: { "idempotency-key": t.idempotencyKey ?? Z("run") },
|
|
814
886
|
method: "POST"
|
|
815
887
|
}));
|
|
816
888
|
return n.source == "live" ? n : i();
|
|
817
889
|
}
|
|
818
890
|
async publishFlow(e, t, n, r = {}) {
|
|
819
|
-
return
|
|
891
|
+
return F(await this.request(`/v1/flows/${X(e)}/revisions/${X(t)}/publications`, {
|
|
820
892
|
body: JSON.stringify({
|
|
821
893
|
engineContract: "open-flow-engine/v1",
|
|
822
894
|
expectedLivePublicationId: n,
|
|
823
895
|
version: 1
|
|
824
896
|
}),
|
|
825
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
897
|
+
headers: { "idempotency-key": r.idempotencyKey ?? Z("publication") },
|
|
826
898
|
method: "POST"
|
|
827
899
|
}));
|
|
828
900
|
}
|
|
901
|
+
async getPublishOperation(e, t) {
|
|
902
|
+
return F(await this.request(`/v1/flows/${X(e)}/publish-operations/${X(t)}`));
|
|
903
|
+
}
|
|
829
904
|
async rollbackFlow(e, t, n, r = {}) {
|
|
830
|
-
return P(await this.request(`/v1/flows/${
|
|
905
|
+
return P(await this.request(`/v1/flows/${X(e)}/publications/${X(t)}/rollback`, {
|
|
831
906
|
body: JSON.stringify({
|
|
832
907
|
expectedLivePublicationId: n,
|
|
833
908
|
version: 1
|
|
834
909
|
}),
|
|
835
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
910
|
+
headers: { "idempotency-key": r.idempotencyKey ?? Z("publication") },
|
|
836
911
|
method: "POST"
|
|
837
912
|
}));
|
|
838
913
|
}
|
|
839
914
|
async getRun(e) {
|
|
840
|
-
return
|
|
915
|
+
return U(await this.request(`/v1/runs/${X(e)}`));
|
|
841
916
|
}
|
|
842
917
|
async listRuns(e, t = {}) {
|
|
843
918
|
let n = new URLSearchParams();
|
|
844
919
|
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
920
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
846
|
-
return
|
|
921
|
+
return W(await this.request(`/v1/flows/${X(e)}/runs${r}`));
|
|
847
922
|
}
|
|
848
923
|
async getRunEvents(e, t = {}) {
|
|
849
924
|
let n = new URLSearchParams();
|
|
850
925
|
t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
|
|
851
926
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
852
|
-
return
|
|
927
|
+
return q(await this.request(`/v1/runs/${X(e)}/events${r}`));
|
|
853
928
|
}
|
|
854
929
|
async getRunResult(e) {
|
|
855
|
-
return
|
|
930
|
+
return Y(await this.request(`/v1/runs/${X(e)}/result`));
|
|
856
931
|
}
|
|
857
932
|
async cancelRun(e) {
|
|
858
|
-
return
|
|
933
|
+
return J(await this.request(`/v1/runs/${X(e)}/cancel`, {
|
|
859
934
|
body: JSON.stringify({ version: 1 }),
|
|
860
935
|
method: "POST"
|
|
861
936
|
}));
|
|
862
937
|
}
|
|
863
938
|
async connectorActions(e, t) {
|
|
864
|
-
let n = Object.entries(e).map(([e, t]) => `${
|
|
939
|
+
let n = Object.entries(e).map(([e, t]) => `${X(e)}=${X(t)}`).join("&"), r = n == "" ? "" : `?${n}`, o = a(await this.request(`/v1/connector/actions${r}`, { signal: t }));
|
|
865
940
|
return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
|
|
866
941
|
}
|
|
867
942
|
async request(e, t = {}) {
|
|
@@ -884,4 +959,4 @@ var Z = class {
|
|
|
884
959
|
}
|
|
885
960
|
};
|
|
886
961
|
//#endregion
|
|
887
|
-
export { r as ApiError,
|
|
962
|
+
export { r as ApiError, Q as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
|
|
@@ -8722,21 +8722,14 @@ async function Sr(e, t) {
|
|
|
8722
8722
|
}
|
|
8723
8723
|
for (let t of [...n.dependencies.tasks].toSorted()) {
|
|
8724
8724
|
let n = e.document.tasks[t];
|
|
8725
|
-
n != null &&
|
|
8725
|
+
n != null && n.executor.kind == "connector" && n.executor.action.length == 0 && r.diagnostics.push({
|
|
8726
8726
|
code: "task.connector-incomplete",
|
|
8727
8727
|
column: 0,
|
|
8728
8728
|
line: 1,
|
|
8729
8729
|
message: `Connector Task "${t}" requires an action.`,
|
|
8730
8730
|
path: `/document/tasks/${t}/executor`,
|
|
8731
8731
|
values: { taskId: t }
|
|
8732
|
-
})
|
|
8733
|
-
code: "task.connector-connection-required",
|
|
8734
|
-
column: 0,
|
|
8735
|
-
line: 1,
|
|
8736
|
-
message: `Connector Task "${t}" requires a Connection.`,
|
|
8737
|
-
path: `/document/tasks/${t}/executor/connectionId`,
|
|
8738
|
-
values: { taskId: t }
|
|
8739
|
-
}));
|
|
8732
|
+
});
|
|
8740
8733
|
}
|
|
8741
8734
|
let o = r.diagnostics.toSorted(or);
|
|
8742
8735
|
return {
|
|
@@ -48,6 +48,7 @@ export interface IntegrationReconcileContext {
|
|
|
48
48
|
readonly config: Readonly<Record<string, JsonValue>>;
|
|
49
49
|
readonly connector: ConnectorProxy;
|
|
50
50
|
readonly endpointUrl: string;
|
|
51
|
+
readonly idempotencyKey: string;
|
|
51
52
|
readonly now: Date;
|
|
52
53
|
readonly signal?: AbortSignal;
|
|
53
54
|
readonly state?: IntegrationStateContext;
|
|
@@ -3923,7 +3923,10 @@ var ci = 300, H = "/v1/webhook_endpoints", li = { "Content-Type": "application/x
|
|
|
3923
3923
|
let t = await U(e, "endpoint create", {
|
|
3924
3924
|
body: fi(e.endpointUrl, n),
|
|
3925
3925
|
endpoint: H,
|
|
3926
|
-
headers:
|
|
3926
|
+
headers: {
|
|
3927
|
+
...li,
|
|
3928
|
+
"Idempotency-Key": e.idempotencyKey
|
|
3929
|
+
},
|
|
3927
3930
|
method: "POST"
|
|
3928
3931
|
});
|
|
3929
3932
|
W(t, "endpoint create");
|