@oomol-lab/open-flow 0.1.0-alpha.1 → 0.1.0-alpha.12

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 (78) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/addNodeOptions-BYQXyUmQ.js +9571 -0
  3. package/dist/browser/carbon-DMCVsjHo.js +53 -0
  4. package/dist/browser/{project-change.js → change-7rp2OZLm.js} +16 -46
  5. package/dist/browser/createResourceDialog-CWD62rU0.js +467 -0
  6. package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
  7. package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
  8. package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
  9. package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
  10. package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
  11. package/dist/browser/dist-C46JByB-.js +252 -0
  12. package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
  13. package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
  14. package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
  15. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  16. package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
  17. package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
  18. package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
  19. package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
  20. package/dist/browser/{esm-DXw7EADW.js → esm-DmVDlOEJ.js} +14 -24
  21. package/dist/browser/flow-authoring-edge.d.ts +3 -0
  22. package/dist/browser/flow-authoring-module.d.ts +4 -0
  23. package/dist/browser/flow-authoring-node.d.ts +86 -0
  24. package/dist/browser/flow-authoring.d.ts +4 -0
  25. package/dist/browser/flow-authoring.js +783 -0
  26. package/dist/browser/{project-change.d.ts → flow-change.d.ts} +29 -37
  27. package/dist/browser/flow-change.js +234 -0
  28. package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  29. package/dist/browser/flowRunInputEditorStore-BYxwvHZl.js +8952 -0
  30. package/dist/browser/flowWorkspace-Bwqmoq-c.js +47439 -0
  31. package/dist/browser/languages-DgJehE1g.js +62 -0
  32. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  33. package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
  34. package/dist/browser/licenses.md +620 -12
  35. package/dist/browser/main-DmjVyuWr.js +76 -0
  36. package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-0teWaxq8.js} +5188 -5144
  37. package/dist/browser/theme.css +63 -0
  38. package/dist/browser/theme.css.d.ts +1 -0
  39. package/dist/browser/typeScriptSession-D5neIpug.js +2560 -0
  40. package/dist/browser/{composite-7VwgfnXx.js → useOpenInteractionType-CRgOHg5M.js} +2209 -2750
  41. package/dist/browser/workbench-contract.d.ts +6 -6
  42. package/dist/browser/workbench.css +1 -1
  43. package/dist/browser/workbench.d.ts +18 -2
  44. package/dist/browser/workbench.js +4200 -2233
  45. package/dist/common/connector-action.d.ts +6 -0
  46. package/dist/common/connector-action.js +38 -30
  47. package/dist/common/control-api-conformance.js +262 -359
  48. package/dist/common/control-api-errors.d.ts +32 -24
  49. package/dist/common/control-api.d.ts +57 -73
  50. package/dist/common/control-api.js +199 -205
  51. package/dist/common/cron-trigger.d.ts +1 -1
  52. package/dist/common/cron-trigger.js +1 -1
  53. package/dist/common/flow-encoding.d.ts +11 -0
  54. package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
  55. package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  56. package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +11 -12
  57. package/dist/common/{project-semantics.js → flow-semantics.js} +959 -934
  58. package/dist/common/integration-trigger.d.ts +2 -1
  59. package/dist/common/integration-trigger.js +1 -1
  60. package/dist/common/licenses.md +1 -25
  61. package/dist/common/localization.d.ts +21 -0
  62. package/dist/common/localization.js +62 -0
  63. package/dist/common/poll-trigger.d.ts +1 -1
  64. package/dist/common/provider-triggers.js +1057 -948
  65. package/dist/common/run-lifecycle.js +1 -1
  66. package/dist/common/runtime-contract.d.ts +1 -1
  67. package/dist/common/runtime-contract.js +1 -1
  68. package/dist/common/scheduler.d.ts +8 -7
  69. package/dist/common/scheduler.js +251 -232
  70. package/dist/common/webhook-trigger.d.ts +1 -1
  71. package/dist/common/webhook-trigger.js +35 -1
  72. package/package.json +23 -10
  73. package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
  74. package/dist/browser/carbon-nMY84Amv.js +0 -53
  75. package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
  76. package/dist/browser/dist-n-z5HtaO.js +0 -4
  77. package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
  78. package/dist/common/project-encoding.d.ts +0 -11
