@oomol-lab/open-flow 0.1.0-beta.16 → 0.1.0-beta.18

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 (33) hide show
  1. package/dist/browser/{createResourceDialog-DRUIXBbz.js → createResourceDialog-DlrAMxmo.js} +2 -2
  2. package/dist/browser/flow-authoring.js +1464 -1463
  3. package/dist/browser/flow-change.js +1 -0
  4. package/dist/browser/{flowChanges-iuoam3Bx.js → flowChanges-DR6bsnz-.js} +1745 -1484
  5. package/dist/browser/{flowWorkspace-B0UAQ-s7.js → flowWorkspace-fsNhVe8S.js} +32429 -29399
  6. package/dist/browser/{i18n-JtW9O5x3.js → i18n-9ypjMjOo.js} +167 -27
  7. package/dist/browser/{inputValues-DICmJoN-.js → inputValues-MIPdGucY.js} +2 -2
  8. package/dist/browser/licenses.md +48 -0
  9. package/dist/browser/{markdownContent-tWc7bRAs.js → markdownContent-BBgH9ZIV.js} +13 -13
  10. package/dist/browser/theme.css +9 -9
  11. package/dist/browser/ui.css +1 -1
  12. package/dist/browser/ui.d.ts +9 -0
  13. package/dist/browser/ui.js +1219 -1022
  14. package/dist/browser/{useValueChanged-DSookOEC.js → useValueChanged-BY05Usw-.js} +3 -3
  15. package/dist/browser/workbench.css +1 -1
  16. package/dist/browser/workbench.js +931 -629
  17. package/dist/browser/{workbenchSelect-DgxXqCAa.js → workbenchSelect-CwP6rphY.js} +4 -3
  18. package/dist/common/control-api-conformance.js +389 -394
  19. package/dist/common/control-api-errors.d.ts +5 -0
  20. package/dist/common/control-api.d.ts +1 -6
  21. package/dist/common/control-api.js +1019 -1003
  22. package/dist/common/control-requests.js +1 -0
  23. package/dist/common/engine-contract.d.ts +2 -0
  24. package/dist/common/flow-encoding.js +1 -0
  25. package/dist/common/flow-semantics.js +2802 -2767
  26. package/dist/common/integration-trigger.d.ts +23 -1
  27. package/dist/common/integration-trigger.js +188 -52
  28. package/dist/common/mcp.js +409 -391
  29. package/dist/common/provider-triggers.js +890 -842
  30. package/dist/common/runtime-contract.d.ts +2 -1
  31. package/dist/common/runtime-contract.js +99 -28
  32. package/dist/common/scheduler.js +1255 -1254
  33. package/package.json +1 -1
@@ -4657,6 +4657,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4657
4657
  }),
4658
4658
  M({
4659
4659
  ...kc,
4660
+ inputs: _s().transform(() => ({})).default({}),
4660
4661
  kind: L("value"),
4661
4662
  values: j(B)
4662
4663
  }),
