triangulum 0.12.2-x86_64-linux-gnu → 0.13.0-x86_64-linux-gnu
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.
- checksums.yaml +4 -4
- data/lib/triangulum/js/single-validation.js +73 -55
- data/lib/triangulum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 73f2b977efccea1e6c469cd85b713fd19b8f70e635a2b6a1185d597b7ca48822
|
|
4
|
+
data.tar.gz: 3a387df2bc0e79a4b1f46b75d8c9e475dd8aaab6d0a9046d55aa8ef74b3c64ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca96c055a6c3284bab389def9b9c7fc6c7e8b82954778955b562046dcea23879fde2391679d76f1669d599edc83fd094e21ea77a85c54b78de892718f69cd5ba
|
|
7
|
+
data.tar.gz: 1283a7a6cd6054bf222fd06d2d4d56db6b650c9fadc155e3dc9e196907189451b13ff5b61db5c78212250ffe3a872b04a5f9fb09d218687714e90a1b08c63677
|
|
@@ -174493,71 +174493,65 @@ ${i3}`;
|
|
|
174493
174493
|
}
|
|
174494
174494
|
var T2 = (e6) => e6.replace(/[^a-zA-Z0-9]/g, "_");
|
|
174495
174495
|
function E2(e6, t3, n3, r3 = false) {
|
|
174496
|
-
let i3 = e6?.nodes?.nodes || [], a3 = new Map(t3?.map((e7) => [e7.identifier, e7])), o4 = /* @__PURE__ */ new Set, s4 = (
|
|
174497
|
-
let
|
|
174498
|
-
if (!
|
|
174496
|
+
let i3 = e6?.nodes?.nodes || [], a3 = new Map(t3?.map((e7) => [e7.identifier, e7])), o4 = /* @__PURE__ */ new Set, s4 = (t4, n4, a4) => {
|
|
174497
|
+
let o5 = i3.find((e7) => e7?.id === t4);
|
|
174498
|
+
if (!o5 || !o5.functionDefinition?.identifier)
|
|
174499
174499
|
return "undefined";
|
|
174500
|
-
let
|
|
174501
|
-
let
|
|
174502
|
-
if (!
|
|
174503
|
-
return r3 ? `/* @pos ${
|
|
174504
|
-
if (
|
|
174505
|
-
let
|
|
174506
|
-
|
|
174507
|
-
|
|
174508
|
-
|
|
174509
|
-
|
|
174510
|
-
|
|
174511
|
-
|
|
174512
|
-
|
|
174513
|
-
|
|
174514
|
-
|
|
174515
|
-
return t4 !== undefined && n4 !== undefined ? `${c5}` : c5;
|
|
174516
|
-
}, c4 = (e7, t4 = "") => {
|
|
174517
|
-
if (o4.has(e7))
|
|
174500
|
+
let c5 = (o5.parameters?.nodes || []).map((n5, i4) => {
|
|
174501
|
+
let a5 = n5.value;
|
|
174502
|
+
if (!a5)
|
|
174503
|
+
return r3 ? `/* @pos ${t4} ${i4} */ {}` : `/* @pos ${t4} ${i4} */ undefined`;
|
|
174504
|
+
if (a5.__typename === "ReferenceValue") {
|
|
174505
|
+
let n6 = a5, r4 = typeof n6.inputIndex == "number" ? `p_${T2(n6.nodeFunctionId ?? "undefined")}_${n6.parameterIndex}[${n6.inputIndex}]` : n6.nodeFunctionId ? `node_${T2(n6.nodeFunctionId)}` : `flow_${T2(e6?.id ?? "undefined")}`;
|
|
174506
|
+
return n6.referencePath?.forEach((e7) => {
|
|
174507
|
+
r4 += `?.${e7.path}`;
|
|
174508
|
+
}), `/* @pos ${t4} ${i4} */ ${r4}`;
|
|
174509
|
+
}
|
|
174510
|
+
return a5.__typename === "LiteralValue" ? `/* @pos ${t4} ${i4} */ ${y2(a5?.value)}` : a5.__typename === "NodeFunctionIdWrapper" ? s4(a5.id, t4, i4) : r3 ? `/* @pos ${t4} ${i4} */ ({} as any)` : `/* @pos ${t4} ${i4} */ undefined`;
|
|
174511
|
+
}).join(", "), l5 = `${`/* @pos ${t4} null */ fn_${o5.functionDefinition.identifier.replace(/::/g, "_")}`}(${c5})`;
|
|
174512
|
+
return n4 !== undefined && a4 !== undefined ? `${l5}` : l5;
|
|
174513
|
+
}, c4 = (t4, l5 = "") => {
|
|
174514
|
+
if (o4.has(t4))
|
|
174518
174515
|
return "";
|
|
174519
|
-
let
|
|
174520
|
-
if (!
|
|
174516
|
+
let u5 = i3.find((e7) => e7?.id === t4);
|
|
174517
|
+
if (!u5 || !u5.functionDefinition)
|
|
174521
174518
|
return "";
|
|
174522
|
-
o4.add(
|
|
174523
|
-
let
|
|
174524
|
-
if (!
|
|
174525
|
-
return `${
|
|
174519
|
+
o4.add(t4);
|
|
174520
|
+
let d5 = a3.get(u5.functionDefinition.identifier);
|
|
174521
|
+
if (!d5)
|
|
174522
|
+
return `${l5}// Error: Function ${u5.functionDefinition.identifier} not found
|
|
174526
174523
|
`;
|
|
174527
|
-
let
|
|
174528
|
-
r3 || (
|
|
174529
|
-
let
|
|
174524
|
+
let f5 = { parameters: [] };
|
|
174525
|
+
r3 || (f5 = g3(d5));
|
|
174526
|
+
let p5 = (u5.parameters?.nodes || []).map((i4, a4) => {
|
|
174530
174527
|
let o5 = i4.value;
|
|
174531
174528
|
if (!o5)
|
|
174532
|
-
return r3 ? `/* @pos ${
|
|
174529
|
+
return r3 ? `/* @pos ${t4} ${a4} */ {}` : `/* @pos ${t4} ${a4} */ undefined`;
|
|
174533
174530
|
if (o5.__typename === "ReferenceValue") {
|
|
174534
|
-
let
|
|
174535
|
-
|
|
174536
|
-
|
|
174537
|
-
|
|
174538
|
-
return t5.referencePath?.forEach((e8) => {
|
|
174539
|
-
n4 += `?.${e8.path}`;
|
|
174540
|
-
}), `/* @pos ${e7} ${a4} */ ${n4}`;
|
|
174531
|
+
let n4 = o5, r4 = typeof n4.inputIndex == "number" ? `p_${T2(n4.nodeFunctionId ?? "undefined")}_${n4.parameterIndex}[${n4.inputIndex}]` : n4.nodeFunctionId ? `node_${T2(n4.nodeFunctionId)}` : `flow_${T2(e6?.id ?? "undefined")}`;
|
|
174532
|
+
return n4.referencePath?.forEach((e7) => {
|
|
174533
|
+
r4 += `?.${e7.path}`;
|
|
174534
|
+
}), `/* @pos ${t4} ${a4} */ ${r4}`;
|
|
174541
174535
|
}
|
|
174542
174536
|
if (o5.__typename === "LiteralValue")
|
|
174543
|
-
return `/* @pos ${
|
|
174537
|
+
return `/* @pos ${t4} ${a4} */ ${y2(o5?.value)}`;
|
|
174544
174538
|
if (o5.__typename === "NodeFunctionIdWrapper") {
|
|
174545
|
-
let
|
|
174539
|
+
let e7 = o5;
|
|
174546
174540
|
if (r3)
|
|
174547
|
-
return `/* @pos ${
|
|
174548
|
-
${c4(
|
|
174541
|
+
return `/* @pos ${t4} ${a4} */ (...${`p_${T2(t4)}_${a4}`}) => {
|
|
174542
|
+
${c4(e7.id, l5 + " ")}${l5}}`;
|
|
174549
174543
|
{
|
|
174550
|
-
let r4 =
|
|
174551
|
-
return r4 && h3(r4, n3)[0].variant === m3.NODE ? `/* @pos ${
|
|
174552
|
-
${c4(
|
|
174544
|
+
let r4 = f5.parameters[a4];
|
|
174545
|
+
return r4 && h3(r4, n3)[0].variant === m3.NODE ? `/* @pos ${t4} ${a4} */ (...${`p_${T2(t4)}_${a4}`}) => {
|
|
174546
|
+
${c4(e7.id, l5 + " ")}${l5}}` : `/* @pos ${t4} ${a4} */ ${s4(e7.id, t4, a4)}`;
|
|
174553
174547
|
}
|
|
174554
174548
|
}
|
|
174555
|
-
return r3 ? `/* @pos ${
|
|
174556
|
-
}).join(", "),
|
|
174557
|
-
|
|
174558
|
-
let
|
|
174549
|
+
return r3 ? `/* @pos ${t4} ${a4} */ {}` : `/* @pos ${t4} ${a4} */ undefined`;
|
|
174550
|
+
}).join(", "), _3 = `node_${T2(u5.id)}`, v3 = `fn_${u5?.functionDefinition?.identifier?.replace(/::/g, "_")}`;
|
|
174551
|
+
p5.includes("undefined");
|
|
174552
|
+
let b3 = `${l5}${u5.functionDefinition.identifier === "std::control::return" ? "return " : `const ${_3} = `}/* @pos ${t4} null */ ${v3}(${p5}) ;
|
|
174559
174553
|
`;
|
|
174560
|
-
return
|
|
174554
|
+
return u5.nextNodeId && (b3 += c4(u5.nextNodeId, l5)), b3;
|
|
174561
174555
|
}, l4 = w2(n3), u4 = `declare function flow${e6?.signature ?? "(): void"}`, d4 = t3?.map((e7) => `declare function fn_${e7.identifier?.replace(/::/g, "_")}${e7.signature}`).join(`
|
|
174562
174556
|
`), f4 = new Set(i3.map((e7) => e7?.nextNodeId).filter((e7) => !!e7)), p4 = /* @__PURE__ */ new Set;
|
|
174563
174557
|
return i3.forEach((e7) => e7?.parameters?.nodes?.forEach((e8) => {
|
|
@@ -174570,30 +174564,54 @@ ${c4(i5.id, t4 + " ")}${t4}}` : `/* @pos ${e7} ${a4} */ ${s4(i5.id, e7, a4)}`
|
|
|
174570
174564
|
${d4}
|
|
174571
174565
|
|
|
174572
174566
|
(() =>
|
|
174573
|
-
${e6 ? `const flow_${T2(e6.id ?? "")} = flow(${e6.settings?.nodes?.map((e7, t4) => `/* @pos
|
|
174567
|
+
${e6 ? `const flow_${T2(e6.id ?? "")} = /* @pos null null */ flow(${e6.settings?.nodes?.map((e7, t4) => `/* @pos null ${t4} */ ${y2(e7?.value)}`).join(", ") ?? ""});` : ""}
|
|
174574
174568
|
${i3.filter((e7) => e7?.id && !f4.has(e7.id) && !p4.has(e7.id)).map((e7) => c4(e7.id)).join(`
|
|
174575
174569
|
`)}
|
|
174576
174570
|
)();
|
|
174577
174571
|
`;
|
|
174578
174572
|
}
|
|
174579
174573
|
var I2 = (e6, n3, r3) => {
|
|
174574
|
+
if (!e6?.startingNodeId)
|
|
174575
|
+
return {
|
|
174576
|
+
isValid: false,
|
|
174577
|
+
returnType: "void",
|
|
174578
|
+
diagnostics: [{
|
|
174579
|
+
nodeId: null,
|
|
174580
|
+
parameterIndex: null,
|
|
174581
|
+
code: 0,
|
|
174582
|
+
message: "You need to provide a starting node to be able to execute this flow.",
|
|
174583
|
+
severity: "error"
|
|
174584
|
+
}]
|
|
174585
|
+
};
|
|
174586
|
+
if (!e6.nodes?.nodes?.find((t3) => t3?.id == e6.startingNodeId))
|
|
174587
|
+
return {
|
|
174588
|
+
isValid: false,
|
|
174589
|
+
returnType: "void",
|
|
174590
|
+
diagnostics: [{
|
|
174591
|
+
nodeId: null,
|
|
174592
|
+
parameterIndex: null,
|
|
174593
|
+
code: 0,
|
|
174594
|
+
message: "The starting node is not linked within the flow. Please make sure the starting node is connected to the rest of the flow.",
|
|
174595
|
+
severity: "error"
|
|
174596
|
+
}]
|
|
174597
|
+
};
|
|
174580
174598
|
let i3 = E2(e6, n3, r3), a3 = "index.ts", o4 = S2(a3, i3), s4 = o4.getSourceFile(a3), c4 = o4.languageService.getProgram().getSemanticDiagnostics(s4).map((e7) => {
|
|
174581
174599
|
let n4 = import_typescript.flattenDiagnosticMessageText(e7.messageText, `
|
|
174582
|
-
`), r4, i4;
|
|
174600
|
+
`), r4, i4 = null;
|
|
174583
174601
|
if (e7.start !== undefined) {
|
|
174584
|
-
let t3 = s4.getFullText(), n5 = Math.max(0, e7.start - 300), a4 = Math.min(t3.length, e7.start), o5 = t3.substring(n5, a4), c5 = /\/\* @pos ([^ ]+) (\d
|
|
174602
|
+
let t3 = s4.getFullText(), n5 = Math.max(0, e7.start - 300), a4 = Math.min(t3.length, e7.start), o5 = t3.substring(n5, a4), c5 = /\/\* @pos ([^ ]+) (\d+|null) \*\//g, l4, u4 = null, d4 = -1;
|
|
174585
174603
|
for (;(l4 = c5.exec(o5)) !== null; ) {
|
|
174586
174604
|
let t4 = n5 + l4.index + l4[0].length;
|
|
174587
174605
|
t4 <= e7.start && t4 > d4 && (d4 = t4, u4 = l4);
|
|
174588
174606
|
}
|
|
174589
|
-
u4 && (r4 = u4[1] === "
|
|
174607
|
+
u4 && (r4 = u4[1] === "null" ? null : u4[1], i4 = parseInt(u4[2], 10));
|
|
174590
174608
|
}
|
|
174591
174609
|
return {
|
|
174592
174610
|
message: n4,
|
|
174593
174611
|
code: e7.code,
|
|
174594
174612
|
severity: "error",
|
|
174595
174613
|
nodeId: r4,
|
|
174596
|
-
parameterIndex: i4
|
|
174614
|
+
parameterIndex: typeof i4 == "number" && Number.isSafeInteger(i4) ? i4 : null
|
|
174597
174615
|
};
|
|
174598
174616
|
}).filter((e7) => e7 !== null);
|
|
174599
174617
|
return {
|
data/lib/triangulum/version.rb
CHANGED