@oomol-lab/open-flow 0.1.0-beta.84 → 0.1.0-beta.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{FlowCanvas-B2g7NceZ.js → FlowCanvas-CHIaMaBv.js} +112 -16
- package/dist/browser/{createResourceDialog-Bi4fUnbD.js → createResourceDialog-C0E5yPe6.js} +3 -3
- package/dist/browser/{dialog-BzoSxhXQ.js → dialog-b3hsdu8i.js} +291 -143
- package/dist/browser/{exportPng-DLdtJvg3.js → exportPng-DGHcejgy.js} +2 -2
- package/dist/browser/{flowChanges-C567g-Pc.js → flowChanges-BvSWezEb.js} +375 -83
- package/dist/browser/{flowWorkspace-DBk4A-Ld.js → flowWorkspace-BKnMRClO.js} +1619 -475
- package/dist/browser/fr-CNTSedYU.js +593 -0
- package/dist/browser/ja-CxQBHr2J.js +593 -0
- package/dist/browser/ko-D1Exiv1h.js +593 -0
- package/dist/browser/licenses.md +1 -1
- package/dist/browser/{markdownContent-DIuJThGK.js → markdownContent-BR9-1ikU.js} +1 -1
- package/dist/browser/preview.css +181 -181
- package/dist/browser/preview.js +2103 -636
- package/dist/browser/ru-BzLZv0B7.js +593 -0
- package/dist/browser/{tooltip-DGj5pudg.js → tooltip-DSBF3bRw.js} +55 -23
- package/dist/browser/workbench.css +181 -181
- package/dist/browser/workbench.js +86 -17
- package/dist/browser/{workbenchSelect-BIaEVTx6.js → workbenchSelect-Di1Bm_-d.js} +2 -2
- package/dist/browser/{wrapLayout-C4moMKgb.js → wrapLayout-B0AT8_-i.js} +1 -1
- package/dist/browser/zh-CN-Dg_xSGde.js +593 -0
- package/dist/browser/zh-TW-oxuLwsV0.js +593 -0
- package/dist/command/index.js +61 -57
- package/dist/command/licenses.md +28 -4
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +41 -4
- package/dist/common/catalogCache.d.ts +46 -0
- package/dist/common/connector-action.js +13 -10
- package/dist/common/connector-proxy.d.ts +96 -0
- package/dist/common/connector-proxy.js +5209 -0
- package/dist/common/control-api-conformance.js +312 -46
- package/dist/common/control-api.d.ts +12 -1
- package/dist/common/control-api.js +303 -41
- package/dist/common/control-requests.d.ts +4 -3
- package/dist/common/control-requests.js +14111 -171
- package/dist/common/engine-contract.d.ts +3 -2
- package/dist/common/event-source.js +55 -23
- package/dist/common/flow-authoring-node.d.ts +2 -0
- package/dist/common/flow-authoring.js +6936 -6781
- package/dist/common/flow-change-schema.d.ts +1 -1
- package/dist/common/flow-change.d.ts +2 -2
- package/dist/common/flow-change.js +91 -36
- package/dist/common/flow-connectionUsage.d.ts +1 -1
- package/dist/common/flow-encoding.js +93 -38
- package/dist/common/flow-requestParameters.d.ts +34 -0
- package/dist/common/flow-semantics.js +9429 -9236
- package/dist/common/flow-state.js +55 -23
- package/dist/common/flow-workflowFile.d.ts +3 -1
- package/dist/common/http-request.d.ts +6 -11
- package/dist/common/http-request.js +192 -141
- package/dist/common/licenses.md +1 -1
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +303 -41
- package/dist/common/run-events.js +1 -0
- package/dist/common/runtime-contract.js +10 -4
- package/dist/common/runtime-nodejs-compat.js +55 -23
- package/dist/common/scheduler-checkpoint.d.ts +3 -3
- package/dist/common/scheduler-dependencies.d.ts +22 -28
- package/dist/common/scheduler-node-execution.d.ts +1 -0
- package/dist/common/scheduler.d.ts +8 -2
- package/dist/common/scheduler.js +274 -95
- package/dist/common/workflow.js +51 -19
- package/dist/common/workflowAuthoring.d.ts +411 -0
- package/dist/render/browser/licenses.md +1 -1
- package/dist/render/browser/runtime.js +289 -61
- package/dist/render/node/index.js +85 -30
- package/dist/render/node/licenses.md +1 -1
- package/package.json +1 -1
- package/skills/open-flow/references/flow-authoring.md +14 -13
- package/src/base/common/jsonSchema.ts +11 -0
- package/src/connector/common/actionSchema.ts +4 -11
- package/src/connector/common/proxy.ts +152 -0
- package/src/control/common/api.ts +99 -3
- package/src/control/common/authoring.ts +23 -9
- package/src/control/common/authoringExamples.ts +9 -0
- package/src/control/common/authoringSchema.ts +21 -12
- package/src/control/common/catalogCache.ts +145 -0
- package/src/control/common/conformance.ts +9 -3
- package/src/control/common/connectorQueries.ts +17 -2
- package/src/control/common/requests.ts +1 -0
- package/src/control/common/workflowAuthoring.ts +120 -0
- package/src/execution/common/checkpoint.ts +18 -12
- package/src/execution/common/dependencies.ts +132 -15
- package/src/execution/common/events.ts +3 -0
- package/src/execution/common/node-execution.ts +22 -15
- package/src/execution/common/scheduler.ts +20 -31
- package/src/flow/common/change.ts +2 -1
- package/src/flow/common/changeSchema.ts +11 -1
- package/src/flow/common/connectionUsage.ts +4 -2
- package/src/flow/common/errorHandling.ts +3 -1
- package/src/flow/common/nodeChanges.ts +35 -18
- package/src/flow/common/requestParameters.ts +120 -0
- package/src/flow/common/semantics.ts +51 -1
- package/src/flow/common/sourceField.ts +3 -2
- package/src/flow/common/workflowFile.ts +2 -2
- package/src/http/common/httpRequest.ts +28 -78
- package/src/runtime/common/engineContract.ts +6 -3
package/dist/common/mcp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
2
2
|
function getEnumValues(entries) {
|
|
3
3
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
4
4
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -323,6 +323,17 @@ function prefixIssues(path, issues) {
|
|
|
323
323
|
function unwrapMessage(message) {
|
|
324
324
|
return typeof message === "string" ? message : message?.message;
|
|
325
325
|
}
|
|
326
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
327
|
+
function sizeCaps(defChecks) {
|
|
328
|
+
const caps = [];
|
|
329
|
+
for (const ch of defChecks ?? []) {
|
|
330
|
+
const d = ch._zod.def;
|
|
331
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
332
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
333
|
+
if (max >= 0) caps.push([max, ch]);
|
|
334
|
+
}
|
|
335
|
+
return caps;
|
|
336
|
+
}
|
|
326
337
|
function attachSchema(issues, start, inst) {
|
|
327
338
|
var _a;
|
|
328
339
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -539,7 +550,7 @@ function constantCatch(value) {
|
|
|
539
550
|
return fn;
|
|
540
551
|
}
|
|
541
552
|
//#endregion
|
|
542
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
553
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
543
554
|
var _a$1;
|
|
544
555
|
var _zodDesc = {
|
|
545
556
|
value: void 0,
|
|
@@ -645,7 +656,7 @@ function config(newConfig) {
|
|
|
645
656
|
return globalConfig;
|
|
646
657
|
}
|
|
647
658
|
//#endregion
|
|
648
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
659
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
649
660
|
function _getMessage() {
|
|
650
661
|
const internals = this._zod;
|
|
651
662
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -761,7 +772,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
761
772
|
return fieldErrors;
|
|
762
773
|
}
|
|
763
774
|
//#endregion
|
|
764
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
775
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
765
776
|
function finalizeParams(callee, params) {
|
|
766
777
|
return {
|
|
767
778
|
callee: params?.callee ?? callee,
|
|
@@ -964,7 +975,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
964
975
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
965
976
|
};
|
|
966
977
|
//#endregion
|
|
967
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
978
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
968
979
|
/**
|
|
969
980
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
970
981
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1037,7 +1048,7 @@ var _null$2 = /^null$/i;
|
|
|
1037
1048
|
var lowercase = /^[^A-Z]*$/;
|
|
1038
1049
|
var uppercase = /^[^a-z]*$/;
|
|
1039
1050
|
//#endregion
|
|
1040
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1051
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1041
1052
|
var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1042
1053
|
var _a;
|
|
1043
1054
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1333,7 +1344,7 @@ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst,
|
|
|
1333
1344
|
};
|
|
1334
1345
|
});
|
|
1335
1346
|
//#endregion
|
|
1336
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1347
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1337
1348
|
var Doc = class {
|
|
1338
1349
|
constructor(args = [], closed = {}) {
|
|
1339
1350
|
this.content = [];
|
|
@@ -1367,14 +1378,14 @@ var Doc = class {
|
|
|
1367
1378
|
}
|
|
1368
1379
|
};
|
|
1369
1380
|
//#endregion
|
|
1370
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1381
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1371
1382
|
var version = {
|
|
1372
1383
|
major: 4,
|
|
1373
1384
|
minor: 6,
|
|
1374
|
-
patch:
|
|
1385
|
+
patch: 7
|
|
1375
1386
|
};
|
|
1376
1387
|
//#endregion
|
|
1377
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1388
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1378
1389
|
var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1379
1390
|
var _a;
|
|
1380
1391
|
inst ?? (inst = {});
|
|
@@ -1887,6 +1898,26 @@ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
|
1887
1898
|
return payload;
|
|
1888
1899
|
};
|
|
1889
1900
|
});
|
|
1901
|
+
function capSize(inst, size) {
|
|
1902
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
1903
|
+
if (!caps.length) return;
|
|
1904
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
1905
|
+
const parse = inst._zod.parse;
|
|
1906
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1907
|
+
const n = size(payload.value);
|
|
1908
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
1909
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
1910
|
+
const start = payload.issues.length;
|
|
1911
|
+
ch._zod.check(payload);
|
|
1912
|
+
payload.issues[start].continue = false;
|
|
1913
|
+
attachSchema(payload.issues, start, inst);
|
|
1914
|
+
return payload;
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
return parse(payload, ctx);
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
1890
1921
|
function handleArrayResult(result, final, index) {
|
|
1891
1922
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1892
1923
|
final.value[index] = result.value;
|
|
@@ -1924,6 +1955,7 @@ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
1924
1955
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1925
1956
|
return payload;
|
|
1926
1957
|
};
|
|
1958
|
+
capSize(inst, arraySize);
|
|
1927
1959
|
});
|
|
1928
1960
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
1929
1961
|
const isPresent = key in input;
|
|
@@ -2842,7 +2874,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2842
2874
|
}
|
|
2843
2875
|
}
|
|
2844
2876
|
//#endregion
|
|
2845
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
2877
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
2846
2878
|
var $ZodCyclicError = class extends Error {
|
|
2847
2879
|
constructor() {
|
|
2848
2880
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3095,7 +3127,7 @@ function isBackEdge(ctx, value) {
|
|
|
3095
3127
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3096
3128
|
}
|
|
3097
3129
|
//#endregion
|
|
3098
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3130
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3099
3131
|
var error = () => {
|
|
3100
3132
|
const Sizable = {
|
|
3101
3133
|
string: {
|
|
@@ -3203,7 +3235,7 @@ function en_default() {
|
|
|
3203
3235
|
return { localeError: error() };
|
|
3204
3236
|
}
|
|
3205
3237
|
//#endregion
|
|
3206
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3238
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3207
3239
|
var _a;
|
|
3208
3240
|
var $ZodRegistry = class {
|
|
3209
3241
|
constructor() {
|
|
@@ -3250,7 +3282,7 @@ function registry() {
|
|
|
3250
3282
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3251
3283
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3252
3284
|
//#endregion
|
|
3253
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3285
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3254
3286
|
function snapshotChecks(def) {
|
|
3255
3287
|
if (def.checks) def.checks = [...def.checks];
|
|
3256
3288
|
return def;
|
|
@@ -3766,7 +3798,7 @@ function _check(fn, params) {
|
|
|
3766
3798
|
return ch;
|
|
3767
3799
|
}
|
|
3768
3800
|
//#endregion
|
|
3769
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3801
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
3770
3802
|
function assignProps(target, ...sources) {
|
|
3771
3803
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3772
3804
|
return target;
|
|
@@ -4210,7 +4242,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4210
4242
|
return finalize(ctx, schema);
|
|
4211
4243
|
};
|
|
4212
4244
|
//#endregion
|
|
4213
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4245
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4214
4246
|
var narrowMin = (agg, key, value) => {
|
|
4215
4247
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4216
4248
|
};
|
|
@@ -4856,7 +4888,7 @@ function toJSONSchema(input, params) {
|
|
|
4856
4888
|
return finalize(ctx, input);
|
|
4857
4889
|
}
|
|
4858
4890
|
//#endregion
|
|
4859
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4891
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
4860
4892
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4861
4893
|
function _lazyMethod(proto, key, make) {
|
|
4862
4894
|
Object.defineProperty(proto, key, {
|
|
@@ -4906,7 +4938,7 @@ var initializer = (inst, issues) => {
|
|
|
4906
4938
|
};
|
|
4907
4939
|
var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4908
4940
|
//#endregion
|
|
4909
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4941
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
4910
4942
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4911
4943
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4912
4944
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4920,7 +4952,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
4920
4952
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4921
4953
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4922
4954
|
//#endregion
|
|
4923
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4955
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
4924
4956
|
function _ensureDefaultLocale() {
|
|
4925
4957
|
if (!globalConfig.localeError) config(en_default());
|
|
4926
4958
|
}
|
|
@@ -5852,7 +5884,7 @@ function preprocess(fn, schema) {
|
|
|
5852
5884
|
});
|
|
5853
5885
|
}
|
|
5854
5886
|
//#endregion
|
|
5855
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
5887
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
5856
5888
|
function datetime(params) {
|
|
5857
5889
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5858
5890
|
}
|
|
@@ -8693,6 +8725,35 @@ function isSchemaKeyword(value) {
|
|
|
8693
8725
|
/** Shared by decision entry points, the editor, and durable decision storage. */
|
|
8694
8726
|
var waitCommentSchema = string$1().trim().refine((value) => [...value].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
|
|
8695
8727
|
//#endregion
|
|
8728
|
+
//#region src/flow/common/requestParameters.ts
|
|
8729
|
+
var requestParameterSchema = strictObject({
|
|
8730
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
8731
|
+
names: array(string$1()).default([])
|
|
8732
|
+
});
|
|
8733
|
+
//#endregion
|
|
8734
|
+
//#region src/connector/common/proxy.ts
|
|
8735
|
+
var connectorProxyConfigSchema = strictObject({
|
|
8736
|
+
providerId: string$1().min(1),
|
|
8737
|
+
connectionId: string$1().optional(),
|
|
8738
|
+
method: _enum([
|
|
8739
|
+
"GET",
|
|
8740
|
+
"POST",
|
|
8741
|
+
"PUT",
|
|
8742
|
+
"PATCH",
|
|
8743
|
+
"DELETE"
|
|
8744
|
+
]).default("GET"),
|
|
8745
|
+
query: requestParameterSchema.default({
|
|
8746
|
+
mode: "fields",
|
|
8747
|
+
names: []
|
|
8748
|
+
}),
|
|
8749
|
+
headers: requestParameterSchema.default({
|
|
8750
|
+
mode: "fields",
|
|
8751
|
+
names: []
|
|
8752
|
+
}),
|
|
8753
|
+
bodyFormat: _enum(["none", "json"]).default("none")
|
|
8754
|
+
});
|
|
8755
|
+
var connectorProxyExecutorSchema = connectorProxyConfigSchema.extend({ kind: literal("connector-proxy") });
|
|
8756
|
+
//#endregion
|
|
8696
8757
|
//#region src/decision/common/decision.ts
|
|
8697
8758
|
function isDecisionExecutor(executor) {
|
|
8698
8759
|
return executor.kind === "decision";
|
|
@@ -8801,10 +8862,6 @@ function isHttpHost(value) {
|
|
|
8801
8862
|
}
|
|
8802
8863
|
//#endregion
|
|
8803
8864
|
//#region src/http/common/httpRequest.ts
|
|
8804
|
-
var parameterSchema = strictObject({
|
|
8805
|
-
mode: _enum(["fields", "object"]).default("fields"),
|
|
8806
|
-
names: array(string$1()).default([])
|
|
8807
|
-
});
|
|
8808
8865
|
var httpRequestConfigSchema = strictObject({
|
|
8809
8866
|
method: _enum([
|
|
8810
8867
|
"GET",
|
|
@@ -8815,11 +8872,11 @@ var httpRequestConfigSchema = strictObject({
|
|
|
8815
8872
|
"HEAD",
|
|
8816
8873
|
"OPTIONS"
|
|
8817
8874
|
]).default("GET"),
|
|
8818
|
-
query:
|
|
8875
|
+
query: requestParameterSchema.default({
|
|
8819
8876
|
mode: "fields",
|
|
8820
8877
|
names: []
|
|
8821
8878
|
}),
|
|
8822
|
-
headers:
|
|
8879
|
+
headers: requestParameterSchema.default({
|
|
8823
8880
|
mode: "fields",
|
|
8824
8881
|
names: []
|
|
8825
8882
|
}),
|
|
@@ -9200,7 +9257,8 @@ var managedFields = object({
|
|
|
9200
9257
|
revisionId: text
|
|
9201
9258
|
}),
|
|
9202
9259
|
httpRequestExecutorSchema,
|
|
9203
|
-
skipDuplicatesExecutorSchema
|
|
9260
|
+
skipDuplicatesExecutorSchema,
|
|
9261
|
+
connectorProxyExecutorSchema
|
|
9204
9262
|
])
|
|
9205
9263
|
});
|
|
9206
9264
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9245,7 +9303,7 @@ var condition = {
|
|
|
9245
9303
|
})) }))
|
|
9246
9304
|
}))
|
|
9247
9305
|
};
|
|
9248
|
-
var wait = {
|
|
9306
|
+
var wait$1 = {
|
|
9249
9307
|
inputDefinitions: array(input),
|
|
9250
9308
|
prompt: text
|
|
9251
9309
|
};
|
|
@@ -9358,12 +9416,12 @@ var node = union([
|
|
|
9358
9416
|
strictObject({
|
|
9359
9417
|
...base,
|
|
9360
9418
|
kind: literal("approval"),
|
|
9361
|
-
...wait
|
|
9419
|
+
...wait$1
|
|
9362
9420
|
}).omit({ timeoutMs: true }),
|
|
9363
9421
|
strictObject({
|
|
9364
9422
|
...base,
|
|
9365
9423
|
kind: literal("wait"),
|
|
9366
|
-
...wait,
|
|
9424
|
+
...wait$1,
|
|
9367
9425
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9368
9426
|
}).omit({ timeoutMs: true }),
|
|
9369
9427
|
object({
|
|
@@ -9419,7 +9477,7 @@ var authoringDefinitionSchemas = {
|
|
|
9419
9477
|
port: port$1,
|
|
9420
9478
|
ports: ports$1,
|
|
9421
9479
|
condition: strictObject(condition),
|
|
9422
|
-
wait: strictObject(wait),
|
|
9480
|
+
wait: strictObject(wait$1),
|
|
9423
9481
|
waitAutoContinue: waitAutoContinueSchema,
|
|
9424
9482
|
webhook: strictObject(webhook),
|
|
9425
9483
|
schedule: triggerScheduleSchema,
|
|
@@ -9471,7 +9529,8 @@ var revision = object({
|
|
|
9471
9529
|
literal(10),
|
|
9472
9530
|
literal(11),
|
|
9473
9531
|
literal(12),
|
|
9474
|
-
literal(13)
|
|
9532
|
+
literal(13),
|
|
9533
|
+
literal(14)
|
|
9475
9534
|
]),
|
|
9476
9535
|
document,
|
|
9477
9536
|
modules: record$2(text, module)
|
|
@@ -9605,11 +9664,11 @@ var shapes = {
|
|
|
9605
9664
|
"graph.node.resolution.set": {
|
|
9606
9665
|
...at,
|
|
9607
9666
|
before: strictObject({
|
|
9608
|
-
...wait,
|
|
9667
|
+
...wait$1,
|
|
9609
9668
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9610
9669
|
}),
|
|
9611
9670
|
value: strictObject({
|
|
9612
|
-
...wait,
|
|
9671
|
+
...wait$1,
|
|
9613
9672
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9614
9673
|
})
|
|
9615
9674
|
},
|
|
@@ -9672,6 +9731,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9672
9731
|
...shape
|
|
9673
9732
|
})])).values()])).min(1);
|
|
9674
9733
|
function checkModelVersion(content) {
|
|
9734
|
+
if (content.modelVersion < 14 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind === "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind === "connector-proxy")) throw new TypeError("Custom API Request requires Flow model v14.");
|
|
9675
9735
|
if (content.modelVersion < 13 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind === "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind === "skip-duplicates")) throw new Error("Skip Duplicates requires Flow model v13.");
|
|
9676
9736
|
if (content.modelVersion < 12 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "moduleId" in candidateNode.task && candidateNode.task.capabilities?.some((item) => item.kind == "http"))) throw new TypeError("Code HTTP access requires Flow model version 12.");
|
|
9677
9737
|
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
|
|
@@ -9725,8 +9785,8 @@ function resourceNameIssue(value) {
|
|
|
9725
9785
|
}
|
|
9726
9786
|
//#endregion
|
|
9727
9787
|
//#region src/runtime/common/engineContract.ts
|
|
9728
|
-
/**
|
|
9729
|
-
var currentEngineContract = "open-flow-engine/
|
|
9788
|
+
/** v11 adds Provider API requests through Connector Proxy. */
|
|
9789
|
+
var currentEngineContract = "open-flow-engine/v11";
|
|
9730
9790
|
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
9731
9791
|
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
9732
9792
|
var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
|
|
@@ -9776,13 +9836,19 @@ var v9Contract = {
|
|
|
9776
9836
|
codeFetch: true,
|
|
9777
9837
|
platformSource: platformSource("open-flow-engine/v9")
|
|
9778
9838
|
};
|
|
9779
|
-
var
|
|
9839
|
+
var v10Contract = {
|
|
9780
9840
|
...v9Contract,
|
|
9781
9841
|
flowState: true,
|
|
9842
|
+
platformSource: platformSource("open-flow-engine/v10")
|
|
9843
|
+
};
|
|
9844
|
+
var currentContract = {
|
|
9845
|
+
...v10Contract,
|
|
9846
|
+
connectorProxy: true,
|
|
9782
9847
|
platformSource: platformSource(currentEngineContract)
|
|
9783
9848
|
};
|
|
9784
9849
|
function findEngineContract(contract) {
|
|
9785
|
-
if (contract == "open-flow-engine/
|
|
9850
|
+
if (contract == "open-flow-engine/v11") return currentContract;
|
|
9851
|
+
if (contract == "open-flow-engine/v10") return v10Contract;
|
|
9786
9852
|
if (contract == "open-flow-engine/v9") return v9Contract;
|
|
9787
9853
|
if (contract == "open-flow-engine/v8") return v8Contract;
|
|
9788
9854
|
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
@@ -9845,6 +9911,7 @@ var type = _enum([
|
|
|
9845
9911
|
"integration",
|
|
9846
9912
|
"code",
|
|
9847
9913
|
"connector",
|
|
9914
|
+
"connector-proxy",
|
|
9848
9915
|
"agent",
|
|
9849
9916
|
"llm",
|
|
9850
9917
|
"decision",
|
|
@@ -9979,6 +10046,7 @@ var authoringConfigurations = {
|
|
|
9979
10046
|
capabilities: authoringCapabilities.optional()
|
|
9980
10047
|
}),
|
|
9981
10048
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
10049
|
+
"connector-proxy": connectorProxyConfigSchema,
|
|
9982
10050
|
"openapi": authoringOpenApiSchema,
|
|
9983
10051
|
"http-request": httpRequestConfigSchema,
|
|
9984
10052
|
"skip-duplicates": skipDuplicatesConfigSchema,
|
|
@@ -10837,7 +10905,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
10837
10905
|
const { connectionId: _, ...rest } = value;
|
|
10838
10906
|
return rest;
|
|
10839
10907
|
};
|
|
10840
|
-
if (executor.kind == "connector") return [id, {
|
|
10908
|
+
if (executor.kind == "connector" || executor.kind == "connector-proxy") return [id, {
|
|
10841
10909
|
...node,
|
|
10842
10910
|
task: {
|
|
10843
10911
|
...node.task,
|
|
@@ -11602,6 +11670,118 @@ function decodeResultRead(value) {
|
|
|
11602
11670
|
}
|
|
11603
11671
|
new TextEncoder();
|
|
11604
11672
|
//#endregion
|
|
11673
|
+
//#region src/control/common/catalogCache.ts
|
|
11674
|
+
function cachedResponse(value) {
|
|
11675
|
+
if (value == null || typeof value != "object" || Array.isArray(value)) return;
|
|
11676
|
+
const entry = value;
|
|
11677
|
+
if (entry.version !== 1 || !Object.hasOwn(entry, "body") || !(entry.etag === null || typeof entry.etag == "string") || typeof entry.validatedAt != "number" || !Number.isFinite(entry.validatedAt) || entry.validatedAt < 0) return;
|
|
11678
|
+
return {
|
|
11679
|
+
version: 1,
|
|
11680
|
+
body: jsonValue(entry.body),
|
|
11681
|
+
etag: entry.etag,
|
|
11682
|
+
validatedAt: entry.validatedAt
|
|
11683
|
+
};
|
|
11684
|
+
}
|
|
11685
|
+
/** Cancellation belongs to each waiter, not the shared metadata request. */
|
|
11686
|
+
function wait(promise, signal) {
|
|
11687
|
+
if (signal == null) return promise;
|
|
11688
|
+
if (signal.aborted) {
|
|
11689
|
+
promise.catch(() => {});
|
|
11690
|
+
return Promise.reject(signal.reason);
|
|
11691
|
+
}
|
|
11692
|
+
return new Promise((resolve, reject) => {
|
|
11693
|
+
const abort = () => reject(signal.reason);
|
|
11694
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
11695
|
+
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
11696
|
+
});
|
|
11697
|
+
}
|
|
11698
|
+
/** Complete Flow API responses, never a merged store of catalog entities. */
|
|
11699
|
+
var ControlCatalogCache = class {
|
|
11700
|
+
#pending = /* @__PURE__ */ new Map();
|
|
11701
|
+
constructor(options) {
|
|
11702
|
+
this.options = options;
|
|
11703
|
+
if (!options.scope.trim()) throw new TypeError("Control cache scope must be nonempty.");
|
|
11704
|
+
if (options.maxAgeMs != null && (!Number.isFinite(options.maxAgeMs) || options.maxAgeMs < 0)) throw new TypeError("Control cache maxAgeMs must be finite and nonnegative.");
|
|
11705
|
+
}
|
|
11706
|
+
async read(query, load, maxAgeMs, signal, fresh = false) {
|
|
11707
|
+
signal?.throwIfAborted();
|
|
11708
|
+
const key = JSON.stringify([
|
|
11709
|
+
"open-flow:catalog",
|
|
11710
|
+
1,
|
|
11711
|
+
this.options.scope,
|
|
11712
|
+
query.path
|
|
11713
|
+
]);
|
|
11714
|
+
const result = await wait(this.#request(key, query, load, this.options.maxAgeMs ?? maxAgeMs, fresh || this.options.mode == "refresh"), signal);
|
|
11715
|
+
const data = query.decode(structuredClone(result.body));
|
|
11716
|
+
try {
|
|
11717
|
+
this.options.onRead?.({
|
|
11718
|
+
...result,
|
|
11719
|
+
body: structuredClone(result.body)
|
|
11720
|
+
});
|
|
11721
|
+
} catch {}
|
|
11722
|
+
return {
|
|
11723
|
+
data,
|
|
11724
|
+
etag: result.etag
|
|
11725
|
+
};
|
|
11726
|
+
}
|
|
11727
|
+
#request(key, query, load, maxAgeMs, fresh) {
|
|
11728
|
+
const previous = this.#pending.get(key);
|
|
11729
|
+
if (previous != null) {
|
|
11730
|
+
if (!fresh || previous.fresh) return previous.promise;
|
|
11731
|
+
return previous.promise.catch(() => void 0).then(() => this.#request(key, query, load, maxAgeMs, true));
|
|
11732
|
+
}
|
|
11733
|
+
const promise = this.#load(key, query, load, maxAgeMs, fresh).finally(() => {
|
|
11734
|
+
if (this.#pending.get(key)?.promise === promise) this.#pending.delete(key);
|
|
11735
|
+
});
|
|
11736
|
+
this.#pending.set(key, {
|
|
11737
|
+
fresh,
|
|
11738
|
+
promise
|
|
11739
|
+
});
|
|
11740
|
+
return promise;
|
|
11741
|
+
}
|
|
11742
|
+
async #load(key, query, load, maxAgeMs, fresh) {
|
|
11743
|
+
let cached;
|
|
11744
|
+
try {
|
|
11745
|
+
const stored = await this.options.delegate.get(key);
|
|
11746
|
+
cached = cachedResponse(stored);
|
|
11747
|
+
if (cached != null) query.decode(structuredClone(cached.body));
|
|
11748
|
+
if (stored !== void 0 && cached == null) await this.options.delegate.delete(key);
|
|
11749
|
+
} catch {
|
|
11750
|
+
cached = void 0;
|
|
11751
|
+
try {
|
|
11752
|
+
await this.options.delegate.delete(key);
|
|
11753
|
+
} catch {}
|
|
11754
|
+
}
|
|
11755
|
+
const now = Date.now();
|
|
11756
|
+
const stale = cached == null || cached.validatedAt > now || now - cached.validatedAt >= maxAgeMs;
|
|
11757
|
+
if (cached != null && (this.options.mode == "offline" || !fresh && !stale)) return {
|
|
11758
|
+
...cached,
|
|
11759
|
+
path: query.path,
|
|
11760
|
+
source: "cache",
|
|
11761
|
+
stale
|
|
11762
|
+
};
|
|
11763
|
+
if (this.options.mode == "offline") throw new ApiError(503, "catalog.cache-miss", `No compatible cached response for ${query.path}.`);
|
|
11764
|
+
const result = await load(cached?.etag ?? null);
|
|
11765
|
+
if (!result.modified && cached == null) throw new ApiError(502, "response.invalid", "A catalog returned 304 without a cached response.");
|
|
11766
|
+
const entry = {
|
|
11767
|
+
version: 1,
|
|
11768
|
+
body: result.modified ? result.data : cached.body,
|
|
11769
|
+
etag: result.etag ?? (result.modified ? null : cached.etag),
|
|
11770
|
+
validatedAt: Date.now()
|
|
11771
|
+
};
|
|
11772
|
+
query.decode(structuredClone(entry.body));
|
|
11773
|
+
try {
|
|
11774
|
+
await this.options.delegate.set(key, structuredClone({ ...entry }));
|
|
11775
|
+
} catch {}
|
|
11776
|
+
return {
|
|
11777
|
+
...entry,
|
|
11778
|
+
path: query.path,
|
|
11779
|
+
source: result.modified ? "network" : "revalidated",
|
|
11780
|
+
stale: false
|
|
11781
|
+
};
|
|
11782
|
+
}
|
|
11783
|
+
};
|
|
11784
|
+
//#endregion
|
|
11605
11785
|
//#region src/control/common/checkDecoders.ts
|
|
11606
11786
|
function schemaPath(value) {
|
|
11607
11787
|
if (!Array.isArray(value)) return invalidResponse();
|
|
@@ -11686,6 +11866,23 @@ function connectorActionQuery(actionId, flowId, locale) {
|
|
|
11686
11866
|
}
|
|
11687
11867
|
};
|
|
11688
11868
|
}
|
|
11869
|
+
function connectorActionMetadataQuery(actionId, flowId, locale) {
|
|
11870
|
+
const parameters = new URLSearchParams({
|
|
11871
|
+
...flowId == null ? {} : { flowId },
|
|
11872
|
+
...locale == null ? {} : { locale }
|
|
11873
|
+
}).toString();
|
|
11874
|
+
return {
|
|
11875
|
+
path: `/v1/connector/action-metadata/${encodeURIComponent(actionId)}${parameters ? `?${parameters}` : ""}`,
|
|
11876
|
+
decode: (value) => {
|
|
11877
|
+
const source = record(value);
|
|
11878
|
+
requiredFields(source, ["action", "version"]);
|
|
11879
|
+
if (source.version != 1) return invalidResponse();
|
|
11880
|
+
const action = connectorActionMetadata(source.action);
|
|
11881
|
+
if (action.actionId != actionId) return invalidResponse("action.actionId: does not match the requested Action.");
|
|
11882
|
+
return action;
|
|
11883
|
+
}
|
|
11884
|
+
};
|
|
11885
|
+
}
|
|
11689
11886
|
function allConnectorConnectionsQuery(flowId) {
|
|
11690
11887
|
return {
|
|
11691
11888
|
path: `/v1/connector/connections${scope(flowId)}`,
|
|
@@ -12364,7 +12561,7 @@ function decodeRunEvent(value) {
|
|
|
12364
12561
|
switch (kind) {
|
|
12365
12562
|
case "node.started": {
|
|
12366
12563
|
const nodeKind = payload.nodeKind;
|
|
12367
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "skip-duplicates" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
12564
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "connector-proxy" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "skip-duplicates" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
12368
12565
|
return {
|
|
12369
12566
|
...base,
|
|
12370
12567
|
kind,
|
|
@@ -12473,9 +12670,11 @@ function operationKey(operation) {
|
|
|
12473
12670
|
return `${operation}-${randomId()}`;
|
|
12474
12671
|
}
|
|
12475
12672
|
var ControlClient = class {
|
|
12476
|
-
constructor(requestControl, channel = "api") {
|
|
12673
|
+
constructor(requestControl, channel = "api", options = {}) {
|
|
12674
|
+
this.options = options;
|
|
12477
12675
|
this.channel = channel;
|
|
12478
12676
|
this.requestControl = requestControl;
|
|
12677
|
+
if (options.cache != null) this.catalogCache = new ControlCatalogCache(options.cache);
|
|
12479
12678
|
}
|
|
12480
12679
|
async loadOpenApiDocument(url, signal) {
|
|
12481
12680
|
const result = record(await this.request("/v1/openapi/document", {
|
|
@@ -12770,6 +12969,16 @@ var ControlClient = class {
|
|
|
12770
12969
|
};
|
|
12771
12970
|
}
|
|
12772
12971
|
async getTriggerCatalog(locale, cached, signal) {
|
|
12972
|
+
if (this.catalogCache != null) {
|
|
12973
|
+
const result = await this.catalogResponse({
|
|
12974
|
+
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`,
|
|
12975
|
+
decode: decodeTriggerCatalog
|
|
12976
|
+
}, 3e5, signal);
|
|
12977
|
+
return {
|
|
12978
|
+
data: result.data,
|
|
12979
|
+
etag: result.etag
|
|
12980
|
+
};
|
|
12981
|
+
}
|
|
12773
12982
|
const headers = new Headers();
|
|
12774
12983
|
if (cached?.etag) headers.set("if-none-match", cached.etag);
|
|
12775
12984
|
const response = await this.response(`/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`, {
|
|
@@ -12789,6 +12998,16 @@ var ControlClient = class {
|
|
|
12789
12998
|
};
|
|
12790
12999
|
}
|
|
12791
13000
|
async getTriggerKey(key, signal) {
|
|
13001
|
+
if (this.catalogCache != null) return (await this.catalogResponse({
|
|
13002
|
+
path: `/v1/trigger-keys/${segment(key)}`,
|
|
13003
|
+
decode: (value) => {
|
|
13004
|
+
const source = record(value);
|
|
13005
|
+
if (source.version != 1) return invalidResponse();
|
|
13006
|
+
const definition = triggerKey(source.definition);
|
|
13007
|
+
if (definition.key != key) return invalidResponse("Trigger key does not match the requested definition.");
|
|
13008
|
+
return definition;
|
|
13009
|
+
}
|
|
13010
|
+
}, 3e5, signal)).data;
|
|
12792
13011
|
const source = record(await this.request(`/v1/trigger-keys/${segment(key)}`, { signal }));
|
|
12793
13012
|
if (source.version != 1) return invalidResponse();
|
|
12794
13013
|
return triggerKey(source.definition);
|
|
@@ -12904,6 +13123,7 @@ var ControlClient = class {
|
|
|
12904
13123
|
}
|
|
12905
13124
|
async listConnectorProviders(signal, flowId, locale) {
|
|
12906
13125
|
const query = connectorProvidersQuery(flowId, locale);
|
|
13126
|
+
if (this.catalogCache != null) return (await this.catalogResponse(query, 3e5, signal)).data;
|
|
12907
13127
|
return this.connectorRequest(query.path, "providers", signal, query.decode);
|
|
12908
13128
|
}
|
|
12909
13129
|
async listLeinaBots(flowId, signal) {
|
|
@@ -12984,6 +13204,23 @@ var ControlClient = class {
|
|
|
12984
13204
|
const query = connectorActionQuery(actionId, flowId, locale);
|
|
12985
13205
|
return this.connectorRequest(query.path, "actions", signal, query.decode, fresh);
|
|
12986
13206
|
}
|
|
13207
|
+
async listConnectorActionMetadata(serviceId, signal, flowId, locale) {
|
|
13208
|
+
return this.connectorMetadata({
|
|
13209
|
+
...serviceId == null ? {} : { service: serviceId },
|
|
13210
|
+
...flowId == null ? {} : { flowId },
|
|
13211
|
+
...locale == null ? {} : { locale }
|
|
13212
|
+
}, signal);
|
|
13213
|
+
}
|
|
13214
|
+
async searchConnectorActionMetadata(query, signal, flowId, locale) {
|
|
13215
|
+
return this.connectorMetadata({
|
|
13216
|
+
q: query.trim(),
|
|
13217
|
+
...flowId == null ? {} : { flowId },
|
|
13218
|
+
...locale == null ? {} : { locale }
|
|
13219
|
+
}, signal);
|
|
13220
|
+
}
|
|
13221
|
+
async getConnectorActionMetadata(actionId, signal, flowId, locale, fresh = false) {
|
|
13222
|
+
return (await this.catalogResponse(connectorActionMetadataQuery(actionId, flowId, locale), 3e4, signal, fresh)).data;
|
|
13223
|
+
}
|
|
12987
13224
|
async listAllConnectorConnections(signal, flowId, fresh = false) {
|
|
12988
13225
|
const query = allConnectorConnectionsQuery(flowId);
|
|
12989
13226
|
return this.connectorRequest(query.path, "connections", signal, query.decode, fresh);
|
|
@@ -13215,6 +13452,30 @@ var ControlClient = class {
|
|
|
13215
13452
|
method: "POST"
|
|
13216
13453
|
}));
|
|
13217
13454
|
}
|
|
13455
|
+
async catalogResponse(query, maxAgeMs, signal, fresh = false) {
|
|
13456
|
+
if (this.catalogCache != null) return this.catalogCache.read(query, (etag) => this.readCatalog({
|
|
13457
|
+
path: query.path,
|
|
13458
|
+
decode: jsonValue
|
|
13459
|
+
}, etag), maxAgeMs, signal, fresh);
|
|
13460
|
+
const response = await this.readCatalog(query, null, signal);
|
|
13461
|
+
if (!response.modified) return invalidResponse();
|
|
13462
|
+
return {
|
|
13463
|
+
data: response.data,
|
|
13464
|
+
etag: response.etag
|
|
13465
|
+
};
|
|
13466
|
+
}
|
|
13467
|
+
async connectorMetadata(parameters, signal) {
|
|
13468
|
+
const query = new URLSearchParams(parameters).toString();
|
|
13469
|
+
return (await this.catalogResponse({
|
|
13470
|
+
path: `/v1/connector/action-metadata${query ? `?${query}` : ""}`,
|
|
13471
|
+
decode: (value) => {
|
|
13472
|
+
const source = record(value);
|
|
13473
|
+
requiredFields(source, ["actions", "version"]);
|
|
13474
|
+
if (source.version != 1 || !Array.isArray(source.actions)) return invalidResponse();
|
|
13475
|
+
return source.actions.map(connectorActionMetadata);
|
|
13476
|
+
}
|
|
13477
|
+
}, 3e4, signal)).data;
|
|
13478
|
+
}
|
|
13218
13479
|
async connectorActions(parameters, signal) {
|
|
13219
13480
|
const query = Object.entries(parameters).map(([key, value]) => `${segment(key)}=${segment(value)}`).join("&");
|
|
13220
13481
|
const suffix = query == "" ? "" : `?${query}`;
|
|
@@ -13229,6 +13490,7 @@ var ControlClient = class {
|
|
|
13229
13490
|
return decode(await this.request(path, { signal }));
|
|
13230
13491
|
}
|
|
13231
13492
|
async response(path, init, allowNotModified = false) {
|
|
13493
|
+
if (this.options.cache?.mode == "offline") throw new ApiError(503, "control.offline", "Network requests are disabled for this Control client.");
|
|
13232
13494
|
const headers = new Headers(init.headers);
|
|
13233
13495
|
if (init.body != null) headers.set("content-type", "application/json");
|
|
13234
13496
|
const response = await this.requestControl(path, {
|