@teamkeel/functions-runtime 0.416.2 → 0.418.0
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/index.cjs +36 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -18
- package/dist/index.d.ts +90 -18
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2335,9 +2335,11 @@ var import_json_rpc_26 = require("json-rpc-2.0");
|
|
|
2335
2335
|
var opentelemetry6 = __toESM(require("@opentelemetry/api"), 1);
|
|
2336
2336
|
|
|
2337
2337
|
// src/tryExecuteFlow.js
|
|
2338
|
-
function tryExecuteFlow(db, cb) {
|
|
2338
|
+
function tryExecuteFlow(db, request, cb) {
|
|
2339
2339
|
return withDatabase(db, false, async () => {
|
|
2340
|
-
return
|
|
2340
|
+
return withAuditContext(request, async () => {
|
|
2341
|
+
return cb();
|
|
2342
|
+
});
|
|
2341
2343
|
});
|
|
2342
2344
|
}
|
|
2343
2345
|
__name(tryExecuteFlow, "tryExecuteFlow");
|
|
@@ -2911,6 +2913,33 @@ var NonRetriableError = class extends Error {
|
|
|
2911
2913
|
}
|
|
2912
2914
|
};
|
|
2913
2915
|
|
|
2916
|
+
// src/flows/ui/elements/interactive/bulkScan.ts
|
|
2917
|
+
var bulkScan = /* @__PURE__ */ __name((name, options) => {
|
|
2918
|
+
return {
|
|
2919
|
+
__type: "input",
|
|
2920
|
+
uiConfig: {
|
|
2921
|
+
__type: "ui.interactive.bulkScan",
|
|
2922
|
+
name,
|
|
2923
|
+
title: options?.title ?? void 0,
|
|
2924
|
+
description: options?.description ?? void 0,
|
|
2925
|
+
unit: options?.unit ?? void 0,
|
|
2926
|
+
max: options?.max ?? void 0,
|
|
2927
|
+
min: options?.min ?? void 0,
|
|
2928
|
+
duplicateHandling: options?.duplicateHandling ?? "none"
|
|
2929
|
+
},
|
|
2930
|
+
validate: /* @__PURE__ */ __name(async (data) => {
|
|
2931
|
+
if (!("scans" in data)) {
|
|
2932
|
+
return "Missing scans in response";
|
|
2933
|
+
}
|
|
2934
|
+
if (!Array.isArray(data.scans)) {
|
|
2935
|
+
return "Scans must be an array";
|
|
2936
|
+
}
|
|
2937
|
+
return options?.validate?.(data) ?? true;
|
|
2938
|
+
}, "validate"),
|
|
2939
|
+
getData: /* @__PURE__ */ __name((x) => x, "getData")
|
|
2940
|
+
};
|
|
2941
|
+
}, "bulkScan");
|
|
2942
|
+
|
|
2914
2943
|
// src/flows/index.ts
|
|
2915
2944
|
var STEP_STATUS = /* @__PURE__ */ ((STEP_STATUS2) => {
|
|
2916
2945
|
STEP_STATUS2["NEW"] = "NEW";
|
|
@@ -3149,7 +3178,8 @@ function createFlowContext(runId, data, action, spanId, ctx) {
|
|
|
3149
3178
|
iterator,
|
|
3150
3179
|
interactive: {
|
|
3151
3180
|
print,
|
|
3152
|
-
pickList
|
|
3181
|
+
pickList,
|
|
3182
|
+
bulkScan
|
|
3153
3183
|
}
|
|
3154
3184
|
}
|
|
3155
3185
|
};
|
|
@@ -3183,7 +3213,8 @@ async function complete(options) {
|
|
|
3183
3213
|
title: options.title,
|
|
3184
3214
|
description: options.description,
|
|
3185
3215
|
content: contentUiConfig || [],
|
|
3186
|
-
autoClose: options.autoClose
|
|
3216
|
+
autoClose: options.autoClose,
|
|
3217
|
+
allowRestart: typeof options.allowRestart === "boolean" ? options.allowRestart ? { inputs: void 0 } : void 0 : options.allowRestart
|
|
3187
3218
|
};
|
|
3188
3219
|
}
|
|
3189
3220
|
__name(complete, "complete");
|
|
@@ -3247,7 +3278,7 @@ async function handleFlow(request, config) {
|
|
|
3247
3278
|
const inputs = parseInputs(request.meta?.inputs);
|
|
3248
3279
|
let response = void 0;
|
|
3249
3280
|
try {
|
|
3250
|
-
response = await tryExecuteFlow(db, async () => {
|
|
3281
|
+
response = await tryExecuteFlow(db, request, async () => {
|
|
3251
3282
|
return flowFunction(ctx, inputs);
|
|
3252
3283
|
});
|
|
3253
3284
|
} catch (e) {
|