@@ -9,15 +9,13 @@ var e = {
9
9
  engineUnsupported: "engine.unsupported",
10
10
  flowInvalid: "flow.invalid",
11
11
  flowNotFound: "flow.not-found",
12
+ flowBusy: "flow.busy",
13
+ flowConflict: "flow.conflict",
14
+ flowPresentationConflict: "flow.presentation-conflict",
15
+ flowRevisionConflict: "flow.revision-conflict",
12
16
  liveConflict: "live.conflict",
13
17
  liveNotFound: "live.not-found",
14
18
  pageInvalidCursor: "page.invalid-cursor",
15
- projectBusy: "project.busy",
16
- projectConflict: "project.conflict",
17
- projectInvalid: "project.invalid",
18
- projectNotFound: "project.not-found",
19
- projectPresentationConflict: "project.presentation-conflict",
20
- projectRevisionConflict: "project.revision-conflict",
21
19
  publicationConflict: "publication.conflict",
22
20
  publicationNotFound: "publication.not-found",
23
21
  routeNotFound: "route.not-found",
@@ -26,9 +24,13 @@ var e = {
26
24
  runInvalid: "run.invalid",
27
25
  runNotFound: "run.not-found",
28
26
  runNotTerminal: "run.not-terminal",
27
+ runOverloaded: "run.overloaded",
29
28
  triggerKeyInvalid: "trigger-key.invalid",
30
29
  triggerKeyNotFound: "trigger-key.not-found",
31
- triggerNotFound: "trigger.not-found"
30
+ triggerNotFound: "trigger.not-found",
31
+ variableInvalid: "variable.invalid",
32
+ variableLimitReached: "variable.limit-reached",
33
+ variableNotFound: "variable.not-found"
32
34
  }, t = {
33
35
  [e.authenticationRequired]: { status: 401 },
34
36
  [e.authorizationDenied]: { status: 403 },
@@ -39,15 +41,13 @@ var e = {
39
41
  [e.engineUnsupported]: { status: 409 },
40
42
  [e.flowInvalid]: { status: 400 },
41
43
  [e.flowNotFound]: { status: 404 },
44
+ [e.flowBusy]: { status: 409 },
45
+ [e.flowConflict]: { status: 409 },
46
+ [e.flowPresentationConflict]: { status: 412 },
47
+ [e.flowRevisionConflict]: { status: 412 },
42
48
  [e.liveConflict]: { status: 412 },
43
49
  [e.liveNotFound]: { status: 404 },
44
50
  [e.pageInvalidCursor]: { status: 400 },
45
- [e.projectBusy]: { status: 409 },
46
- [e.projectConflict]: { status: 409 },
47
- [e.projectInvalid]: { status: 400 },
48
- [e.projectNotFound]: { status: 404 },
49
- [e.projectPresentationConflict]: { status: 412 },
50
- [e.projectRevisionConflict]: { status: 412 },
51
51
  [e.publicationConflict]: { status: 409 },
52
52
  [e.publicationNotFound]: { status: 404 },
53
53
  [e.routeNotFound]: { status: 404 },
@@ -56,9 +56,13 @@ var e = {
56
56
  [e.runInvalid]: { status: 400 },
57
57
  [e.runNotFound]: { status: 404 },
58
58
  [e.runNotTerminal]: { status: 409 },
59
+ [e.runOverloaded]: { status: 429 },
59
60
  [e.triggerKeyInvalid]: { status: 409 },
60
61
  [e.triggerKeyNotFound]: { status: 404 },
61
- [e.triggerNotFound]: { status: 404 }
62
+ [e.triggerNotFound]: { status: 404 },
63
+ [e.variableInvalid]: { status: 400 },
64
+ [e.variableLimitReached]: { status: 409 },
65
+ [e.variableNotFound]: { status: 404 }
62
66
  }, n = [
63
67
  "canceled",
64
68
  "completed",
@@ -69,7 +73,7 @@ var e = {
69
73
  "starting"
70
74
  ], r = class extends Error {
71
75
  constructor(e, t, n) {
72
- super(n), this.status = e, this.code = t, this.name = "ApiError";
76
+ super(n), this.code = t, this.name = "ApiError", this.status = e;
73
77
  }
74
78
  };
75
79
  function i() {
@@ -259,7 +263,6 @@ function S(e) {
259
263
  kind: r,
260
264
  ...t.lastErrorCode == null ? {} : { lastErrorCode: o(t.lastErrorCode) },
261
265
  operatorState: s,
262
- projectId: o(t.projectId),
263
266
  runtimeVersion: l,
264
267
  triggerNodeId: o(t.triggerNodeId),
265
268
  updatedAt: o(t.updatedAt),
@@ -310,8 +313,8 @@ function D(e) {
310
313
  return t.version != 1 || n != "active" && n != "retiring" ? i() : {
311
314
  createdAt: o(t.createdAt),
312
315
  draftRevisionId: o(t.draftRevisionId),
316
+ flowId: o(t.flowId),
313
317
  name: o(t.name),
314
- projectId: o(t.projectId),
315
318
  status: n,
316
319
  updatedAt: o(t.updatedAt),
317
320
  version: 1
@@ -319,64 +322,70 @@ function D(e) {
319
322
  }
320
323
  function O(e) {
321
324
  let t = a(e);
322
- if (t.version != 1 || !Array.isArray(t.projects)) return i();
325
+ if (t.version != 1 || !Array.isArray(t.flows)) return i();
323
326
  let n = t.nextCursor, r = t.total;
324
327
  return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
325
328
  ...n == null ? {} : { nextCursor: n },
326
- projects: t.projects.map(D),
329
+ flows: t.flows.map(D),
327
330
  ...r == null ? {} : { total: r },
328
331
  version: 1
329
332
  };
330
333
  }
331
334
  function k(e) {
335
+ let t = a(e);
336
+ if (s(t, [
337
+ "name",
338
+ "updatedAt",
339
+ "value",
340
+ "version"
341
+ ]), t.version != 1 || typeof t.value != "string") return i();
342
+ let n = o(t.updatedAt);
343
+ try {
344
+ if (new Date(n).toISOString() != n) return i();
345
+ } catch {
346
+ return i();
347
+ }
348
+ return {
349
+ name: o(t.name),
350
+ updatedAt: n,
351
+ value: t.value,
352
+ version: 1
353
+ };
354
+ }
355
+ function A(e) {
332
356
  let t = a(e), n = t.parentRevisionId;
333
357
  return t.version != 1 || n !== null && typeof n != "string" ? i() : {
334
358
  actorId: o(t.actorId),
335
359
  createdAt: o(t.createdAt),
336
360
  digest: o(t.digest),
361
+ flowId: o(t.flowId),
337
362
  modelVersion: c(t.modelVersion),
338
363
  parentRevisionId: n,
339
- projectId: o(t.projectId),
340
364
  revisionId: o(t.revisionId),
341
365
  version: 1
342
366
  };
343
367
  }
344
- function A(e) {
368
+ function j(e) {
345
369
  let t = a(e), n = a(t.content);
346
370
  return n.modelVersion == 1 ? (a(n.document), a(n.modules), {
347
- ...k(t),
371
+ ...A(t),
348
372
  content: t.content
349
373
  }) : i();
350
374
  }
351
- function j(e) {
352
- return Array.isArray(e) ? e.map((e) => {
353
- let t = a(e);
354
- return {
355
- closureDigest: o(t.closureDigest),
356
- flowId: o(t.flowId),
357
- name: o(t.name)
358
- };
359
- }) : i();
360
- }
361
375
  function M(e) {
362
376
  let t = a(e);
363
377
  return t.version == 1 ? {
364
- draftFlows: j(t.draftFlows),
365
- revision: k(t.revision),
378
+ revision: A(t.revision),
366
379
  version: 1
367
380
  } : i();
368
381
  }
369
382
  function N(e) {
370
383
  let t = a(e);
371
- if (t.version != 1) return i();
372
- let n = j(t.draftFlows);
373
- return t.kind == "snapshot" ? {
374
- draft: A(t.draft),
375
- draftFlows: n,
384
+ return t.version == 1 ? t.kind == "snapshot" ? {
385
+ draft: j(t.draft),
376
386
  kind: "snapshot",
377
387
  version: 1
378
388
  } : t.kind != "changes" || !Array.isArray(t.revisions) ? i() : {
379
- draftFlows: n,
380
389
  kind: "changes",
381
390
  revisions: t.revisions.map((e) => {
382
391
  let t = a(e);
@@ -384,11 +393,11 @@ function N(e) {
384
393
  for (let e of t.operations) if (typeof a(e).kind != "string") return i();
385
394
  return {
386
395
  operations: t.operations,
387
- revision: k(t.revision)
396
+ revision: A(t.revision)
388
397
  };
389
398
  }),
390
399
  version: 1
391
- };
400
+ } : i();
392
401
  }
393
402
  function P(e) {
394
403
  let t = a(e), n = t.operation, r = t.sourcePublicationId;
@@ -400,7 +409,6 @@ function P(e) {
400
409
  flowId: o(t.flowId),
401
410
  modelVersion: c(t.modelVersion),
402
411
  operation: n,
403
- projectId: o(t.projectId),
404
412
  publicationId: o(t.publicationId),
405
413
  revisionDigest: o(t.revisionDigest),
406
414
  revisionId: o(t.revisionId),
@@ -409,28 +417,6 @@ function P(e) {
409
417
  };
410
418
  }
411
419
  function F(e) {
412
- let t = a(e), n = t.draft == null ? null : a(t.draft), r = t.live == null ? null : a(t.live), s = r?.status;
413
- return typeof t.hasUnpublishedChanges != "boolean" || r != null && s != "runnable" && s != "suspended" ? i() : {
414
- draft: n == null ? null : {
415
- closureDigest: o(n.closureDigest),
416
- name: o(n.name),
417
- revisionDigest: o(n.revisionDigest),
418
- revisionId: o(n.revisionId)
419
- },
420
- flowId: o(t.flowId),
421
- hasUnpublishedChanges: t.hasUnpublishedChanges,
422
- live: r == null ? null : {
423
- publication: P(r.publication),
424
- revision: c(r.revision),
425
- status: s
426
- }
427
- };
428
- }
429
- function I(e) {
430
- let t = a(e);
431
- return t.version != 1 || !Array.isArray(t.flows) ? i() : (o(t.projectId), t.flows.map(F));
432
- }
433
- function L(e) {
434
420
  let t = a(e);
435
421
  return {
436
422
  code: o(t.code),
@@ -440,34 +426,32 @@ function L(e) {
440
426
  path: typeof t.path == "string" ? t.path : i()
441
427
  };
442
428
  }
443
- function R(e) {
429
+ function I(e) {
444
430
  let t = a(e);
445
431
  return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? i() : {
446
432
  closureDigest: o(t.closureDigest),
447
- diagnostics: t.diagnostics.map(L),
433
+ diagnostics: t.diagnostics.map(F),
448
434
  engineContract: o(t.engineContract),
449
435
  flowId: o(t.flowId),
450
436
  modelVersion: c(t.modelVersion),
451
- projectId: o(t.projectId),
452
437
  revisionDigest: o(t.revisionDigest),
453
438
  revisionId: o(t.revisionId),
454
439
  valid: t.valid,
455
440
  version: 1
456
441
  };
457
442
  }
458
- function z(e) {
443
+ function L(e) {
459
444
  let t = a(e), n = t.status, r = t.publication;
460
445
  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() : {
461
446
  flowId: o(t.flowId),
462
447
  hasUnpublishedChanges: t.hasUnpublishedChanges,
463
- projectId: o(t.projectId),
464
448
  publication: r === null ? null : P(r),
465
449
  revision: c(t.revision),
466
450
  status: n,
467
451
  version: 1
468
452
  };
469
453
  }
470
- function B(e) {
454
+ function R(e) {
471
455
  let t = a(e), n = t.nextCursor, r = t.total;
472
456
  return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
473
457
  ...n == null ? {} : { nextCursor: n },
@@ -476,27 +460,26 @@ function B(e) {
476
460
  version: 1
477
461
  };
478
462
  }
479
- var V = new Set(n);
480
- function H(e) {
481
- return typeof e == "string" && V.has(e) ? e : i();
463
+ var z = new Set(n);
464
+ function B(e) {
465
+ return typeof e == "string" && z.has(e) ? e : i();
482
466
  }
483
- function U(e) {
467
+ function V(e) {
484
468
  let t = a(e), n = t.source, r = t.startedAt, s = t.finishedAt;
485
469
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || s != null && typeof s != "string" ? i() : {
486
470
  createdAt: o(t.createdAt),
487
471
  ...s == null ? {} : { finishedAt: s },
488
472
  flowId: o(t.flowId),
489
- projectId: o(t.projectId),
490
473
  revisionId: o(t.revisionId),
491
474
  runId: o(t.runId),
492
475
  source: n,
493
476
  ...r == null ? {} : { startedAt: r },
494
- status: H(t.status),
477
+ status: B(t.status),
495
478
  version: 1
496
479
  };
497
480
  }
498
- function W(e) {
499
- let t = a(e), n = U(t), r = t.eventsExpiresAt;
481
+ function H(e) {
482
+ let t = a(e), n = V(t), r = t.eventsExpiresAt;
500
483
  if (r != null && typeof r != "string") return i();
501
484
  let s = {
502
485
  ...n,
@@ -526,16 +509,16 @@ function W(e) {
526
509
  };
527
510
  }
528
511
  }
529
- function G(e) {
512
+ function U(e) {
530
513
  let t = a(e), n = t.nextCursor;
531
514
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
515
+ flowId: o(t.flowId),
532
516
  ...n == null ? {} : { nextCursor: n },
533
- projectId: o(t.projectId),
534
- runs: t.runs.map(U),
517
+ runs: t.runs.map(V),
535
518
  version: 1
536
519
  };
537
520
  }
538
- var K = /* @__PURE__ */ new Set([
521
+ var W = /* @__PURE__ */ new Set([
539
522
  "node.artifact",
540
523
  "node.completed",
541
524
  "node.failed",
@@ -552,9 +535,9 @@ var K = /* @__PURE__ */ new Set([
552
535
  "run.queued",
553
536
  "run.started"
554
537
  ]);
555
- function q(e) {
538
+ function G(e) {
556
539
  let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
557
- return typeof n != "string" || !K.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
540
+ return typeof n != "string" || !W.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
558
541
  createdAt: o(t.createdAt),
559
542
  kind: n,
560
543
  payload: a(t.payload),
@@ -562,11 +545,11 @@ function q(e) {
562
545
  ...s == null ? {} : { sourceSequence: s }
563
546
  };
564
547
  }
565
- function J(e) {
548
+ function K(e) {
566
549
  let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
567
550
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? i() : {
568
551
  done: t.done,
569
- events: t.events.map(q),
552
+ events: t.events.map(G),
570
553
  ...n == null ? {} : { eventsExpiresAt: n },
571
554
  historyComplete: t.historyComplete,
572
555
  nextAfter: r,
@@ -574,8 +557,8 @@ function J(e) {
574
557
  version: 1
575
558
  };
576
559
  }
577
- function Y(e) {
578
- let t = a(e), n = H(t.status);
560
+ function q(e) {
561
+ let t = a(e), n = B(t.status);
579
562
  return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
580
563
  cancelAccepted: t.cancelAccepted,
581
564
  runId: o(t.runId),
@@ -583,7 +566,7 @@ function Y(e) {
583
566
  version: 1
584
567
  };
585
568
  }
586
- function X(e) {
569
+ function J(e) {
587
570
  let t = a(e), n = t.status;
588
571
  if (t.version != 1) return i();
589
572
  let r = {
@@ -624,22 +607,42 @@ function X(e) {
624
607
  }
625
608
  return i();
626
609
  }
627
- var Z = encodeURIComponent;
628
- function Q(e) {
610
+ var Y = encodeURIComponent;
611
+ function X(e) {
629
612
  return `${e}-${crypto.randomUUID()}`;
630
613
  }
631
- var $ = class {
614
+ var Z = class {
632
615
  constructor(e) {
633
616
  this.requestControl = e;
634
617
  }
635
- async listProjects(e = {}) {
618
+ async listFlows(e = {}) {
636
619
  let t = new URLSearchParams();
637
620
  e.cursor != null && t.set("cursor", e.cursor), e.limit != null && t.set("limit", String(e.limit)), e.includeTotal != null && t.set("includeTotal", String(e.includeTotal));
638
621
  let n = t.size == 0 ? "" : `?${t}`;
639
- return O(await this.request(`/v1/projects${n}`));
622
+ return O(await this.request(`/v1/flows${n}`));
623
+ }
624
+ async listVariables() {
625
+ let e = a(await this.request("/v1/variables"));
626
+ return s(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? i() : {
627
+ variables: e.variables.map(k),
628
+ version: 1
629
+ };
640
630
  }
641
- async createProject(e, t = `project-${crypto.randomUUID()}`) {
642
- return D(await this.request("/v1/projects", {
631
+ async getVariable(e) {
632
+ return k(await this.request(`/v1/variables/${Y(e)}`));
633
+ }
634
+ async putVariable(e, t) {
635
+ return k(await this.request(`/v1/variables/${Y(e)}`, {
636
+ body: JSON.stringify({ value: t }),
637
+ method: "PUT"
638
+ }));
639
+ }
640
+ async deleteVariable(e) {
641
+ let t = a(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
642
+ if (s(t, ["version"]), t.version != 1) return i();
643
+ }
644
+ async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
645
+ return D(await this.request("/v1/flows", {
643
646
  body: JSON.stringify({
644
647
  name: e,
645
648
  version: 1
@@ -648,11 +651,20 @@ var $ = class {
648
651
  method: "POST"
649
652
  }));
650
653
  }
651
- async getProject(e) {
652
- return D(await this.request(`/v1/projects/${Z(e)}`));
654
+ async getFlow(e) {
655
+ return D(await this.request(`/v1/flows/${Y(e)}`));
656
+ }
657
+ async renameFlow(e, t) {
658
+ return D(await this.request(`/v1/flows/${Y(e)}`, {
659
+ body: JSON.stringify({
660
+ name: t,
661
+ version: 1
662
+ }),
663
+ method: "PATCH"
664
+ }));
653
665
  }
654
- async deleteProject(e) {
655
- return D(await this.request(`/v1/projects/${Z(e)}`, { method: "DELETE" }));
666
+ async deleteFlow(e) {
667
+ return D(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
656
668
  }
657
669
  async listTriggerKeys(e) {
658
670
  let t = a(await this.request("/v1/trigger-keys", { signal: e }));
@@ -663,102 +675,87 @@ var $ = class {
663
675
  return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
664
676
  }
665
677
  async getTriggerKey(e, t) {
666
- let n = a(await this.request(`/v1/trigger-keys/${Z(e)}`, { signal: t }));
678
+ let n = a(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
667
679
  return n.version == 1 ? _(n.definition) : i();
668
680
  }
669
- async listFlowTriggerBindings(e, t) {
670
- let n = a(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers`));
671
- return n.version != 1 || o(n.projectId) != e || o(n.flowId) != t || !Array.isArray(n.bindings) ? i() : n.bindings.map(S);
681
+ async listFlowTriggerBindings(e) {
682
+ let t = a(await this.request(`/v1/flows/${Y(e)}/triggers`));
683
+ return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
672
684
  }
673
- async getFlowTriggerBinding(e, t, n) {
674
- return C(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers/${Z(n)}`));
685
+ async getFlowTriggerBinding(e, t) {
686
+ return C(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
675
687
  }
676
- async listFlowTriggerActivities(e, t, n, r = {}) {
677
- let i = new URLSearchParams();
678
- r.cursor != null && i.set("cursor", r.cursor), r.limit != null && i.set("limit", String(r.limit));
679
- let a = i.size == 0 ? "" : `?${i}`;
680
- return T(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers/${Z(n)}/activities${a}`));
688
+ async listFlowTriggerActivities(e, t, n = {}) {
689
+ let r = new URLSearchParams();
690
+ n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
691
+ let i = r.size == 0 ? "" : `?${r}`;
692
+ return T(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
681
693
  }
682
- async pauseFlowTrigger(e, t, n) {
683
- return S(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers/${Z(n)}/pause`, {
694
+ async pauseFlowTrigger(e, t) {
695
+ return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
684
696
  body: JSON.stringify({ version: 1 }),
685
697
  method: "POST"
686
698
  }));
687
699
  }
688
- async resumeFlowTrigger(e, t, n) {
689
- return S(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers/${Z(n)}/resume`, {
700
+ async resumeFlowTrigger(e, t) {
701
+ return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
690
702
  body: JSON.stringify({ version: 1 }),
691
703
  method: "POST"
692
704
  }));
693
705
  }
694
- async testFlowPollTrigger(e, t, n) {
695
- return E(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/triggers/${Z(n)}/test`, {
706
+ async testFlowPollTrigger(e, t) {
707
+ return E(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
696
708
  body: JSON.stringify({ version: 1 }),
697
709
  method: "POST"
698
710
  }));
699
711
  }
700
712
  async getDraft(e) {
701
- return A(await this.request(`/v1/projects/${Z(e)}/draft`));
713
+ return j(await this.request(`/v1/flows/${Y(e)}/draft`));
702
714
  }
703
715
  async syncDraft(e, t) {
704
- let n = t == null ? "" : `?fromRevisionId=${Z(t)}`;
705
- return N(await this.request(`/v1/projects/${Z(e)}/draft/sync${n}`));
716
+ let n = t == null ? "" : `?fromRevisionId=${Y(t)}`;
717
+ return N(await this.request(`/v1/flows/${Y(e)}/draft/sync${n}`));
706
718
  }
707
719
  async getRevision(e, t) {
708
- return A(await this.request(`/v1/projects/${Z(e)}/revisions/${Z(t)}`));
709
- }
710
- async listFlows(e) {
711
- return I(await this.request(`/v1/projects/${Z(e)}/flows`));
720
+ return j(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
712
721
  }
713
- async listConnectorProviders(e, t) {
714
- let n = a(await this.request(`/v1/projects/${Z(e)}/connector/providers`, { signal: t }));
715
- return s(n, [
716
- "projectId",
717
- "providers",
718
- "version"
719
- ]), n.version != 1 || o(n.projectId) != e || !Array.isArray(n.providers) ? i() : n.providers.map(h);
722
+ async listConnectorProviders(e) {
723
+ let t = a(await this.request("/v1/connector/providers", { signal: e }));
724
+ return s(t, ["providers", "version"]), t.version != 1 || !Array.isArray(t.providers) ? i() : t.providers.map(h);
720
725
  }
721
- async listConnectorActions(e, t, n) {
722
- return await this.connectorActions(e, t == null ? {} : { service: t }, n);
726
+ async listConnectorActions(e, t) {
727
+ return await this.connectorActions(e == null ? {} : { service: e }, t);
723
728
  }
724
- async searchConnectorActions(e, t, n) {
725
- return await this.connectorActions(e, { q: t.trim() }, n);
729
+ async searchConnectorActions(e, t) {
730
+ return await this.connectorActions({ q: e.trim() }, t);
726
731
  }
727
- async getConnectorAction(e, t, n) {
728
- let r = a(await this.request(`/v1/projects/${Z(e)}/connector/actions/${Z(t)}`, { signal: n }));
729
- return s(r, [
730
- "action",
731
- "projectId",
732
- "version"
733
- ]), r.version != 1 || o(r.projectId) != e ? i() : m(r.action);
732
+ async getConnectorAction(e, t) {
733
+ let n = a(await this.request(`/v1/connector/actions/${Y(e)}`, { signal: t }));
734
+ return s(n, ["action", "version"]), n.version == 1 ? m(n.action) : i();
734
735
  }
735
- async listConnectorConnections(e, t, n) {
736
- let r = a(await this.request(`/v1/projects/${Z(e)}/connector/connections/${Z(t)}`, { signal: n }));
737
- return s(r, [
736
+ async listConnectorConnections(e, t) {
737
+ let n = a(await this.request(`/v1/connector/connections/${Y(e)}`, { signal: t }));
738
+ return s(n, [
738
739
  "connections",
739
- "projectId",
740
740
  "serviceId",
741
741
  "version"
742
- ]), r.version != 1 || o(r.projectId) != e || o(r.serviceId) != t || !Array.isArray(r.connections) ? i() : r.connections.map(u);
742
+ ]), n.version != 1 || o(n.serviceId) != e || !Array.isArray(n.connections) ? i() : n.connections.map(u);
743
743
  }
744
- async createConnectorConnectionPage(e, t, n) {
745
- let r = a(await this.request(`/v1/projects/${Z(e)}/connector/connections/${Z(t)}/page`, {
746
- body: JSON.stringify({
747
- returnUrl: n,
748
- version: 1
749
- }),
744
+ async createConnectorConnectionPage(e) {
745
+ let t = a(await this.request(`/v1/connector/connections/${Y(e)}/page`, {
746
+ body: JSON.stringify({ version: 1 }),
750
747
  method: "POST"
751
748
  }));
752
- if (s(r, ["url", "version"]), r.version != 1) return i();
749
+ if (s(t, ["url", "version"]), t.version != 1) return i();
753
750
  try {
754
- let e = new URL(o(r.url));
751
+ let e = new URL(o(t.url));
755
752
  return e.protocol != "http:" && e.protocol != "https:" ? i() : e.href;
756
753
  } catch {
757
754
  return i();
758
755
  }
759
756
  }
760
757
  async changeDraft(e, t, n) {
761
- return M(await this.request(`/v1/projects/${Z(e)}/draft/changes`, {
758
+ return M(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
762
759
  body: JSON.stringify({
763
760
  expectedRevisionId: t,
764
761
  operations: n,
@@ -767,8 +764,8 @@ var $ = class {
767
764
  method: "POST"
768
765
  }));
769
766
  }
770
- async checkFlow(e, t, n) {
771
- return R(await this.request(`/v1/projects/${Z(e)}/revisions/${Z(t)}/flows/${Z(n)}/check`, {
767
+ async checkFlow(e, t) {
768
+ return I(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
772
769
  body: JSON.stringify({
773
770
  engineContract: "open-flow-engine/v1",
774
771
  version: 1
@@ -776,90 +773,87 @@ var $ = class {
776
773
  method: "POST"
777
774
  }));
778
775
  }
779
- async getLive(e, t) {
780
- return z(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/live`));
776
+ async getLive(e) {
777
+ return L(await this.request(`/v1/flows/${Y(e)}/live`));
781
778
  }
782
- async listPublications(e, t, n = {}) {
783
- let r = new URLSearchParams();
784
- n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit)), n.includeTotal != null && r.set("includeTotal", String(n.includeTotal));
785
- let i = r.size == 0 ? "" : `?${r}`;
786
- return B(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/publications${i}`));
779
+ async listPublications(e, t = {}) {
780
+ let n = new URLSearchParams();
781
+ 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));
782
+ let r = n.size == 0 ? "" : `?${n}`;
783
+ return R(await this.request(`/v1/flows/${Y(e)}/publications${r}`));
787
784
  }
788
- async createDraftRun(e, t, n, r = {}) {
789
- let a = W(await this.request(`/v1/projects/${Z(e)}/revisions/${Z(t)}/flows/${Z(n)}/runs`, {
785
+ async createDraftRun(e, t, n = {}) {
786
+ let r = H(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
790
787
  body: JSON.stringify({
791
788
  engineContract: "open-flow-engine/v1",
792
- inputs: r.inputs ?? {},
789
+ inputs: n.inputs ?? {},
793
790
  version: 1
794
791
  }),
795
- headers: { "idempotency-key": r.idempotencyKey ?? Q("run") },
792
+ headers: { "idempotency-key": n.idempotencyKey ?? X("run") },
796
793
  method: "POST"
797
794
  }));
798
- return a.source == "draft" ? a : i();
795
+ return r.source == "draft" ? r : i();
799
796
  }
800
- async createLiveRun(e, t, n = {}) {
801
- let r = W(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/runs`, {
797
+ async createLiveRun(e, t = {}) {
798
+ let n = H(await this.request("/v1/runs", {
802
799
  body: JSON.stringify({
803
- inputs: n.inputs ?? {},
800
+ inputs: t.inputs ?? {},
801
+ publicationId: e,
804
802
  version: 1
805
803
  }),
806
- headers: { "idempotency-key": n.idempotencyKey ?? Q("run") },
804
+ headers: { "idempotency-key": t.idempotencyKey ?? X("run") },
807
805
  method: "POST"
808
806
  }));
809
- return r.source == "live" ? r : i();
807
+ return n.source == "live" ? n : i();
810
808
  }
811
- async publishFlow(e, t, n, r, i = {}) {
812
- return P(await this.request(`/v1/projects/${Z(e)}/revisions/${Z(t)}/flows/${Z(n)}/publications`, {
809
+ async publishFlow(e, t, n, r = {}) {
810
+ return P(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
813
811
  body: JSON.stringify({
814
812
  engineContract: "open-flow-engine/v1",
815
- expectedLivePublicationId: r,
813
+ expectedLivePublicationId: n,
816
814
  version: 1
817
815
  }),
818
- headers: { "idempotency-key": i.idempotencyKey ?? Q("publication") },
816
+ headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
819
817
  method: "POST"
820
818
  }));
821
819
  }
822
- async rollbackFlow(e, t, n, r, i = {}) {
823
- return P(await this.request(`/v1/projects/${Z(e)}/flows/${Z(t)}/publications/${Z(n)}/rollback`, {
820
+ async rollbackFlow(e, t, n, r = {}) {
821
+ return P(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
824
822
  body: JSON.stringify({
825
- expectedLivePublicationId: r,
823
+ expectedLivePublicationId: n,
826
824
  version: 1
827
825
  }),
828
- headers: { "idempotency-key": i.idempotencyKey ?? Q("publication") },
826
+ headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
829
827
  method: "POST"
830
828
  }));
831
829
  }
832
- async getRun(e, t) {
833
- return W(await this.request(`/v1/projects/${Z(e)}/runs/${Z(t)}`));
830
+ async getRun(e) {
831
+ return H(await this.request(`/v1/runs/${Y(e)}`));
834
832
  }
835
833
  async listRuns(e, t = {}) {
836
834
  let n = new URLSearchParams();
837
- t.cursor != null && n.set("cursor", t.cursor), t.flowId != null && n.set("flowId", t.flowId), t.limit != null && n.set("limit", String(t.limit)), t.status != null && n.set("status", t.status);
835
+ 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);
838
836
  let r = n.size == 0 ? "" : `?${n}`;
839
- return G(await this.request(`/v1/projects/${Z(e)}/runs${r}`));
837
+ return U(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
840
838
  }
841
- async getRunEvents(e, t, n = {}) {
842
- let r = new URLSearchParams();
843
- n.after != null && r.set("after", String(n.after)), n.limit != null && r.set("limit", String(n.limit));
844
- let i = r.size == 0 ? "" : `?${r}`;
845
- return J(await this.request(`/v1/projects/${Z(e)}/runs/${Z(t)}/events${i}`));
839
+ async getRunEvents(e, t = {}) {
840
+ let n = new URLSearchParams();
841
+ t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
842
+ let r = n.size == 0 ? "" : `?${n}`;
843
+ return K(await this.request(`/v1/runs/${Y(e)}/events${r}`));
846
844
  }
847
- async getRunResult(e, t) {
848
- return X(await this.request(`/v1/projects/${Z(e)}/runs/${Z(t)}/result`));
845
+ async getRunResult(e) {
846
+ return J(await this.request(`/v1/runs/${Y(e)}/result`));
849
847
  }
850
- async cancelRun(e, t) {
851
- return Y(await this.request(`/v1/projects/${Z(e)}/runs/${Z(t)}/cancel`, {
848
+ async cancelRun(e) {
849
+ return q(await this.request(`/v1/runs/${Y(e)}/cancel`, {
852
850
  body: JSON.stringify({ version: 1 }),
853
851
  method: "POST"
854
852
  }));
855
853
  }
856
- async connectorActions(e, t, n) {
857
- let r = Object.entries(t).map(([e, t]) => `${Z(e)}=${Z(t)}`).join("&"), c = r == "" ? "" : `?${r}`, l = a(await this.request(`/v1/projects/${Z(e)}/connector/actions${c}`, { signal: n }));
858
- return s(l, [
859
- "actions",
860
- "projectId",
861
- "version"
862
- ]), l.version != 1 || o(l.projectId) != e || !Array.isArray(l.actions) ? i() : l.actions.map(m);
854
+ async connectorActions(e, t) {
855
+ 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 }));
856
+ return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
863
857
  }
864
858
  async request(e, t = {}) {
865
859
  let n = new Headers(t.headers);
@@ -881,4 +875,4 @@ var $ = class {
881
875
  }
882
876
  };
883
877
  //#endregion
884
- export { r as ApiError, $ as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
878
+ export { r as ApiError, Z as ControlClient, e as controlErrorCode, t as controlErrorMetadata };