@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
|
@@ -22,7 +22,7 @@ function dequal(foo, bar) {
|
|
|
22
22
|
return foo !== foo && bar !== bar;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
25
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
26
26
|
function getEnumValues(entries) {
|
|
27
27
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
28
28
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -347,6 +347,17 @@ function prefixIssues(path, issues) {
|
|
|
347
347
|
function unwrapMessage(message) {
|
|
348
348
|
return typeof message === "string" ? message : message?.message;
|
|
349
349
|
}
|
|
350
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
351
|
+
function sizeCaps(defChecks) {
|
|
352
|
+
const caps = [];
|
|
353
|
+
for (const ch of defChecks ?? []) {
|
|
354
|
+
const d = ch._zod.def;
|
|
355
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
356
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
357
|
+
if (max >= 0) caps.push([max, ch]);
|
|
358
|
+
}
|
|
359
|
+
return caps;
|
|
360
|
+
}
|
|
350
361
|
function attachSchema(issues, start, inst) {
|
|
351
362
|
var _a;
|
|
352
363
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -563,7 +574,7 @@ function constantCatch(value) {
|
|
|
563
574
|
return fn;
|
|
564
575
|
}
|
|
565
576
|
//#endregion
|
|
566
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
577
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
567
578
|
var _a$1;
|
|
568
579
|
var _zodDesc = {
|
|
569
580
|
value: void 0,
|
|
@@ -669,7 +680,7 @@ function config(newConfig) {
|
|
|
669
680
|
return globalConfig;
|
|
670
681
|
}
|
|
671
682
|
//#endregion
|
|
672
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
683
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
673
684
|
function _getMessage() {
|
|
674
685
|
const internals = this._zod;
|
|
675
686
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -785,7 +796,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
785
796
|
return fieldErrors;
|
|
786
797
|
}
|
|
787
798
|
//#endregion
|
|
788
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
799
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
789
800
|
function finalizeParams(callee, params) {
|
|
790
801
|
return {
|
|
791
802
|
callee: params?.callee ?? callee,
|
|
@@ -988,7 +999,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
988
999
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
989
1000
|
};
|
|
990
1001
|
//#endregion
|
|
991
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1002
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
992
1003
|
/**
|
|
993
1004
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
994
1005
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1061,7 +1072,7 @@ var _null$2 = /^null$/i;
|
|
|
1061
1072
|
var lowercase = /^[^A-Z]*$/;
|
|
1062
1073
|
var uppercase = /^[^a-z]*$/;
|
|
1063
1074
|
//#endregion
|
|
1064
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1075
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1065
1076
|
var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1066
1077
|
var _a;
|
|
1067
1078
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1357,7 +1368,7 @@ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst,
|
|
|
1357
1368
|
};
|
|
1358
1369
|
});
|
|
1359
1370
|
//#endregion
|
|
1360
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1371
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1361
1372
|
var Doc = class {
|
|
1362
1373
|
constructor(args = [], closed = {}) {
|
|
1363
1374
|
this.content = [];
|
|
@@ -1391,14 +1402,14 @@ var Doc = class {
|
|
|
1391
1402
|
}
|
|
1392
1403
|
};
|
|
1393
1404
|
//#endregion
|
|
1394
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1405
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1395
1406
|
var version = {
|
|
1396
1407
|
major: 4,
|
|
1397
1408
|
minor: 6,
|
|
1398
|
-
patch:
|
|
1409
|
+
patch: 7
|
|
1399
1410
|
};
|
|
1400
1411
|
//#endregion
|
|
1401
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
1412
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1402
1413
|
var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1403
1414
|
var _a;
|
|
1404
1415
|
inst ?? (inst = {});
|
|
@@ -1911,6 +1922,26 @@ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
|
1911
1922
|
return payload;
|
|
1912
1923
|
};
|
|
1913
1924
|
});
|
|
1925
|
+
function capSize(inst, size) {
|
|
1926
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
1927
|
+
if (!caps.length) return;
|
|
1928
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
1929
|
+
const parse = inst._zod.parse;
|
|
1930
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1931
|
+
const n = size(payload.value);
|
|
1932
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
1933
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
1934
|
+
const start = payload.issues.length;
|
|
1935
|
+
ch._zod.check(payload);
|
|
1936
|
+
payload.issues[start].continue = false;
|
|
1937
|
+
attachSchema(payload.issues, start, inst);
|
|
1938
|
+
return payload;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
return parse(payload, ctx);
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
1914
1945
|
function handleArrayResult(result, final, index) {
|
|
1915
1946
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1916
1947
|
final.value[index] = result.value;
|
|
@@ -1948,6 +1979,7 @@ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
1948
1979
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1949
1980
|
return payload;
|
|
1950
1981
|
};
|
|
1982
|
+
capSize(inst, arraySize);
|
|
1951
1983
|
});
|
|
1952
1984
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
1953
1985
|
const isPresent = key in input;
|
|
@@ -2866,7 +2898,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2866
2898
|
}
|
|
2867
2899
|
}
|
|
2868
2900
|
//#endregion
|
|
2869
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
2901
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
2870
2902
|
var $ZodCyclicError = class extends Error {
|
|
2871
2903
|
constructor() {
|
|
2872
2904
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3119,7 +3151,7 @@ function isBackEdge(ctx, value) {
|
|
|
3119
3151
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3120
3152
|
}
|
|
3121
3153
|
//#endregion
|
|
3122
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3154
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3123
3155
|
var error = () => {
|
|
3124
3156
|
const Sizable = {
|
|
3125
3157
|
string: {
|
|
@@ -3227,7 +3259,7 @@ function en_default() {
|
|
|
3227
3259
|
return { localeError: error() };
|
|
3228
3260
|
}
|
|
3229
3261
|
//#endregion
|
|
3230
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3262
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3231
3263
|
var _a;
|
|
3232
3264
|
var $ZodRegistry = class {
|
|
3233
3265
|
constructor() {
|
|
@@ -3274,7 +3306,7 @@ function registry() {
|
|
|
3274
3306
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3275
3307
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3276
3308
|
//#endregion
|
|
3277
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3309
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3278
3310
|
function snapshotChecks(def) {
|
|
3279
3311
|
if (def.checks) def.checks = [...def.checks];
|
|
3280
3312
|
return def;
|
|
@@ -3790,7 +3822,7 @@ function _check(fn, params) {
|
|
|
3790
3822
|
return ch;
|
|
3791
3823
|
}
|
|
3792
3824
|
//#endregion
|
|
3793
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
3825
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
3794
3826
|
function assignProps(target, ...sources) {
|
|
3795
3827
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3796
3828
|
return target;
|
|
@@ -4234,7 +4266,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4234
4266
|
return finalize(ctx, schema);
|
|
4235
4267
|
};
|
|
4236
4268
|
//#endregion
|
|
4237
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4269
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4238
4270
|
var narrowMin = (agg, key, value) => {
|
|
4239
4271
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4240
4272
|
};
|
|
@@ -4695,7 +4727,7 @@ var lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
4695
4727
|
seen.ref = innerType;
|
|
4696
4728
|
};
|
|
4697
4729
|
//#endregion
|
|
4698
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4730
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
4699
4731
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4700
4732
|
function _lazyMethod(proto, key, make) {
|
|
4701
4733
|
Object.defineProperty(proto, key, {
|
|
@@ -4745,7 +4777,7 @@ var initializer = (inst, issues) => {
|
|
|
4745
4777
|
};
|
|
4746
4778
|
var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4747
4779
|
//#endregion
|
|
4748
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4780
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
4749
4781
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4750
4782
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4751
4783
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4759,7 +4791,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
4759
4791
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4760
4792
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4761
4793
|
//#endregion
|
|
4762
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
4794
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
4763
4795
|
function _ensureDefaultLocale() {
|
|
4764
4796
|
if (!globalConfig.localeError) config(en_default());
|
|
4765
4797
|
}
|
|
@@ -5691,11 +5723,37 @@ function preprocess(fn, schema) {
|
|
|
5691
5723
|
});
|
|
5692
5724
|
}
|
|
5693
5725
|
//#endregion
|
|
5694
|
-
//#region ../../node_modules/.bun/zod@4.6.
|
|
5726
|
+
//#region ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
5695
5727
|
function datetime(params) {
|
|
5696
5728
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5697
5729
|
}
|
|
5698
5730
|
//#endregion
|
|
5731
|
+
//#region src/flow/common/requestParameters.ts
|
|
5732
|
+
var requestParameterSchema = strictObject({
|
|
5733
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
5734
|
+
names: array(string()).default([])
|
|
5735
|
+
});
|
|
5736
|
+
var connectorProxyExecutorSchema = strictObject({
|
|
5737
|
+
providerId: string().min(1),
|
|
5738
|
+
connectionId: string().optional(),
|
|
5739
|
+
method: _enum([
|
|
5740
|
+
"GET",
|
|
5741
|
+
"POST",
|
|
5742
|
+
"PUT",
|
|
5743
|
+
"PATCH",
|
|
5744
|
+
"DELETE"
|
|
5745
|
+
]).default("GET"),
|
|
5746
|
+
query: requestParameterSchema.default({
|
|
5747
|
+
mode: "fields",
|
|
5748
|
+
names: []
|
|
5749
|
+
}),
|
|
5750
|
+
headers: requestParameterSchema.default({
|
|
5751
|
+
mode: "fields",
|
|
5752
|
+
names: []
|
|
5753
|
+
}),
|
|
5754
|
+
bodyFormat: _enum(["none", "json"]).default("none")
|
|
5755
|
+
}).extend({ kind: literal("connector-proxy") });
|
|
5756
|
+
//#endregion
|
|
5699
5757
|
//#region src/json-schema-subset/utils.ts
|
|
5700
5758
|
var nextId = 0;
|
|
5701
5759
|
function createId() {
|
|
@@ -8558,12 +8616,6 @@ var httpHostPattern = /^(?:\*\.)?(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0
|
|
|
8558
8616
|
function isHttpHost(value) {
|
|
8559
8617
|
return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
|
|
8560
8618
|
}
|
|
8561
|
-
//#endregion
|
|
8562
|
-
//#region src/http/common/httpRequest.ts
|
|
8563
|
-
var parameterSchema = strictObject({
|
|
8564
|
-
mode: _enum(["fields", "object"]).default("fields"),
|
|
8565
|
-
names: array(string()).default([])
|
|
8566
|
-
});
|
|
8567
8619
|
var httpRequestExecutorSchema = strictObject({
|
|
8568
8620
|
method: _enum([
|
|
8569
8621
|
"GET",
|
|
@@ -8574,11 +8626,11 @@ var httpRequestExecutorSchema = strictObject({
|
|
|
8574
8626
|
"HEAD",
|
|
8575
8627
|
"OPTIONS"
|
|
8576
8628
|
]).default("GET"),
|
|
8577
|
-
query:
|
|
8629
|
+
query: requestParameterSchema.default({
|
|
8578
8630
|
mode: "fields",
|
|
8579
8631
|
names: []
|
|
8580
8632
|
}),
|
|
8581
|
-
headers:
|
|
8633
|
+
headers: requestParameterSchema.default({
|
|
8582
8634
|
mode: "fields",
|
|
8583
8635
|
names: []
|
|
8584
8636
|
}),
|
|
@@ -8953,7 +9005,8 @@ var managedFields = object({
|
|
|
8953
9005
|
revisionId: text
|
|
8954
9006
|
}),
|
|
8955
9007
|
httpRequestExecutorSchema,
|
|
8956
|
-
skipDuplicatesExecutorSchema
|
|
9008
|
+
skipDuplicatesExecutorSchema,
|
|
9009
|
+
connectorProxyExecutorSchema
|
|
8957
9010
|
])
|
|
8958
9011
|
});
|
|
8959
9012
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9208,7 +9261,8 @@ var revision = object({
|
|
|
9208
9261
|
literal(10),
|
|
9209
9262
|
literal(11),
|
|
9210
9263
|
literal(12),
|
|
9211
|
-
literal(13)
|
|
9264
|
+
literal(13),
|
|
9265
|
+
literal(14)
|
|
9212
9266
|
]),
|
|
9213
9267
|
document,
|
|
9214
9268
|
modules: record$1(text, module)
|
|
@@ -9463,14 +9517,14 @@ function repairRevisionEnvelope(value) {
|
|
|
9463
9517
|
checkJsonDepth(value);
|
|
9464
9518
|
const envelopeSource = record(value);
|
|
9465
9519
|
if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
|
|
9466
|
-
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion >
|
|
9520
|
+
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 14) throw new TypeError("The Flow model is newer than this package.");
|
|
9467
9521
|
let sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
|
|
9468
9522
|
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion < 6) sourceDocument = upgradeTaskNodes(sourceDocument);
|
|
9469
9523
|
sourceDocument = record(normalizeDocument(sourceDocument));
|
|
9470
9524
|
const bindings = record(sourceDocument.bindings);
|
|
9471
9525
|
const sourceGraph = repairGraph(sourceDocument.graph, bindings);
|
|
9472
9526
|
return decodeRevisionContent({
|
|
9473
|
-
modelVersion:
|
|
9527
|
+
modelVersion: 14,
|
|
9474
9528
|
document: {
|
|
9475
9529
|
bindings: repairedEntries(sourceDocument.bindings, binding),
|
|
9476
9530
|
graph: sourceGraph
|
|
@@ -9672,6 +9726,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9672
9726
|
...shape
|
|
9673
9727
|
})])).values()])).min(1);
|
|
9674
9728
|
function checkModelVersion(content) {
|
|
9729
|
+
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
9730
|
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
9731
|
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
9732
|
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.");
|
|
@@ -9734,10 +9789,10 @@ function upgradeRevisionContent(content) {
|
|
|
9734
9789
|
function upgradeDecodedRevisionContent(content) {
|
|
9735
9790
|
const graph = content.document.graph;
|
|
9736
9791
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9737
|
-
if (!hasManual && content.modelVersion ==
|
|
9792
|
+
if (!hasManual && content.modelVersion == 14) return content;
|
|
9738
9793
|
return {
|
|
9739
9794
|
...content,
|
|
9740
|
-
modelVersion:
|
|
9795
|
+
modelVersion: 14,
|
|
9741
9796
|
document: {
|
|
9742
9797
|
...content.document,
|
|
9743
9798
|
graph: hasManual ? {
|
|
@@ -9792,7 +9847,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
9792
9847
|
const { connectionId: _, ...rest } = value;
|
|
9793
9848
|
return rest;
|
|
9794
9849
|
};
|
|
9795
|
-
if (executor.kind == "connector") return [id, {
|
|
9850
|
+
if (executor.kind == "connector" || executor.kind == "connector-proxy") return [id, {
|
|
9796
9851
|
...node,
|
|
9797
9852
|
task: {
|
|
9798
9853
|
...node.task,
|
|
@@ -9928,8 +9983,8 @@ function cleanWorkflowFile(value) {
|
|
|
9928
9983
|
}
|
|
9929
9984
|
};
|
|
9930
9985
|
}
|
|
9931
|
-
function encodeWorkflowFile(file) {
|
|
9932
|
-
return `${JSON.stringify(cleanWorkflowFile(file).file, null, 2)}\n`;
|
|
9986
|
+
function encodeWorkflowFile(file, options = {}) {
|
|
9987
|
+
return `${JSON.stringify(options.clean === false ? decodeWorkflowFile(file) : cleanWorkflowFile(file).file, null, 2)}\n`;
|
|
9933
9988
|
}
|
|
9934
9989
|
function workflowFileName(name) {
|
|
9935
9990
|
return `${name.replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").replace(/[. ]+$/g, "") || "workflow"}.openflow.json`;
|
|
@@ -10475,7 +10530,7 @@ function revisionRepairKind(bytes) {
|
|
|
10475
10530
|
return;
|
|
10476
10531
|
}
|
|
10477
10532
|
const source = value;
|
|
10478
|
-
return typeof source.modelVersion == "number" && source.modelVersion <
|
|
10533
|
+
return typeof source.modelVersion == "number" && source.modelVersion < 14 ? "upgrade" : "repair";
|
|
10479
10534
|
}
|
|
10480
10535
|
function repairRevision(bytes) {
|
|
10481
10536
|
return repairRevisionEnvelope(revisionValue(bytes));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InputMapping, InputPort, JsonValue, TaskDefinitionBase, TaskExecutor } from './flow-model.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const requestParameterSchema: z.ZodObject<{
|
|
4
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
fields: "fields";
|
|
6
|
+
object: "object";
|
|
7
|
+
}>>;
|
|
8
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type RequestParameters = z.infer<typeof requestParameterSchema>;
|
|
11
|
+
export interface RequestParameterConfig {
|
|
12
|
+
readonly query: RequestParameters;
|
|
13
|
+
readonly headers: RequestParameters;
|
|
14
|
+
}
|
|
15
|
+
export interface RequestTaskNode {
|
|
16
|
+
readonly inputs: Readonly<Record<string, InputMapping>>;
|
|
17
|
+
readonly task: TaskDefinitionBase & {
|
|
18
|
+
readonly executor?: TaskExecutor;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function requestParameterHandle(group: 'query' | 'headers', name: string): string;
|
|
22
|
+
export declare function requestParameterPorts(config: RequestParameterConfig, querySchema: JsonValue, queryValueSchema: JsonValue, headerSchema: JsonValue): InputPort[];
|
|
23
|
+
export declare function retainRequestPorts(ports: readonly InputPort[], old?: TaskDefinitionBase['inputs']): TaskDefinitionBase['inputs'];
|
|
24
|
+
export interface RequestParameterIssue {
|
|
25
|
+
readonly field: 'query' | 'headers';
|
|
26
|
+
readonly index: number;
|
|
27
|
+
readonly code: 'parameterNamesInvalid' | 'headerNameInvalid';
|
|
28
|
+
readonly message: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function requestParameterIssues(config: RequestParameterConfig): RequestParameterIssue[];
|
|
31
|
+
/** Only a named parameter rename carries a source; changing modes does not rename a port. */
|
|
32
|
+
export declare function requestInputMappings(mappings: Readonly<Record<string, InputMapping>>, previous: TaskDefinitionBase, next: TaskDefinitionBase): Record<string, InputMapping>;
|
|
33
|
+
export declare function withRequestParameterFields<Node extends RequestTaskNode>(node: Node, group: 'query' | 'headers', values: Record<string, JsonValue>, previous: RequestParameters, createTask: (parameters: RequestParameters) => Node['task']): Node;
|
|
34
|
+
export declare function withRequestParameterSource<Node extends RequestTaskNode>(node: Node, group: 'query' | 'headers', mapping: InputMapping | undefined, createTask: (parameters: RequestParameters) => Node['task']): Node;
|