@oomol-lab/open-flow 0.1.0-beta.21 → 0.1.0-beta.23

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 (46) hide show
  1. package/dist/browser/{createResourceDialog-CjuJryCv.js → createResourceDialog-PKbMMpEk.js} +29 -29
  2. package/dist/browser/event-sources.d.ts +30 -0
  3. package/dist/browser/{flowChanges-Tg1duLry.js → flowChanges-BUlMz4iC.js} +4236 -3019
  4. package/dist/browser/{flowWorkspace-CoK10XHY.js → flowWorkspace-DLArN17T.js} +49585 -42617
  5. package/dist/browser/{i18n-CVBh0Ni1.js → input-group-C2frNYAx.js} +1801 -75
  6. package/dist/browser/{inputValues-CDiBMKu8.js → inputValues-CcGVt51C.js} +10 -10
  7. package/dist/browser/licenses.md +60 -0
  8. package/dist/browser/lite-Cy6aeiL6.js +8538 -0
  9. package/dist/browser/{markdownContent-BBgH9ZIV.js → markdownContent-SIlWuHve.js} +17 -17
  10. package/dist/browser/theme.css +45 -5
  11. package/dist/browser/ui.css +1 -1
  12. package/dist/browser/ui.d.ts +23 -1
  13. package/dist/browser/ui.js +59 -27
  14. package/dist/browser/workbench-contract.d.ts +19 -0
  15. package/dist/browser/workbench.css +1 -1
  16. package/dist/browser/workbench.d.ts +1 -0
  17. package/dist/browser/workbench.js +1176 -734
  18. package/dist/browser/workbenchSelect-CPRUXKbf.js +6088 -0
  19. package/dist/common/control-api-conformance.js +273 -232
  20. package/dist/common/control-api-errors.d.ts +20 -0
  21. package/dist/common/control-api.d.ts +50 -10
  22. package/dist/common/control-api.js +899 -661
  23. package/dist/common/control-requests.d.ts +23 -0
  24. package/dist/common/control-requests.js +377 -351
  25. package/dist/common/event-sources.d.ts +50 -0
  26. package/dist/common/feishu-events.d.ts +20 -0
  27. package/dist/common/feishu-subscriptions.d.ts +10 -0
  28. package/dist/common/fr-iv1541dF.js +93 -0
  29. package/dist/common/integration-trigger.d.ts +4 -0
  30. package/dist/common/ja-Bq-ZDOD4.js +93 -0
  31. package/dist/common/ko-Z-k9R2c6.js +93 -0
  32. package/dist/common/localization.d.ts +2 -0
  33. package/dist/common/localization.js +37 -1
  34. package/dist/common/mcp.js +615 -382
  35. package/dist/common/poll-trigger.d.ts +2 -0
  36. package/dist/common/provider-triggers.d.ts +4 -0
  37. package/dist/common/provider-triggers.js +3229 -2692
  38. package/dist/common/ru-B4gFecYZ.js +93 -0
  39. package/dist/common/trigger-catalog.d.ts +17 -0
  40. package/dist/common/trigger-config-options.d.ts +13 -0
  41. package/dist/common/trigger-localization.d.ts +7 -0
  42. package/dist/common/zh-CN-ByQ6nYam.js +93 -0
  43. package/dist/common/zh-TW-QjIarvX9.js +93 -0
  44. package/package.json +1 -1
  45. package/dist/browser/useValueChanged-BY05Usw-.js +0 -2944
  46. package/dist/browser/workbenchSelect-DEmv7SLW.js +0 -11666
@@ -4935,52 +4935,53 @@ var Hc = N({
4935
4935
  offset: k().int().nonnegative().default(0),
4936
4936
  limit: k().int().min(1).max(100).default(20),
4937
4937
  maxBytes: k().int().min(1).max(1048576).default(15e3)
4938
- }), Uc = rc(), Wc = N({
4939
- pointer: D(),
4940
- type: I([
4941
- "object",
4942
- "array",
4943
- "string",
4944
- "number",
4945
- "boolean",
4946
- "null"
4947
- ]),
4948
- length: k().int().nonnegative().optional(),
4949
- complete: A(),
4950
- value: Uc.optional()
4951
- }), Gc = Wc.extend({
4952
- offset: k().int().nonnegative(),
4953
- nextOffset: k().int().positive().optional(),
4954
- entries: j(Wc).optional()
4955
- }), Kc = N({
4956
- resultId: D().min(1),
4957
- callId: D().min(1),
4958
- toolId: D().min(1),
4959
- source: ws("kind", [N({
4960
- kind: L("connector"),
4961
- action: D().min(1)
4962
- }), N({ kind: L("code") })]),
4963
- bytes: k().int().nonnegative(),
4964
- digest: D().regex(/^[a-f0-9]{64}$/),
4965
- createdAt: D().datetime()
4966
- }), qc = N({
4967
- version: L(1),
4968
- runId: D(),
4969
- results: j(Kc),
4970
- nextAfter: D().optional()
4971
- }), Jc = N({
4938
+ }), Uc = D().min(1).max(256), Wc = D().regex(/^[a-z][a-z0-9_.]{0,127}$/), Gc = D().trim().min(1).max(128), Kc = N({
4972
4939
  version: L(1),
4973
- runId: D(),
4974
- result: Kc,
4975
- page: Gc
4940
+ sourceId: Uc,
4941
+ revision: fs().positive(),
4942
+ name: Gc,
4943
+ provider: I(["feishu", "feishu_app_bot"]),
4944
+ appId: Uc,
4945
+ tenantKey: Uc,
4946
+ connectionId: Uc,
4947
+ teamId: Uc.nullable(),
4948
+ enabled: A(),
4949
+ eventTypes: j(Wc),
4950
+ manageSubscriptions: A(),
4951
+ verificationTokenConfigured: A(),
4952
+ encryptKeyConfigured: A(),
4953
+ endpointUrl: D().nullable(),
4954
+ verifiedAt: D().nullable(),
4955
+ lastReceivedAt: D().nullable(),
4956
+ updatedAt: D(),
4957
+ consumers: j(N({
4958
+ flowId: Uc,
4959
+ flowName: D(),
4960
+ triggerNodeId: Uc
4961
+ }))
4976
4962
  });
4977
- function Yc(e) {
4978
- return qc.parse(e);
4979
- }
4963
+ function qc(e) {
4964
+ return Kc.parse(e);
4965
+ }
4966
+ function Jc(e) {
4967
+ return N({
4968
+ version: L(1),
4969
+ sources: j(Kc),
4970
+ teamId: Uc.nullable().optional()
4971
+ }).parse(e);
4972
+ }
4973
+ var Yc = new Map([
4974
+ "en",
4975
+ "zh-CN",
4976
+ "zh-TW",
4977
+ "ja",
4978
+ "ko",
4979
+ "ru",
4980
+ "fr"
4981
+ ].map((e) => [e.toLowerCase(), e]));
4980
4982
  function Xc(e) {
4981
- return Jc.parse(e);
4983
+ return typeof e == "string" && Yc.get(e.toLowerCase()) == e;
4982
4984
  }
4983
- new TextEncoder();
4984
4985
  //#endregion
4985
4986
  //#region src/control/common/errors.ts
