@oomol-lab/open-flow 0.1.0-beta.85 → 0.1.0-beta.87
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-CZoHhB1y.js → FlowCanvas-SqPUBqze.js} +3 -3
- package/dist/browser/{createResourceDialog-Bi4fUnbD.js → createResourceDialog-CB3eiK7e.js} +3 -3
- package/dist/browser/{dialog-BzoSxhXQ.js → dialog-Bi-MVTGj.js} +291 -143
- package/dist/browser/{exportPng-CXVWVlLc.js → exportPng-CLZKdNzR.js} +2 -2
- package/dist/browser/{flowChanges-C567g-Pc.js → flowChanges-azhepfr-.js} +375 -83
- package/dist/browser/{flowWorkspace-BNdBKtla.js → flowWorkspace-Cs2ZGBYK.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-DF39sd9T.js → markdownContent-D0BBrFcF.js} +1 -1
- package/dist/browser/preview.css +193 -191
- package/dist/browser/preview.js +1997 -624
- package/dist/browser/ru-BzLZv0B7.js +593 -0
- package/dist/browser/theme.css +3 -1
- package/dist/browser/{tooltip-DGj5pudg.js → tooltip-BZ6tpqnr.js} +58 -24
- package/dist/browser/ui.css +12 -10
- package/dist/browser/ui.d.ts +1 -0
- package/dist/browser/ui.js +110 -63
- package/dist/browser/workbench.css +193 -191
- package/dist/browser/workbench.js +86 -17
- package/dist/browser/{workbenchSelect-BIaEVTx6.js → workbenchSelect-CHOeceKA.js} +2 -2
- package/dist/browser/{wrapLayout-C4moMKgb.js → wrapLayout-BB_qwy3k.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.css +12 -10
- package/dist/render/browser/runtime.js +183 -49
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/runtime/common/engineContract.ts
|
|
2
|
-
/**
|
|
3
|
-
var currentEngineContract = "open-flow-engine/
|
|
2
|
+
/** v11 adds Provider API requests through Connector Proxy. */
|
|
3
|
+
var currentEngineContract = "open-flow-engine/v11";
|
|
4
4
|
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
5
5
|
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
6
6
|
var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
|
|
@@ -50,13 +50,19 @@ var v9Contract = {
|
|
|
50
50
|
codeFetch: true,
|
|
51
51
|
platformSource: platformSource("open-flow-engine/v9")
|
|
52
52
|
};
|
|
53
|
-
var
|
|
53
|
+
var v10Contract = {
|
|
54
54
|
...v9Contract,
|
|
55
55
|
flowState: true,
|
|
56
|
+
platformSource: platformSource("open-flow-engine/v10")
|
|
57
|
+
};
|
|
58
|
+
var currentContract = {
|
|
59
|
+
...v10Contract,
|
|
60
|
+
connectorProxy: true,
|
|
56
61
|
platformSource: platformSource(currentEngineContract)
|
|
57
62
|
};
|
|
58
63
|
function findEngineContract(contract) {
|
|
59
|
-
if (contract == "open-flow-engine/
|
|
64
|
+
if (contract == "open-flow-engine/v11") return currentContract;
|
|
65
|
+
if (contract == "open-flow-engine/v10") return v10Contract;
|
|
60
66
|
if (contract == "open-flow-engine/v9") return v9Contract;
|
|
61
67
|
if (contract == "open-flow-engine/v8") return v8Contract;
|
|
62
68
|
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
@@ -76,7 +82,7 @@ function findEngineContract(contract) {
|
|
|
76
82
|
};
|
|
77
83
|
}
|
|
78
84
|
//#endregion
|
|
79
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
85
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
80
86
|
function getEnumValues(entries) {
|
|
81
87
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
82
88
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -401,6 +407,17 @@ function prefixIssues(path, issues) {
|
|
|
401
407
|
function unwrapMessage(message) {
|
|
402
408
|
return typeof message === "string" ? message : message?.message;
|
|
403
409
|
}
|
|
410
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
411
|
+
function sizeCaps(defChecks) {
|
|
412
|
+
const caps = [];
|
|
413
|
+
for (const ch of defChecks ?? []) {
|
|
414
|
+
const d = ch._zod.def;
|
|
415
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
416
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
417
|
+
if (max >= 0) caps.push([max, ch]);
|
|
418
|
+
}
|
|
419
|
+
return caps;
|
|
420
|
+
}
|
|
404
421
|
function attachSchema(issues, start, inst) {
|
|
405
422
|
var _a;
|
|
406
423
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -617,7 +634,7 @@ function constantCatch(value) {
|
|
|
617
634
|
return fn;
|
|
618
635
|
}
|
|
619
636
|
//#endregion
|
|
620
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
637
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
621
638
|
var _a$1;
|
|
622
639
|
var _zodDesc = {
|
|
623
640
|
value: void 0,
|
|
@@ -723,7 +740,7 @@ function config(newConfig) {
|
|
|
723
740
|
return globalConfig;
|
|
724
741
|
}
|
|
725
742
|
//#endregion
|
|
726
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
743
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
727
744
|
function _getMessage() {
|
|
728
745
|
const internals = this._zod;
|
|
729
746
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -839,7 +856,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
839
856
|
return fieldErrors;
|
|
840
857
|
}
|
|
841
858
|
//#endregion
|
|
842
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
859
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
843
860
|
function finalizeParams(callee, params) {
|
|
844
861
|
return {
|
|
845
862
|
callee: params?.callee ?? callee,
|
|
@@ -1042,7 +1059,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1042
1059
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1043
1060
|
};
|
|
1044
1061
|
//#endregion
|
|
1045
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1062
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
1046
1063
|
/**
|
|
1047
1064
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1048
1065
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1115,7 +1132,7 @@ var _null$2 = /^null$/i;
|
|
|
1115
1132
|
var lowercase = /^[^A-Z]*$/;
|
|
1116
1133
|
var uppercase = /^[^a-z]*$/;
|
|
1117
1134
|
//#endregion
|
|
1118
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1135
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1119
1136
|
var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1120
1137
|
var _a;
|
|
1121
1138
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1411,7 +1428,7 @@ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst,
|
|
|
1411
1428
|
};
|
|
1412
1429
|
});
|
|
1413
1430
|
//#endregion
|
|
1414
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1431
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1415
1432
|
var Doc = class {
|
|
1416
1433
|
constructor(args = [], closed = {}) {
|
|
1417
1434
|
this.content = [];
|
|
@@ -1445,14 +1462,14 @@ var Doc = class {
|
|
|
1445
1462
|
}
|
|
1446
1463
|
};
|
|
1447
1464
|
//#endregion
|
|
1448
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1465
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1449
1466
|
var version = {
|
|
1450
1467
|
major: 4,
|
|
1451
1468
|
minor: 6,
|
|
1452
|
-
patch:
|
|
1469
|
+
patch: 7
|
|
1453
1470
|
};
|
|
1454
1471
|
//#endregion
|
|
1455
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1472
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1456
1473
|
var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1457
1474
|
var _a;
|
|
1458
1475
|
inst ?? (inst = {});
|
|
@@ -1965,6 +1982,26 @@ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
|
1965
1982
|
return payload;
|
|
1966
1983
|
};
|
|
1967
1984
|
});
|
|
1985
|
+
function capSize(inst, size) {
|
|
1986
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
1987
|
+
if (!caps.length) return;
|
|
1988
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
1989
|
+
const parse = inst._zod.parse;
|
|
1990
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1991
|
+
const n = size(payload.value);
|
|
1992
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
1993
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
1994
|
+
const start = payload.issues.length;
|
|
1995
|
+
ch._zod.check(payload);
|
|
1996
|
+
payload.issues[start].continue = false;
|
|
1997
|
+
attachSchema(payload.issues, start, inst);
|
|
1998
|
+
return payload;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
return parse(payload, ctx);
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
1968
2005
|
function handleArrayResult(result, final, index) {
|
|
1969
2006
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1970
2007
|
final.value[index] = result.value;
|
|
@@ -2002,6 +2039,7 @@ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
2002
2039
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2003
2040
|
return payload;
|
|
2004
2041
|
};
|
|
2042
|
+
capSize(inst, arraySize);
|
|
2005
2043
|
});
|
|
2006
2044
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2007
2045
|
const isPresent = key in input;
|
|
@@ -2920,7 +2958,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2920
2958
|
}
|
|
2921
2959
|
}
|
|
2922
2960
|
//#endregion
|
|
2923
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
2961
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
2924
2962
|
var $ZodCyclicError = class extends Error {
|
|
2925
2963
|
constructor() {
|
|
2926
2964
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3173,7 +3211,7 @@ function isBackEdge(ctx, value) {
|
|
|
3173
3211
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3174
3212
|
}
|
|
3175
3213
|
//#endregion
|
|
3176
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3214
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3177
3215
|
var error = () => {
|
|
3178
3216
|
const Sizable = {
|
|
3179
3217
|
string: {
|
|
@@ -3281,7 +3319,7 @@ function en_default() {
|
|
|
3281
3319
|
return { localeError: error() };
|
|
3282
3320
|
}
|
|
3283
3321
|
//#endregion
|
|
3284
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3322
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3285
3323
|
var _a;
|
|
3286
3324
|
var $ZodRegistry = class {
|
|
3287
3325
|
constructor() {
|
|
@@ -3328,7 +3366,7 @@ function registry() {
|
|
|
3328
3366
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3329
3367
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3330
3368
|
//#endregion
|
|
3331
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3369
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3332
3370
|
function snapshotChecks(def) {
|
|
3333
3371
|
if (def.checks) def.checks = [...def.checks];
|
|
3334
3372
|
return def;
|
|
@@ -3844,7 +3882,7 @@ function _check(fn, params) {
|
|
|
3844
3882
|
return ch;
|
|
3845
3883
|
}
|
|
3846
3884
|
//#endregion
|
|
3847
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3885
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
3848
3886
|
function assignProps(target, ...sources) {
|
|
3849
3887
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3850
3888
|
return target;
|
|
@@ -4288,7 +4326,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4288
4326
|
return finalize(ctx, schema);
|
|
4289
4327
|
};
|
|
4290
4328
|
//#endregion
|
|
4291
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4329
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4292
4330
|
var narrowMin = (agg, key, value) => {
|
|
4293
4331
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4294
4332
|
};
|
|
@@ -4749,7 +4787,7 @@ var lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
4749
4787
|
seen.ref = innerType;
|
|
4750
4788
|
};
|
|
4751
4789
|
//#endregion
|
|
4752
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4790
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
4753
4791
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4754
4792
|
function _lazyMethod(proto, key, make) {
|
|
4755
4793
|
Object.defineProperty(proto, key, {
|
|
@@ -4799,7 +4837,7 @@ var initializer = (inst, issues) => {
|
|
|
4799
4837
|
};
|
|
4800
4838
|
var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4801
4839
|
//#endregion
|
|
4802
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4840
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
4803
4841
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4804
4842
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4805
4843
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4813,7 +4851,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
4813
4851
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4814
4852
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4815
4853
|
//#endregion
|
|
4816
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4854
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
4817
4855
|
function _ensureDefaultLocale() {
|
|
4818
4856
|
if (!globalConfig.localeError) config(en_default());
|
|
4819
4857
|
}
|
|
@@ -5745,7 +5783,7 @@ function preprocess(fn, schema) {
|
|
|
5745
5783
|
});
|
|
5746
5784
|
}
|
|
5747
5785
|
//#endregion
|
|
5748
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
5786
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
5749
5787
|
function datetime(params) {
|
|
5750
5788
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5751
5789
|
}
|
|
@@ -8691,6 +8729,35 @@ function webhookSupportsBody(method) {
|
|
|
8691
8729
|
return method !== "GET";
|
|
8692
8730
|
}
|
|
8693
8731
|
//#endregion
|
|
8732
|
+
//#region src/flow/common/requestParameters.ts
|
|
8733
|
+
var requestParameterSchema = strictObject({
|
|
8734
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
8735
|
+
names: array(string$1()).default([])
|
|
8736
|
+
});
|
|
8737
|
+
//#endregion
|
|
8738
|
+
//#region src/connector/common/proxy.ts
|
|
8739
|
+
var connectorProxyConfigSchema = strictObject({
|
|
8740
|
+
providerId: string$1().min(1),
|
|
8741
|
+
connectionId: string$1().optional(),
|
|
8742
|
+
method: _enum([
|
|
8743
|
+
"GET",
|
|
8744
|
+
"POST",
|
|
8745
|
+
"PUT",
|
|
8746
|
+
"PATCH",
|
|
8747
|
+
"DELETE"
|
|
8748
|
+
]).default("GET"),
|
|
8749
|
+
query: requestParameterSchema.default({
|
|
8750
|
+
mode: "fields",
|
|
8751
|
+
names: []
|
|
8752
|
+
}),
|
|
8753
|
+
headers: requestParameterSchema.default({
|
|
8754
|
+
mode: "fields",
|
|
8755
|
+
names: []
|
|
8756
|
+
}),
|
|
8757
|
+
bodyFormat: _enum(["none", "json"]).default("none")
|
|
8758
|
+
});
|
|
8759
|
+
var connectorProxyExecutorSchema = connectorProxyConfigSchema.extend({ kind: literal("connector-proxy") });
|
|
8760
|
+
//#endregion
|
|
8694
8761
|
//#region src/decision/common/decision.ts
|
|
8695
8762
|
function isDecisionExecutor(executor) {
|
|
8696
8763
|
return executor.kind === "decision";
|
|
@@ -8799,10 +8866,6 @@ function isHttpHost(value) {
|
|
|
8799
8866
|
}
|
|
8800
8867
|
//#endregion
|
|
8801
8868
|
//#region src/http/common/httpRequest.ts
|
|
8802
|
-
var parameterSchema = strictObject({
|
|
8803
|
-
mode: _enum(["fields", "object"]).default("fields"),
|
|
8804
|
-
names: array(string$1()).default([])
|
|
8805
|
-
});
|
|
8806
8869
|
var httpRequestConfigSchema = strictObject({
|
|
8807
8870
|
method: _enum([
|
|
8808
8871
|
"GET",
|
|
@@ -8813,11 +8876,11 @@ var httpRequestConfigSchema = strictObject({
|
|
|
8813
8876
|
"HEAD",
|
|
8814
8877
|
"OPTIONS"
|
|
8815
8878
|
]).default("GET"),
|
|
8816
|
-
query:
|
|
8879
|
+
query: requestParameterSchema.default({
|
|
8817
8880
|
mode: "fields",
|
|
8818
8881
|
names: []
|
|
8819
8882
|
}),
|
|
8820
|
-
headers:
|
|
8883
|
+
headers: requestParameterSchema.default({
|
|
8821
8884
|
mode: "fields",
|
|
8822
8885
|
names: []
|
|
8823
8886
|
}),
|
|
@@ -9141,7 +9204,8 @@ var managedFields = object({
|
|
|
9141
9204
|
revisionId: text
|
|
9142
9205
|
}),
|
|
9143
9206
|
httpRequestExecutorSchema,
|
|
9144
|
-
skipDuplicatesExecutorSchema
|
|
9207
|
+
skipDuplicatesExecutorSchema,
|
|
9208
|
+
connectorProxyExecutorSchema
|
|
9145
9209
|
])
|
|
9146
9210
|
});
|
|
9147
9211
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9186,7 +9250,7 @@ var condition = {
|
|
|
9186
9250
|
})) }))
|
|
9187
9251
|
}))
|
|
9188
9252
|
};
|
|
9189
|
-
var wait = {
|
|
9253
|
+
var wait$1 = {
|
|
9190
9254
|
inputDefinitions: array(input),
|
|
9191
9255
|
prompt: text
|
|
9192
9256
|
};
|
|
@@ -9299,12 +9363,12 @@ var node = union([
|
|
|
9299
9363
|
strictObject({
|
|
9300
9364
|
...base,
|
|
9301
9365
|
kind: literal("approval"),
|
|
9302
|
-
...wait
|
|
9366
|
+
...wait$1
|
|
9303
9367
|
}).omit({ timeoutMs: true }),
|
|
9304
9368
|
strictObject({
|
|
9305
9369
|
...base,
|
|
9306
9370
|
kind: literal("wait"),
|
|
9307
|
-
...wait,
|
|
9371
|
+
...wait$1,
|
|
9308
9372
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9309
9373
|
}).omit({ timeoutMs: true }),
|
|
9310
9374
|
object({
|
|
@@ -9360,7 +9424,7 @@ var authoringDefinitionSchemas = {
|
|
|
9360
9424
|
port: port$1,
|
|
9361
9425
|
ports: ports$1,
|
|
9362
9426
|
condition: strictObject(condition),
|
|
9363
|
-
wait: strictObject(wait),
|
|
9427
|
+
wait: strictObject(wait$1),
|
|
9364
9428
|
waitAutoContinue: waitAutoContinueSchema,
|
|
9365
9429
|
webhook: strictObject(webhook),
|
|
9366
9430
|
schedule: triggerScheduleSchema,
|
|
@@ -9412,7 +9476,8 @@ var revision = object({
|
|
|
9412
9476
|
literal(10),
|
|
9413
9477
|
literal(11),
|
|
9414
9478
|
literal(12),
|
|
9415
|
-
literal(13)
|
|
9479
|
+
literal(13),
|
|
9480
|
+
literal(14)
|
|
9416
9481
|
]),
|
|
9417
9482
|
document,
|
|
9418
9483
|
modules: record$2(text, module)
|
|
@@ -9546,11 +9611,11 @@ var shapes = {
|
|
|
9546
9611
|
"graph.node.resolution.set": {
|
|
9547
9612
|
...at,
|
|
9548
9613
|
before: strictObject({
|
|
9549
|
-
...wait,
|
|
9614
|
+
...wait$1,
|
|
9550
9615
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9551
9616
|
}),
|
|
9552
9617
|
value: strictObject({
|
|
9553
|
-
...wait,
|
|
9618
|
+
...wait$1,
|
|
9554
9619
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9555
9620
|
})
|
|
9556
9621
|
},
|
|
@@ -9613,6 +9678,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9613
9678
|
...shape
|
|
9614
9679
|
})])).values()])).min(1);
|
|
9615
9680
|
function checkModelVersion(content) {
|
|
9681
|
+
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.");
|
|
9616
9682
|
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.");
|
|
9617
9683
|
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.");
|
|
9618
9684
|
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.");
|
|
@@ -9677,6 +9743,7 @@ var type = _enum([
|
|
|
9677
9743
|
"integration",
|
|
9678
9744
|
"code",
|
|
9679
9745
|
"connector",
|
|
9746
|
+
"connector-proxy",
|
|
9680
9747
|
"agent",
|
|
9681
9748
|
"llm",
|
|
9682
9749
|
"decision",
|
|
@@ -9811,6 +9878,7 @@ var authoringConfigurations = {
|
|
|
9811
9878
|
capabilities: authoringCapabilities.optional()
|
|
9812
9879
|
}),
|
|
9813
9880
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9881
|
+
"connector-proxy": connectorProxyConfigSchema,
|
|
9814
9882
|
"openapi": authoringOpenApiSchema,
|
|
9815
9883
|
"http-request": httpRequestConfigSchema,
|
|
9816
9884
|
"skip-duplicates": skipDuplicatesConfigSchema,
|
|
@@ -10757,7 +10825,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
10757
10825
|
const { connectionId: _, ...rest } = value;
|
|
10758
10826
|
return rest;
|
|
10759
10827
|
};
|
|
10760
|
-
if (executor.kind == "connector") return [id, {
|
|
10828
|
+
if (executor.kind == "connector" || executor.kind == "connector-proxy") return [id, {
|
|
10761
10829
|
...node,
|
|
10762
10830
|
task: {
|
|
10763
10831
|
...node.task,
|
|
@@ -12087,6 +12155,118 @@ function readResult(value, query = {}) {
|
|
|
12087
12155
|
};
|
|
12088
12156
|
}
|
|
12089
12157
|
//#endregion
|
|
12158
|
+
//#region src/control/common/catalogCache.ts
|
|
12159
|
+
function cachedResponse(value) {
|
|
12160
|
+
if (value == null || typeof value != "object" || Array.isArray(value)) return;
|
|
12161
|
+
const entry = value;
|
|
12162
|
+
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;
|
|
12163
|
+
return {
|
|
12164
|
+
version: 1,
|
|
12165
|
+
body: jsonValue(entry.body),
|
|
12166
|
+
etag: entry.etag,
|
|
12167
|
+
validatedAt: entry.validatedAt
|
|
12168
|
+
};
|
|
12169
|
+
}
|
|
12170
|
+
/** Cancellation belongs to each waiter, not the shared metadata request. */
|
|
12171
|
+
function wait(promise, signal) {
|
|
12172
|
+
if (signal == null) return promise;
|
|
12173
|
+
if (signal.aborted) {
|
|
12174
|
+
promise.catch(() => {});
|
|
12175
|
+
return Promise.reject(signal.reason);
|
|
12176
|
+
}
|
|
12177
|
+
return new Promise((resolve, reject) => {
|
|
12178
|
+
const abort = () => reject(signal.reason);
|
|
12179
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
12180
|
+
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
12181
|
+
});
|
|
12182
|
+
}
|
|
12183
|
+
/** Complete Flow API responses, never a merged store of catalog entities. */
|
|
12184
|
+
var ControlCatalogCache = class {
|
|
12185
|
+
#pending = /* @__PURE__ */ new Map();
|
|
12186
|
+
constructor(options) {
|
|
12187
|
+
this.options = options;
|
|
12188
|
+
if (!options.scope.trim()) throw new TypeError("Control cache scope must be nonempty.");
|
|
12189
|
+
if (options.maxAgeMs != null && (!Number.isFinite(options.maxAgeMs) || options.maxAgeMs < 0)) throw new TypeError("Control cache maxAgeMs must be finite and nonnegative.");
|
|
12190
|
+
}
|
|
12191
|
+
async read(query, load, maxAgeMs, signal, fresh = false) {
|
|
12192
|
+
signal?.throwIfAborted();
|
|
12193
|
+
const key = JSON.stringify([
|
|
12194
|
+
"open-flow:catalog",
|
|
12195
|
+
1,
|
|
12196
|
+
this.options.scope,
|
|
12197
|
+
query.path
|
|
12198
|
+
]);
|
|
12199
|
+
const result = await wait(this.#request(key, query, load, this.options.maxAgeMs ?? maxAgeMs, fresh || this.options.mode == "refresh"), signal);
|
|
12200
|
+
const data = query.decode(structuredClone(result.body));
|
|
12201
|
+
try {
|
|
12202
|
+
this.options.onRead?.({
|
|
12203
|
+
...result,
|
|
12204
|
+
body: structuredClone(result.body)
|
|
12205
|
+
});
|
|
12206
|
+
} catch {}
|
|
12207
|
+
return {
|
|
12208
|
+
data,
|
|
12209
|
+
etag: result.etag
|
|
12210
|
+
};
|
|
12211
|
+
}
|
|
12212
|
+
#request(key, query, load, maxAgeMs, fresh) {
|
|
12213
|
+
const previous = this.#pending.get(key);
|
|
12214
|
+
if (previous != null) {
|
|
12215
|
+
if (!fresh || previous.fresh) return previous.promise;
|
|
12216
|
+
return previous.promise.catch(() => void 0).then(() => this.#request(key, query, load, maxAgeMs, true));
|
|
12217
|
+
}
|
|
12218
|
+
const promise = this.#load(key, query, load, maxAgeMs, fresh).finally(() => {
|
|
12219
|
+
if (this.#pending.get(key)?.promise === promise) this.#pending.delete(key);
|
|
12220
|
+
});
|
|
12221
|
+
this.#pending.set(key, {
|
|
12222
|
+
fresh,
|
|
12223
|
+
promise
|
|
12224
|
+
});
|
|
12225
|
+
return promise;
|
|
12226
|
+
}
|
|
12227
|
+
async #load(key, query, load, maxAgeMs, fresh) {
|
|
12228
|
+
let cached;
|
|
12229
|
+
try {
|
|
12230
|
+
const stored = await this.options.delegate.get(key);
|
|
12231
|
+
cached = cachedResponse(stored);
|
|
12232
|
+
if (cached != null) query.decode(structuredClone(cached.body));
|
|
12233
|
+
if (stored !== void 0 && cached == null) await this.options.delegate.delete(key);
|
|
12234
|
+
} catch {
|
|
12235
|
+
cached = void 0;
|
|
12236
|
+
try {
|
|
12237
|
+
await this.options.delegate.delete(key);
|
|
12238
|
+
} catch {}
|
|
12239
|
+
}
|
|
12240
|
+
const now = Date.now();
|
|
12241
|
+
const stale = cached == null || cached.validatedAt > now || now - cached.validatedAt >= maxAgeMs;
|
|
12242
|
+
if (cached != null && (this.options.mode == "offline" || !fresh && !stale)) return {
|
|
12243
|
+
...cached,
|
|
12244
|
+
path: query.path,
|
|
12245
|
+
source: "cache",
|
|
12246
|
+
stale
|
|
12247
|
+
};
|
|
12248
|
+
if (this.options.mode == "offline") throw new ApiError(503, "catalog.cache-miss", `No compatible cached response for ${query.path}.`);
|
|
12249
|
+
const result = await load(cached?.etag ?? null);
|
|
12250
|
+
if (!result.modified && cached == null) throw new ApiError(502, "response.invalid", "A catalog returned 304 without a cached response.");
|
|
12251
|
+
const entry = {
|
|
12252
|
+
version: 1,
|
|
12253
|
+
body: result.modified ? result.data : cached.body,
|
|
12254
|
+
etag: result.etag ?? (result.modified ? null : cached.etag),
|
|
12255
|
+
validatedAt: Date.now()
|
|
12256
|
+
};
|
|
12257
|
+
query.decode(structuredClone(entry.body));
|
|
12258
|
+
try {
|
|
12259
|
+
await this.options.delegate.set(key, structuredClone({ ...entry }));
|
|
12260
|
+
} catch {}
|
|
12261
|
+
return {
|
|
12262
|
+
...entry,
|
|
12263
|
+
path: query.path,
|
|
12264
|
+
source: result.modified ? "network" : "revalidated",
|
|
12265
|
+
stale: false
|
|
12266
|
+
};
|
|
12267
|
+
}
|
|
12268
|
+
};
|
|
12269
|
+
//#endregion
|
|
12090
12270
|
//#region src/control/common/checkDecoders.ts
|
|
12091
12271
|
function schemaPath(value) {
|
|
12092
12272
|
if (!Array.isArray(value)) return invalidResponse();
|
|
@@ -12171,6 +12351,23 @@ function connectorActionQuery(actionId, flowId, locale) {
|
|
|
12171
12351
|
}
|
|
12172
12352
|
};
|
|
12173
12353
|
}
|
|
12354
|
+
function connectorActionMetadataQuery(actionId, flowId, locale) {
|
|
12355
|
+
const parameters = new URLSearchParams({
|
|
12356
|
+
...flowId == null ? {} : { flowId },
|
|
12357
|
+
...locale == null ? {} : { locale }
|
|
12358
|
+
}).toString();
|
|
12359
|
+
return {
|
|
12360
|
+
path: `/v1/connector/action-metadata/${encodeURIComponent(actionId)}${parameters ? `?${parameters}` : ""}`,
|
|
12361
|
+
decode: (value) => {
|
|
12362
|
+
const source = record(value);
|
|
12363
|
+
requiredFields(source, ["action", "version"]);
|
|
12364
|
+
if (source.version != 1) return invalidResponse();
|
|
12365
|
+
const action = connectorActionMetadata(source.action);
|
|
12366
|
+
if (action.actionId != actionId) return invalidResponse("action.actionId: does not match the requested Action.");
|
|
12367
|
+
return action;
|
|
12368
|
+
}
|
|
12369
|
+
};
|
|
12370
|
+
}
|
|
12174
12371
|
function allConnectorConnectionsQuery(flowId) {
|
|
12175
12372
|
return {
|
|
12176
12373
|
path: `/v1/connector/connections${scope(flowId)}`,
|
|
@@ -12863,7 +13060,7 @@ function decodeRunEvent(value) {
|
|
|
12863
13060
|
switch (kind) {
|
|
12864
13061
|
case "node.started": {
|
|
12865
13062
|
const nodeKind = payload.nodeKind;
|
|
12866
|
-
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();
|
|
13063
|
+
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();
|
|
12867
13064
|
return {
|
|
12868
13065
|
...base,
|
|
12869
13066
|
kind,
|
|
@@ -12972,9 +13169,11 @@ function operationKey(operation) {
|
|
|
12972
13169
|
return `${operation}-${randomId()}`;
|
|
12973
13170
|
}
|
|
12974
13171
|
var ControlClient = class {
|
|
12975
|
-
constructor(requestControl, channel = "api") {
|
|
13172
|
+
constructor(requestControl, channel = "api", options = {}) {
|
|
13173
|
+
this.options = options;
|
|
12976
13174
|
this.channel = channel;
|
|
12977
13175
|
this.requestControl = requestControl;
|
|
13176
|
+
if (options.cache != null) this.catalogCache = new ControlCatalogCache(options.cache);
|
|
12978
13177
|
}
|
|
12979
13178
|
async loadOpenApiDocument(url, signal) {
|
|
12980
13179
|
const result = record(await this.request("/v1/openapi/document", {
|
|
@@ -13269,6 +13468,16 @@ var ControlClient = class {
|
|
|
13269
13468
|
};
|
|
13270
13469
|
}
|
|
13271
13470
|
async getTriggerCatalog(locale, cached, signal) {
|
|
13471
|
+
if (this.catalogCache != null) {
|
|
13472
|
+
const result = await this.catalogResponse({
|
|
13473
|
+
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`,
|
|
13474
|
+
decode: decodeTriggerCatalog
|
|
13475
|
+
}, 3e5, signal);
|
|
13476
|
+
return {
|
|
13477
|
+
data: result.data,
|
|
13478
|
+
etag: result.etag
|
|
13479
|
+
};
|
|
13480
|
+
}
|
|
13272
13481
|
const headers = new Headers();
|
|
13273
13482
|
if (cached?.etag) headers.set("if-none-match", cached.etag);
|
|
13274
13483
|
const response = await this.response(`/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`, {
|
|
@@ -13288,6 +13497,16 @@ var ControlClient = class {
|
|
|
13288
13497
|
};
|
|
13289
13498
|
}
|
|
13290
13499
|
async getTriggerKey(key, signal) {
|
|
13500
|
+
if (this.catalogCache != null) return (await this.catalogResponse({
|
|
13501
|
+
path: `/v1/trigger-keys/${segment(key)}`,
|
|
13502
|
+
decode: (value) => {
|
|
13503
|
+
const source = record(value);
|
|
13504
|
+
if (source.version != 1) return invalidResponse();
|
|
13505
|
+
const definition = triggerKey(source.definition);
|
|
13506
|
+
if (definition.key != key) return invalidResponse("Trigger key does not match the requested definition.");
|
|
13507
|
+
return definition;
|
|
13508
|
+
}
|
|
13509
|
+
}, 3e5, signal)).data;
|
|
13291
13510
|
const source = record(await this.request(`/v1/trigger-keys/${segment(key)}`, { signal }));
|
|
13292
13511
|
if (source.version != 1) return invalidResponse();
|
|
13293
13512
|
return triggerKey(source.definition);
|
|
@@ -13403,6 +13622,7 @@ var ControlClient = class {
|
|
|
13403
13622
|
}
|
|
13404
13623
|
async listConnectorProviders(signal, flowId, locale) {
|
|
13405
13624
|
const query = connectorProvidersQuery(flowId, locale);
|
|
13625
|
+
if (this.catalogCache != null) return (await this.catalogResponse(query, 3e5, signal)).data;
|
|
13406
13626
|
return this.connectorRequest(query.path, "providers", signal, query.decode);
|
|
13407
13627
|
}
|
|
13408
13628
|
async listLeinaBots(flowId, signal) {
|
|
@@ -13483,6 +13703,23 @@ var ControlClient = class {
|
|
|
13483
13703
|
const query = connectorActionQuery(actionId, flowId, locale);
|
|
13484
13704
|
return this.connectorRequest(query.path, "actions", signal, query.decode, fresh);
|
|
13485
13705
|
}
|
|
13706
|
+
async listConnectorActionMetadata(serviceId, signal, flowId, locale) {
|
|
13707
|
+
return this.connectorMetadata({
|
|
13708
|
+
...serviceId == null ? {} : { service: serviceId },
|
|
13709
|
+
...flowId == null ? {} : { flowId },
|
|
13710
|
+
...locale == null ? {} : { locale }
|
|
13711
|
+
}, signal);
|
|
13712
|
+
}
|
|
13713
|
+
async searchConnectorActionMetadata(query, signal, flowId, locale) {
|
|
13714
|
+
return this.connectorMetadata({
|
|
13715
|
+
q: query.trim(),
|
|
13716
|
+
...flowId == null ? {} : { flowId },
|
|
13717
|
+
...locale == null ? {} : { locale }
|
|
13718
|
+
}, signal);
|
|
13719
|
+
}
|
|
13720
|
+
async getConnectorActionMetadata(actionId, signal, flowId, locale, fresh = false) {
|
|
13721
|
+
return (await this.catalogResponse(connectorActionMetadataQuery(actionId, flowId, locale), 3e4, signal, fresh)).data;
|
|
13722
|
+
}
|
|
13486
13723
|
async listAllConnectorConnections(signal, flowId, fresh = false) {
|
|
13487
13724
|
const query = allConnectorConnectionsQuery(flowId);
|
|
13488
13725
|
return this.connectorRequest(query.path, "connections", signal, query.decode, fresh);
|
|
@@ -13714,6 +13951,30 @@ var ControlClient = class {
|
|
|
13714
13951
|
method: "POST"
|
|
13715
13952
|
}));
|
|
13716
13953
|
}
|
|
13954
|
+
async catalogResponse(query, maxAgeMs, signal, fresh = false) {
|
|
13955
|
+
if (this.catalogCache != null) return this.catalogCache.read(query, (etag) => this.readCatalog({
|
|
13956
|
+
path: query.path,
|
|
13957
|
+
decode: jsonValue
|
|
13958
|
+
}, etag), maxAgeMs, signal, fresh);
|
|
13959
|
+
const response = await this.readCatalog(query, null, signal);
|
|
13960
|
+
if (!response.modified) return invalidResponse();
|
|
13961
|
+
return {
|
|
13962
|
+
data: response.data,
|
|
13963
|
+
etag: response.etag
|
|
13964
|
+
};
|
|
13965
|
+
}
|
|
13966
|
+
async connectorMetadata(parameters, signal) {
|
|
13967
|
+
const query = new URLSearchParams(parameters).toString();
|
|
13968
|
+
return (await this.catalogResponse({
|
|
13969
|
+
path: `/v1/connector/action-metadata${query ? `?${query}` : ""}`,
|
|
13970
|
+
decode: (value) => {
|
|
13971
|
+
const source = record(value);
|
|
13972
|
+
requiredFields(source, ["actions", "version"]);
|
|
13973
|
+
if (source.version != 1 || !Array.isArray(source.actions)) return invalidResponse();
|
|
13974
|
+
return source.actions.map(connectorActionMetadata);
|
|
13975
|
+
}
|
|
13976
|
+
}, 3e4, signal)).data;
|
|
13977
|
+
}
|
|
13717
13978
|
async connectorActions(parameters, signal) {
|
|
13718
13979
|
const query = Object.entries(parameters).map(([key, value]) => `${segment(key)}=${segment(value)}`).join("&");
|
|
13719
13980
|
const suffix = query == "" ? "" : `?${query}`;
|
|
@@ -13728,6 +13989,7 @@ var ControlClient = class {
|
|
|
13728
13989
|
return decode(await this.request(path, { signal }));
|
|
13729
13990
|
}
|
|
13730
13991
|
async response(path, init, allowNotModified = false) {
|
|
13992
|
+
if (this.options.cache?.mode == "offline") throw new ApiError(503, "control.offline", "Network requests are disabled for this Control client.");
|
|
13731
13993
|
const headers = new Headers(init.headers);
|
|
13732
13994
|
if (init.body != null) headers.set("content-type", "application/json");
|
|
13733
13995
|
const response = await this.requestControl(path, {
|