@oomol-lab/open-flow 0.1.0-alpha.8 → 0.1.0-beta.1
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/README.md +5 -1
- package/dist/browser/{createResourceDialog-A64dDFCG.js → createResourceDialog-DXQz0thK.js} +228 -191
- package/dist/browser/diagnostics-BGoGFvHA.js +9237 -0
- package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
- package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
- package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
- package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
- package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
- package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
- package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
- package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
- package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
- package/dist/browser/{esm-YIGXG-Js.js → esm-DGQbgYoJ.js} +13 -13
- package/dist/browser/flow-authoring-node.d.ts +3 -1
- package/dist/browser/flow-authoring.d.ts +2 -1
- package/dist/browser/flow-authoring.js +386 -96
- package/dist/browser/flow-change.d.ts +9 -4
- package/dist/browser/flow-change.js +49 -46
- package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
- package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DwyxAOBH.js} +18384 -16381
- package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
- package/dist/browser/languages-DgJehE1g.js +62 -0
- package/dist/browser/lib-C5Ipyfps.js +7856 -0
- package/dist/browser/licenses.md +119 -1
- package/dist/browser/main-DmjVyuWr.js +76 -0
- package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
- package/dist/browser/theme.css +63 -0
- package/dist/browser/theme.css.d.ts +1 -0
- package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
- package/dist/browser/workbench-contract.d.ts +2 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +45 -1
- package/dist/browser/workbench.js +982 -1328
- package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +37 -29
- package/dist/common/control-api-conformance.js +45 -4
- package/dist/common/control-api-errors.d.ts +16 -0
- package/dist/common/control-api.d.ts +20 -6
- package/dist/common/control-api.js +151 -95
- package/dist/common/flow-encoding.d.ts +2 -2
- package/dist/common/flow-encoding.js +4 -1
- package/dist/common/flow-semantics.d.ts +3 -0
- package/dist/common/flow-semantics.js +939 -844
- package/dist/common/licenses.md +1 -25
- package/dist/common/localization.d.ts +21 -0
- package/dist/common/localization.js +62 -0
- package/dist/common/scheduler.d.ts +5 -5
- package/dist/common/scheduler.js +250 -236
- package/package.json +10 -1
- package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
- package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
- package/dist/browser/field-CKGQHCIi.js +0 -312
|
@@ -4,6 +4,7 @@ var e = {
|
|
|
4
4
|
authorizationDenied: "authorization.denied",
|
|
5
5
|
bindingUnresolved: "binding.unresolved",
|
|
6
6
|
connectorActionNotFound: "connector.action-not-found",
|
|
7
|
+
connectorUnconfigured: "connector.unconfigured",
|
|
7
8
|
connectorUnavailable: "connector.unavailable",
|
|
8
9
|
engineUnavailable: "engine.unavailable",
|
|
9
10
|
engineUnsupported: "engine.unsupported",
|
|
@@ -27,12 +28,16 @@ var e = {
|
|
|
27
28
|
runOverloaded: "run.overloaded",
|
|
28
29
|
triggerKeyInvalid: "trigger-key.invalid",
|
|
29
30
|
triggerKeyNotFound: "trigger-key.not-found",
|
|
30
|
-
triggerNotFound: "trigger.not-found"
|
|
31
|
+
triggerNotFound: "trigger.not-found",
|
|
32
|
+
variableInvalid: "variable.invalid",
|
|
33
|
+
variableLimitReached: "variable.limit-reached",
|
|
34
|
+
variableNotFound: "variable.not-found"
|
|
31
35
|
}, t = {
|
|
32
36
|
[e.authenticationRequired]: { status: 401 },
|
|
33
37
|
[e.authorizationDenied]: { status: 403 },
|
|
34
38
|
[e.bindingUnresolved]: { status: 409 },
|
|
35
39
|
[e.connectorActionNotFound]: { status: 404 },
|
|
40
|
+
[e.connectorUnconfigured]: { status: 503 },
|
|
36
41
|
[e.connectorUnavailable]: { status: 503 },
|
|
37
42
|
[e.engineUnavailable]: { status: 503 },
|
|
38
43
|
[e.engineUnsupported]: { status: 409 },
|
|
@@ -56,7 +61,10 @@ var e = {
|
|
|
56
61
|
[e.runOverloaded]: { status: 429 },
|
|
57
62
|
[e.triggerKeyInvalid]: { status: 409 },
|
|
58
63
|
[e.triggerKeyNotFound]: { status: 404 },
|
|
59
|
-
[e.triggerNotFound]: { status: 404 }
|
|
64
|
+
[e.triggerNotFound]: { status: 404 },
|
|
65
|
+
[e.variableInvalid]: { status: 400 },
|
|
66
|
+
[e.variableLimitReached]: { status: 409 },
|
|
67
|
+
[e.variableNotFound]: { status: 404 }
|
|
60
68
|
}, n = [
|
|
61
69
|
"canceled",
|
|
62
70
|
"completed",
|
|
@@ -326,6 +334,27 @@ function O(e) {
|
|
|
326
334
|
};
|
|
327
335
|
}
|
|
328
336
|
function k(e) {
|
|
337
|
+
let t = a(e);
|
|
338
|
+
if (s(t, [
|
|
339
|
+
"name",
|
|
340
|
+
"updatedAt",
|
|
341
|
+
"value",
|
|
342
|
+
"version"
|
|
343
|
+
]), t.version != 1 || typeof t.value != "string") return i();
|
|
344
|
+
let n = o(t.updatedAt);
|
|
345
|
+
try {
|
|
346
|
+
if (new Date(n).toISOString() != n) return i();
|
|
347
|
+
} catch {
|
|
348
|
+
return i();
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
name: o(t.name),
|
|
352
|
+
updatedAt: n,
|
|
353
|
+
value: t.value,
|
|
354
|
+
version: 1
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function A(e) {
|
|
329
358
|
let t = a(e), n = t.parentRevisionId;
|
|
330
359
|
return t.version != 1 || n !== null && typeof n != "string" ? i() : {
|
|
331
360
|
actorId: o(t.actorId),
|
|
@@ -338,24 +367,24 @@ function k(e) {
|
|
|
338
367
|
version: 1
|
|
339
368
|
};
|
|
340
369
|
}
|
|
341
|
-
function
|
|
370
|
+
function j(e) {
|
|
342
371
|
let t = a(e), n = a(t.content);
|
|
343
372
|
return n.modelVersion == 1 ? (a(n.document), a(n.modules), {
|
|
344
|
-
...
|
|
373
|
+
...A(t),
|
|
345
374
|
content: t.content
|
|
346
375
|
}) : i();
|
|
347
376
|
}
|
|
348
|
-
function
|
|
377
|
+
function M(e) {
|
|
349
378
|
let t = a(e);
|
|
350
379
|
return t.version == 1 ? {
|
|
351
|
-
revision:
|
|
380
|
+
revision: A(t.revision),
|
|
352
381
|
version: 1
|
|
353
382
|
} : i();
|
|
354
383
|
}
|
|
355
|
-
function
|
|
384
|
+
function N(e) {
|
|
356
385
|
let t = a(e);
|
|
357
386
|
return t.version == 1 ? t.kind == "snapshot" ? {
|
|
358
|
-
draft:
|
|
387
|
+
draft: j(t.draft),
|
|
359
388
|
kind: "snapshot",
|
|
360
389
|
version: 1
|
|
361
390
|
} : t.kind != "changes" || !Array.isArray(t.revisions) ? i() : {
|
|
@@ -366,13 +395,13 @@ function M(e) {
|
|
|
366
395
|
for (let e of t.operations) if (typeof a(e).kind != "string") return i();
|
|
367
396
|
return {
|
|
368
397
|
operations: t.operations,
|
|
369
|
-
revision:
|
|
398
|
+
revision: A(t.revision)
|
|
370
399
|
};
|
|
371
400
|
}),
|
|
372
401
|
version: 1
|
|
373
402
|
} : i();
|
|
374
403
|
}
|
|
375
|
-
function
|
|
404
|
+
function P(e) {
|
|
376
405
|
let t = a(e), n = t.operation, r = t.sourcePublicationId;
|
|
377
406
|
return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? i() : {
|
|
378
407
|
actorId: o(t.actorId),
|
|
@@ -389,21 +418,22 @@ function N(e) {
|
|
|
389
418
|
version: 1
|
|
390
419
|
};
|
|
391
420
|
}
|
|
392
|
-
function
|
|
393
|
-
let t = a(e);
|
|
421
|
+
function F(e) {
|
|
422
|
+
let t = a(e), n = t.values == null ? void 0 : a(t.values);
|
|
394
423
|
return {
|
|
395
424
|
code: o(t.code),
|
|
396
425
|
column: c(t.column),
|
|
397
426
|
line: c(t.line),
|
|
398
427
|
message: o(t.message),
|
|
399
|
-
path: typeof t.path == "string" ? t.path : i()
|
|
428
|
+
path: typeof t.path == "string" ? t.path : i(),
|
|
429
|
+
...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : i()])) }
|
|
400
430
|
};
|
|
401
431
|
}
|
|
402
|
-
function
|
|
432
|
+
function I(e) {
|
|
403
433
|
let t = a(e);
|
|
404
434
|
return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? i() : {
|
|
405
435
|
closureDigest: o(t.closureDigest),
|
|
406
|
-
diagnostics: t.diagnostics.map(
|
|
436
|
+
diagnostics: t.diagnostics.map(F),
|
|
407
437
|
engineContract: o(t.engineContract),
|
|
408
438
|
flowId: o(t.flowId),
|
|
409
439
|
modelVersion: c(t.modelVersion),
|
|
@@ -413,31 +443,31 @@ function F(e) {
|
|
|
413
443
|
version: 1
|
|
414
444
|
};
|
|
415
445
|
}
|
|
416
|
-
function
|
|
446
|
+
function L(e) {
|
|
417
447
|
let t = a(e), n = t.status, r = t.publication;
|
|
418
448
|
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() : {
|
|
419
449
|
flowId: o(t.flowId),
|
|
420
450
|
hasUnpublishedChanges: t.hasUnpublishedChanges,
|
|
421
|
-
publication: r === null ? null :
|
|
451
|
+
publication: r === null ? null : P(r),
|
|
422
452
|
revision: c(t.revision),
|
|
423
453
|
status: n,
|
|
424
454
|
version: 1
|
|
425
455
|
};
|
|
426
456
|
}
|
|
427
|
-
function
|
|
457
|
+
function R(e) {
|
|
428
458
|
let t = a(e), n = t.nextCursor, r = t.total;
|
|
429
459
|
return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
|
|
430
460
|
...n == null ? {} : { nextCursor: n },
|
|
431
|
-
publications: t.publications.map(
|
|
461
|
+
publications: t.publications.map(P),
|
|
432
462
|
...r == null ? {} : { total: r },
|
|
433
463
|
version: 1
|
|
434
464
|
};
|
|
435
465
|
}
|
|
436
|
-
var
|
|
437
|
-
function z(e) {
|
|
438
|
-
return typeof e == "string" && R.has(e) ? e : i();
|
|
439
|
-
}
|
|
466
|
+
var z = new Set(n);
|
|
440
467
|
function B(e) {
|
|
468
|
+
return typeof e == "string" && z.has(e) ? e : i();
|
|
469
|
+
}
|
|
470
|
+
function V(e) {
|
|
441
471
|
let t = a(e), n = t.source, r = t.startedAt, s = t.finishedAt;
|
|
442
472
|
return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || s != null && typeof s != "string" ? i() : {
|
|
443
473
|
createdAt: o(t.createdAt),
|
|
@@ -447,12 +477,12 @@ function B(e) {
|
|
|
447
477
|
runId: o(t.runId),
|
|
448
478
|
source: n,
|
|
449
479
|
...r == null ? {} : { startedAt: r },
|
|
450
|
-
status:
|
|
480
|
+
status: B(t.status),
|
|
451
481
|
version: 1
|
|
452
482
|
};
|
|
453
483
|
}
|
|
454
|
-
function
|
|
455
|
-
let t = a(e), n =
|
|
484
|
+
function H(e) {
|
|
485
|
+
let t = a(e), n = V(t), r = t.eventsExpiresAt;
|
|
456
486
|
if (r != null && typeof r != "string") return i();
|
|
457
487
|
let s = {
|
|
458
488
|
...n,
|
|
@@ -482,16 +512,16 @@ function V(e) {
|
|
|
482
512
|
};
|
|
483
513
|
}
|
|
484
514
|
}
|
|
485
|
-
function
|
|
515
|
+
function U(e) {
|
|
486
516
|
let t = a(e), n = t.nextCursor;
|
|
487
517
|
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
|
|
488
518
|
flowId: o(t.flowId),
|
|
489
519
|
...n == null ? {} : { nextCursor: n },
|
|
490
|
-
runs: t.runs.map(
|
|
520
|
+
runs: t.runs.map(V),
|
|
491
521
|
version: 1
|
|
492
522
|
};
|
|
493
523
|
}
|
|
494
|
-
var
|
|
524
|
+
var W = /* @__PURE__ */ new Set([
|
|
495
525
|
"node.artifact",
|
|
496
526
|
"node.completed",
|
|
497
527
|
"node.failed",
|
|
@@ -508,9 +538,9 @@ var U = /* @__PURE__ */ new Set([
|
|
|
508
538
|
"run.queued",
|
|
509
539
|
"run.started"
|
|
510
540
|
]);
|
|
511
|
-
function
|
|
541
|
+
function G(e) {
|
|
512
542
|
let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
|
|
513
|
-
return typeof n != "string" || !
|
|
543
|
+
return typeof n != "string" || !W.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
|
|
514
544
|
createdAt: o(t.createdAt),
|
|
515
545
|
kind: n,
|
|
516
546
|
payload: a(t.payload),
|
|
@@ -518,11 +548,11 @@ function W(e) {
|
|
|
518
548
|
...s == null ? {} : { sourceSequence: s }
|
|
519
549
|
};
|
|
520
550
|
}
|
|
521
|
-
function
|
|
551
|
+
function K(e) {
|
|
522
552
|
let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
|
|
523
553
|
return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? i() : {
|
|
524
554
|
done: t.done,
|
|
525
|
-
events: t.events.map(
|
|
555
|
+
events: t.events.map(G),
|
|
526
556
|
...n == null ? {} : { eventsExpiresAt: n },
|
|
527
557
|
historyComplete: t.historyComplete,
|
|
528
558
|
nextAfter: r,
|
|
@@ -530,8 +560,8 @@ function G(e) {
|
|
|
530
560
|
version: 1
|
|
531
561
|
};
|
|
532
562
|
}
|
|
533
|
-
function
|
|
534
|
-
let t = a(e), n =
|
|
563
|
+
function q(e) {
|
|
564
|
+
let t = a(e), n = B(t.status);
|
|
535
565
|
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
|
|
536
566
|
cancelAccepted: t.cancelAccepted,
|
|
537
567
|
runId: o(t.runId),
|
|
@@ -539,7 +569,7 @@ function K(e) {
|
|
|
539
569
|
version: 1
|
|
540
570
|
};
|
|
541
571
|
}
|
|
542
|
-
function
|
|
572
|
+
function J(e) {
|
|
543
573
|
let t = a(e), n = t.status;
|
|
544
574
|
if (t.version != 1) return i();
|
|
545
575
|
let r = {
|
|
@@ -580,11 +610,11 @@ function q(e) {
|
|
|
580
610
|
}
|
|
581
611
|
return i();
|
|
582
612
|
}
|
|
583
|
-
var
|
|
584
|
-
function
|
|
613
|
+
var Y = encodeURIComponent;
|
|
614
|
+
function X(e) {
|
|
585
615
|
return `${e}-${crypto.randomUUID()}`;
|
|
586
616
|
}
|
|
587
|
-
var
|
|
617
|
+
var Z = class {
|
|
588
618
|
constructor(e) {
|
|
589
619
|
this.requestControl = e;
|
|
590
620
|
}
|
|
@@ -594,6 +624,26 @@ var X = class {
|
|
|
594
624
|
let n = t.size == 0 ? "" : `?${t}`;
|
|
595
625
|
return O(await this.request(`/v1/flows${n}`));
|
|
596
626
|
}
|
|
627
|
+
async listVariables() {
|
|
628
|
+
let e = a(await this.request("/v1/variables"));
|
|
629
|
+
return s(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? i() : {
|
|
630
|
+
variables: e.variables.map(k),
|
|
631
|
+
version: 1
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
async getVariable(e) {
|
|
635
|
+
return k(await this.request(`/v1/variables/${Y(e)}`));
|
|
636
|
+
}
|
|
637
|
+
async putVariable(e, t) {
|
|
638
|
+
return k(await this.request(`/v1/variables/${Y(e)}`, {
|
|
639
|
+
body: JSON.stringify({ value: t }),
|
|
640
|
+
method: "PUT"
|
|
641
|
+
}));
|
|
642
|
+
}
|
|
643
|
+
async deleteVariable(e) {
|
|
644
|
+
let t = a(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
|
|
645
|
+
if (s(t, ["version"]), t.version != 1) return i();
|
|
646
|
+
}
|
|
597
647
|
async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
|
|
598
648
|
return D(await this.request("/v1/flows", {
|
|
599
649
|
body: JSON.stringify({
|
|
@@ -605,10 +655,10 @@ var X = class {
|
|
|
605
655
|
}));
|
|
606
656
|
}
|
|
607
657
|
async getFlow(e) {
|
|
608
|
-
return D(await this.request(`/v1/flows/${
|
|
658
|
+
return D(await this.request(`/v1/flows/${Y(e)}`));
|
|
609
659
|
}
|
|
610
660
|
async renameFlow(e, t) {
|
|
611
|
-
return D(await this.request(`/v1/flows/${
|
|
661
|
+
return D(await this.request(`/v1/flows/${Y(e)}`, {
|
|
612
662
|
body: JSON.stringify({
|
|
613
663
|
name: t,
|
|
614
664
|
version: 1
|
|
@@ -617,7 +667,7 @@ var X = class {
|
|
|
617
667
|
}));
|
|
618
668
|
}
|
|
619
669
|
async deleteFlow(e) {
|
|
620
|
-
return D(await this.request(`/v1/flows/${
|
|
670
|
+
return D(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
|
|
621
671
|
}
|
|
622
672
|
async listTriggerKeys(e) {
|
|
623
673
|
let t = a(await this.request("/v1/trigger-keys", { signal: e }));
|
|
@@ -628,87 +678,93 @@ var X = class {
|
|
|
628
678
|
return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
|
|
629
679
|
}
|
|
630
680
|
async getTriggerKey(e, t) {
|
|
631
|
-
let n = a(await this.request(`/v1/trigger-keys/${
|
|
681
|
+
let n = a(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
|
|
632
682
|
return n.version == 1 ? _(n.definition) : i();
|
|
633
683
|
}
|
|
634
684
|
async listFlowTriggerBindings(e) {
|
|
635
|
-
let t = a(await this.request(`/v1/flows/${
|
|
685
|
+
let t = a(await this.request(`/v1/flows/${Y(e)}/triggers`));
|
|
636
686
|
return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
|
|
637
687
|
}
|
|
638
688
|
async getFlowTriggerBinding(e, t) {
|
|
639
|
-
return C(await this.request(`/v1/flows/${
|
|
689
|
+
return C(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
|
|
640
690
|
}
|
|
641
691
|
async listFlowTriggerActivities(e, t, n = {}) {
|
|
642
692
|
let r = new URLSearchParams();
|
|
643
693
|
n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
|
|
644
694
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
645
|
-
return T(await this.request(`/v1/flows/${
|
|
695
|
+
return T(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
|
|
646
696
|
}
|
|
647
697
|
async pauseFlowTrigger(e, t) {
|
|
648
|
-
return S(await this.request(`/v1/flows/${
|
|
698
|
+
return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
|
|
649
699
|
body: JSON.stringify({ version: 1 }),
|
|
650
700
|
method: "POST"
|
|
651
701
|
}));
|
|
652
702
|
}
|
|
653
703
|
async resumeFlowTrigger(e, t) {
|
|
654
|
-
return S(await this.request(`/v1/flows/${
|
|
704
|
+
return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
|
|
655
705
|
body: JSON.stringify({ version: 1 }),
|
|
656
706
|
method: "POST"
|
|
657
707
|
}));
|
|
658
708
|
}
|
|
659
709
|
async testFlowPollTrigger(e, t) {
|
|
660
|
-
return E(await this.request(`/v1/flows/${
|
|
710
|
+
return E(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
|
|
661
711
|
body: JSON.stringify({ version: 1 }),
|
|
662
712
|
method: "POST"
|
|
663
713
|
}));
|
|
664
714
|
}
|
|
665
715
|
async getDraft(e) {
|
|
666
|
-
return
|
|
716
|
+
return j(await this.request(`/v1/flows/${Y(e)}/draft`));
|
|
667
717
|
}
|
|
668
718
|
async syncDraft(e, t) {
|
|
669
|
-
let n = t == null ? "" : `?fromRevisionId=${
|
|
670
|
-
return
|
|
719
|
+
let n = t == null ? "" : `?fromRevisionId=${Y(t)}`;
|
|
720
|
+
return N(await this.request(`/v1/flows/${Y(e)}/draft/sync${n}`));
|
|
671
721
|
}
|
|
672
722
|
async getRevision(e, t) {
|
|
673
|
-
return
|
|
674
|
-
}
|
|
675
|
-
async listConnectorProviders(e) {
|
|
676
|
-
let
|
|
677
|
-
return s(
|
|
678
|
-
}
|
|
679
|
-
async listConnectorActions(e, t) {
|
|
680
|
-
return await this.connectorActions(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}
|
|
685
|
-
async
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
723
|
+
return j(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
|
|
724
|
+
}
|
|
725
|
+
async listConnectorProviders(e, t) {
|
|
726
|
+
let n = a(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Y(t)}`}`, { signal: e }));
|
|
727
|
+
return s(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? i() : n.providers.map(h);
|
|
728
|
+
}
|
|
729
|
+
async listConnectorActions(e, t, n) {
|
|
730
|
+
return await this.connectorActions({
|
|
731
|
+
...n == null ? {} : { flowId: n },
|
|
732
|
+
...e == null ? {} : { service: e }
|
|
733
|
+
}, t);
|
|
734
|
+
}
|
|
735
|
+
async searchConnectorActions(e, t, n) {
|
|
736
|
+
return await this.connectorActions({
|
|
737
|
+
...n == null ? {} : { flowId: n },
|
|
738
|
+
q: e.trim()
|
|
739
|
+
}, t);
|
|
740
|
+
}
|
|
741
|
+
async getConnectorAction(e, t, n) {
|
|
742
|
+
let r = a(await this.request(`/v1/connector/actions/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
|
|
743
|
+
return s(r, ["action", "version"]), r.version == 1 ? m(r.action) : i();
|
|
744
|
+
}
|
|
745
|
+
async listConnectorConnections(e, t, n) {
|
|
746
|
+
let r = a(await this.request(`/v1/connector/connections/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
|
|
747
|
+
return s(r, [
|
|
692
748
|
"connections",
|
|
693
749
|
"serviceId",
|
|
694
750
|
"version"
|
|
695
|
-
]),
|
|
751
|
+
]), r.version != 1 || o(r.serviceId) != e || !Array.isArray(r.connections) ? i() : r.connections.map(u);
|
|
696
752
|
}
|
|
697
|
-
async createConnectorConnectionPage(e) {
|
|
698
|
-
let
|
|
753
|
+
async createConnectorConnectionPage(e, t) {
|
|
754
|
+
let n = a(await this.request(`/v1/connector/connections/${Y(e)}/page${t == null ? "" : `?flowId=${Y(t)}`}`, {
|
|
699
755
|
body: JSON.stringify({ version: 1 }),
|
|
700
756
|
method: "POST"
|
|
701
757
|
}));
|
|
702
|
-
if (s(
|
|
758
|
+
if (s(n, ["url", "version"]), n.version != 1) return i();
|
|
703
759
|
try {
|
|
704
|
-
let e = new URL(o(
|
|
760
|
+
let e = new URL(o(n.url));
|
|
705
761
|
return e.protocol != "http:" && e.protocol != "https:" ? i() : e.href;
|
|
706
762
|
} catch {
|
|
707
763
|
return i();
|
|
708
764
|
}
|
|
709
765
|
}
|
|
710
766
|
async changeDraft(e, t, n) {
|
|
711
|
-
return
|
|
767
|
+
return M(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
|
|
712
768
|
body: JSON.stringify({
|
|
713
769
|
expectedRevisionId: t,
|
|
714
770
|
operations: n,
|
|
@@ -718,7 +774,7 @@ var X = class {
|
|
|
718
774
|
}));
|
|
719
775
|
}
|
|
720
776
|
async checkFlow(e, t) {
|
|
721
|
-
return
|
|
777
|
+
return I(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
|
|
722
778
|
body: JSON.stringify({
|
|
723
779
|
engineContract: "open-flow-engine/v1",
|
|
724
780
|
version: 1
|
|
@@ -727,85 +783,85 @@ var X = class {
|
|
|
727
783
|
}));
|
|
728
784
|
}
|
|
729
785
|
async getLive(e) {
|
|
730
|
-
return
|
|
786
|
+
return L(await this.request(`/v1/flows/${Y(e)}/live`));
|
|
731
787
|
}
|
|
732
788
|
async listPublications(e, t = {}) {
|
|
733
789
|
let n = new URLSearchParams();
|
|
734
790
|
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));
|
|
735
791
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
736
|
-
return
|
|
792
|
+
return R(await this.request(`/v1/flows/${Y(e)}/publications${r}`));
|
|
737
793
|
}
|
|
738
794
|
async createDraftRun(e, t, n = {}) {
|
|
739
|
-
let r =
|
|
795
|
+
let r = H(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
|
|
740
796
|
body: JSON.stringify({
|
|
741
797
|
engineContract: "open-flow-engine/v1",
|
|
742
798
|
inputs: n.inputs ?? {},
|
|
743
799
|
version: 1
|
|
744
800
|
}),
|
|
745
|
-
headers: { "idempotency-key": n.idempotencyKey ??
|
|
801
|
+
headers: { "idempotency-key": n.idempotencyKey ?? X("run") },
|
|
746
802
|
method: "POST"
|
|
747
803
|
}));
|
|
748
804
|
return r.source == "draft" ? r : i();
|
|
749
805
|
}
|
|
750
806
|
async createLiveRun(e, t = {}) {
|
|
751
|
-
let n =
|
|
807
|
+
let n = H(await this.request("/v1/runs", {
|
|
752
808
|
body: JSON.stringify({
|
|
753
809
|
inputs: t.inputs ?? {},
|
|
754
810
|
publicationId: e,
|
|
755
811
|
version: 1
|
|
756
812
|
}),
|
|
757
|
-
headers: { "idempotency-key": t.idempotencyKey ??
|
|
813
|
+
headers: { "idempotency-key": t.idempotencyKey ?? X("run") },
|
|
758
814
|
method: "POST"
|
|
759
815
|
}));
|
|
760
816
|
return n.source == "live" ? n : i();
|
|
761
817
|
}
|
|
762
818
|
async publishFlow(e, t, n, r = {}) {
|
|
763
|
-
return
|
|
819
|
+
return P(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
|
|
764
820
|
body: JSON.stringify({
|
|
765
821
|
engineContract: "open-flow-engine/v1",
|
|
766
822
|
expectedLivePublicationId: n,
|
|
767
823
|
version: 1
|
|
768
824
|
}),
|
|
769
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
825
|
+
headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
|
|
770
826
|
method: "POST"
|
|
771
827
|
}));
|
|
772
828
|
}
|
|
773
829
|
async rollbackFlow(e, t, n, r = {}) {
|
|
774
|
-
return
|
|
830
|
+
return P(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
|
|
775
831
|
body: JSON.stringify({
|
|
776
832
|
expectedLivePublicationId: n,
|
|
777
833
|
version: 1
|
|
778
834
|
}),
|
|
779
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
835
|
+
headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
|
|
780
836
|
method: "POST"
|
|
781
837
|
}));
|
|
782
838
|
}
|
|
783
839
|
async getRun(e) {
|
|
784
|
-
return
|
|
840
|
+
return H(await this.request(`/v1/runs/${Y(e)}`));
|
|
785
841
|
}
|
|
786
842
|
async listRuns(e, t = {}) {
|
|
787
843
|
let n = new URLSearchParams();
|
|
788
844
|
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);
|
|
789
845
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
790
|
-
return
|
|
846
|
+
return U(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
|
|
791
847
|
}
|
|
792
848
|
async getRunEvents(e, t = {}) {
|
|
793
849
|
let n = new URLSearchParams();
|
|
794
850
|
t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
|
|
795
851
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
796
|
-
return
|
|
852
|
+
return K(await this.request(`/v1/runs/${Y(e)}/events${r}`));
|
|
797
853
|
}
|
|
798
854
|
async getRunResult(e) {
|
|
799
|
-
return
|
|
855
|
+
return J(await this.request(`/v1/runs/${Y(e)}/result`));
|
|
800
856
|
}
|
|
801
857
|
async cancelRun(e) {
|
|
802
|
-
return
|
|
858
|
+
return q(await this.request(`/v1/runs/${Y(e)}/cancel`, {
|
|
803
859
|
body: JSON.stringify({ version: 1 }),
|
|
804
860
|
method: "POST"
|
|
805
861
|
}));
|
|
806
862
|
}
|
|
807
863
|
async connectorActions(e, t) {
|
|
808
|
-
let n = Object.entries(e).map(([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 }));
|
|
809
865
|
return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
|
|
810
866
|
}
|
|
811
867
|
async request(e, t = {}) {
|
|
@@ -828,4 +884,4 @@ var X = class {
|
|
|
828
884
|
}
|
|
829
885
|
};
|
|
830
886
|
//#endregion
|
|
831
|
-
export { r as ApiError,
|
|
887
|
+
export { r as ApiError, Z as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CodeModule, FlowDocument, Graph, InputPort, JsonValue, OutputMapping, Port, RevisionContent } from '@oomol-lab/open-flow/flow-change';
|
|
1
|
+
import type { CodeModule, FlowDocument, Graph, Group, InputPort, JsonValue, OutputMapping, Port, RevisionContent } from '@oomol-lab/open-flow/flow-change';
|
|
2
2
|
export declare const maxJsonDepth = 64;
|
|
3
3
|
export declare function canonicalJsonBytes(value: JsonValue): Uint8Array;
|
|
4
4
|
export declare function digestBytes(bytes: Uint8Array): Promise<string>;
|
|
5
|
-
export declare function canonicalPorts(value: readonly (InputPort | Port)[]): JsonValue;
|
|
5
|
+
export declare function canonicalPorts(value: readonly (InputPort | Port | Group)[]): JsonValue;
|
|
6
6
|
export declare function canonicalOutputs(value: readonly (OutputMapping & Port)[]): JsonValue;
|
|
7
7
|
export declare function canonicalGraph(value: Graph): JsonValue;
|
|
8
8
|
export declare function canonicalTask(task: FlowDocument['tasks'][string]): JsonValue;
|
|
@@ -17,12 +17,15 @@ function a(e) {
|
|
|
17
17
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
18
18
|
}
|
|
19
19
|
function o(e) {
|
|
20
|
-
return {
|
|
20
|
+
return "handle" in e ? {
|
|
21
21
|
...e.description == null ? {} : { description: e.description },
|
|
22
22
|
handle: e.handle,
|
|
23
23
|
jsonSchema: e.jsonSchema,
|
|
24
24
|
nullable: e.nullable,
|
|
25
25
|
...Object.hasOwn(e, "value") ? { value: e.value } : {}
|
|
26
|
+
} : e.collapsed == null ? { group: e.group } : {
|
|
27
|
+
collapsed: e.collapsed,
|
|
28
|
+
group: e.group
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
function s(e) {
|
|
@@ -12,12 +12,14 @@ export interface SemanticClosure {
|
|
|
12
12
|
readonly digest: string;
|
|
13
13
|
}
|
|
14
14
|
export declare function flowClosure(content: RevisionContent): Promise<SemanticClosure>;
|
|
15
|
+
export declare function variableBindings(revision: RevisionContent, bindingIds: Iterable<string>): Readonly<Record<string, string>>;
|
|
15
16
|
export interface Diagnostic {
|
|
16
17
|
readonly code: string;
|
|
17
18
|
readonly column: number;
|
|
18
19
|
readonly line: number;
|
|
19
20
|
readonly message: string;
|
|
20
21
|
readonly path: string;
|
|
22
|
+
readonly values?: Readonly<Record<string, string | number>>;
|
|
21
23
|
}
|
|
22
24
|
export interface FlowValidation {
|
|
23
25
|
readonly closure: SemanticClosure;
|
|
@@ -26,6 +28,7 @@ export interface FlowValidation {
|
|
|
26
28
|
}
|
|
27
29
|
export declare function triggerPayloadSchema(trigger: TriggerNode): JsonValue;
|
|
28
30
|
export declare function matchesSchema(value: JsonValue, schema: JsonValue): boolean;
|
|
31
|
+
export declare function variableInputCompatible(jsonSchema: JsonValue): boolean;
|
|
29
32
|
export type FlowInputsValidation = 'invalid' | 'valid';
|
|
30
33
|
export declare function validateFlowInputs(revision: RevisionContent, value: unknown): FlowInputsValidation;
|
|
31
34
|
export declare function validateModules(revision: RevisionContent, moduleIds: readonly string[], engine: EngineContract): readonly Diagnostic[];
|