4986
4987
  var H = {
@@ -4990,8 +4991,13 @@ var H = {
4990
4991
  connectorActionNotFound: "connector.action-not-found",
4991
4992
  connectorUnconfigured: "connector.unconfigured",
4992
4993
  connectorUnavailable: "connector.unavailable",
4994
+ connectorConsoleUnconfigured: "connector.console-unconfigured",
4993
4995
  engineUnavailable: "engine.unavailable",
4994
4996
  engineUnsupported: "engine.unsupported",
4997
+ eventSourceInvalid: "event-source.invalid",
4998
+ eventSourceIdentityUnavailable: "event-source.identity-unavailable",
4999
+ eventSourceNotFound: "event-source.not-found",
5000
+ eventSourceConflict: "event-source.conflict",
4995
5001
  flowInvalid: "flow.invalid",
4996
5002
  flowNotFound: "flow.not-found",
4997
5003
  flowBusy: "flow.busy",
@@ -5020,7 +5026,7 @@ var H = {
5020
5026
  variableLimitReached: "variable.limit-reached",
5021
5027
  variableNotFound: "variable.not-found"
5022
5028
  };
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;
5029
+ H.eventSourceInvalid, H.eventSourceIdentityUnavailable, H.eventSourceNotFound, H.eventSourceConflict, H.authenticationRequired, H.authorizationDenied, H.bindingUnresolved, H.connectorActionNotFound, H.connectorUnconfigured, H.connectorUnavailable, H.connectorConsoleUnconfigured, 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;
5024
5030
  var Zc = class extends Error {
5025
5031
  constructor(e, t, n) {
5026
5032
  super(n), this.code = t, this.name = "ApiError", this.status = e;
@@ -5054,8 +5060,221 @@ function Qc(e) {
5054
5060
  if (e != null) return G(e);
5055
5061
  }
5056
5062
  //#endregion
5057
- //#region src/control/common/checkDecoders.ts
5063
+ //#region src/control/common/triggerDecoders.ts
5058
5064
  function $c(e) {
5065
+ let t = W(e), n = t.type;
5066
+ return n != "integration" && n != "poll" ? U() : {
5067
+ description: typeof t.description == "string" ? t.description : U(),
5068
+ displayName: G(t.displayName),
5069
+ key: G(t.key),
5070
+ name: G(t.name),
5071
+ provider: G(t.provider),
5072
+ type: n
5073
+ };
5074
+ }
5075
+ function el(e) {
5076
+ let t = W(e), n = $c(t), r = {
5077
+ configSchema: J(t.configSchema),
5078
+ definitionVersion: q(t.definitionVersion),
5079
+ description: n.description,
5080
+ displayName: n.displayName,
5081
+ key: n.key,
5082
+ name: n.name,
5083
+ payloadSchema: J(t.payloadSchema),
5084
+ provider: n.provider
5085
+ };
5086
+ if (n.type == "poll") return {
5087
+ ...r,
5088
+ type: "poll"
5089
+ };
5090
+ let i = W(t.endpoint), a = W(i.body);
5091
+ if (!Array.isArray(i.methods) || !Array.isArray(a.formats) || typeof a.allowArray != "boolean" || typeof a.allowEmpty != "boolean") return U();
5092
+ let o = i.methods.map(G), s = a.formats.map(G), c = q(i.successStatus);
5093
+ return o.some((e) => ![
5094
+ "DELETE",
5095
+ "GET",
5096
+ "HEAD",
5097
+ "PATCH",
5098
+ "POST",
5099
+ "PUT"
5100
+ ].includes(e)) || s.some((e) => ![
5101
+ "form",
5102
+ "json",
5103
+ "multipart",
5104
+ "text"
5105
+ ].includes(e)) || c < 200 || c > 299 ? U() : {
5106
+ ...r,
5107
+ endpoint: {
5108
+ body: {
5109
+ allowArray: a.allowArray,
5110
+ allowEmpty: a.allowEmpty,
5111
+ formats: s
5112
+ },
5113
+ methods: o,
5114
+ successStatus: c
5115
+ },
5116
+ type: "integration"
5117
+ };
5118
+ }
5119
+ var tl = /* @__PURE__ */ new Set([
5120
+ "cron",
5121
+ "integration",
5122
+ "poll",
5123
+ "webhook"
5124
+ ]), nl = /* @__PURE__ */ new Set([
5125
+ "failed",
5126
+ "healthy",
5127
+ "initializing",
5128
+ "needs_reauth",
5129
+ "suspended"
5130
+ ]), rl = /* @__PURE__ */ new Set([
5131
+ "delivery.failed",
5132
+ "health.failed",
5133
+ "health.needs_reauth",
5134
+ "health.recovered",
5135
+ "health.suspended",
5136
+ "operator.paused",
5137
+ "operator.resumed"
5138
+ ]);
5139
+ function il(e) {
5140
+ let t = W(e), n = t.health, r = t.listener == null ? void 0 : W(t.listener);
5141
+ if (r != null && r.health != "healthy" && r.health != "failed" && r.health != "needs_reauth") return U();
5142
+ let i = t.kind, a = t.operatorState, o = q(t.runtimeVersion);
5143
+ return t.version != 1 || typeof n != "string" || !nl.has(n) || typeof i != "string" || !tl.has(i) || a != "active" && a != "paused" || o <= 0 ? U() : {
5144
+ ...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
5145
+ ...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
5146
+ ...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
5147
+ ...r == null ? {} : { listener: {
5148
+ health: r.health,
5149
+ ...r.lastErrorCode == null ? {} : { lastErrorCode: G(r.lastErrorCode) }
5150
+ } },
5151
+ flowId: G(t.flowId),
5152
+ health: n,
5153
+ kind: i,
5154
+ ...t.lastErrorCode == null ? {} : { lastErrorCode: G(t.lastErrorCode) },
5155
+ operatorState: a,
5156
+ runtimeVersion: o,
5157
+ triggerNodeId: G(t.triggerNodeId),
5158
+ updatedAt: G(t.updatedAt),
5159
+ version: 1
5160
+ };
5161
+ }
5162
+ function al(e) {
5163
+ let t = W(e);
5164
+ return t.version == 1 ? {
5165
+ binding: il(t.binding),
5166
+ version: 1
5167
+ } : U();
5168
+ }
5169
+ function ol(e) {
5170
+ let t = W(e), n = t.kind;
5171
+ if (typeof n != "string" || !rl.has(n)) return U();
5172
+ let r = Qc(t.errorCode), i = Qc(t.errorMessage);
5173
+ return i != null && i.length > 512 ? U() : {
5174
+ activityId: G(t.activityId),
5175
+ createdAt: G(t.createdAt),
5176
+ ...r == null ? {} : { errorCode: r },
5177
+ ...i == null ? {} : { errorMessage: i },
5178
+ kind: n
5179
+ };
5180
+ }
5181
+ function sl(e) {
5182
+ let t = W(e), n = Qc(t.nextCursor);
5183
+ return t.version != 1 || !Array.isArray(t.activities) ? U() : {
5184
+ activities: t.activities.map(ol),
5185
+ ...n == null ? {} : { nextCursor: n },
5186
+ version: 1
5187
+ };
5188
+ }
5189
+ function cl(e) {
5190
+ let t = W(e), n = q(t.filtered);
5191
+ return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
5192
+ events: t.events.map((e) => {
5193
+ let t = W(e);
5194
+ return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
5195
+ }),
5196
+ filtered: n,
5197
+ hasMore: t.hasMore,
5198
+ version: 1
5199
+ };
5200
+ }
5201
+ //#endregion
5202
+ //#region src/control/common/triggerCatalog.ts
5203
+ function ll(e) {
5204
+ let t = W(e);
5205
+ if (K(t, [
5206
+ "version",
5207
+ "locale",
5208
+ "definitions",
5209
+ "display"
5210
+ ]), t.version != 1 || !Xc(t.locale) || !Array.isArray(t.definitions)) return U();
5211
+ let n = t.definitions.map(el), r = W(t.display), i = new Set(n.map((e) => e.key));
5212
+ if (i.size != n.length || Object.keys(r).length != i.size) return U();
5213
+ let a = Object.fromEntries(n.map(({ key: e }) => {
5214
+ let t = W(r[e]);
5215
+ return K(t, ["displayName", "description"]), [e, {
5216
+ displayName: G(t.displayName),
5217
+ description: typeof t.description == "string" ? t.description : U()
5218
+ }];
5219
+ }));
5220
+ return {
5221
+ version: 1,
5222
+ locale: t.locale,
5223
+ definitions: n,
5224
+ display: a
5225
+ };
5226
+ }
5227
+ //#endregion
5228
+ //#region src/control/common/results.ts
5229
+ var ul = rc(), dl = N({
5230
+ pointer: D(),
5231
+ type: I([
5232
+ "object",
5233
+ "array",
5234
+ "string",
5235
+ "number",
5236
+ "boolean",
5237
+ "null"
5238
+ ]),
5239
+ length: k().int().nonnegative().optional(),
5240
+ complete: A(),
5241
+ value: ul.optional()
5242
+ }), fl = dl.extend({
5243
+ offset: k().int().nonnegative(),
5244
+ nextOffset: k().int().positive().optional(),
5245
+ entries: j(dl).optional()
5246
+ }), pl = N({
5247
+ resultId: D().min(1),
5248
+ callId: D().min(1),
5249
+ toolId: D().min(1),
5250
+ source: ws("kind", [N({
5251
+ kind: L("connector"),
5252
+ action: D().min(1)
5253
+ }), N({ kind: L("code") })]),
5254
+ bytes: k().int().nonnegative(),
5255
+ digest: D().regex(/^[a-f0-9]{64}$/),
5256
+ createdAt: D().datetime()
5257
+ }), ml = N({
5258
+ version: L(1),
5259
+ runId: D(),
5260
+ results: j(pl),
5261
+ nextAfter: D().optional()
5262
+ }), hl = N({
5263
+ version: L(1),
5264
+ runId: D(),
5265
+ result: pl,
5266
+ page: fl
5267
+ });
5268
+ function gl(e) {
5269
+ return ml.parse(e);
5270
+ }
5271
+ function _l(e) {
5272
+ return hl.parse(e);
5273
+ }
5274
+ new TextEncoder();
5275
+ //#endregion
5276
+ //#region src/control/common/checkDecoders.ts
5277
+ function vl(e) {
5059
5278
  let t = W(e), n = t.values == null ? void 0 : W(t.values);
5060
5279
  return {
5061
5280
  code: G(t.code),
@@ -5066,11 +5285,11 @@ function $c(e) {
5066
5285
  ...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : U()])) }
5067
5286
  };
5068
5287
  }