@@ -4979,7 +4980,7 @@ function Yc(e) {
4979
4980
  function Xc(e) {
4980
4981
  return Jc.parse(e);
4981
4982
  }
4982
- new TextEncoder(), new TextEncoder();
4983
+ new TextEncoder();
4983
4984
  //#endregion
4984
4985
  //#region src/control/common/errors.ts
4985
4986
  var H = {
@@ -5020,32 +5021,15 @@ var H = {
5020
5021
  variableNotFound: "variable.not-found"
5021
5022
  };
5022
5023
  H.authenticationRequired, H.authorizationDenied, H.bindingUnresolved, H.connectorActionNotFound, H.connectorUnconfigured, H.connectorUnavailable, H.engineUnavailable, H.engineUnsupported, H.flowInvalid, H.flowNotFound, H.flowBusy, H.flowConflict, H.flowPresentationConflict, H.flowRevisionConflict, H.liveConflict, H.liveNotFound, H.pageInvalidCursor, H.publicationConflict, H.publicationNotFound, H.publicationUnsupported, H.publishOperationNotFound, H.routeNotFound, H.runConflict, H.runEventsExpired, H.runInvalid, H.runNotFound, H.runNotTerminal, H.runOverloaded, H.runWaitNotFound, H.triggerKeyInvalid, H.triggerKeyNotFound, H.triggerNotFound, H.variableInvalid, H.variableLimitReached, H.variableNotFound;
5023
- //#endregion
5024
- //#region src/control/common/random.ts
5025
- function Zc() {
5026
- let e = globalThis.crypto;
5027
- if (e != null) {
5028
- try {
5029
- if (typeof e.randomUUID == "function") return e.randomUUID();
5030
- } catch {}
5031
- if (typeof e.getRandomValues == "function") {
5032
- let t = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
5033
- t[6] = (t[6] ?? 0) & 15 | 64, t[8] = (t[8] ?? 0) & 63 | 128;
5034
- let n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
5035
- return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
5036
- }
5037
- }
5038
- return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
5039
- }
5040
- //#endregion
5041
- //#region src/control/common/api.ts
5042
- var Qc = class extends Error {
5024
+ var Zc = class extends Error {
5043
5025
  constructor(e, t, n) {
5044
5026
  super(n), this.code = t, this.name = "ApiError", this.status = e;
5045
5027
  }
5046
5028
  };
5029
+ //#endregion
5030
+ //#region src/control/common/decoding.ts
5047
5031
  function U() {
5048
- throw new Qc(502, "response.invalid", "The Control API returned an invalid response.");
5032
+ throw new Zc(502, "response.invalid", "The Control API returned an invalid response.");
5049
5033
  }
5050
5034
  function W(e) {
5051
5035
  return typeof e != "object" || !e || Array.isArray(e) ? U() : e;
@@ -5066,7 +5050,39 @@ function J(e) {
5066
5050
  let t = W(e);
5067
5051
  return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
5068
5052
  }
5053
+ function Qc(e) {
5054
+ if (e != null) return G(e);
5055
+ }
5056
+ //#endregion
5057
+ //#region src/control/common/checkDecoders.ts
5069
5058
  function $c(e) {
5059
+ let t = W(e), n = t.values == null ? void 0 : W(t.values);
5060
+ return {
5061
+ code: G(t.code),
5062
+ column: q(t.column),
5063
+ line: q(t.line),
5064
+ message: G(t.message),
5065
+ path: typeof t.path == "string" ? t.path : U(),
5066
+ ...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : U()])) }
5067
+ };
5068
+ }
5069
+ function el(e) {
5070
+ let t = W(e);
5071
+ return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? U() : {
5072
+ closureDigest: G(t.closureDigest),
5073
+ diagnostics: t.diagnostics.map($c),
5074
+ engineContract: G(t.engineContract),
5075
+ flowId: G(t.flowId),
5076
+ modelVersion: q(t.modelVersion),
5077
+ revisionDigest: G(t.revisionDigest),
5078
+ revisionId: G(t.revisionId),
5079
+ valid: t.valid,
5080
+ version: 1
5081
+ };
5082
+ }
5083
+ //#endregion
5084
+ //#region src/control/common/connectorDecoders.ts
5085
+ function tl(e) {
5070
5086
  let t = W(e);
5071
5087
  K(t, [
5072
5088
  ...Object.hasOwn(t, "alias") ? ["alias"] : [],
@@ -5086,7 +5102,7 @@ function $c(e) {
5086
5102
  status: n
5087
5103
  };
5088
5104
  }
5089
- function el(e, t = !1) {
5105
+ function nl(e, t = !1) {
5090
5106
  let n = W(e), r = n.description, i = t && Object.hasOwn(n, "value");
5091
5107
  return K(n, [
5092
5108
  "jsonSchema",
@@ -5100,13 +5116,13 @@ function el(e, t = !1) {
5100
5116
  ...i ? { value: J(n.value) } : {}
5101
5117
  };
5102
5118
  }
5103
- function tl(e) {
5104
- return el(e, !0);
5119
+ function rl(e) {
5120
+ return nl(e, !0);
5105
5121
  }
5106
- function nl(e, t) {
5122
+ function il(e, t) {
5107
5123
  return Object.fromEntries(Object.entries(W(e)).map(([e, n]) => [e, t(n)]));
5108
5124
  }
5109
- function rl(e) {
5125
+ function al(e) {
5110
5126
  let t = W(e), n = t.homepageUrl, r = t.icon, i = t.defaultConnection != null;
5111
5127
  if (K(t, [
5112
5128
  "actionId",
@@ -5128,19 +5144,19 @@ function rl(e) {
5128
5144
  ...t.outputSchema === void 0 ? {} : { outputSchema: J(t.outputSchema) },
5129
5145
  actionId: G(t.actionId),
5130
5146
  authenticated: typeof t.authenticated == "boolean" ? t.authenticated : U(),
5131
- ...i ? { defaultConnection: $c(t.defaultConnection) } : {},
5147
+ ...i ? { defaultConnection: tl(t.defaultConnection) } : {},
5132
5148
  description: typeof t.description == "string" ? t.description : U(),
5133
5149
  ...n == null ? {} : { homepageUrl: n },
5134
5150
  ...r == null ? {} : { icon: r },
5135
- inputs: nl(t.inputs, tl),
5151
+ inputs: il(t.inputs, rl),
5136
5152
  name: G(t.name),
5137
- outputs: nl(t.outputs, el),
5153
+ outputs: il(t.outputs, nl),
5138
5154
  serviceId: G(t.serviceId),
5139
5155
  serviceName: G(t.serviceName)
5140
5156
  };
5141
5157
  return a.defaultConnection != null && (a.defaultConnection.serviceId != a.serviceId || a.defaultConnection.status != "active") ? U() : a;
5142
5158
  }
5143
- function il(e) {
5159
+ function ol(e) {
5144
5160
  let t = W(e), n = t.homepageUrl, r = t.icon;
5145
5161
  return K(t, [
5146
5162
  "serviceId",
@@ -5154,141 +5170,9 @@ function il(e) {
5154
5170
  serviceName: G(t.serviceName)
5155
5171
  };
5156
5172
  }
5157
- function al(e) {
5158
- let t = W(e), n = t.type;
5159
- return n != "integration" && n != "poll" ? U() : {
5160
- description: typeof t.description == "string" ? t.description : U(),
5161
- displayName: G(t.displayName),
5162
- key: G(t.key),
5163
- name: G(t.name),
5164
- provider: G(t.provider),
5165
- type: n
5166
- };
5167
- }
5168
- function ol(e) {
5169
- let t = W(e), n = al(t), r = {
5170
- configSchema: J(t.configSchema),
5171
- definitionVersion: q(t.definitionVersion),
5172
- description: n.description,
5173
- displayName: n.displayName,
5174
- key: n.key,
5175
- name: n.name,
5176
- payloadSchema: J(t.payloadSchema),
5177
- provider: n.provider
5178
- };
5179
- if (n.type == "poll") return {
5180
- ...r,
5181
- type: "poll"
5182
- };
5183
- let i = W(t.endpoint), a = W(i.body);
5184
- if (!Array.isArray(i.methods) || !Array.isArray(a.formats) || typeof a.allowArray != "boolean" || typeof a.allowEmpty != "boolean") return U();
5185
- let o = i.methods.map(G), s = a.formats.map(G), c = q(i.successStatus);
5186
- return o.some((e) => ![
5187
- "DELETE",
5188
- "GET",
5189
- "HEAD",
5190
- "PATCH",
5191
- "POST",
5192
- "PUT"
5193
- ].includes(e)) || s.some((e) => ![
5194
- "form",
5195
- "json",
5196
- "multipart",
5197
- "text"
5198
- ].includes(e)) || c < 200 || c > 299 ? U() : {
5199
- ...r,
5200
- endpoint: {
5201
- body: {
5202
- allowArray: a.allowArray,
5203
- allowEmpty: a.allowEmpty,
5204
- formats: s
5205
- },
5206
- methods: o,
5207
- successStatus: c
5208
- },
5209
- type: "integration"
5210
- };
5211
- }
5212
- var sl = /* @__PURE__ */ new Set([
5213
- "cron",
5214
- "integration",
5215
- "poll",
5216
- "webhook"
5217
- ]), cl = /* @__PURE__ */ new Set([
5218
- "failed",
5219
- "healthy",
5220
- "initializing",
5221
- "needs_reauth",
5222
- "suspended"
5223
- ]), ll = /* @__PURE__ */ new Set([
5224
- "delivery.failed",
5225
- "health.failed",
5226
- "health.needs_reauth",
5227
- "health.recovered",
5228
- "health.suspended",
5229
- "operator.paused",
5230
- "operator.resumed"
5231
- ]);
5232
- function ul(e) {
5233
- if (e != null) return G(e);
5234
- }
5235
- function dl(e) {
5236
- let t = W(e), n = t.health, r = t.kind, i = t.operatorState, a = q(t.runtimeVersion);
5237
- return t.version != 1 || typeof n != "string" || !cl.has(n) || typeof r != "string" || !sl.has(r) || i != "active" && i != "paused" || a <= 0 ? U() : {
5238
- ...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
5239
- ...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
5240
- ...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
5241
- flowId: G(t.flowId),
5242
- health: n,
5243
- kind: r,
5244
- ...t.lastErrorCode == null ? {} : { lastErrorCode: G(t.lastErrorCode) },
5245
- operatorState: i,
5246
- runtimeVersion: a,
5247
- triggerNodeId: G(t.triggerNodeId),
5248
- updatedAt: G(t.updatedAt),
5249
- version: 1
5250
- };
5251
- }
5252
- function fl(e) {
5253
- let t = W(e);
5254
- return t.version == 1 ? {
5255
- binding: dl(t.binding),
5256
- version: 1
5257
- } : U();
5258
- }
5259
- function pl(e) {
5260
- let t = W(e), n = t.kind;
5261
- if (typeof n != "string" || !ll.has(n)) return U();
5262
- let r = ul(t.errorCode), i = ul(t.errorMessage);
5263
- return i != null && i.length > 512 ? U() : {
5264
- activityId: G(t.activityId),
5265
- createdAt: G(t.createdAt),
5266
- ...r == null ? {} : { errorCode: r },
5267
- ...i == null ? {} : { errorMessage: i },
5268
- kind: n
5269
- };
5270
- }
5271
- function ml(e) {
5272
- let t = W(e), n = ul(t.nextCursor);
5273
- return t.version != 1 || !Array.isArray(t.activities) ? U() : {
5274
- activities: t.activities.map(pl),
5275
- ...n == null ? {} : { nextCursor: n },
5276
- version: 1
5277
- };
5278
- }
5279
- function hl(e) {
5280
- let t = W(e), n = q(t.filtered);
5281
- return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
5282
- events: t.events.map((e) => {
5283
- let t = W(e);
5284
- return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
5285
- }),
5286
- filtered: n,
5287
- hasMore: t.hasMore,
5288
- version: 1
5289
- };
5290
- }
5291
- function gl(e) {
5173
+ //#endregion
5174
+ //#region src/control/common/flowDecoders.ts
5175
+ function sl(e) {
5292
5176
  let t = W(e), n = t.status;
5293
5177
  if (t.version != 1 || n != "active" && n != "retiring") return U();
5294
5178
  let r = t.live == null ? void 0 : W(t.live);
@@ -5307,18 +5191,18 @@ function gl(e) {
5307
5191
  version: 1
5308
5192
  };
5309
5193
  }
5310
- function _l(e) {
5194
+ function cl(e) {
5311
5195
  let t = W(e);
5312
5196
  if (t.version != 1 || !Array.isArray(t.flows)) return U();
5313
5197
  let n = t.nextCursor, r = t.total;
5314
5198
  return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
5315
5199
  ...n == null ? {} : { nextCursor: n },
5316
- flows: t.flows.map(gl),
5200
+ flows: t.flows.map(sl),
5317
5201
  ...r == null ? {} : { total: r },
5318
5202
  version: 1
5319
5203
  };
5320
5204
  }
5321
- function vl(e) {
5205
+ function ll(e) {
5322
5206
  let t = W(e);
5323
5207
  if (K(t, [
5324
5208
  "name",
@@ -5339,60 +5223,9 @@ function vl(e) {
5339
5223
  version: 1
5340
5224
  };
5341
5225
  }
5342
- function yl(e) {
5343
- let t = W(e), n = t.parentRevisionId;
5344
- return t.version != 1 || n !== null && typeof n != "string" ? U() : {
5345
- actorId: G(t.actorId),
5346
- createdAt: G(t.createdAt),
5347
- digest: G(t.digest),
5348
- flowId: G(t.flowId),
5349
- modelVersion: q(t.modelVersion),
5350
- parentRevisionId: n,
5351
- revisionId: G(t.revisionId),
5352
- version: 1
5353
- };
5354
- }
5355
- function bl(e) {
5356
- let t = W(e);
5357
- try {
5358
- return {
5359
- ...yl(t),
5360
- content: zc(t.content)
5361
- };
5362
- } catch {
5363
- return U();
5364
- }
5365
- }
5366
- function xl(e) {
5367
- let t = W(e);
5368
- return K(t, [
5369
- "revision",
5370
- "updatedAt",
5371
- "value",
5372
- "version"
5373
- ]), t.version != 1 || q(t.revision) < 1 ? U() : {
5374
- revision: q(t.revision),
5375
- updatedAt: G(t.updatedAt),
5376
- value: Object.fromEntries(Object.entries(W(t.value)).map(([e, t]) => [e, J(t)])),
5377
- version: 1
5378
- };
5379
- }
5380
- function Sl(e) {
5381
- let t = W(e);
5382
- return t.version == 1 ? {
5383
- revision: yl(t.revision),
5384
- version: 1
5385
- } : U();
5386
- }
5387
- function Cl(e) {
5388
- let t = W(e);
5389
- return t.version != 1 || t.kind != "snapshot" ? U() : {
5390
- draft: bl(t.draft),
5391
- kind: "snapshot",
5392
- version: 1
5393
- };
5394
- }
5395
- function wl(e) {
5226
+ //#endregion
5227
+ //#region src/control/common/publicationDecoders.ts
5228
+ function ul(e) {
5396
5229
  let t = W(e), n = t.operation, r = t.sourcePublicationId;
5397
5230
  return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? U() : {
5398
5231
  actorId: G(t.actorId),
@@ -5409,7 +5242,7 @@ function wl(e) {
5409
5242
  version: 1
5410
5243
  };
5411
5244
  }
5412
- function Tl(e) {
5245
+ function dl(e) {
5413
5246
  let t = W(e), n = t.status, r = {
5414
5247
  createdAt: G(t.createdAt),
5415
5248
  flowId: G(t.flowId),
@@ -5475,56 +5308,89 @@ function Tl(e) {
5475
5308
  default: return U();
5476
5309
  }
5477
5310
  }
5478
- function El(e) {
5479
- let t = W(e), n = t.values == null ? void 0 : W(t.values);
5480
- return {
5481
- code: G(t.code),
5482
- column: q(t.column),
5483
- line: q(t.line),
5484
- message: G(t.message),
5485
- path: typeof t.path == "string" ? t.path : U(),
5486
- ...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : U()])) }
5311
+ function fl(e) {
5312
+ let t = W(e), n = t.status, r = t.publication;
5313
+ 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 ? U() : {
5314
+ flowId: G(t.flowId),
5315
+ hasUnpublishedChanges: t.hasUnpublishedChanges,
5316
+ publication: r === null ? null : ul(r),
5317
+ revision: q(t.revision),
5318
+ status: n,
5319
+ version: 1
5487
5320
  };
5488
5321
  }
5489
- function Dl(e) {
5490
- let t = W(e);
5491
- return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? U() : {
5492
- closureDigest: G(t.closureDigest),
5493
- diagnostics: t.diagnostics.map(El),
5494
- engineContract: G(t.engineContract),
5495
- flowId: G(t.flowId),
5322
+ function pl(e) {
5323
+ let t = W(e), n = t.nextCursor, r = t.total;
5324
+ return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
5325
+ ...n == null ? {} : { nextCursor: n },
5326
+ publications: t.publications.map(ul),
5327
+ ...r == null ? {} : { total: r },
5328
+ version: 1
5329
+ };
5330
+ }
5331
+ new TextEncoder();
5332
+ //#endregion
5333
+ //#region src/control/common/revisionDecoders.ts
5334
+ function ml(e) {
5335
+ let t = W(e), n = t.parentRevisionId;
5336
+ return t.version != 1 || n !== null && typeof n != "string" ? U() : {
5337
+ actorId: G(t.actorId),
5338
+ createdAt: G(t.createdAt),
5339
+ digest: G(t.digest),
5340
+ flowId: G(t.flowId),
5496
5341
  modelVersion: q(t.modelVersion),
5497
- revisionDigest: G(t.revisionDigest),
5342
+ parentRevisionId: n,
5498
5343
  revisionId: G(t.revisionId),
5499
- valid: t.valid,
5500
5344
  version: 1
5501
5345
  };
5502
5346
  }
5503
- function Ol(e) {
5504
- let t = W(e), n = t.status, r = t.publication;
5505
- 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 ? U() : {
5506
- flowId: G(t.flowId),
5507
- hasUnpublishedChanges: t.hasUnpublishedChanges,
5508
- publication: r === null ? null : wl(r),
5347
+ function hl(e) {
5348
+ let t = W(e);
5349
+ try {
5350
+ return {
5351
+ ...ml(t),
5352
+ content: zc(t.content)
5353
+ };
5354
+ } catch {
5355
+ return U();
5356
+ }
5357
+ }
5358
+ function gl(e) {
5359
+ let t = W(e);
5360
+ return K(t, [
5361
+ "revision",
5362
+ "updatedAt",
5363
+ "value",
5364
+ "version"
5365
+ ]), t.version != 1 || q(t.revision) < 1 ? U() : {
5509
5366
  revision: q(t.revision),
5510
- status: n,
5367
+ updatedAt: G(t.updatedAt),
5368
+ value: Object.fromEntries(Object.entries(W(t.value)).map(([e, t]) => [e, J(t)])),
5511
5369
  version: 1
5512
5370
  };
5513
5371
  }
5514
- function kl(e) {
5515
- let t = W(e), n = t.nextCursor, r = t.total;
5516
- return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
5517
- ...n == null ? {} : { nextCursor: n },
5518
- publications: t.publications.map(wl),
5519
- ...r == null ? {} : { total: r },
5372
+ function _l(e) {
5373
+ let t = W(e);
5374
+ return t.version == 1 ? {
5375
+ revision: ml(t.revision),
5376
+ version: 1
5377
+ } : U();
5378
+ }
5379
+ function vl(e) {
5380
+ let t = W(e);
5381
+ return t.version != 1 || t.kind != "snapshot" ? U() : {
5382
+ draft: hl(t.draft),
5383
+ kind: "snapshot",
5520
5384
  version: 1
5521
5385
  };
5522
5386
  }
5523
- var Al = new Set(oc);
5524
- function jl(e) {
5525
- return typeof e == "string" && Al.has(e) ? e : U();
5387
+ //#endregion
5388
+ //#region src/control/common/runDecoders.ts
5389
+ var yl = new Set(oc);
5390
+ function bl(e) {
5391
+ return typeof e == "string" && yl.has(e) ? e : U();
5526
5392
  }
5527
- function Ml(e) {
5393
+ function xl(e) {
5528
5394
  let t = W(e), n = t.source, r = t.startedAt, i = t.finishedAt;
5529
5395
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || i != null && typeof i != "string" ? U() : {
5530
5396
  createdAt: G(t.createdAt),
@@ -5534,11 +5400,11 @@ function Ml(e) {
5534
5400
  runId: G(t.runId),
5535
5401
  source: n,
5536
5402
  ...r == null ? {} : { startedAt: r },
5537
- status: jl(t.status),
5403
+ status: bl(t.status),
5538
5404
  version: 1
5539
5405
  };
5540
5406
  }
5541
- function Nl(e) {
5407
+ function Sl(e) {
5542
5408
  let t = W(e);
5543
5409
  K(t, [
5544
5410
  "actions",
@@ -5558,12 +5424,12 @@ function Nl(e) {
5558
5424
  waitingSince: G(t.waitingSince)
5559
5425
  };
5560
5426
  }
5561
- function Pl(e) {
5562
- let t = W(e), n = Ml(t), r = t.eventsExpiresAt;
5427
+ function Cl(e) {
5428
+ let t = W(e), n = xl(t), r = t.eventsExpiresAt;
5563
5429
  if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return U();
5564
5430
  let i = n.status == "waiting" ? {
5565
5431
  status: "waiting",
5566
- waiting: Nl(t.waiting)
5432
+ waiting: Sl(t.waiting)
5567
5433
  } : { status: n.status }, a = {
5568
5434
  ...n,
5569
5435
  closureDigest: G(t.closureDigest),
@@ -5593,16 +5459,240 @@ function Pl(e) {
5593
5459
  };
5594
5460
  }
5595
5461
  }
5596
- function Fl(e) {
5462
+ function wl(e) {
5597
5463
  let t = W(e), n = t.nextCursor;
5598
5464
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? U() : {
5599
5465
  flowId: G(t.flowId),
5600
5466
  ...n == null ? {} : { nextCursor: n },
5601
- runs: t.runs.map(Ml),
5467
+ runs: t.runs.map(xl),
5468
+ version: 1
5469
+ };
5470
+ }
5471
+ function Tl(e) {
5472
+ let t = W(e), n = bl(t.status);
5473
+ return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? U() : {
5474
+ cancelAccepted: t.cancelAccepted,
5475
+ runId: G(t.runId),
5476
+ status: n,
5477
+ version: 1
5478
+ };
5479
+ }
5480
+ function El(e) {
5481
+ let t = W(e);
5482
+ K(t, [
5483
+ "action",
5484
+ "resolutionAccepted",
5485
+ "resolvedAt",
5486
+ "runId",
5487
+ "status",
5488
+ "version",
5489
+ "waitId"
5490
+ ]);
5491
+ let n = t.action, r = t.resolvedAt;
5492
+ 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 ? U() : {
5493
+ action: n,
5494
+ resolutionAccepted: t.resolutionAccepted,
5495
+ resolvedAt: r,
5496
+ runId: G(t.runId),
5497
+ status: bl(t.status),
5498
+ version: 1,
5499
+ waitId: G(t.waitId)
5500
+ };
5501
+ }
5502
+ function Dl(e) {
5503
+ let t = W(e), n = t.status;
5504
+ if (t.version != 1) return U();
5505
+ let r = {
5506
+ finishedAt: G(t.finishedAt),
5507
+ runId: G(t.runId),
5508
+ version: 1
5509
+ };
5510
+ if (n == "completed") return Object.hasOwn(t, "result") ? {
5511
+ ...r,
5512
+ result: t.result,
5513
+ status: "completed"
5514
+ } : U();
5515
+ if (n == "canceled") return {
5516
+ ...r,
5517
+ status: "canceled"
5518
+ };
5519
+ if (n == "failed") {
5520
+ let e = W(t.error);
5521
+ return {
5522
+ ...r,
5523
+ error: {
5524
+ code: G(e.code),
5525
+ message: G(e.message)
5526
+ },
5527
+ status: "failed"
5528
+ };
5529
+ }
5530
+ if (n == "indeterminate") {
5531
+ let e = W(t.error);
5532
+ return {
5533
+ ...r,
5534
+ error: {
5535
+ code: G(e.code),
5536
+ message: G(e.message)
5537
+ },
5538
+ status: "indeterminate"
5539
+ };
5540
+ }
5541
+ return U();
5542
+ }
5543
+ //#endregion
5544
+ //#region src/control/common/triggerDecoders.ts
5545
+ function Ol(e) {
5546
+ let t = W(e), n = t.type;
5547
+ return n != "integration" && n != "poll" ? U() : {
5548
+ description: typeof t.description == "string" ? t.description : U(),
5549
+ displayName: G(t.displayName),
5550
+ key: G(t.key),
5551
+ name: G(t.name),
5552
+ provider: G(t.provider),
5553
+ type: n
5554
+ };
5555
+ }
5556
+ function kl(e) {
5557
+ let t = W(e), n = Ol(t), r = {
5558
+ configSchema: J(t.configSchema),
5559
+ definitionVersion: q(t.definitionVersion),
5560
+ description: n.description,
5561
+ displayName: n.displayName,
5562
+ key: n.key,
5563
+ name: n.name,
5564
+ payloadSchema: J(t.payloadSchema),
5565
+ provider: n.provider
5566
+ };
5567
+ if (n.type == "poll") return {
5568
+ ...r,
5569
+ type: "poll"
5570
+ };
5571
+ let i = W(t.endpoint), a = W(i.body);
5572
+ if (!Array.isArray(i.methods) || !Array.isArray(a.formats) || typeof a.allowArray != "boolean" || typeof a.allowEmpty != "boolean") return U();
5573
+ let o = i.methods.map(G), s = a.formats.map(G), c = q(i.successStatus);
5574
+ return o.some((e) => ![
5575
+ "DELETE",
5576
+ "GET",
5577
+ "HEAD",
5578
+ "PATCH",
5579
+ "POST",
5580
+ "PUT"
5581
+ ].includes(e)) || s.some((e) => ![
5582
+ "form",
5583
+ "json",
5584
+ "multipart",
5585
+ "text"
5586
+ ].includes(e)) || c < 200 || c > 299 ? U() : {
5587
+ ...r,
5588
+ endpoint: {
5589
+ body: {
5590
+ allowArray: a.allowArray,
5591
+ allowEmpty: a.allowEmpty,
5592
+ formats: s
5593
+ },
5594
+ methods: o,
5595
+ successStatus: c
5596
+ },
5597
+ type: "integration"
5598
+ };
5599
+ }
5600
+ var Al = /* @__PURE__ */ new Set([
5601
+ "cron",
5602
+ "integration",
5603
+ "poll",
5604
+ "webhook"
5605
+ ]), jl = /* @__PURE__ */ new Set([
5606
+ "failed",
5607
+ "healthy",
5608
+ "initializing",
5609
+ "needs_reauth",
5610
+ "suspended"
5611
+ ]), Ml = /* @__PURE__ */ new Set([
5612
+ "delivery.failed",
5613
+ "health.failed",
5614
+ "health.needs_reauth",
5615
+ "health.recovered",
5616
+ "health.suspended",
5617
+ "operator.paused",
5618
+ "operator.resumed"
5619
+ ]);
5620
+ function Nl(e) {
5621
+ let t = W(e), n = t.health, r = t.kind, i = t.operatorState, a = q(t.runtimeVersion);
5622
+ return t.version != 1 || typeof n != "string" || !jl.has(n) || typeof r != "string" || !Al.has(r) || i != "active" && i != "paused" || a <= 0 ? U() : {
5623
+ ...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
5624
+ ...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
5625
+ ...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
5626
+ flowId: G(t.flowId),
5627
+ health: n,
5628
+ kind: r,
5629
+ ...t.lastErrorCode == null ? {} : { lastErrorCode: G(t.lastErrorCode) },
5630
+ operatorState: i,
5631
+ runtimeVersion: a,
5632
+ triggerNodeId: G(t.triggerNodeId),
5633
+ updatedAt: G(t.updatedAt),
5634
+ version: 1
5635
+ };
5636
+ }
5637
+ function Pl(e) {
5638
+ let t = W(e);
5639
+ return t.version == 1 ? {
5640
+ binding: Nl(t.binding),
5602
5641
  version: 1
5642
+ } : U();
5643
+ }
5644
+ function Fl(e) {
5645
+ let t = W(e), n = t.kind;
5646
+ if (typeof n != "string" || !Ml.has(n)) return U();
5647
+ let r = Qc(t.errorCode), i = Qc(t.errorMessage);
5648
+ return i != null && i.length > 512 ? U() : {
5649
+ activityId: G(t.activityId),
5650
+ createdAt: G(t.createdAt),
5651
+ ...r == null ? {} : { errorCode: r },
5652
+ ...i == null ? {} : { errorMessage: i },
5653
+ kind: n
5603
5654
  };
5604
5655
  }
5605
5656
  function Il(e) {
5657
+ let t = W(e), n = Qc(t.nextCursor);
5658
+ return t.version != 1 || !Array.isArray(t.activities) ? U() : {
5659
+ activities: t.activities.map(Fl),
5660
+ ...n == null ? {} : { nextCursor: n },
5661
+ version: 1
5662
+ };
5663
+ }
5664
+ function Ll(e) {
5665
+ let t = W(e), n = q(t.filtered);
5666
+ return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
5667
+ events: t.events.map((e) => {
5668
+ let t = W(e);
5669
+ return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
5670
+ }),
5671
+ filtered: n,
5672
+ hasMore: t.hasMore,
5673
+ version: 1
5674
+ };
5675
+ }
5676
+ //#endregion
5677
+ //#region src/control/common/random.ts
5678
+ function Rl() {
5679
+ let e = globalThis.crypto;
5680
+ if (e != null) {
5681
+ try {
5682
+ if (typeof e.randomUUID == "function") return e.randomUUID();
5683
+ } catch {}
5684
+ if (typeof e.getRandomValues == "function") {
5685
+ let t = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
5686
+ t[6] = (t[6] ?? 0) & 15 | 64, t[8] = (t[8] ?? 0) & 63 | 128;
5687
+ let n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
5688
+ return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
5689
+ }
5690
+ }
5691
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
5692
+ }
5693
+ //#endregion
5694
+ //#region src/control/common/api.ts
5695
+ function zl(e) {
5606
5696
  let t = W(e), n = q(t.sequence);
5607
5697
  if (n < 0) return U();
5608
5698
  let r = {
@@ -5630,7 +5720,7 @@ function Il(e) {
5630
5720
  payload: {
5631
5721
  flowId: G(i.flowId),
5632
5722
  scopeId: G(i.scopeId),
5633
- progress: Ll(i.progress)
5723
+ progress: Bl(i.progress)
5634
5724
  }
5635
5725
  };
5636
5726
  case "run.waiting": return {
@@ -5733,7 +5823,7 @@ function Il(e) {
5733
5823
  kind: a,
5734
5824
  payload: {
5735
5825
  ...e,
5736
- progress: Ll(i.progress)
5826
+ progress: Bl(i.progress)
5737
5827
  }
5738
5828
  };
5739
5829
  case "node.artifact": {
@@ -5759,14 +5849,14 @@ function Il(e) {
5759
5849
  default: return U();
5760
5850
  }
5761
5851
  }
5762
- function Ll(e) {
5852
+ function Bl(e) {
5763
5853
  return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : U();
5764
5854
  }
5765
- function Rl(e) {
5855
+ function Vl(e) {
5766
5856
  let t = W(e), n = t.eventsExpiresAt, r = q(t.nextAfter);
5767
5857
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? U() : {
5768
5858
  done: t.done,
5769
- events: t.events.map(Il),
5859
+ events: t.events.map(zl),
5770
5860
  ...n == null ? {} : { eventsExpiresAt: n },
5771
5861
  historyComplete: t.historyComplete,
5772
5862
  nextAfter: r,
@@ -5774,81 +5864,9 @@ function Rl(e) {
5774
5864
  version: 1
5775
5865
  };
5776
5866
  }
5777
- function zl(e) {
5778
- let t = W(e), n = jl(t.status);
5779
- return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? U() : {
5780
- cancelAccepted: t.cancelAccepted,
5781
- runId: G(t.runId),
5782
- status: n,
5783
- version: 1
5784
- };
5785
- }
5786
- function Bl(e) {
5787
- let t = W(e);
5788
- K(t, [
5789
- "action",
5790
- "resolutionAccepted",
5791
- "resolvedAt",
5792
- "runId",
5793
- "status",
5794
- "version",
5795
- "waitId"
5796
- ]);
5797
- let n = t.action, r = t.resolvedAt;
5798
- 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 ? U() : {
5799
- action: n,
5800
- resolutionAccepted: t.resolutionAccepted,
5801
- resolvedAt: r,
5802
- runId: G(t.runId),
5803
- status: jl(t.status),
5804
- version: 1,
5805
- waitId: G(t.waitId)
5806
- };
5807
- }
5808
- function Vl(e) {
5809
- let t = W(e), n = t.status;
5810
- if (t.version != 1) return U();
5811
- let r = {
5812
- finishedAt: G(t.finishedAt),
5813
- runId: G(t.runId),
5814
- version: 1
5815
- };
5816
- if (n == "completed") return Object.hasOwn(t, "result") ? {
5817
- ...r,
5818
- result: t.result,
5819
- status: "completed"
5820
- } : U();
5821
- if (n == "canceled") return {
5822
- ...r,
5823
- status: "canceled"
5824
- };
5825
- if (n == "failed") {
5826
- let e = W(t.error);
5827
- return {
5828
- ...r,
5829
- error: {
5830
- code: G(e.code),
5831
- message: G(e.message)
5832
- },
5833
- status: "failed"
5834
- };
5835
- }
5836
- if (n == "indeterminate") {
5837
- let e = W(t.error);
5838
- return {
5839
- ...r,
5840
- error: {
5841
- code: G(e.code),
5842
- message: G(e.message)
5843
- },
5844
- status: "indeterminate"
5845
- };
5846
- }
5847
- return U();
5848
- }
5849
5867
  var Y = encodeURIComponent;
5850
5868
  function Hl(e) {
5851
- return `${e}-${Zc()}`;
5869
+ return `${e}-${Rl()}`;
5852
5870
  }
5853
5871
  var Ul = class {
5854
5872
  constructor(e) {
@@ -5858,20 +5876,20 @@ var Ul = class {
5858
5876
  let t = new URLSearchParams();
5859
5877
  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));
5860
5878
  let n = t.size == 0 ? "" : `?${t}`;
5861
- return _l(await this.request(`/v1/flows${n}`));
5879
+ return cl(await this.request(`/v1/flows${n}`));
5862
5880
  }
5863
5881
  async listVariables() {
5864
5882
  let e = W(await this.request("/v1/variables"));
5865
5883
  return K(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? U() : {
5866
- variables: e.variables.map(vl),
5884
+ variables: e.variables.map(ll),
5867
5885
  version: 1
5868
5886
  };
5869
5887
  }
5870
5888
  async getVariable(e) {
5871
- return vl(await this.request(`/v1/variables/${Y(e)}`));
5889
+ return ll(await this.request(`/v1/variables/${Y(e)}`));
5872
5890
  }
5873
5891
  async putVariable(e, t) {
5874
- return vl(await this.request(`/v1/variables/${Y(e)}`, {
5892
+ return ll(await this.request(`/v1/variables/${Y(e)}`, {
5875
5893
  body: JSON.stringify({ value: t }),
5876
5894
  method: "PUT"
5877
5895
  }));
@@ -5880,8 +5898,8 @@ var Ul = class {
5880
5898
  let t = W(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
5881
5899
  if (K(t, ["version"]), t.version != 1) return U();
5882
5900
  }
5883
- async createFlow(e, t = `flow-${Zc()}`) {
5884
- return gl(await this.request("/v1/flows", {
5901
+ async createFlow(e, t = `flow-${Rl()}`) {
5902
+ return sl(await this.request("/v1/flows", {
5885
5903
  body: JSON.stringify({
5886
5904
  name: e,
5887
5905
  version: 1
@@ -5891,10 +5909,10 @@ var Ul = class {
5891
5909
  }));
5892
5910
  }
5893
5911
  async getFlow(e) {
5894
- return gl(await this.request(`/v1/flows/${Y(e)}`));
5912
+ return sl(await this.request(`/v1/flows/${Y(e)}`));
5895
5913
  }
5896
5914
  async renameFlow(e, t) {
5897
- return gl(await this.request(`/v1/flows/${Y(e)}`, {
5915
+ return sl(await this.request(`/v1/flows/${Y(e)}`, {
5898
5916
  body: JSON.stringify({
5899
5917
  name: t,
5900
5918
  version: 1
@@ -5903,47 +5921,47 @@ var Ul = class {
5903
5921
  }));
5904
5922
  }
5905
5923
  async deleteFlow(e) {
5906
- return gl(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
5924
+ return sl(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
5907
5925
  }
5908
5926
  async listTriggerKeys(e) {
5909
5927
  let t = W(await this.request("/v1/trigger-keys", { signal: e }));
5910
- return t.version != 1 || !Array.isArray(t.keys) ? U() : t.keys.map(al);
5928
+ return t.version != 1 || !Array.isArray(t.keys) ? U() : t.keys.map(Ol);
5911
5929
  }
5912
5930
  async listTriggerDefinitions(e) {
5913
5931
  let t = W(await this.request("/v1/trigger-keys/catalog", { signal: e }));
5914
- return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(ol);
5932
+ return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(kl);
5915
5933
  }
5916
5934
  async getTriggerKey(e, t) {
5917
5935
  let n = W(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
5918
- return n.version == 1 ? ol(n.definition) : U();
5936
+ return n.version == 1 ? kl(n.definition) : U();
5919
5937
  }
5920
5938
  async listFlowTriggerBindings(e, t) {
5921
5939
  let n = W(await this.request(`/v1/flows/${Y(e)}/triggers`, { signal: t }));
5922
- return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(dl);
5940
+ return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(Nl);
5923
5941
  }
5924
5942
  async getFlowTriggerBinding(e, t) {
5925
- return fl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
5943
+ return Pl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
5926
5944
  }
5927
5945
  async listFlowTriggerActivities(e, t, n = {}) {
5928
5946
  let r = new URLSearchParams();
5929
5947
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
5930
5948
  let i = r.size == 0 ? "" : `?${r}`;
5931
- return ml(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
5949
+ return Il(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
5932
5950
  }
5933
5951
  async pauseFlowTrigger(e, t) {
5934
- return dl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
5952
+ return Nl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
5935
5953
  body: JSON.stringify({ version: 1 }),
5936
5954
  method: "POST"
5937
5955
  }));
5938
5956
  }
5939
5957
  async resumeFlowTrigger(e, t) {
5940
- return dl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
5958
+ return Nl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
5941
5959
  body: JSON.stringify({ version: 1 }),
5942
5960
  method: "POST"
5943
5961
  }));
5944
5962
  }
5945
5963
  async testFlowPollTrigger(e, t) {
5946
- return hl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
5964
+ return Ll(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
5947
5965
  body: JSON.stringify({ version: 1 }),
5948
5966
  method: "POST"
5949
5967
  }));
@@ -5958,29 +5976,29 @@ var Ul = class {
5958
5976
  "version"
5959
5977
  ]), t.version != 1) return U();
5960
5978
  let n = {
5961
- flow: gl(t.flow),
5962
- draft: bl(t.draft),
5963
- live: Ol(t.live),
5964
- presentation: xl(t.presentation),
5979
+ flow: sl(t.flow),
5980
+ draft: hl(t.draft),
5981
+ live: fl(t.live),
5982
+ presentation: gl(t.presentation),
5965
5983
  version: 1
5966
5984
  };
5967
5985
  return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? U() : n;
5968
5986
  }
5969
5987
  async getPresentation(e) {
5970
- return xl(await this.request(`/v1/flows/${Y(e)}/presentation`));
5988
+ return gl(await this.request(`/v1/flows/${Y(e)}/presentation`));
5971
5989
  }
5972
5990
  async getDraft(e) {
5973
- return bl(await this.request(`/v1/flows/${Y(e)}/draft`));
5991
+ return hl(await this.request(`/v1/flows/${Y(e)}/draft`));
5974
5992
  }
5975
5993
  async syncDraft(e) {
5976
- return Cl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
5994
+ return vl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
5977
5995
  }
5978
5996
  async getRevision(e, t) {
5979
- return bl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
5997
+ return hl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
5980
5998
  }
5981
5999
  async listConnectorProviders(e, t) {
5982
6000
  let n = W(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Y(t)}`}`, { signal: e }));
5983
- return K(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? U() : n.providers.map(il);
6001
+ return K(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? U() : n.providers.map(ol);
5984
6002
  }
5985
6003
  async listConnectorActions(e, t, n) {
5986
6004
  return await this.connectorActions({
@@ -5996,7 +6014,7 @@ var Ul = class {
5996
6014
  }
5997
6015
  async getConnectorAction(e, t, n) {
5998
6016
  let r = W(await this.request(`/v1/connector/actions/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
5999
- return K(r, ["action", "version"]), r.version == 1 ? rl(r.action) : U();
6017
+ return K(r, ["action", "version"]), r.version == 1 ? al(r.action) : U();
6000
6018
  }
6001
6019
  async listConnectorConnections(e, t, n) {
6002
6020
  let r = W(await this.request(`/v1/connector/connections/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
@@ -6004,7 +6022,7 @@ var Ul = class {
6004
6022
  "connections",
6005
6023
  "serviceId",
6006
6024
  "version"
6007
- ]), r.version != 1 || G(r.serviceId) != e || !Array.isArray(r.connections) ? U() : r.connections.map($c);
6025
+ ]), r.version != 1 || G(r.serviceId) != e || !Array.isArray(r.connections) ? U() : r.connections.map(tl);
6008
6026
  }
6009
6027
  async createConnectorConnectionPage(e, t) {
6010
6028
  let n = W(await this.request(`/v1/connector/connections/${Y(e)}/page${t == null ? "" : `?flowId=${Y(t)}`}`, {
@@ -6020,7 +6038,7 @@ var Ul = class {
6020
6038
  }
6021
6039
  }
6022
6040
  async changeDraft(e, t, n, r = Hl("change")) {
6023
- return Sl(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6041
+ return _l(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6024
6042
  body: JSON.stringify({
6025
6043
  expectedRevisionId: t,
6026
6044
  operations: n,
@@ -6031,7 +6049,7 @@ var Ul = class {
6031
6049
  }));
6032
6050
  }
6033
6051
  async checkFlow(e, t) {
6034
- return Dl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
6052
+ return el(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
6035
6053
  body: JSON.stringify({
6036
6054
  engineContract: "open-flow-engine/v2",
6037
6055
  version: 1
@@ -6040,16 +6058,16 @@ var Ul = class {
6040
6058
  }));
6041
6059
  }
6042
6060
  async getLive(e, t) {
6043
- return Ol(await this.request(`/v1/flows/${Y(e)}/live`, { signal: t }));
6061
+ return fl(await this.request(`/v1/flows/${Y(e)}/live`, { signal: t }));
6044
6062
  }
6045
6063
  async listPublications(e, t = {}, n) {
6046
6064
  let r = new URLSearchParams();
6047
6065
  t.cursor != null && r.set("cursor", t.cursor), t.limit != null && r.set("limit", String(t.limit)), t.includeTotal != null && r.set("includeTotal", String(t.includeTotal));
6048
6066
  let i = r.size == 0 ? "" : `?${r}`;
6049
- return kl(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
6067
+ return pl(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
6050
6068
  }
6051
6069
  async createDraftRun(e, t, n) {
6052
- let r = Pl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6070
+ let r = Cl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6053
6071
  body: JSON.stringify({
6054
6072
  engineContract: "open-flow-engine/v2",
6055
6073
  inputs: n.inputs ?? {},
@@ -6062,7 +6080,7 @@ var Ul = class {
6062
6080
  return r.source == "draft" ? r : U();
6063
6081
  }
6064
6082
  async createLiveRun(e, t) {
6065
- let n = Pl(await this.request("/v1/runs", {
6083
+ let n = Cl(await this.request("/v1/runs", {
6066
6084
  body: JSON.stringify({
6067
6085
  inputs: t.inputs ?? {},
6068
6086
  trigger: t.trigger,
@@ -6075,7 +6093,7 @@ var Ul = class {
6075
6093
  return n.source == "live" ? n : U();
6076
6094
  }
6077
6095
  async setFlowEnabled(e, t, n) {
6078
- return gl(await this.request(`/v1/flows/${Y(e)}/enabled`, {
6096
+ return sl(await this.request(`/v1/flows/${Y(e)}/enabled`, {
6079
6097
  method: "PUT",
6080
6098
  body: JSON.stringify({
6081
6099
  enabled: n,
@@ -6085,7 +6103,7 @@ var Ul = class {
6085
6103
  }));
6086
6104
  }
6087
6105
  async publishFlow(e, t, n, r = {}) {
6088
- return Tl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
6106
+ return dl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
6089
6107
  body: JSON.stringify({
6090
6108
  engineContract: "open-flow-engine/v2",
6091
6109
  expectedLivePublicationId: n,
@@ -6096,10 +6114,10 @@ var Ul = class {
6096
6114
  }));
6097
6115
  }
6098
6116
  async getPublishOperation(e, t, n) {
6099
- return Tl(await this.request(`/v1/flows/${Y(e)}/publish-operations/${Y(t)}`, { signal: n }));
6117
+ return dl(await this.request(`/v1/flows/${Y(e)}/publish-operations/${Y(t)}`, { signal: n }));
6100
6118
  }
6101
6119
  async rollbackFlow(e, t, n, r = {}) {
6102
- return wl(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
6120
+ return ul(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
6103
6121
  body: JSON.stringify({
6104
6122
  expectedLivePublicationId: n,
6105
6123
  version: 1
@@ -6109,19 +6127,19 @@ var Ul = class {
6109
6127
  }));
6110
6128
  }
6111
6129
  async getRun(e, t) {
6112
- return Pl(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6130
+ return Cl(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6113
6131
  }
6114
6132
  async listRuns(e, t = {}) {
6115
6133
  let n = new URLSearchParams();
6116
6134
  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);
6117
6135
  let r = n.size == 0 ? "" : `?${n}`;
6118
- return Fl(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6136
+ return wl(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6119
6137
  }
6120
6138
  async getRunEvents(e, t = {}, n) {
6121
6139
  let r = new URLSearchParams();
6122
6140
  t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
6123
6141
  let i = r.size == 0 ? "" : `?${r}`;
6124
- return Rl(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6142
+ return Vl(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6125
6143
  }
6126
6144
  async listRunResults(e, t, n) {
6127
6145
  return Yc(await this.request(`/v1/runs/${Y(e)}/results${t == null ? "" : `?after=${encodeURIComponent(t)}`}`, { signal: n }));
@@ -6134,16 +6152,16 @@ var Ul = class {
6134
6152
  return (await this.response(`/v1/runs/${Y(e)}/results/${Y(t)}/content`, { signal: n })).blob();
6135
6153
  }
6136
6154
  async getRunResult(e, t) {
6137
- return Vl(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6155
+ return Dl(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6138
6156
  }
6139
6157
  async cancelRun(e) {
6140
- return zl(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6158
+ return Tl(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6141
6159
  body: JSON.stringify({ version: 1 }),
6142
6160
  method: "POST"
6143
6161
  }));
6144
6162
  }
6145
6163
  async resolveRunWait(e, t, n) {
6146
- return Bl(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6164
+ return El(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6147
6165
  body: JSON.stringify({
6148
6166
  action: n,
6149
6167
  version: 1
@@ -6153,7 +6171,7 @@ var Ul = class {
6153
6171
  }
6154
6172
  async connectorActions(e, t) {
6155
6173
  let n = Object.entries(e).map(([e, t]) => `${Y(e)}=${Y(t)}`).join("&"), r = n == "" ? "" : `?${n}`, i = W(await this.request(`/v1/connector/actions${r}`, { signal: t }));
6156
- return K(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? U() : i.actions.map(rl);
6174
+ return K(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? U() : i.actions.map(al);
6157
6175
  }
6158
6176
  async response(e, t) {
6159
6177
  let n = new Headers(t.headers);
@@ -6170,7 +6188,7 @@ var Ul = class {
6170
6188
  return U();
6171
6189
  }
6172
6190
  let t = W(e).error, n = t == null ? void 0 : W(t);
6173
- throw new Qc(r.status, typeof n?.code == "string" ? n.code : "request.failed", typeof n?.message == "string" ? n.message : `Request failed with status ${r.status}.`);
6191
+ throw new Zc(r.status, typeof n?.code == "string" ? n.code : "request.failed", typeof n?.message == "string" ? n.message : `Request failed with status ${r.status}.`);
6174
6192
  }
6175
6193
  return r;
6176
6194
  }