@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
|
@@ -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$1 = () => {
|
|
3124
3156
|
const Sizable = {
|
|
3125
3157
|
string: {
|
|
@@ -3227,7 +3259,7 @@ function en_default() {
|
|
|
3227
3259
|
return { localeError: error$1() };
|
|
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,40 @@ 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$1()).default([])
|
|
5735
|
+
});
|
|
5736
|
+
//#endregion
|
|
5737
|
+
//#region src/connector/common/proxy.ts
|
|
5738
|
+
var connectorProxyConfigSchema = strictObject({
|
|
5739
|
+
providerId: string$1().min(1),
|
|
5740
|
+
connectionId: string$1().optional(),
|
|
5741
|
+
method: _enum([
|
|
5742
|
+
"GET",
|
|
5743
|
+
"POST",
|
|
5744
|
+
"PUT",
|
|
5745
|
+
"PATCH",
|
|
5746
|
+
"DELETE"
|
|
5747
|
+
]).default("GET"),
|
|
5748
|
+
query: requestParameterSchema.default({
|
|
5749
|
+
mode: "fields",
|
|
5750
|
+
names: []
|
|
5751
|
+
}),
|
|
5752
|
+
headers: requestParameterSchema.default({
|
|
5753
|
+
mode: "fields",
|
|
5754
|
+
names: []
|
|
5755
|
+
}),
|
|
5756
|
+
bodyFormat: _enum(["none", "json"]).default("none")
|
|
5757
|
+
});
|
|
5758
|
+
var connectorProxyExecutorSchema = connectorProxyConfigSchema.extend({ kind: literal("connector-proxy") });
|
|
5759
|
+
//#endregion
|
|
5699
5760
|
//#region src/json-schema-subset/utils.ts
|
|
5700
5761
|
var nextId = 0;
|
|
5701
5762
|
function createId() {
|
|
@@ -8583,10 +8644,6 @@ function isHttpHost(value) {
|
|
|
8583
8644
|
}
|
|
8584
8645
|
//#endregion
|
|
8585
8646
|
//#region src/http/common/httpRequest.ts
|
|
8586
|
-
var parameterSchema = strictObject({
|
|
8587
|
-
mode: _enum(["fields", "object"]).default("fields"),
|
|
8588
|
-
names: array(string$1()).default([])
|
|
8589
|
-
});
|
|
8590
8647
|
var httpRequestConfigSchema = strictObject({
|
|
8591
8648
|
method: _enum([
|
|
8592
8649
|
"GET",
|
|
@@ -8597,11 +8654,11 @@ var httpRequestConfigSchema = strictObject({
|
|
|
8597
8654
|
"HEAD",
|
|
8598
8655
|
"OPTIONS"
|
|
8599
8656
|
]).default("GET"),
|
|
8600
|
-
query:
|
|
8657
|
+
query: requestParameterSchema.default({
|
|
8601
8658
|
mode: "fields",
|
|
8602
8659
|
names: []
|
|
8603
8660
|
}),
|
|
8604
|
-
headers:
|
|
8661
|
+
headers: requestParameterSchema.default({
|
|
8605
8662
|
mode: "fields",
|
|
8606
8663
|
names: []
|
|
8607
8664
|
}),
|
|
@@ -8981,7 +9038,8 @@ var managedFields = object({
|
|
|
8981
9038
|
revisionId: text
|
|
8982
9039
|
}),
|
|
8983
9040
|
httpRequestExecutorSchema,
|
|
8984
|
-
skipDuplicatesExecutorSchema
|
|
9041
|
+
skipDuplicatesExecutorSchema,
|
|
9042
|
+
connectorProxyExecutorSchema
|
|
8985
9043
|
])
|
|
8986
9044
|
});
|
|
8987
9045
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9026,7 +9084,7 @@ var condition = {
|
|
|
9026
9084
|
})) }))
|
|
9027
9085
|
}))
|
|
9028
9086
|
};
|
|
9029
|
-
var wait = {
|
|
9087
|
+
var wait$1 = {
|
|
9030
9088
|
inputDefinitions: array(input),
|
|
9031
9089
|
prompt: text
|
|
9032
9090
|
};
|
|
@@ -9139,12 +9197,12 @@ var node = union([
|
|
|
9139
9197
|
strictObject({
|
|
9140
9198
|
...base,
|
|
9141
9199
|
kind: literal("approval"),
|
|
9142
|
-
...wait
|
|
9200
|
+
...wait$1
|
|
9143
9201
|
}).omit({ timeoutMs: true }),
|
|
9144
9202
|
strictObject({
|
|
9145
9203
|
...base,
|
|
9146
9204
|
kind: literal("wait"),
|
|
9147
|
-
...wait,
|
|
9205
|
+
...wait$1,
|
|
9148
9206
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9149
9207
|
}).omit({ timeoutMs: true }),
|
|
9150
9208
|
object({
|
|
@@ -9200,7 +9258,7 @@ var authoringDefinitionSchemas = {
|
|
|
9200
9258
|
port: port$1,
|
|
9201
9259
|
ports: ports$1,
|
|
9202
9260
|
condition: strictObject(condition),
|
|
9203
|
-
wait: strictObject(wait),
|
|
9261
|
+
wait: strictObject(wait$1),
|
|
9204
9262
|
waitAutoContinue: waitAutoContinueSchema,
|
|
9205
9263
|
webhook: strictObject(webhook),
|
|
9206
9264
|
schedule: triggerScheduleSchema,
|
|
@@ -9252,7 +9310,8 @@ var revision = object({
|
|
|
9252
9310
|
literal(10),
|
|
9253
9311
|
literal(11),
|
|
9254
9312
|
literal(12),
|
|
9255
|
-
literal(13)
|
|
9313
|
+
literal(13),
|
|
9314
|
+
literal(14)
|
|
9256
9315
|
]),
|
|
9257
9316
|
document,
|
|
9258
9317
|
modules: record$3(text, module)
|
|
@@ -9386,11 +9445,11 @@ var shapes = {
|
|
|
9386
9445
|
"graph.node.resolution.set": {
|
|
9387
9446
|
...at,
|
|
9388
9447
|
before: strictObject({
|
|
9389
|
-
...wait,
|
|
9448
|
+
...wait$1,
|
|
9390
9449
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9391
9450
|
}),
|
|
9392
9451
|
value: strictObject({
|
|
9393
|
-
...wait,
|
|
9452
|
+
...wait$1,
|
|
9394
9453
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9395
9454
|
})
|
|
9396
9455
|
},
|
|
@@ -9453,6 +9512,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9453
9512
|
...shape
|
|
9454
9513
|
})])).values()])).min(1);
|
|
9455
9514
|
function checkModelVersion(content) {
|
|
9515
|
+
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.");
|
|
9456
9516
|
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.");
|
|
9457
9517
|
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.");
|
|
9458
9518
|
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.");
|
|
@@ -9504,10 +9564,10 @@ function upgradeRevisionContent(content) {
|
|
|
9504
9564
|
function upgradeDecodedRevisionContent(content) {
|
|
9505
9565
|
const graph = content.document.graph;
|
|
9506
9566
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9507
|
-
if (!hasManual && content.modelVersion ==
|
|
9567
|
+
if (!hasManual && content.modelVersion == 14) return content;
|
|
9508
9568
|
return {
|
|
9509
9569
|
...content,
|
|
9510
|
-
modelVersion:
|
|
9570
|
+
modelVersion: 14,
|
|
9511
9571
|
document: {
|
|
9512
9572
|
...content.document,
|
|
9513
9573
|
graph: hasManual ? {
|
|
@@ -9526,8 +9586,8 @@ function upgradeManualTrigger(node) {
|
|
|
9526
9586
|
}
|
|
9527
9587
|
//#endregion
|
|
9528
9588
|
//#region src/runtime/common/engineContract.ts
|
|
9529
|
-
/**
|
|
9530
|
-
var currentEngineContract = "open-flow-engine/
|
|
9589
|
+
/** v11 adds Provider API requests through Connector Proxy. */
|
|
9590
|
+
var currentEngineContract = "open-flow-engine/v11";
|
|
9531
9591
|
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
9532
9592
|
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
9533
9593
|
var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
|
|
@@ -9577,13 +9637,19 @@ var v9Contract = {
|
|
|
9577
9637
|
codeFetch: true,
|
|
9578
9638
|
platformSource: platformSource("open-flow-engine/v9")
|
|
9579
9639
|
};
|
|
9580
|
-
var
|
|
9640
|
+
var v10Contract = {
|
|
9581
9641
|
...v9Contract,
|
|
9582
9642
|
flowState: true,
|
|
9643
|
+
platformSource: platformSource("open-flow-engine/v10")
|
|
9644
|
+
};
|
|
9645
|
+
var currentContract = {
|
|
9646
|
+
...v10Contract,
|
|
9647
|
+
connectorProxy: true,
|
|
9583
9648
|
platformSource: platformSource(currentEngineContract)
|
|
9584
9649
|
};
|
|
9585
9650
|
function findEngineContract(contract) {
|
|
9586
|
-
if (contract == "open-flow-engine/
|
|
9651
|
+
if (contract == "open-flow-engine/v11") return currentContract;
|
|
9652
|
+
if (contract == "open-flow-engine/v10") return v10Contract;
|
|
9587
9653
|
if (contract == "open-flow-engine/v9") return v9Contract;
|
|
9588
9654
|
if (contract == "open-flow-engine/v8") return v8Contract;
|
|
9589
9655
|
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
@@ -9708,6 +9774,7 @@ var type = _enum([
|
|
|
9708
9774
|
"integration",
|
|
9709
9775
|
"code",
|
|
9710
9776
|
"connector",
|
|
9777
|
+
"connector-proxy",
|
|
9711
9778
|
"agent",
|
|
9712
9779
|
"llm",
|
|
9713
9780
|
"decision",
|
|
@@ -9842,6 +9909,7 @@ var authoringConfigurations = {
|
|
|
9842
9909
|
capabilities: authoringCapabilities.optional()
|
|
9843
9910
|
}),
|
|
9844
9911
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9912
|
+
"connector-proxy": connectorProxyConfigSchema,
|
|
9845
9913
|
"openapi": authoringOpenApiSchema,
|
|
9846
9914
|
"http-request": httpRequestConfigSchema,
|
|
9847
9915
|
"skip-duplicates": skipDuplicatesConfigSchema,
|
|
@@ -10630,7 +10698,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
10630
10698
|
const { connectionId: _, ...rest } = value;
|
|
10631
10699
|
return rest;
|
|
10632
10700
|
};
|
|
10633
|
-
if (executor.kind == "connector") return [id, {
|
|
10701
|
+
if (executor.kind == "connector" || executor.kind == "connector-proxy") return [id, {
|
|
10634
10702
|
...node,
|
|
10635
10703
|
task: {
|
|
10636
10704
|
...node.task,
|
|
@@ -11401,6 +11469,118 @@ function decodeResultRead(value) {
|
|
|
11401
11469
|
}
|
|
11402
11470
|
new TextEncoder();
|
|
11403
11471
|
//#endregion
|
|
11472
|
+
//#region src/control/common/catalogCache.ts
|
|
11473
|
+
function cachedResponse(value) {
|
|
11474
|
+
if (value == null || typeof value != "object" || Array.isArray(value)) return;
|
|
11475
|
+
const entry = value;
|
|
11476
|
+
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;
|
|
11477
|
+
return {
|
|
11478
|
+
version: 1,
|
|
11479
|
+
body: jsonValue(entry.body),
|
|
11480
|
+
etag: entry.etag,
|
|
11481
|
+
validatedAt: entry.validatedAt
|
|
11482
|
+
};
|
|
11483
|
+
}
|
|
11484
|
+
/** Cancellation belongs to each waiter, not the shared metadata request. */
|
|
11485
|
+
function wait(promise, signal) {
|
|
11486
|
+
if (signal == null) return promise;
|
|
11487
|
+
if (signal.aborted) {
|
|
11488
|
+
promise.catch(() => {});
|
|
11489
|
+
return Promise.reject(signal.reason);
|
|
11490
|
+
}
|
|
11491
|
+
return new Promise((resolve, reject) => {
|
|
11492
|
+
const abort = () => reject(signal.reason);
|
|
11493
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
11494
|
+
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
11495
|
+
});
|
|
11496
|
+
}
|
|
11497
|
+
/** Complete Flow API responses, never a merged store of catalog entities. */
|
|
11498
|
+
var ControlCatalogCache = class {
|
|
11499
|
+
#pending = /* @__PURE__ */ new Map();
|
|
11500
|
+
constructor(options) {
|
|
11501
|
+
this.options = options;
|
|
11502
|
+
if (!options.scope.trim()) throw new TypeError("Control cache scope must be nonempty.");
|
|
11503
|
+
if (options.maxAgeMs != null && (!Number.isFinite(options.maxAgeMs) || options.maxAgeMs < 0)) throw new TypeError("Control cache maxAgeMs must be finite and nonnegative.");
|
|
11504
|
+
}
|
|
11505
|
+
async read(query, load, maxAgeMs, signal, fresh = false) {
|
|
11506
|
+
signal?.throwIfAborted();
|
|
11507
|
+
const key = JSON.stringify([
|
|
11508
|
+
"open-flow:catalog",
|
|
11509
|
+
1,
|
|
11510
|
+
this.options.scope,
|
|
11511
|
+
query.path
|
|
11512
|
+
]);
|
|
11513
|
+
const result = await wait(this.#request(key, query, load, this.options.maxAgeMs ?? maxAgeMs, fresh || this.options.mode == "refresh"), signal);
|
|
11514
|
+
const data = query.decode(structuredClone(result.body));
|
|
11515
|
+
try {
|
|
11516
|
+
this.options.onRead?.({
|
|
11517
|
+
...result,
|
|
11518
|
+
body: structuredClone(result.body)
|
|
11519
|
+
});
|
|
11520
|
+
} catch {}
|
|
11521
|
+
return {
|
|
11522
|
+
data,
|
|
11523
|
+
etag: result.etag
|
|
11524
|
+
};
|
|
11525
|
+
}
|
|
11526
|
+
#request(key, query, load, maxAgeMs, fresh) {
|
|
11527
|
+
const previous = this.#pending.get(key);
|
|
11528
|
+
if (previous != null) {
|
|
11529
|
+
if (!fresh || previous.fresh) return previous.promise;
|
|
11530
|
+
return previous.promise.catch(() => void 0).then(() => this.#request(key, query, load, maxAgeMs, true));
|
|
11531
|
+
}
|
|
11532
|
+
const promise = this.#load(key, query, load, maxAgeMs, fresh).finally(() => {
|
|
11533
|
+
if (this.#pending.get(key)?.promise === promise) this.#pending.delete(key);
|
|
11534
|
+
});
|
|
11535
|
+
this.#pending.set(key, {
|
|
11536
|
+
fresh,
|
|
11537
|
+
promise
|
|
11538
|
+
});
|
|
11539
|
+
return promise;
|
|
11540
|
+
}
|
|
11541
|
+
async #load(key, query, load, maxAgeMs, fresh) {
|
|
11542
|
+
let cached;
|
|
11543
|
+
try {
|
|
11544
|
+
const stored = await this.options.delegate.get(key);
|
|
11545
|
+
cached = cachedResponse(stored);
|
|
11546
|
+
if (cached != null) query.decode(structuredClone(cached.body));
|
|
11547
|
+
if (stored !== void 0 && cached == null) await this.options.delegate.delete(key);
|
|
11548
|
+
} catch {
|
|
11549
|
+
cached = void 0;
|
|
11550
|
+
try {
|
|
11551
|
+
await this.options.delegate.delete(key);
|
|
11552
|
+
} catch {}
|
|
11553
|
+
}
|
|
11554
|
+
const now = Date.now();
|
|
11555
|
+
const stale = cached == null || cached.validatedAt > now || now - cached.validatedAt >= maxAgeMs;
|
|
11556
|
+
if (cached != null && (this.options.mode == "offline" || !fresh && !stale)) return {
|
|
11557
|
+
...cached,
|
|
11558
|
+
path: query.path,
|
|
11559
|
+
source: "cache",
|
|
11560
|
+
stale
|
|
11561
|
+
};
|
|
11562
|
+
if (this.options.mode == "offline") throw new ApiError(503, "catalog.cache-miss", `No compatible cached response for ${query.path}.`);
|
|
11563
|
+
const result = await load(cached?.etag ?? null);
|
|
11564
|
+
if (!result.modified && cached == null) throw new ApiError(502, "response.invalid", "A catalog returned 304 without a cached response.");
|
|
11565
|
+
const entry = {
|
|
11566
|
+
version: 1,
|
|
11567
|
+
body: result.modified ? result.data : cached.body,
|
|
11568
|
+
etag: result.etag ?? (result.modified ? null : cached.etag),
|
|
11569
|
+
validatedAt: Date.now()
|
|
11570
|
+
};
|
|
11571
|
+
query.decode(structuredClone(entry.body));
|
|
11572
|
+
try {
|
|
11573
|
+
await this.options.delegate.set(key, structuredClone({ ...entry }));
|
|
11574
|
+
} catch {}
|
|
11575
|
+
return {
|
|
11576
|
+
...entry,
|
|
11577
|
+
path: query.path,
|
|
11578
|
+
source: result.modified ? "network" : "revalidated",
|
|
11579
|
+
stale: false
|
|
11580
|
+
};
|
|
11581
|
+
}
|
|
11582
|
+
};
|
|
11583
|
+
//#endregion
|
|
11404
11584
|
//#region src/control/common/checkDecoders.ts
|
|
11405
11585
|
function schemaPath(value) {
|
|
11406
11586
|
if (!Array.isArray(value)) return invalidResponse();
|
|
@@ -11485,6 +11665,23 @@ function connectorActionQuery(actionId, flowId, locale) {
|
|
|
11485
11665
|
}
|
|
11486
11666
|
};
|
|
11487
11667
|
}
|
|
11668
|
+
function connectorActionMetadataQuery(actionId, flowId, locale) {
|
|
11669
|
+
const parameters = new URLSearchParams({
|
|
11670
|
+
...flowId == null ? {} : { flowId },
|
|
11671
|
+
...locale == null ? {} : { locale }
|
|
11672
|
+
}).toString();
|
|
11673
|
+
return {
|
|
11674
|
+
path: `/v1/connector/action-metadata/${encodeURIComponent(actionId)}${parameters ? `?${parameters}` : ""}`,
|
|
11675
|
+
decode: (value) => {
|
|
11676
|
+
const source = record$1(value);
|
|
11677
|
+
requiredFields(source, ["action", "version"]);
|
|
11678
|
+
if (source.version != 1) return invalidResponse();
|
|
11679
|
+
const action = connectorActionMetadata(source.action);
|
|
11680
|
+
if (action.actionId != actionId) return invalidResponse("action.actionId: does not match the requested Action.");
|
|
11681
|
+
return action;
|
|
11682
|
+
}
|
|
11683
|
+
};
|
|
11684
|
+
}
|
|
11488
11685
|
function allConnectorConnectionsQuery(flowId) {
|
|
11489
11686
|
return {
|
|
11490
11687
|
path: `/v1/connector/connections${scope(flowId)}`,
|
|
@@ -12174,7 +12371,7 @@ function decodeRunEvent(value) {
|
|
|
12174
12371
|
switch (kind) {
|
|
12175
12372
|
case "node.started": {
|
|
12176
12373
|
const nodeKind = payload.nodeKind;
|
|
12177
|
-
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();
|
|
12374
|
+
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();
|
|
12178
12375
|
return {
|
|
12179
12376
|
...base,
|
|
12180
12377
|
kind,
|
|
@@ -12283,9 +12480,11 @@ function operationKey(operation) {
|
|
|
12283
12480
|
return `${operation}-${randomId()}`;
|
|
12284
12481
|
}
|
|
12285
12482
|
var ControlClient = class {
|
|
12286
|
-
constructor(requestControl, channel = "api") {
|
|
12483
|
+
constructor(requestControl, channel = "api", options = {}) {
|
|
12484
|
+
this.options = options;
|
|
12287
12485
|
this.channel = channel;
|
|
12288
12486
|
this.requestControl = requestControl;
|
|
12487
|
+
if (options.cache != null) this.catalogCache = new ControlCatalogCache(options.cache);
|
|
12289
12488
|
}
|
|
12290
12489
|
async loadOpenApiDocument(url, signal) {
|
|
12291
12490
|
const result = record$1(await this.request("/v1/openapi/document", {
|
|
@@ -12580,6 +12779,16 @@ var ControlClient = class {
|
|
|
12580
12779
|
};
|
|
12581
12780
|
}
|
|
12582
12781
|
async getTriggerCatalog(locale, cached, signal) {
|
|
12782
|
+
if (this.catalogCache != null) {
|
|
12783
|
+
const result = await this.catalogResponse({
|
|
12784
|
+
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`,
|
|
12785
|
+
decode: decodeTriggerCatalog
|
|
12786
|
+
}, 3e5, signal);
|
|
12787
|
+
return {
|
|
12788
|
+
data: result.data,
|
|
12789
|
+
etag: result.etag
|
|
12790
|
+
};
|
|
12791
|
+
}
|
|
12583
12792
|
const headers = new Headers();
|
|
12584
12793
|
if (cached?.etag) headers.set("if-none-match", cached.etag);
|
|
12585
12794
|
const response = await this.response(`/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`, {
|
|
@@ -12599,6 +12808,16 @@ var ControlClient = class {
|
|
|
12599
12808
|
};
|
|
12600
12809
|
}
|
|
12601
12810
|
async getTriggerKey(key, signal) {
|
|
12811
|
+
if (this.catalogCache != null) return (await this.catalogResponse({
|
|
12812
|
+
path: `/v1/trigger-keys/${segment(key)}`,
|
|
12813
|
+
decode: (value) => {
|
|
12814
|
+
const source = record$1(value);
|
|
12815
|
+
if (source.version != 1) return invalidResponse();
|
|
12816
|
+
const definition = triggerKey(source.definition);
|
|
12817
|
+
if (definition.key != key) return invalidResponse("Trigger key does not match the requested definition.");
|
|
12818
|
+
return definition;
|
|
12819
|
+
}
|
|
12820
|
+
}, 3e5, signal)).data;
|
|
12602
12821
|
const source = record$1(await this.request(`/v1/trigger-keys/${segment(key)}`, { signal }));
|
|
12603
12822
|
if (source.version != 1) return invalidResponse();
|
|
12604
12823
|
return triggerKey(source.definition);
|
|
@@ -12714,6 +12933,7 @@ var ControlClient = class {
|
|
|
12714
12933
|
}
|
|
12715
12934
|
async listConnectorProviders(signal, flowId, locale) {
|
|
12716
12935
|
const query = connectorProvidersQuery(flowId, locale);
|
|
12936
|
+
if (this.catalogCache != null) return (await this.catalogResponse(query, 3e5, signal)).data;
|
|
12717
12937
|
return this.connectorRequest(query.path, "providers", signal, query.decode);
|
|
12718
12938
|
}
|
|
12719
12939
|
async listLeinaBots(flowId, signal) {
|
|
@@ -12794,6 +13014,23 @@ var ControlClient = class {
|
|
|
12794
13014
|
const query = connectorActionQuery(actionId, flowId, locale);
|
|
12795
13015
|
return this.connectorRequest(query.path, "actions", signal, query.decode, fresh);
|
|
12796
13016
|
}
|
|
13017
|
+
async listConnectorActionMetadata(serviceId, signal, flowId, locale) {
|
|
13018
|
+
return this.connectorMetadata({
|
|
13019
|
+
...serviceId == null ? {} : { service: serviceId },
|
|
13020
|
+
...flowId == null ? {} : { flowId },
|
|
13021
|
+
...locale == null ? {} : { locale }
|
|
13022
|
+
}, signal);
|
|
13023
|
+
}
|
|
13024
|
+
async searchConnectorActionMetadata(query, signal, flowId, locale) {
|
|
13025
|
+
return this.connectorMetadata({
|
|
13026
|
+
q: query.trim(),
|
|
13027
|
+
...flowId == null ? {} : { flowId },
|
|
13028
|
+
...locale == null ? {} : { locale }
|
|
13029
|
+
}, signal);
|
|
13030
|
+
}
|
|
13031
|
+
async getConnectorActionMetadata(actionId, signal, flowId, locale, fresh = false) {
|
|
13032
|
+
return (await this.catalogResponse(connectorActionMetadataQuery(actionId, flowId, locale), 3e4, signal, fresh)).data;
|
|
13033
|
+
}
|
|
12797
13034
|
async listAllConnectorConnections(signal, flowId, fresh = false) {
|
|
12798
13035
|
const query = allConnectorConnectionsQuery(flowId);
|
|
12799
13036
|
return this.connectorRequest(query.path, "connections", signal, query.decode, fresh);
|
|
@@ -13025,6 +13262,30 @@ var ControlClient = class {
|
|
|
13025
13262
|
method: "POST"
|
|
13026
13263
|
}));
|
|
13027
13264
|
}
|
|
13265
|
+
async catalogResponse(query, maxAgeMs, signal, fresh = false) {
|
|
13266
|
+
if (this.catalogCache != null) return this.catalogCache.read(query, (etag) => this.readCatalog({
|
|
13267
|
+
path: query.path,
|
|
13268
|
+
decode: jsonValue
|
|
13269
|
+
}, etag), maxAgeMs, signal, fresh);
|
|
13270
|
+
const response = await this.readCatalog(query, null, signal);
|
|
13271
|
+
if (!response.modified) return invalidResponse();
|
|
13272
|
+
return {
|
|
13273
|
+
data: response.data,
|
|
13274
|
+
etag: response.etag
|
|
13275
|
+
};
|
|
13276
|
+
}
|
|
13277
|
+
async connectorMetadata(parameters, signal) {
|
|
13278
|
+
const query = new URLSearchParams(parameters).toString();
|
|
13279
|
+
return (await this.catalogResponse({
|
|
13280
|
+
path: `/v1/connector/action-metadata${query ? `?${query}` : ""}`,
|
|
13281
|
+
decode: (value) => {
|
|
13282
|
+
const source = record$1(value);
|
|
13283
|
+
requiredFields(source, ["actions", "version"]);
|
|
13284
|
+
if (source.version != 1 || !Array.isArray(source.actions)) return invalidResponse();
|
|
13285
|
+
return source.actions.map(connectorActionMetadata);
|
|
13286
|
+
}
|
|
13287
|
+
}, 3e4, signal)).data;
|
|
13288
|
+
}
|
|
13028
13289
|
async connectorActions(parameters, signal) {
|
|
13029
13290
|
const query = Object.entries(parameters).map(([key, value]) => `${segment(key)}=${segment(value)}`).join("&");
|
|
13030
13291
|
const suffix = query == "" ? "" : `?${query}`;
|
|
@@ -13039,6 +13300,7 @@ var ControlClient = class {
|
|
|
13039
13300
|
return decode(await this.request(path, { signal }));
|
|
13040
13301
|
}
|
|
13041
13302
|
async response(path, init, allowNotModified = false) {
|
|
13303
|
+
if (this.options.cache?.mode == "offline") throw new ApiError(503, "control.offline", "Network requests are disabled for this Control client.");
|
|
13042
13304
|
const headers = new Headers(init.headers);
|
|
13043
13305
|
if (init.body != null) headers.set("content-type", "application/json");
|
|
13044
13306
|
const response = await this.requestControl(path, {
|
|
@@ -13075,6 +13337,9 @@ function fail(message) {
|
|
|
13075
13337
|
function equal(actual, expected, message) {
|
|
13076
13338
|
if (!dequal(actual, expected)) fail(`${message}: expected ${JSON.stringify(expected)}, received ${JSON.stringify(actual)}.`);
|
|
13077
13339
|
}
|
|
13340
|
+
function oneOf(actual, expected, message) {
|
|
13341
|
+
if (!expected.some((value) => dequal(actual, value))) fail(`${message}: expected one of ${JSON.stringify(expected)}, received ${JSON.stringify(actual)}.`);
|
|
13342
|
+
}
|
|
13078
13343
|
function record(value, message) {
|
|
13079
13344
|
if (value == null || typeof value != "object" || Array.isArray(value)) fail(`${message}: expected an object.`);
|
|
13080
13345
|
return value;
|
|
@@ -14070,9 +14335,10 @@ var controlApiConformanceCases = [
|
|
|
14070
14335
|
}
|
|
14071
14336
|
return current;
|
|
14072
14337
|
};
|
|
14338
|
+
const pausedStatuses = ["running", "waiting"];
|
|
14073
14339
|
const hasWait = (value) => list(value.waits, "Waits").length > 0;
|
|
14074
14340
|
let detail = await awaitRun(run, hasWait, "Wait Run to pause");
|
|
14075
|
-
|
|
14341
|
+
oneOf(detail.status, pausedStatuses, "Wait Run status");
|
|
14076
14342
|
const waiting = record(list(detail.waits, "Waits")[0], "Active Wait");
|
|
14077
14343
|
equal(waiting.actions, ["approve", "reject"], "Wait actions");
|
|
14078
14344
|
equal(waiting.nodeId, "approval", "Wait node");
|
|
@@ -14098,7 +14364,7 @@ var controlApiConformanceCases = [
|
|
|
14098
14364
|
const approved = await json(await resolveWait("approve"), 200, "Approve Wait");
|
|
14099
14365
|
equal(approved.action, "approve", "Approved action");
|
|
14100
14366
|
equal(approved.resolutionAccepted, true, "Approved resolution");
|
|
14101
|
-
|
|
14367
|
+
oneOf(approved.status, ["running", "queued"], "Resolved Run status");
|
|
14102
14368
|
requiredString(approved.resolvedAt, "Wait resolution time");
|
|
14103
14369
|
const rejected = await json(await resolveWait("reject"), 200, "Reject resolved Wait");
|
|
14104
14370
|
equal(rejected.action, "approve", "Winning action");
|
|
@@ -14114,7 +14380,7 @@ var controlApiConformanceCases = [
|
|
|
14114
14380
|
equal(list(completedEvents.events, "Completed events").filter((value) => record(value, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
|
|
14115
14381
|
const canceled = await create("wait-run-cancel", "Create cancelable Wait Run");
|
|
14116
14382
|
const canceledRunId = requiredString(canceled.runId, "Cancelable Wait Run id");
|
|
14117
|
-
|
|
14383
|
+
oneOf((await awaitRun(canceled, hasWait, "Wait cancelable Run to pause")).status, pausedStatuses, "Cancelable Wait status");
|
|
14118
14384
|
equal((await json(await request(harness, `/v1/runs/${canceledRunId}/cancel`, {
|
|
14119
14385
|
body: JSON.stringify({ version: 1 }),
|
|
14120
14386
|
method: "POST"
|