@particle-academy/fancy-flow 0.78.0 → 0.79.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/{chunk-XO4ODEY2.js → chunk-I5EPWHNM.js} +3 -3
- package/dist/{chunk-XO4ODEY2.js.map → chunk-I5EPWHNM.js.map} +1 -1
- package/dist/{chunk-BBFHGAEN.js → chunk-J66LOLJR.js} +4 -4
- package/dist/{chunk-BBFHGAEN.js.map → chunk-J66LOLJR.js.map} +1 -1
- package/dist/{chunk-3EDB6ELL.js → chunk-KMONOPAK.js} +3 -3
- package/dist/{chunk-3EDB6ELL.js.map → chunk-KMONOPAK.js.map} +1 -1
- package/dist/{chunk-GPFIJR2K.js → chunk-LBE4L3DS.js} +4 -4
- package/dist/{chunk-GPFIJR2K.js.map → chunk-LBE4L3DS.js.map} +1 -1
- package/dist/{chunk-J5YUYDMK.js → chunk-OZHBAXMA.js} +21 -4
- package/dist/chunk-OZHBAXMA.js.map +1 -0
- package/dist/{chunk-S4MOUOG4.js → chunk-QMJVUT7C.js} +3 -3
- package/dist/{chunk-S4MOUOG4.js.map → chunk-QMJVUT7C.js.map} +1 -1
- package/dist/{chunk-4GNDRRJ3.js → chunk-R4G7SPLD.js} +3 -3
- package/dist/{chunk-4GNDRRJ3.js.map → chunk-R4G7SPLD.js.map} +1 -1
- package/dist/durable.cjs +19 -2
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +19 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -4
- package/dist/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/registry.cjs +19 -2
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/runtime.cjs +19 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +19 -2
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +19 -2
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +19 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-J5YUYDMK.js.map +0 -1
package/dist/durable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getNodeKind, runFlow, resolveKindId, kindIds, pauseForHuman, truthy, RunIdentity, decodePause, undeliveredEdgeWarnings } from './chunk-
|
|
1
|
+
import { getNodeKind, runFlow, resolveKindId, kindIds, pauseForHuman, truthy, RunIdentity, decodePause, undeliveredEdgeWarnings } from './chunk-OZHBAXMA.js';
|
|
2
2
|
import './chunk-2QXKDLGT.js';
|
|
3
3
|
|
|
4
4
|
// src/durable/state.ts
|
package/dist/engine.cjs
CHANGED
|
@@ -439,6 +439,7 @@ var branchExecutor = (ctx) => {
|
|
|
439
439
|
const inputs = ctx.inputs;
|
|
440
440
|
let taken;
|
|
441
441
|
const raw = config.condition;
|
|
442
|
+
validateRoutingExpression(ctx, raw, "branch", "condition");
|
|
442
443
|
if (typeof raw === "string" && raw.trim() !== "") {
|
|
443
444
|
taken = truthy(resolve(raw, inputs));
|
|
444
445
|
warnIfUnresolved(ctx, raw, taken ? "true" : "false");
|
|
@@ -608,6 +609,7 @@ var switchCaseExecutor = (ctx) => {
|
|
|
608
609
|
const config = configOf(ctx.node);
|
|
609
610
|
const inputs = ctx.inputs;
|
|
610
611
|
const expression = config.value;
|
|
612
|
+
validateRoutingExpression(ctx, expression, "switch_case", "value");
|
|
611
613
|
const value = text(resolve(expression, inputs));
|
|
612
614
|
const cases = config.cases ?? {};
|
|
613
615
|
const matched = Object.prototype.hasOwnProperty.call(cases, value);
|
|
@@ -615,6 +617,21 @@ var switchCaseExecutor = (ctx) => {
|
|
|
615
617
|
warnIfUnresolved(ctx, expression, port, "value");
|
|
616
618
|
return { __port: port, value: inputs.in ?? inputs };
|
|
617
619
|
};
|
|
620
|
+
function validateRoutingExpression(ctx, value, kind, field) {
|
|
621
|
+
if (typeof value !== "string" || value.trim() === "") return;
|
|
622
|
+
const bare = value.trim();
|
|
623
|
+
const subject = `${kind} "${ctx.node.id}" ${field} "${bare}"`;
|
|
624
|
+
if (!value.includes("{{")) {
|
|
625
|
+
ctx.abort(`${subject} is not an expression -- wrap it: {{ ${bare} }}`);
|
|
626
|
+
}
|
|
627
|
+
let open = 0;
|
|
628
|
+
for (const [delimiter] of value.matchAll(/\{\{|\}\}/g)) {
|
|
629
|
+
open = delimiter === "{{" ? open + 1 : Math.max(0, open - 1);
|
|
630
|
+
}
|
|
631
|
+
if (open > 0) {
|
|
632
|
+
ctx.abort(`${subject} has an unclosed expression -- close every {{ with }}`);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
618
635
|
|
|
619
636
|
// src/registry/terminal-nodes.ts
|
|
620
637
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -1106,7 +1123,7 @@ var KINDS = [
|
|
|
1106
1123
|
key: "condition",
|
|
1107
1124
|
label: "Raw expression (advanced)",
|
|
1108
1125
|
example: "{{ $json.active && $json.score > 10 }}",
|
|
1109
|
-
description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set."
|
|
1126
|
+
description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set. String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run."
|
|
1110
1127
|
}
|
|
1111
1128
|
]
|
|
1112
1129
|
},
|
|
@@ -1126,7 +1143,7 @@ var KINDS = [
|
|
|
1126
1143
|
// moves the ports on the canvas and the ports the runtime activates.
|
|
1127
1144
|
outputs: (config) => casePorts(config?.cases),
|
|
1128
1145
|
configSchema: [
|
|
1129
|
-
{ type: "expression", key: "value", label: "Switch on", example: "{{ $json.kind }}", required: true },
|
|
1146
|
+
{ type: "expression", key: "value", label: "Switch on", description: "String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run.", example: "{{ $json.kind }}", required: true },
|
|
1130
1147
|
{
|
|
1131
1148
|
type: "keyvalue",
|
|
1132
1149
|
key: "cases",
|