5069
- function el(e) {
5288
+ function yl(e) {
5070
5289
  let t = W(e);
5071
5290
  return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? U() : {
5072
5291
  closureDigest: G(t.closureDigest),
5073
- diagnostics: t.diagnostics.map($c),
5292
+ diagnostics: t.diagnostics.map(vl),
5074
5293
  engineContract: G(t.engineContract),
5075
5294
  flowId: G(t.flowId),
5076
5295
  modelVersion: q(t.modelVersion),
@@ -5082,19 +5301,23 @@ function el(e) {
5082
5301
  }
5083
5302
  //#endregion
5084
5303
  //#region src/control/common/connectorDecoders.ts
5085
- function tl(e) {
5304
+ function bl(e) {
5086
5305
  let t = W(e);
5087
- K(t, [
5306
+ if (K(t, [
5307
+ ...Object.hasOwn(t, "providerAccountId") ? ["providerAccountId"] : [],
5088
5308
  ...Object.hasOwn(t, "alias") ? ["alias"] : [],
5309
+ ...Object.hasOwn(t, "builtInAccount") ? ["builtInAccount"] : [],
5089
5310
  "connectionId",
5090
5311
  "displayName",
5091
5312
  "isDefault",
5092
5313
  "serviceId",
5093
5314
  "status"
5094
- ]);
5315
+ ]), t.builtInAccount !== void 0 && typeof t.builtInAccount != "boolean") return U();
5095
5316
  let n = t.status;
5096
5317
  return n != "active" && n != "disconnected" && n != "error" && n != "reauth_required" || typeof t.isDefault != "boolean" ? U() : {
5318
+ ...t.providerAccountId === void 0 ? {} : { providerAccountId: G(t.providerAccountId) },
5097
5319
  ...t.alias === void 0 ? {} : { alias: G(t.alias) },
5320
+ ...t.builtInAccount === void 0 ? {} : { builtInAccount: t.builtInAccount },
5098
5321
  connectionId: G(t.connectionId),
5099
5322
  displayName: G(t.displayName),
5100
5323
  isDefault: t.isDefault,
@@ -5102,7 +5325,7 @@ function tl(e) {
5102
5325
  status: n
5103
5326
  };
5104
5327
  }
5105
- function nl(e, t = !1) {
5328
+ function xl(e, t = !1) {
5106
5329
  let n = W(e), r = n.description, i = t && Object.hasOwn(n, "value");
5107
5330
  return K(n, [
5108
5331
  "jsonSchema",
@@ -5116,20 +5339,20 @@ function nl(e, t = !1) {
5116
5339
  ...i ? { value: J(n.value) } : {}
5117
5340
  };
5118
5341
  }
5119
- function rl(e) {
5120
- return nl(e, !0);
5342
+ function Sl(e) {
5343
+ return xl(e, !0);
5121
5344
  }
5122
- function il(e, t) {
5345
+ function Cl(e, t) {
5123
5346
  return Object.fromEntries(Object.entries(W(e)).map(([e, n]) => [e, t(n)]));
5124
5347
  }
5125
- function al(e) {
5126
- let t = W(e), n = t.homepageUrl, r = t.icon, i = t.defaultConnection != null;
5127
- if (K(t, [
5348
+ function wl(e) {
5349
+ let t = W(e), n = t.homepageUrl, r = t.icon;
5350
+ return K(t, [
5128
5351
  "actionId",
5352
+ ...Object.hasOwn(t, "operationType") ? ["operationType"] : [],
5129
5353
  ...Object.hasOwn(t, "inputSchema") ? ["inputSchema"] : [],
5130
5354
  ...Object.hasOwn(t, "outputSchema") ? ["outputSchema"] : [],
5131
5355
  "authenticated",
5132
- ...i ? ["defaultConnection"] : [],
5133
5356
  "description",
5134
5357
  ...n == null ? [] : ["homepageUrl"],
5135
5358
  ...r == null ? [] : ["icon"],
@@ -5138,41 +5361,101 @@ function al(e) {
5138
5361
  "outputs",
5139
5362
  "serviceId",
5140
5363
  "serviceName"
5141
- ]), n != null && typeof n != "string" || r != null && typeof r != "string") return U();
5142
- let a = {
5364
+ ]), n != null && typeof n != "string" || r != null && typeof r != "string" ? U() : {
5143
5365
  ...t.inputSchema === void 0 ? {} : { inputSchema: J(t.inputSchema) },
5144
5366
  ...t.outputSchema === void 0 ? {} : { outputSchema: J(t.outputSchema) },
5145
5367
  actionId: G(t.actionId),
5368
+ ...t.operationType == null ? {} : { operationType: G(t.operationType) },
5146
5369
  authenticated: typeof t.authenticated == "boolean" ? t.authenticated : U(),
5147
- ...i ? { defaultConnection: tl(t.defaultConnection) } : {},
5148
5370
  description: typeof t.description == "string" ? t.description : U(),
5149
5371
  ...n == null ? {} : { homepageUrl: n },
5150
5372
  ...r == null ? {} : { icon: r },
5151
- inputs: il(t.inputs, rl),
5373
+ inputs: Cl(t.inputs, Sl),
5152
5374
  name: G(t.name),
5153
- outputs: il(t.outputs, nl),
5375
+ outputs: Cl(t.outputs, xl),
5154
5376
  serviceId: G(t.serviceId),
5155
5377
  serviceName: G(t.serviceName)
5156
5378
  };
5157
- return a.defaultConnection != null && (a.defaultConnection.serviceId != a.serviceId || a.defaultConnection.status != "active") ? U() : a;
5158
5379
  }
5159
- function ol(e) {
5380
+ function Tl(e) {
5381
+ let { defaultConnection: t, ...n } = W(e), r = wl(n);
5382
+ if (t == null) return r;
5383
+ let i = bl(t);
5384
+ return i.serviceId != r.serviceId || i.status != "active" ? U() : {
5385
+ ...r,
5386
+ defaultConnection: i
5387
+ };
5388
+ }
5389
+ function El(e) {
5160
5390
  let t = W(e), n = t.homepageUrl, r = t.icon;
5161
- return K(t, [
5391
+ return t.noSetup !== void 0 && typeof t.noSetup != "boolean" || (K(t, [
5392
+ ...Object.hasOwn(t, "noSetup") ? ["noSetup"] : [],
5162
5393
  "serviceId",
5163
5394
  "serviceName",
5164
5395
  ...n == null ? [] : ["homepageUrl"],
5165
5396
  ...r == null ? [] : ["icon"]
5166
- ]), n != null && typeof n != "string" || r != null && typeof r != "string" ? U() : {
5397
+ ]), n != null && typeof n != "string" || r != null && typeof r != "string") ? U() : {
5167
5398
  ...n == null ? {} : { homepageUrl: n },
5168
5399
  ...r == null ? {} : { icon: r },
5169
5400
  serviceId: G(t.serviceId),
5170
- serviceName: G(t.serviceName)
5401
+ serviceName: G(t.serviceName),
5402
+ ...t.noSetup === void 0 ? {} : { noSetup: t.noSetup }
5403
+ };
5404
+ }
5405
+ //#endregion
5406
+ //#region src/control/common/connectorQueries.ts
5407
+ var Dl = (e) => e == null ? "" : `?flowId=${encodeURIComponent(e)}`;
5408
+ function Ol(e, t) {
5409
+ let n = new URLSearchParams({
5410
+ ...e == null ? {} : { flowId: e },
5411
+ ...t == null ? {} : { locale: t }
5412
+ }).toString();
5413
+ return {
5414
+ path: `/v1/connector/providers${n ? `?${n}` : ""}`,
5415
+ decode: (e) => {
5416
+ let t = W(e);
5417
+ return K(t, ["providers", "version"]), t.version != 1 || !Array.isArray(t.providers) ? U() : t.providers.map(El);
5418
+ }
5419
+ };
5420
+ }
5421
+ function kl(e, t, n) {
5422
+ let r = new URLSearchParams({
5423
+ ...t == null ? {} : { flowId: t },
5424
+ ...n == null ? {} : { locale: n }
5425
+ }).toString();
5426
+ return {
5427
+ path: `/v1/connector/actions/${encodeURIComponent(e)}${r ? `?${r}` : ""}`,
5428
+ decode: (e) => {
5429
+ let t = W(e);
5430
+ return K(t, ["action", "version"]), t.version == 1 ? Tl(t.action) : U();
5431
+ }
5432
+ };
5433
+ }
5434
+ function Al(e) {
5435
+ return {
5436
+ path: `/v1/connector/connections${Dl(e)}`,
5437
+ decode: (e) => {
5438
+ let t = W(e);
5439
+ return K(t, ["connections", "version"]), t.version != 1 || !Array.isArray(t.connections) ? U() : t.connections.map(bl);
5440
+ }
5441
+ };
5442
+ }
5443
+ function jl(e, t) {
5444
+ return {
5445
+ path: `/v1/connector/connections/${encodeURIComponent(e)}${Dl(t)}`,
5446
+ decode: (t) => {
5447
+ let n = W(t);
5448
+ return K(n, [
5449
+ "connections",
5450
+ "serviceId",
5451
+ "version"
5452
+ ]), n.version != 1 || G(n.serviceId) != e || !Array.isArray(n.connections) ? U() : n.connections.map(bl);
5453
+ }
5171
5454
  };
5172
5455
  }
5173
5456
  //#endregion
5174
5457
  //#region src/control/common/flowDecoders.ts
5175
- function sl(e) {
5458
+ function Ml(e) {
5176
5459
  let t = W(e), n = t.status;
5177
5460
  if (t.version != 1 || n != "active" && n != "retiring") return U();
5178
5461
  let r = t.live == null ? void 0 : W(t.live);
@@ -5191,18 +5474,18 @@ function sl(e) {
5191
5474
  version: 1
5192
5475
  };
5193
5476
  }
5194
- function cl(e) {
5477
+ function Nl(e) {
5195
5478
  let t = W(e);
5196
5479
  if (t.version != 1 || !Array.isArray(t.flows)) return U();
5197
5480
  let n = t.nextCursor, r = t.total;
5198
5481
  return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
5199
5482
  ...n == null ? {} : { nextCursor: n },
5200
- flows: t.flows.map(sl),
5483
+ flows: t.flows.map(Ml),
5201
5484
  ...r == null ? {} : { total: r },
5202
5485
  version: 1
5203
5486
  };
5204
5487
  }
5205
- function ll(e) {
5488
+ function Pl(e) {
5206
5489
  let t = W(e);
5207
5490
  if (K(t, [
5208
5491
  "name",
@@ -5225,7 +5508,7 @@ function ll(e) {
5225
5508
  }
5226
5509
  //#endregion
5227
5510
  //#region src/control/common/publicationDecoders.ts
5228
- function ul(e) {
5511
+ function Fl(e) {
5229
5512
  let t = W(e), n = t.operation, r = t.sourcePublicationId;
5230
5513
  return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? U() : {
5231
5514
  actorId: G(t.actorId),
@@ -5242,7 +5525,7 @@ function ul(e) {
5242
5525
  version: 1
5243
5526
  };
5244
5527
  }
5245
- function dl(e) {
5528
+ function Il(e) {
5246
5529
  let t = W(e), n = t.status, r = {
5247
5530
  createdAt: G(t.createdAt),
5248
5531
  flowId: G(t.flowId),
@@ -5308,33 +5591,33 @@ function dl(e) {
5308
5591
  default: return U();
5309
5592
  }
5310
5593
  }
5311
- function fl(e) {
5594
+ function Ll(e) {
5312
5595
  let t = W(e), n = t.status, r = t.publication;
5313
5596
  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
5597
  flowId: G(t.flowId),
5315
5598
  hasUnpublishedChanges: t.hasUnpublishedChanges,
5316
- publication: r === null ? null : ul(r),
5599
+ publication: r === null ? null : Fl(r),
5317
5600
  revision: q(t.revision),
5318
5601
  status: n,
5319
5602
  version: 1
5320
5603
  };
5321
5604
  }
5322
- function pl(e) {
5605
+ function Rl(e) {
5323
5606
  let t = W(e), n = t.nextCursor, r = t.total;
5324
5607
  return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
5325
5608
  ...n == null ? {} : { nextCursor: n },
5326
- publications: t.publications.map(ul),
5609
+ publications: t.publications.map(Fl),
5327
5610
  ...r == null ? {} : { total: r },
5328
5611
  version: 1
5329
5612
  };
5330
5613
  }
5331
5614
  new TextEncoder();
5332
- var ml = F(D(), _s()), hl = M({
5615
+ var zl = F(D(), _s()), Bl = M({
5333
5616
  jsonSchema: _s(),
5334
5617
  nullable: A(),
5335
5618
  value: _s().optional(),
5336
5619
  description: D().optional()
5337
- }).strict(), gl = F(D(), hl), _l = P([M({
5620
+ }).strict(), Vl = F(D(), Bl), Hl = P([M({
5338
5621
  kind: L("value"),
5339
5622
  value: _s()
5340
5623
  }).strict(), M({
@@ -5344,36 +5627,36 @@ var ml = F(D(), _s()), hl = M({
5344
5627
  nodeId: D(),
5345
5628
  output: D()
5346
5629
  }).strict())
5347
- }).strict()]), vl = {
5630
+ }).strict()]), Ul = {
5348
5631
  name: D().optional(),
5349
5632
  description: D().optional(),
5350
5633
  icon: D().optional()
5351
- }, yl = P([
5634
+ }, Wl = P([
5352
5635
  M({
5353
- ...vl,
5636
+ ...Ul,
5354
5637
  kind: L("cron"),
5355
5638
  cronTimes: j(_s())
5356
5639
  }).strict(),
5357
5640
  M({
5358
- ...vl,
5641
+ ...Ul,
5359
5642
  kind: L("manual")
5360
5643
  }).strict(),
5361
5644
  M({
5362
- ...vl,
5645
+ ...Ul,
5363
5646
  kind: L("task"),
5364
5647
  concurrency: L(1).optional(),
5365
- inputs: F(D(), _l),
5648
+ inputs: F(D(), Hl),
5366
5649
  task: M({
5367
5650
  name: D(),
5368
5651
  moduleId: D(),
5369
- inputs: gl,
5370
- outputs: F(D(), hl.omit({ value: !0 }))
5652
+ inputs: Vl,
5653
+ outputs: F(D(), Bl.omit({ value: !0 }))
5371
5654
  }).strict()
5372
5655
  }).strict()
5373
5656
  ]);
5374
5657
  M({
5375
5658
  name: D(),
5376
- graph: M({ nodes: F(D(), yl) }).strict()
5659
+ graph: M({ nodes: F(D(), Wl) }).strict()
5377
5660
  }).strict(), M({
5378
5661
  kind: L("open-flow-project-revision"),
5379
5662
  version: L(1),
@@ -5384,15 +5667,15 @@ M({
5384
5667
  imports: j(D())
5385
5668
  }).strict()),
5386
5669
  document: M({
5387
- bindings: ml,
5388
- flows: ml,
5389
- subflows: ml,
5390
- tasks: ml
5670
+ bindings: zl,
5671
+ flows: zl,
5672
+ subflows: zl,
5673
+ tasks: zl
5391
5674
  }).strict()
5392
5675
  }).strict();
5393
5676
  //#endregion
5394
5677
  //#region src/control/common/revisionDecoders.ts
5395
- function bl(e) {
5678
+ function Gl(e) {
5396
5679
  let t = W(e), n = t.parentRevisionId;
5397
5680
  return t.version != 1 || n !== null && typeof n != "string" ? U() : {
5398
5681
  actorId: G(t.actorId),
@@ -5405,18 +5688,18 @@ function bl(e) {
5405
5688
  version: 1
5406
5689
  };
5407
5690
  }
5408
- function xl(e) {
5691
+ function Kl(e) {
5409
5692
  let t = W(e);
5410
5693
  try {
5411
5694
  return {
5412
- ...bl(t),
5695
+ ...Gl(t),
5413
5696
  content: zc(t.content)
5414
5697
  };
5415
5698
  } catch {
5416
5699
  return U();
5417
5700
  }
5418
5701
  }
5419
- function Sl(e) {
5702
+ function ql(e) {
5420
5703
  let t = W(e);
5421
5704
  return K(t, [
5422
5705
  "revision",
@@ -5430,28 +5713,28 @@ function Sl(e) {
5430
5713
  version: 1
5431
5714
  };
5432
5715
  }
5433
- function Cl(e) {
5716
+ function Jl(e) {
5434
5717
  let t = W(e);
5435
5718
  return t.version == 1 ? {
5436
- revision: bl(t.revision),
5719
+ revision: Gl(t.revision),
5437
5720
  version: 1
5438
5721
  } : U();
5439
5722
  }
5440
- function wl(e) {
5723
+ function Yl(e) {
5441
5724
  let t = W(e);
5442
5725
  return t.version != 1 || t.kind != "snapshot" ? U() : {
5443
- draft: xl(t.draft),
5726
+ draft: Kl(t.draft),
5444
5727
  kind: "snapshot",
5445
5728
  version: 1
5446
5729
  };
5447
5730
  }
5448
5731
  //#endregion
5449
5732
  //#region src/control/common/runDecoders.ts
5450
- var Tl = new Set(oc);
5451
- function El(e) {
5452
- return typeof e == "string" && Tl.has(e) ? e : U();
5733
+ var Xl = new Set(oc);
5734
+ function Zl(e) {
5735
+ return typeof e == "string" && Xl.has(e) ? e : U();
5453
5736
  }
5454
- function Dl(e) {
5737
+ function Ql(e) {
5455
5738
  let t = W(e), n = t.source, r = t.startedAt, i = t.finishedAt;
5456
5739
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || i != null && typeof i != "string" ? U() : {
5457
5740
  createdAt: G(t.createdAt),
@@ -5461,11 +5744,11 @@ function Dl(e) {
5461
5744
  runId: G(t.runId),
5462
5745
  source: n,
5463
5746
  ...r == null ? {} : { startedAt: r },
5464
- status: El(t.status),
5747
+ status: Zl(t.status),
5465
5748
  version: 1
5466
5749
  };
5467
5750
  }
5468
- function Ol(e) {
5751
+ function $l(e) {
5469
5752
  let t = W(e);
5470
5753
  K(t, [
5471
5754
  "actions",
@@ -5485,12 +5768,12 @@ function Ol(e) {
5485
5768
  waitingSince: G(t.waitingSince)
5486
5769
  };
5487
5770
  }
5488
- function kl(e) {
5489
- let t = W(e), n = Dl(t), r = t.eventsExpiresAt;
5771
+ function eu(e) {
5772
+ let t = W(e), n = Ql(t), r = t.eventsExpiresAt;
5490
5773
  if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return U();
5491
5774
  let i = n.status == "waiting" ? {
5492
5775
  status: "waiting",
5493
- waiting: Ol(t.waiting)
5776
+ waiting: $l(t.waiting)
5494
5777
  } : { status: n.status }, a = {
5495
5778
  ...n,
5496
5779
  closureDigest: G(t.closureDigest),
@@ -5520,17 +5803,17 @@ function kl(e) {
5520
5803
  };
5521
5804
  }
5522
5805
  }
5523
- function Al(e) {
5806
+ function tu(e) {
5524
5807
  let t = W(e), n = t.nextCursor;
5525
5808
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? U() : {
5526
5809
  flowId: G(t.flowId),
5527
5810
  ...n == null ? {} : { nextCursor: n },
5528
- runs: t.runs.map(Dl),
5811
+ runs: t.runs.map(Ql),
5529
5812
  version: 1
5530
5813
  };
5531
5814
  }
5532
- function jl(e) {
5533
- let t = W(e), n = El(t.status);
5815
+ function nu(e) {
5816
+ let t = W(e), n = Zl(t.status);
5534
5817
  return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? U() : {
5535
5818
  cancelAccepted: t.cancelAccepted,
5536
5819
  runId: G(t.runId),
@@ -5538,7 +5821,7 @@ function jl(e) {
5538
5821
  version: 1
5539
5822
  };
5540
5823
  }
5541
- function Ml(e) {
5824
+ function ru(e) {
5542
5825
  let t = W(e);
5543
5826
  K(t, [
5544
5827
  "action",
@@ -5555,12 +5838,12 @@ function Ml(e) {
5555
5838
  resolutionAccepted: t.resolutionAccepted,
5556
5839
  resolvedAt: r,
5557
5840
  runId: G(t.runId),
5558
- status: El(t.status),
5841
+ status: Zl(t.status),
5559
5842
  version: 1,
5560
5843
  waitId: G(t.waitId)
5561
5844
  };
5562
5845
  }
5563
- function Nl(e) {
5846
+ function iu(e) {
5564
5847
  let t = W(e), n = t.status;
5565
5848
  if (t.version != 1) return U();
5566
5849
  let r = {
@@ -5602,147 +5885,8 @@ function Nl(e) {
5602
5885
  return U();
5603
5886
  }
5604
5887
  //#endregion
5605
- //#region src/control/common/triggerDecoders.ts
5606
- function Pl(e) {
5607
- let t = W(e), n = t.type;
5608
- return n != "integration" && n != "poll" ? U() : {
5609
- description: typeof t.description == "string" ? t.description : U(),
5610
- displayName: G(t.displayName),
5611
- key: G(t.key),
5612
- name: G(t.name),
5613
- provider: G(t.provider),
5614
- type: n
5615
- };
5616
- }
5617
- function Fl(e) {
5618
- let t = W(e), n = Pl(t), r = {
5619
- configSchema: J(t.configSchema),
5620
- definitionVersion: q(t.definitionVersion),
5621
- description: n.description,
5622
- displayName: n.displayName,
5623
- key: n.key,
5624
- name: n.name,
5625
- payloadSchema: J(t.payloadSchema),
5626
- provider: n.provider
5627
- };
5628
- if (n.type == "poll") return {
5629
- ...r,
5630
- type: "poll"
5631
- };
5632
- let i = W(t.endpoint), a = W(i.body);
5633
- if (!Array.isArray(i.methods) || !Array.isArray(a.formats) || typeof a.allowArray != "boolean" || typeof a.allowEmpty != "boolean") return U();
5634
- let o = i.methods.map(G), s = a.formats.map(G), c = q(i.successStatus);
5635
- return o.some((e) => ![
5636
- "DELETE",
5637
- "GET",
5638
- "HEAD",
5639
- "PATCH",
5640
- "POST",
5641
- "PUT"
5642
- ].includes(e)) || s.some((e) => ![
5643
- "form",
5644
- "json",
5645
- "multipart",
5646
- "text"
5647
- ].includes(e)) || c < 200 || c > 299 ? U() : {
5648
- ...r,
5649
- endpoint: {
5650
- body: {
5651
- allowArray: a.allowArray,
5652
- allowEmpty: a.allowEmpty,
5653
- formats: s
5654
- },
5655
- methods: o,
5656
- successStatus: c
5657
- },
5658
- type: "integration"
5659
- };
5660
- }
5661
- var Il = /* @__PURE__ */ new Set([
5662
- "cron",
5663
- "integration",
5664
- "poll",
5665
- "webhook"
5666
- ]), Ll = /* @__PURE__ */ new Set([
5667
- "failed",
5668
- "healthy",
5669
- "initializing",
5670
- "needs_reauth",
5671
- "suspended"
5672
- ]), Rl = /* @__PURE__ */ new Set([
5673
- "delivery.failed",
5674
- "health.failed",
5675
- "health.needs_reauth",
5676
- "health.recovered",
5677
- "health.suspended",
5678
- "operator.paused",
5679
- "operator.resumed"
5680
- ]);
5681
- function zl(e) {
5682
- let t = W(e), n = t.health, r = t.listener == null ? void 0 : W(t.listener);
5683
- if (r != null && r.health != "healthy" && r.health != "failed" && r.health != "needs_reauth") return U();
5684
- let i = t.kind, a = t.operatorState, o = q(t.runtimeVersion);
5685
- return t.version != 1 || typeof n != "string" || !Ll.has(n) || typeof i != "string" || !Il.has(i) || a != "active" && a != "paused" || o <= 0 ? U() : {
5686
- ...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
5687
- ...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
5688
- ...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
5689
- ...r == null ? {} : { listener: {
5690
- health: r.health,
5691
- ...r.lastErrorCode == null ? {} : { lastErrorCode: G(r.lastErrorCode) }
5692
- } },
5693
- flowId: G(t.flowId),
5694
- health: n,
5695
- kind: i,
5696
- ...t.lastErrorCode == null ? {} : { lastErrorCode: G(t.lastErrorCode) },
5697
- operatorState: a,
5698
- runtimeVersion: o,
5699
- triggerNodeId: G(t.triggerNodeId),
5700
- updatedAt: G(t.updatedAt),
5701
- version: 1
5702
- };
5703
- }
5704
- function Bl(e) {
5705
- let t = W(e);
5706
- return t.version == 1 ? {
5707
- binding: zl(t.binding),
5708
- version: 1
5709
- } : U();
5710
- }
5711
- function Vl(e) {
5712
- let t = W(e), n = t.kind;
5713
- if (typeof n != "string" || !Rl.has(n)) return U();
5714
- let r = Qc(t.errorCode), i = Qc(t.errorMessage);
5715
- return i != null && i.length > 512 ? U() : {
5716
- activityId: G(t.activityId),
5717
- createdAt: G(t.createdAt),
5718
- ...r == null ? {} : { errorCode: r },
5719
- ...i == null ? {} : { errorMessage: i },
5720
- kind: n
5721
- };
5722
- }
5723
- function Hl(e) {
5724
- let t = W(e), n = Qc(t.nextCursor);
5725
- return t.version != 1 || !Array.isArray(t.activities) ? U() : {
5726
- activities: t.activities.map(Vl),
5727
- ...n == null ? {} : { nextCursor: n },
5728
- version: 1
5729
- };
5730
- }
5731
- function Ul(e) {
5732
- let t = W(e), n = q(t.filtered);
5733
- return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
5734
- events: t.events.map((e) => {
5735
- let t = W(e);
5736
- return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
5737
- }),
5738
- filtered: n,
5739
- hasMore: t.hasMore,
5740
- version: 1
5741
- };
5742
- }
5743
- //#endregion
5744
5888
  //#region src/control/common/random.ts
5745
- function Wl() {
5889
+ function au() {
5746
5890
  let e = globalThis.crypto;
5747
5891
  if (e != null) {
5748
5892
  try {
@@ -5759,7 +5903,7 @@ function Wl() {
5759
5903
  }
5760
5904
  //#endregion
5761
5905
  //#region src/control/common/api.ts
5762
- function Gl(e) {
5906
+ function ou(e) {
5763
5907
  let t = W(e), n = q(t.sequence);
5764
5908
  if (n < 0) return U();
5765
5909
  let r = {
@@ -5787,7 +5931,7 @@ function Gl(e) {
5787
5931
  payload: {
5788
5932
  flowId: G(i.flowId),
5789
5933
  scopeId: G(i.scopeId),
5790
- progress: Kl(i.progress)
5934
+ progress: su(i.progress)
5791
5935
  }
5792
5936
  };
5793
5937
  case "run.waiting": return {
@@ -5890,7 +6034,7 @@ function Gl(e) {
5890
6034
  kind: a,
5891
6035
  payload: {
5892
6036
  ...e,
5893
- progress: Kl(i.progress)
6037
+ progress: su(i.progress)
5894
6038
  }
5895
6039
  };
5896
6040
  case "node.artifact": {
@@ -5916,14 +6060,14 @@ function Gl(e) {
5916
6060
  default: return U();
5917
6061
  }
5918
6062
  }
5919
- function Kl(e) {
6063
+ function su(e) {
5920
6064
  return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : U();
5921
6065
  }
5922
- function ql(e) {
6066
+ function cu(e) {
5923
6067
  let t = W(e), n = t.eventsExpiresAt, r = q(t.nextAfter);
5924
6068
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? U() : {
5925
6069
  done: t.done,
5926
- events: t.events.map(Gl),
6070
+ events: t.events.map(ou),
5927
6071
  ...n == null ? {} : { eventsExpiresAt: n },
5928
6072
  historyComplete: t.historyComplete,
5929
6073
  nextAfter: r,
@@ -5932,10 +6076,10 @@ function ql(e) {
5932
6076
  };
5933
6077
  }
5934
6078
  var Y = encodeURIComponent;
5935
- function Jl(e) {
5936
- return `${e}-${Wl()}`;
6079
+ function lu(e) {
6080
+ return `${e}-${au()}`;
5937
6081
  }
5938
- var Yl = class {
6082
+ var uu = class {
5939
6083
  constructor(e) {
5940
6084
  this.requestControl = e;
5941
6085
  }
@@ -5943,20 +6087,48 @@ var Yl = class {
5943
6087
  let t = new URLSearchParams();
5944
6088
  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));
5945
6089
  let n = t.size == 0 ? "" : `?${t}`;
5946
- return cl(await this.request(`/v1/flows${n}`));
6090
+ return Nl(await this.request(`/v1/flows${n}`));
6091
+ }
6092
+ async listEventSources(e, t) {
6093
+ return Jc(await this.request("/v1/event-sources" + (e == null ? "" : `?flowId=${Y(e)}`), { signal: t }));
6094
+ }
6095
+ async listEventSourceConnections(e, t) {
6096
+ let n = W(await this.request(`/v1/event-sources/connections${e == null ? "" : `?teamId=${Y(e)}`}`, { signal: t }));
6097
+ return K(n, ["version", "connections"]), n.version != 1 || !Array.isArray(n.connections) ? U() : n.connections.map(bl);
6098
+ }
6099
+ async createEventSource(e) {
6100
+ return qc(await this.request("/v1/event-sources", {
6101
+ method: "POST",
6102
+ body: JSON.stringify(e)
6103
+ }));
6104
+ }
6105
+ async updateEventSource(e, t) {
6106
+ return qc(await this.request(`/v1/event-sources/${Y(e)}`, {
6107
+ method: "PUT",
6108
+ body: JSON.stringify(t)
6109
+ }));
6110
+ }
6111
+ async deleteEventSource(e, t) {
6112
+ await this.request(`/v1/event-sources/${Y(e)}`, {
6113
+ method: "DELETE",
6114
+ body: JSON.stringify({
6115
+ version: 1,
6116
+ expectedRevision: t
6117
+ })
6118
+ });
5947
6119
  }
5948
6120
  async listVariables() {
5949
6121
  let e = W(await this.request("/v1/variables"));
5950
6122
  return K(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? U() : {
5951
- variables: e.variables.map(ll),
6123
+ variables: e.variables.map(Pl),
5952
6124
  version: 1
5953
6125
  };
5954
6126
  }
5955
6127
  async getVariable(e) {
5956
- return ll(await this.request(`/v1/variables/${Y(e)}`));
6128
+ return Pl(await this.request(`/v1/variables/${Y(e)}`));
5957
6129
  }
5958
6130
  async putVariable(e, t) {
5959
- return ll(await this.request(`/v1/variables/${Y(e)}`, {
6131
+ return Pl(await this.request(`/v1/variables/${Y(e)}`, {
5960
6132
  body: JSON.stringify({ value: t }),
5961
6133
  method: "PUT"
5962
6134
  }));
@@ -5965,8 +6137,8 @@ var Yl = class {
5965
6137
  let t = W(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
5966
6138
  if (K(t, ["version"]), t.version != 1) return U();
5967
6139
  }
5968
- async createFlow(e, t = `flow-${Wl()}`) {
5969
- return sl(await this.request("/v1/flows", {
6140
+ async createFlow(e, t = `flow-${au()}`) {
6141
+ return Ml(await this.request("/v1/flows", {
5970
6142
  body: JSON.stringify({
5971
6143
  name: e,
5972
6144
  version: 1
@@ -5976,10 +6148,10 @@ var Yl = class {
5976
6148
  }));
5977
6149
  }
5978
6150
  async getFlow(e) {
5979
- return sl(await this.request(`/v1/flows/${Y(e)}`));
6151
+ return Ml(await this.request(`/v1/flows/${Y(e)}`));
5980
6152
  }
5981
6153
  async renameFlow(e, t) {
5982
- return sl(await this.request(`/v1/flows/${Y(e)}`, {
6154
+ return Ml(await this.request(`/v1/flows/${Y(e)}`, {
5983
6155
  body: JSON.stringify({
5984
6156
  name: t,
5985
6157
  version: 1
@@ -5988,47 +6160,78 @@ var Yl = class {
5988
6160
  }));
5989
6161
  }
5990
6162
  async deleteFlow(e) {
5991
- return sl(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
6163
+ return Ml(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
5992
6164
  }
5993
- async listTriggerKeys(e) {
5994
- let t = W(await this.request("/v1/trigger-keys", { signal: e }));
5995
- return t.version != 1 || !Array.isArray(t.keys) ? U() : t.keys.map(Pl);
6165
+ async listTriggerKeys(e, t) {
6166
+ let n = W(await this.request(`/v1/trigger-keys${t == null ? "" : `?locale=${encodeURIComponent(t)}`}`, { signal: e }));
6167
+ return n.version != 1 || !Array.isArray(n.keys) ? U() : n.keys.map($c);
5996
6168
  }
5997
6169
  async listTriggerDefinitions(e) {
5998
6170
  let t = W(await this.request("/v1/trigger-keys/catalog", { signal: e }));
5999
- return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(Fl);
6171
+ return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(el);
6172
+ }
6173
+ async readCatalog(e, t, n) {
6174
+ let r = new Headers();
6175
+ t && r.set("if-none-match", t);
6176
+ let i = await this.response(e.path, {
6177
+ headers: r,
6178
+ signal: n
6179
+ }, !0), a = i.headers.get("etag")?.trim() || null;
6180
+ return i.status == 304 ? {
6181
+ modified: !1,
6182
+ etag: a
6183
+ } : {
6184
+ modified: !0,
6185
+ data: e.decode(await i.json()),
6186
+ etag: a
6187
+ };
6188
+ }
6189
+ async getTriggerCatalog(e, t, n) {
6190
+ let r = new Headers();
6191
+ t?.etag && r.set("if-none-match", t.etag);
6192
+ let i = await this.response(`/v1/trigger-keys/catalog?locale=${encodeURIComponent(e)}`, {
6193
+ headers: r,
6194
+ signal: n
6195
+ }, !0);
6196
+ return i.status == 304 ? t == null ? U() : {
6197
+ ...t,
6198
+ etag: i.headers.get("etag")?.trim() || t.etag
6199
+ } : {
6200
+ data: ll(await i.json()),
6201
+ etag: i.headers.get("etag")?.trim() || null
6202
+ };
6000
6203
  }
6001
6204
  async getTriggerKey(e, t) {
6002
6205
  let n = W(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
6003
- return n.version == 1 ? Fl(n.definition) : U();
6206
+ return n.version == 1 ? el(n.definition) : U();
6004
6207
  }
6005
6208
  async listFlowTriggerBindings(e, t) {
6006
6209
  let n = W(await this.request(`/v1/flows/${Y(e)}/triggers`, { signal: t }));
6007
- return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(zl);
6210
+ return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(il);
6008
6211
  }
6009
6212
  async getFlowTriggerBinding(e, t) {
6010
- return Bl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
6213
+ return al(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
6011
6214
  }
6012
6215
  async listFlowTriggerActivities(e, t, n = {}) {
6013
6216
  let r = new URLSearchParams();
6014
6217
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
6015
6218
  let i = r.size == 0 ? "" : `?${r}`;
6016
- return Hl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
6219
+ return sl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
6017
6220
  }
6018
6221
  async pauseFlowTrigger(e, t) {
6019
- return zl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
6222
+ return il(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
6020
6223
  body: JSON.stringify({ version: 1 }),
6021
6224
  method: "POST"
6022
6225
  }));
6023
6226
  }
6024
6227
  async resumeFlowTrigger(e, t) {
6025
- return zl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
6228
+ return il(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
6026
6229
  body: JSON.stringify({ version: 1 }),
6027
6230
  method: "POST"
6028
6231
  }));
6029
6232
  }
6030
6233
  async testFlowPollTrigger(e, t) {
6031
- return Ul(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
6234
+ return cl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
6032
6235
  body: JSON.stringify({ version: 1 }),
6033
6236
  method: "POST"
6034
6237
  }));
@@ -6043,69 +6246,93 @@ var Yl = class {
6043
6246
  "version"
6044
6247
  ]), t.version != 1) return U();
6045
6248
  let n = {
6046
- flow: sl(t.flow),
6047
- draft: xl(t.draft),
6048
- live: fl(t.live),
6049
- presentation: Sl(t.presentation),
6249
+ flow: Ml(t.flow),
6250
+ draft: Kl(t.draft),
6251
+ live: Ll(t.live),
6252
+ presentation: ql(t.presentation),
6050
6253
  version: 1
6051
6254
  };
6052
6255
  return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? U() : n;
6053
6256
  }
6054
6257
  async getPresentation(e) {
6055
- return Sl(await this.request(`/v1/flows/${Y(e)}/presentation`));
6258
+ return ql(await this.request(`/v1/flows/${Y(e)}/presentation`));
6056
6259
  }
6057
6260
  async getDraft(e) {
6058
- return xl(await this.request(`/v1/flows/${Y(e)}/draft`));
6261
+ return Kl(await this.request(`/v1/flows/${Y(e)}/draft`));
6059
6262
  }
6060
6263
  async syncDraft(e) {
6061
- return wl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
6264
+ return Yl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
6062
6265
  }
6063
6266
  async getRevision(e, t) {
6064
- return xl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
6267
+ return Kl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
6065
6268
  }
6066
- async listConnectorProviders(e, t) {
6067
- let n = W(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Y(t)}`}`, { signal: e }));
6068
- return K(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? U() : n.providers.map(ol);
6269
+ async listTriggerConfigOptions(e, t, n, r) {
6270
+ let i = W(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/options/${Y(n)}`, { signal: r }));
6271
+ return K(i, ["options", "version"]), i.version != 1 || !Array.isArray(i.options) || i.options.length > 1e3 ? U() : i.options.map((e) => {
6272
+ let t = W(e);
6273
+ K(t, [
6274
+ "value",
6275
+ "label",
6276
+ ...t.color == null ? [] : ["color"]
6277
+ ]);
6278
+ let n = t.color == null ? void 0 : G(t.color);
6279
+ return n != null && !/^#[0-9a-fA-F]{6}$/.test(n) ? U() : n == null ? {
6280
+ value: G(t.value),
6281
+ label: G(t.label)
6282
+ } : {
6283
+ value: G(t.value),
6284
+ label: G(t.label),
6285
+ color: n
6286
+ };
6287
+ });
6288
+ }
6289
+ async listConnectorProviders(e, t, n) {
6290
+ let r = Ol(t, n);
6291
+ return this.connectorRequest(r.path, "providers", e, r.decode);
6069
6292
  }
6070
- async listConnectorActions(e, t, n) {
6293
+ async listConnectorActions(e, t, n, r) {
6071
6294
  return await this.connectorActions({
6295
+ ...r == null ? {} : { locale: r },
6072
6296
  ...n == null ? {} : { flowId: n },
6073
6297
  ...e == null ? {} : { service: e }
6074
6298
  }, t);
6075
6299
  }
6076
- async searchConnectorActions(e, t, n) {
6300
+ async searchConnectorActions(e, t, n, r) {
6077
6301
  return await this.connectorActions({
6302
+ ...r == null ? {} : { locale: r },
6078
6303
  ...n == null ? {} : { flowId: n },
6079
6304
  q: e.trim()
6080
6305
  }, t);
6081
6306
  }
6082
- async getConnectorAction(e, t, n) {
6083
- let r = W(await this.request(`/v1/connector/actions/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
6084
- return K(r, ["action", "version"]), r.version == 1 ? al(r.action) : U();
6307
+ async getConnectorAction(e, t, n, r, i = !1) {
6308
+ let a = kl(e, n, r);
6309
+ return this.connectorRequest(a.path, "actions", t, a.decode, i);
6085
6310
  }
6086
- async listConnectorConnections(e, t, n) {
6087
- let r = W(await this.request(`/v1/connector/connections/${Y(e)}${n == null ? "" : `?flowId=${Y(n)}`}`, { signal: t }));
6088
- return K(r, [
6089
- "connections",
6090
- "serviceId",
6091
- "version"
6092
- ]), r.version != 1 || G(r.serviceId) != e || !Array.isArray(r.connections) ? U() : r.connections.map(tl);
6311
+ async listAllConnectorConnections(e, t, n = !1) {
6312
+ let r = Al(t);
6313
+ return this.connectorRequest(r.path, "connections", e, r.decode, n);
6314
+ }
6315
+ async listConnectorConnections(e, t, n, r = !1) {
6316
+ let i = jl(e, n);
6317
+ return this.connectorRequest(i.path, "connections", t, i.decode, r);
6093
6318
  }
6094
- async createConnectorConnectionPage(e, t) {
6095
- let n = W(await this.request(`/v1/connector/connections/${Y(e)}/page${t == null ? "" : `?flowId=${Y(t)}`}`, {
6319
+ async createConnectorConnectionPage(e, t, n) {
6320
+ let r = new URLSearchParams();
6321
+ t != null && r.set("flowId", t), n != null && r.set("teamId", n);
6322
+ let i = W(await this.request(`/v1/connector/connections/${Y(e)}/page${r.size == 0 ? "" : `?${r}`}`, {
6096
6323
  body: JSON.stringify({ version: 1 }),
6097
6324
  method: "POST"
6098
6325
  }));
6099
- if (K(n, ["url", "version"]), n.version != 1) return U();
6326
+ if (K(i, ["url", "version"]), i.version != 1) return U();
6100
6327
  try {
6101
- let e = new URL(G(n.url));
6328
+ let e = new URL(G(i.url));
6102
6329
  return e.protocol != "http:" && e.protocol != "https:" ? U() : e.href;
6103
6330
  } catch {
6104
6331
  return U();
6105
6332
  }
6106
6333
  }
6107
- async changeDraft(e, t, n, r = Jl("change")) {
6108
- return Cl(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6334
+ async changeDraft(e, t, n, r = lu("change")) {
6335
+ return Jl(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6109
6336
  body: JSON.stringify({
6110
6337
  expectedRevisionId: t,
6111
6338
  operations: n,
@@ -6116,7 +6343,7 @@ var Yl = class {
6116
6343
  }));
6117
6344
  }
6118
6345
  async checkFlow(e, t) {
6119
- return el(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
6346
+ return yl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
6120
6347
  body: JSON.stringify({
6121
6348
  engineContract: "open-flow-engine/v2",
6122
6349
  version: 1
@@ -6125,42 +6352,42 @@ var Yl = class {
6125
6352
  }));
6126
6353
  }
6127
6354
  async getLive(e, t) {
6128
- return fl(await this.request(`/v1/flows/${Y(e)}/live`, { signal: t }));
6355
+ return Ll(await this.request(`/v1/flows/${Y(e)}/live`, { signal: t }));
6129
6356
  }
6130
6357
  async listPublications(e, t = {}, n) {
6131
6358
  let r = new URLSearchParams();
6132
6359
  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));
6133
6360
  let i = r.size == 0 ? "" : `?${r}`;
6134
- return pl(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
6361
+ return Rl(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
6135
6362
  }
6136
6363
  async createDraftRun(e, t, n) {
6137
- let r = kl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6364
+ let r = eu(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6138
6365
  body: JSON.stringify({
6139
6366
  engineContract: "open-flow-engine/v2",
6140
6367
  inputs: n.inputs ?? {},
6141
6368
  trigger: n.trigger,
6142
6369
  version: 1
6143
6370
  }),
6144
- headers: { "idempotency-key": n.idempotencyKey ?? Jl("run") },
6371
+ headers: { "idempotency-key": n.idempotencyKey ?? lu("run") },
6145
6372
  method: "POST"
6146
6373
  }));
6147
6374
  return r.source == "draft" ? r : U();
6148
6375
  }
6149
6376
  async createLiveRun(e, t) {
6150
- let n = kl(await this.request("/v1/runs", {
6377
+ let n = eu(await this.request("/v1/runs", {
6151
6378
  body: JSON.stringify({
6152
6379
  inputs: t.inputs ?? {},
6153
6380
  trigger: t.trigger,
6154
6381
  publicationId: e,
6155
6382
  version: 1
6156
6383
  }),
6157
- headers: { "idempotency-key": t.idempotencyKey ?? Jl("run") },
6384
+ headers: { "idempotency-key": t.idempotencyKey ?? lu("run") },
6158
6385
  method: "POST"
6159
6386
  }));
6160
6387
  return n.source == "live" ? n : U();
6161
6388
  }
6162
6389
  async setFlowEnabled(e, t, n) {
6163
- return sl(await this.request(`/v1/flows/${Y(e)}/enabled`, {
6390
+ return Ml(await this.request(`/v1/flows/${Y(e)}/enabled`, {
6164
6391
  method: "PUT",
6165
6392
  body: JSON.stringify({
6166
6393
  enabled: n,
@@ -6170,65 +6397,65 @@ var Yl = class {
6170
6397
  }));
6171
6398
  }
6172
6399
  async publishFlow(e, t, n, r = {}) {
6173
- return dl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
6400
+ return Il(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
6174
6401
  body: JSON.stringify({
6175
6402
  engineContract: "open-flow-engine/v2",
6176
6403
  expectedLivePublicationId: n,
6177
6404
  version: 1
6178
6405
  }),
6179
- headers: { "idempotency-key": r.idempotencyKey ?? Jl("publication") },
6406
+ headers: { "idempotency-key": r.idempotencyKey ?? lu("publication") },
6180
6407
  method: "POST"
6181
6408
  }));
6182
6409
  }
6183
6410
  async getPublishOperation(e, t, n) {
6184
- return dl(await this.request(`/v1/flows/${Y(e)}/publish-operations/${Y(t)}`, { signal: n }));
6411
+ return Il(await this.request(`/v1/flows/${Y(e)}/publish-operations/${Y(t)}`, { signal: n }));
6185
6412
  }
6186
6413
  async rollbackFlow(e, t, n, r = {}) {
6187
- return ul(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
6414
+ return Fl(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
6188
6415
  body: JSON.stringify({
6189
6416
  expectedLivePublicationId: n,
6190
6417
  version: 1
6191
6418
  }),
6192
- headers: { "idempotency-key": r.idempotencyKey ?? Jl("publication") },
6419
+ headers: { "idempotency-key": r.idempotencyKey ?? lu("publication") },
6193
6420
  method: "POST"
6194
6421
  }));
6195
6422
  }
6196
6423
  async getRun(e, t) {
6197
- return kl(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6424
+ return eu(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6198
6425
  }
6199
6426
  async listRuns(e, t = {}) {
6200
6427
  let n = new URLSearchParams();
6201
6428
  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);
6202
6429
  let r = n.size == 0 ? "" : `?${n}`;
6203
- return Al(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6430
+ return tu(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6204
6431
  }
6205
6432
  async getRunEvents(e, t = {}, n) {
6206
6433
  let r = new URLSearchParams();
6207
6434
  t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
6208
6435
  let i = r.size == 0 ? "" : `?${r}`;
6209
- return ql(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6436
+ return cu(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6210
6437
  }
6211
6438
  async listRunResults(e, t, n) {
6212
- return Yc(await this.request(`/v1/runs/${Y(e)}/results${t == null ? "" : `?after=${encodeURIComponent(t)}`}`, { signal: n }));
6439
+ return gl(await this.request(`/v1/runs/${Y(e)}/results${t == null ? "" : `?after=${encodeURIComponent(t)}`}`, { signal: n }));
6213
6440
  }
6214
6441
  async readRunResult(e, t, n = {}, r) {
6215
6442
  let i = new URLSearchParams(Object.entries(n).map(([e, t]) => [e, String(t)]));
6216
- return Xc(await this.request(`/v1/runs/${Y(e)}/results/${Y(t)}?${i}`, { signal: r }));
6443
+ return _l(await this.request(`/v1/runs/${Y(e)}/results/${Y(t)}?${i}`, { signal: r }));
6217
6444
  }
6218
6445
  async downloadRunResult(e, t, n) {
6219
6446
  return (await this.response(`/v1/runs/${Y(e)}/results/${Y(t)}/content`, { signal: n })).blob();
6220
6447
  }
6221
6448
  async getRunResult(e, t) {
6222
- return Nl(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6449
+ return iu(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6223
6450
  }
6224
6451
  async cancelRun(e) {
6225
- return jl(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6452
+ return nu(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6226
6453
  body: JSON.stringify({ version: 1 }),
6227
6454
  method: "POST"
6228
6455
  }));
6229
6456
  }
6230
6457
  async resolveRunWait(e, t, n) {
6231
- return Ml(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6458
+ return ru(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6232
6459
  body: JSON.stringify({
6233
6460
  action: n,
6234
6461
  version: 1
@@ -6237,27 +6464,33 @@ var Yl = class {
6237
6464
  }));
6238
6465
  }
6239
6466
  async connectorActions(e, t) {
6240
- 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 }));
6241
- return K(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? U() : i.actions.map(al);
6467
+ let n = Object.entries(e).map(([e, t]) => `${Y(e)}=${Y(t)}`).join("&"), r = n == "" ? "" : `?${n}`;
6468
+ return this.connectorRequest(`/v1/connector/actions${r}`, "actions", t, (e) => {
6469
+ let t = W(e);
6470
+ return K(t, ["actions", "version"]), t.version != 1 || !Array.isArray(t.actions) ? U() : t.actions.map(Tl);
6471
+ });
6472
+ }
6473
+ async connectorRequest(e, t, n, r, i = !1) {
6474
+ return r(await this.request(e, { signal: n }));
6242
6475
  }
6243
- async response(e, t) {
6244
- let n = new Headers(t.headers);
6245
- t.body != null && n.set("content-type", "application/json");
6246
- let r = await this.requestControl(e, {
6476
+ async response(e, t, n = !1) {
6477
+ let r = new Headers(t.headers);
6478
+ t.body != null && r.set("content-type", "application/json");
6479
+ let i = await this.requestControl(e, {
6247
6480
  ...t,
6248
- headers: n
6481
+ headers: r
6249
6482
  });
6250
- if (!r.ok) {
6483
+ if (!i.ok && !(n && i.status == 304)) {
6251
6484
  let e;
6252
6485
  try {
6253
- e = await r.json();
6486
+ e = await i.json();
6254
6487
  } catch {
6255
6488
  return U();
6256
6489
  }
6257
6490
  let t = W(e).error, n = t == null ? void 0 : W(t);
6258
- 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}.`);
6491
+ throw new Zc(i.status, typeof n?.code == "string" ? n.code : "request.failed", typeof n?.message == "string" ? n.message : `Request failed with status ${i.status}.`);
6259
6492
  }
6260
- return r;
6493
+ return i;
6261
6494
  }
6262
6495
  async request(e, t = {}) {
6263
6496
  let n = await this.response(e, t);
@@ -6273,13 +6506,13 @@ var Yl = class {
6273
6506
  function X(e, t) {
6274
6507
  if (!e) throw Error(t);
6275
6508
  }
6276
- async function Xl(e, t, n) {
6509
+ async function du(e, t, n) {
6277
6510
  let r = await e.request(new Request(new URL("/v1/mcp", e.origin), {
6278
6511
  method: "POST",
6279
6512
  headers: {
6280
6513
  "content-type": "application/json",
6281
6514
  accept: "application/json, text/event-stream",
6282
- "mcp-protocol-version": Ql,
6515
+ "mcp-protocol-version": pu,
6283
6516
  "mcp-method": t,
6284
6517
  ...t == "tools/call" ? { "mcp-name": String(n?.name) } : {}
6285
6518
  },
@@ -6290,7 +6523,7 @@ async function Xl(e, t, n) {
6290
6523
  params: {
6291
6524
  ...n,
6292
6525
  _meta: {
6293
- "io.modelcontextprotocol/protocolVersion": Ql,
6526
+ "io.modelcontextprotocol/protocolVersion": pu,
6294
6527
  "io.modelcontextprotocol/clientCapabilities": {}
6295
6528
  }
6296
6529
  }
@@ -6300,13 +6533,13 @@ async function Xl(e, t, n) {
6300
6533
  let i = await r.text(), a = r.headers.get("content-type")?.includes("text/event-stream") ? JSON.parse(i.split("\n").findLast((e) => e.startsWith("data:"))?.slice(5) ?? "null") : JSON.parse(i);
6301
6534
  return X(a != null && a.error == null, `MCP ${t} failed: ${JSON.stringify(a)}.`), a.result;
6302
6535
  }
6303
- var Zl = [
6536
+ var fu = [
6304
6537
  {
6305
6538
  name: "publishes the public MCP catalog, input schemas and annotations",
6306
6539
  async verify(e) {
6307
- let t = await Xl(e, "tools/list");
6308
- X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(iu).length, "MCP tool count differs from the public contract.");
6309
- for (let [e, n] of Object.entries(iu)) {
6540
+ let t = await du(e, "tools/list");
6541
+ X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(yu).length, "MCP tool count differs from the public contract.");
6542
+ for (let [e, n] of Object.entries(yu)) {
6310
6543
  let r = t.tools.find((t) => t.name == e);
6311
6544
  X(r != null, `Missing MCP tool ${e}.`), X(r.description == n.description, `${e} description differs.`), X(ac(r.annotations, n.annotations), `${e} annotations differ.`);
6312
6545
  let { $schema: i, ...a } = n.inputSchema["~standard"].jsonSchema.input(), { $schema: o, ...s } = r.inputSchema;
@@ -6317,7 +6550,7 @@ var Zl = [
6317
6550
  {
6318
6551
  name: "shares Run pagination, status filters and cancellation between MCP and REST",
6319
6552
  async verify(e) {
6320
- let t = new Yl((t, n) => e.request(new Request(new URL(t, e.origin), n))), n = await t.createFlow("MCP Run listing"), r = await t.changeDraft(n.flowId, n.draftRevisionId, [{
6553
+ let t = new uu((t, n) => e.request(new Request(new URL(t, e.origin), n))), n = await t.createFlow("MCP Run listing"), r = await t.changeDraft(n.flowId, n.draftRevisionId, [{
6321
6554
  kind: "graph.node.create",
6322
6555
  target: { kind: "flow" },
6323
6556
  nodeId: "start",
@@ -6335,7 +6568,7 @@ var Zl = [
6335
6568
  }
6336
6569
  }, a = [];
6337
6570
  for (let t = 0; t < 2; t++) {
6338
- let t = (await Xl(e, "tools/call", {
6571
+ let t = (await du(e, "tools/call", {
6339
6572
  name: "flow_run",
6340
6573
  arguments: {
6341
6574
  ...i,
@@ -6344,7 +6577,7 @@ var Zl = [
6344
6577
  })).structuredContent;
6345
6578
  X(typeof t.runId == "string", "MCP must return an accepted Run ID."), a.push(t.runId);
6346
6579
  }
6347
- let o = (await Xl(e, "tools/call", {
6580
+ let o = (await du(e, "tools/call", {
6348
6581
  name: "run_list",
6349
6582
  arguments: {
6350
6583
  flowId: n.flowId,
@@ -6358,24 +6591,24 @@ var Zl = [
6358
6591
  });
6359
6592
  X(s.runs.length == 1 && s.runs[0]?.runId != o.runs[0]?.runId, "REST must continue the MCP Run cursor without duplicates.");
6360
6593
  let c = await t.listRuns(n.flowId, { limit: 1 });
6361
- X(ac((await Xl(e, "tools/call", {
6594
+ X(ac((await du(e, "tools/call", {
6362
6595
  name: "run_list",
6363
6596
  arguments: {
6364
6597
  flowId: n.flowId,
6365
6598
  cursor: c.nextCursor,
6366
6599
  limit: 1
6367
6600
  }
6368
- })).structuredContent, s), "MCP must continue the REST Run cursor."), await Xl(e, "tools/call", {
6601
+ })).structuredContent, s), "MCP must continue the REST Run cursor."), await du(e, "tools/call", {
6369
6602
  name: "run_cancel",
6370
6603
  arguments: { runId: a[0] }
6371
- }), X(ac((await Xl(e, "tools/call", {
6604
+ }), X(ac((await du(e, "tools/call", {
6372
6605
  name: "run_list",
6373
6606
  arguments: {
6374
6607
  flowId: n.flowId,
6375
6608
  status: "canceled"
6376
6609
  }
6377
6610
  })).structuredContent, await t.listRuns(n.flowId, { status: "canceled" })), "MCP and REST status filters differ.");
6378
- let l = await Xl(e, "tools/call", {
6611
+ let l = await du(e, "tools/call", {
6379
6612
  name: "run_list",
6380
6613
  arguments: {
6381
6614
  flowId: (await t.createFlow("Other Run scope")).flowId,
@@ -6391,7 +6624,7 @@ var Zl = [
6391
6624
  let t = {
6392
6625
  name: "MCP conformance",
6393
6626
  idempotencyKey: crypto.randomUUID()
6394
- }, n = () => Xl(e, "tools/call", {
6627
+ }, n = () => du(e, "tools/call", {
6395
6628
  name: "flow_create",
6396
6629
  arguments: t
6397
6630
  }), r = await n();
@@ -6400,7 +6633,7 @@ var Zl = [
6400
6633
  X(typeof i.flowId == "string", "MCP did not return a Flow ID."), X(ac((await n()).structuredContent, i), "MCP mutation replay changed identity.");
6401
6634
  let a = await e.request(new Request(new URL(`/v1/flows/${encodeURIComponent(i.flowId)}/draft`, e.origin)));
6402
6635
  X(a.ok, "REST cannot read the Flow created through MCP."), X((await a.json()).revisionId == i.draftRevisionId, "MCP and REST disagree on the Draft head.");
6403
- let o = await Xl(e, "tools/call", {
6636
+ let o = await du(e, "tools/call", {
6404
6637
  name: "flow_create",
6405
6638
  arguments: {
6406
6639
  ...t,
@@ -6410,7 +6643,7 @@ var Zl = [
6410
6643
  X(o.isError == 1, "MCP must reject a changed idempotent replay."), X(o.structuredContent.error.code == "flow.conflict", "MCP must preserve the Control error code.");
6411
6644
  }
6412
6645
  }
6413
- ], Ql = "2026-07-28", $l = rc(), Z = D().min(1), eu = Z.max(256).describe("Stable identity for this mutation. Retry with the same key and identical arguments, even after a lost response."), tu = fs().min(1).max(100).default(50), Q = Z.describe("Exact Flow ID returned by flow_list or flow_create."), nu = Z.describe("Exact Run ID returned by flow_run or run_list."), ru = "Use flow_list and flow_get to inspect a Flow. Use flow_schema to learn atomic edit operations, then flow_apply with the observed expectedRevisionId and a stable idempotencyKey. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_create, flow_apply, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
6646
+ ], pu = "2026-07-28", mu = rc(), Z = D().min(1), hu = Z.max(256).describe("Stable identity for this mutation. Retry with the same key and identical arguments, even after a lost response."), gu = fs().min(1).max(100).default(50), Q = Z.describe("Exact Flow ID returned by flow_list or flow_create."), _u = Z.describe("Exact Run ID returned by flow_run or run_list."), vu = "Use flow_list and flow_get to inspect a Flow. Use flow_schema to learn atomic edit operations, then flow_apply with the observed expectedRevisionId and a stable idempotencyKey. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_create, flow_apply, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
6414
6647
  function $(e, t, n) {
6415
6648
  return {
6416
6649
  description: e,
@@ -6437,23 +6670,23 @@ function $(e, t, n) {
6437
6670
  } }
6438
6671
  };
6439
6672
  }
6440
- var iu = {
6673
+ var yu = {
6441
6674
  flow_list: $("List Flows in this deployment. Continue with nextCursor; cursors are compatible with the Control API.", N({
6442
6675
  cursor: Z.optional(),
6443
- limit: tu
6676
+ limit: gu
6444
6677
  }), !0),
6445
6678
  flow_get: $("Read Flow metadata, the full Draft and current Live publication. Use draft.revisionId as the base of an edit.", N({ flowId: Q }), !0),
6446
6679
  flow_schema: $("Get the JSON Schema for atomic change operations, optionally one operation kind. Node titles must be non-empty and unique within a graph.", N({ kind: Z.optional() }), !0),
6447
6680
  flow_create: $("Create an empty Flow. If this deployment uses OOMOL Connector, choose a teamId from connector_teams. Keep the key and arguments stable when retrying.", N({
6448
6681
  name: Z.refine((e) => e == e.trim() && Vc(e) == null, "Flow name is invalid."),
6449
- idempotencyKey: eu,
6682
+ idempotencyKey: hu,
6450
6683
  teamId: Z.optional()
6451
6684
  }), !1),
6452
6685
  flow_apply: $("Apply ordered atomic changes. Read flow_schema first. A stale expectedRevisionId is a conflict; reread the Draft before deciding on a new edit.", N({
6453
6686
  flowId: Q,
6454
6687
  expectedRevisionId: Z,
6455
- idempotencyKey: eu,
6456
- operations: j($l).min(1).describe("Change operations defined by flow_schema. Explicit IDs and before values refer to the base Revision.")
6688
+ idempotencyKey: hu,
6689
+ operations: j(mu).min(1).describe("Change operations defined by flow_schema. Explicit IDs and before values refer to the base Revision.")
6457
6690
  }), !1),
6458
6691
  flow_check: $("Validate a fixed Revision and return diagnostics. Get its revisionId from flow_get or flow_apply.", N({
6459
6692
  flowId: Q,
@@ -6463,7 +6696,7 @@ var iu = {
6463
6696
  flowId: Q,
6464
6697
  revisionId: Z,
6465
6698
  expectedLivePublicationId: Z.nullable(),
6466
- idempotencyKey: eu
6699
+ idempotencyKey: hu
6467
6700
  }), !1),
6468
6701
  flow_publish_status: $("Read a publish operation. Only succeeded confirms publication; failed includes the failure details. Keep polling while pending.", N({
6469
6702
  flowId: Q,
@@ -6481,34 +6714,34 @@ var iu = {
6481
6714
  publicationId: Z.optional(),
6482
6715
  trigger: N({
6483
6716
  nodeId: Z,
6484
- payload: $l
6717
+ payload: mu
6485
6718
  }),
6486
- inputs: F(D(), F(D(), $l)).default({}),
6487
- idempotencyKey: eu
6719
+ inputs: F(D(), F(D(), mu)).default({}),
6720
+ idempotencyKey: hu
6488
6721
  }), !1),
6489
6722
  run_list: $("List Runs for a Flow, optionally filtered by status. Continue with nextCursor; cursors are compatible with the Control API.", N({
6490
6723
  flowId: Q,
6491
6724
  status: I(oc).optional(),
6492
6725
  cursor: Z.optional(),
6493
- limit: tu
6726
+ limit: gu
6494
6727
  }), !0),
6495
- run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", N({ runId: nu }), !0),
6728
+ run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", N({ runId: _u }), !0),
6496
6729
  run_events: $("Read one page of Run events. Continue with nextAfter. Events can expire independently of the terminal result.", N({
6497
- runId: nu,
6730
+ runId: _u,
6498
6731
  after: fs().min(0).default(0),
6499
- limit: tu
6732
+ limit: gu
6500
6733
  }), !0),
6501
- run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", N({ runId: nu }), !0),
6734
+ run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", N({ runId: _u }), !0),
6502
6735
  run_results: $("List stored Agent tool result metadata for a Run, including Connector and code results. Continue with nextAfter as after. Use run_result_read to inspect content.", N({
6503
- runId: nu,
6736
+ runId: _u,
6504
6737
  after: Z.optional()
6505
6738
  }), !0),
6506
6739
  run_result_read: $("Read a bounded page of a stored Agent tool result. Select a JSON Pointer with pointer and continue with nextOffset as offset at the same pointer. A complete value contains all data at that pointer.", Hc.extend({
6507
- runId: nu,
6740
+ runId: _u,
6508
6741
  resultId: Z
6509
6742
  }), !0),
6510
6743
  run_resolve_wait: $("Explicitly resolve the waitId observed in run_get with one of its allowed actions. The first decision wins; inspect resolutionAccepted and action. Resume the same Run and poll run_get; do not create a replacement Run.", N({
6511
- runId: nu,
6744
+ runId: _u,
6512
6745
  waitId: Z,
6513
6746
  action: I([
6514
6747
  "approve",
@@ -6516,7 +6749,7 @@ var iu = {
6516
6749
  "reject"
6517
6750
  ])
6518
6751
  }), !1),
6519
- run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", N({ runId: nu }), !1),
6752
+ run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", N({ runId: _u }), !1),
6520
6753
  connector_teams: $("List OOMOL Teams available for Flow creation. An unconfigured or custom Connector may not provide Teams.", N({}), !0),
6521
6754
  connector_list: $("List Connector providers available in the Flow scope.", N({ flowId: Q.optional() }), !0),
6522
6755
  connector_search: $("Search Connector actions in the Flow scope.", N({
@@ -6535,4 +6768,4 @@ var iu = {
6535
6768
  trigger_get: $("Read a provider Trigger definition before creating its node.", N({ key: Z }), !0)
6536
6769
  };
6537
6770
  //#endregion
6538
- export { Zl as mcpConformanceCases, ru as mcpInstructions, Ql as mcpProtocolVersion, iu as mcpTools };
6771
+ export { fu as mcpConformanceCases, vu as mcpInstructions, pu as mcpProtocolVersion, yu as mcpTools };