flowlint 0.8.2 → 0.8.4
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/cli.js +30 -27
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -23532,6 +23532,30 @@ var metadata7 = {
|
|
|
23532
23532
|
description: "Ensures critical paths include logging or alerting steps.",
|
|
23533
23533
|
details: "For example, a failed payment processing branch should trigger an alert for monitoring."
|
|
23534
23534
|
};
|
|
23535
|
+
function isPathHandled(graph, startNodeId) {
|
|
23536
|
+
const queue = [startNodeId];
|
|
23537
|
+
const visited = /* @__PURE__ */ new Set([startNodeId]);
|
|
23538
|
+
let head = 0;
|
|
23539
|
+
while (head < queue.length) {
|
|
23540
|
+
const currentId = queue[head++];
|
|
23541
|
+
const currentNode = graph.nodes.find((n) => n.id === currentId);
|
|
23542
|
+
if (!currentNode) continue;
|
|
23543
|
+
if (isNotificationNode(currentNode.type) || isErrorHandlerNode(currentNode.type, currentNode.name)) {
|
|
23544
|
+
return true;
|
|
23545
|
+
}
|
|
23546
|
+
if (isRejoinNode(graph, currentId)) {
|
|
23547
|
+
continue;
|
|
23548
|
+
}
|
|
23549
|
+
const outgoing = graph.edges.filter((e) => e.from === currentId);
|
|
23550
|
+
for (const outEdge of outgoing) {
|
|
23551
|
+
if (!visited.has(outEdge.to)) {
|
|
23552
|
+
visited.add(outEdge.to);
|
|
23553
|
+
queue.push(outEdge.to);
|
|
23554
|
+
}
|
|
23555
|
+
}
|
|
23556
|
+
}
|
|
23557
|
+
return false;
|
|
23558
|
+
}
|
|
23535
23559
|
function r7AlertLogEnforcement(graph, ctx) {
|
|
23536
23560
|
const cfg = ctx.cfg.rules.alert_log_enforcement;
|
|
23537
23561
|
if (!cfg?.enabled) return [];
|
|
@@ -23539,29 +23563,7 @@ function r7AlertLogEnforcement(graph, ctx) {
|
|
|
23539
23563
|
const errorEdges = graph.edges.filter((edge) => edge.on === "error");
|
|
23540
23564
|
for (const edge of errorEdges) {
|
|
23541
23565
|
const fromNode = graph.nodes.find((n) => n.id === edge.from);
|
|
23542
|
-
|
|
23543
|
-
const queue = [edge.to];
|
|
23544
|
-
const visited = /* @__PURE__ */ new Set([edge.to]);
|
|
23545
|
-
let head = 0;
|
|
23546
|
-
while (head < queue.length) {
|
|
23547
|
-
const currentId = queue[head++];
|
|
23548
|
-
const currentNode = graph.nodes.find((n) => n.id === currentId);
|
|
23549
|
-
if (isNotificationNode(currentNode.type) || isErrorHandlerNode(currentNode.type, currentNode.name)) {
|
|
23550
|
-
isHandled = true;
|
|
23551
|
-
break;
|
|
23552
|
-
}
|
|
23553
|
-
if (isRejoinNode(graph, currentId)) {
|
|
23554
|
-
continue;
|
|
23555
|
-
}
|
|
23556
|
-
const outgoing = graph.edges.filter((e) => e.from === currentId);
|
|
23557
|
-
for (const outEdge of outgoing) {
|
|
23558
|
-
if (!visited.has(outEdge.to)) {
|
|
23559
|
-
visited.add(outEdge.to);
|
|
23560
|
-
queue.push(outEdge.to);
|
|
23561
|
-
}
|
|
23562
|
-
}
|
|
23563
|
-
}
|
|
23564
|
-
if (!isHandled) {
|
|
23566
|
+
if (!isPathHandled(graph, edge.to)) {
|
|
23565
23567
|
findings.push({
|
|
23566
23568
|
rule: metadata7.id,
|
|
23567
23569
|
severity: metadata7.severity,
|
|
@@ -23772,7 +23774,7 @@ var r14RetryAfterCompliance = createNodeRule(metadata14.id, metadata14.name, (no
|
|
|
23772
23774
|
const waitBetweenTries = node.flags?.waitBetweenTries;
|
|
23773
23775
|
if (waitBetweenTries !== void 0 && waitBetweenTries !== null) {
|
|
23774
23776
|
if (typeof waitBetweenTries === "number") return null;
|
|
23775
|
-
if (typeof waitBetweenTries === "string" && !isNaN(Number(waitBetweenTries)) && !waitBetweenTries.includes("{{")) {
|
|
23777
|
+
if (typeof waitBetweenTries === "string" && !Number.isNaN(Number(waitBetweenTries)) && !waitBetweenTries.includes("{{")) {
|
|
23776
23778
|
return null;
|
|
23777
23779
|
}
|
|
23778
23780
|
}
|
|
@@ -23911,9 +23913,10 @@ function loadConfig(configPath) {
|
|
|
23911
23913
|
}
|
|
23912
23914
|
return loadConfigFromCwd();
|
|
23913
23915
|
}
|
|
23916
|
+
var fsOverride = null;
|
|
23914
23917
|
function loadConfigFromFile(configPath) {
|
|
23915
23918
|
try {
|
|
23916
|
-
const fs3 = __require("fs");
|
|
23919
|
+
const fs3 = fsOverride || __require("fs");
|
|
23917
23920
|
if (!fs3.existsSync(configPath)) {
|
|
23918
23921
|
return defaultConfig;
|
|
23919
23922
|
}
|
|
@@ -23925,7 +23928,7 @@ function loadConfigFromFile(configPath) {
|
|
|
23925
23928
|
}
|
|
23926
23929
|
function loadConfigFromCwd() {
|
|
23927
23930
|
try {
|
|
23928
|
-
const fs3 = __require("fs");
|
|
23931
|
+
const fs3 = fsOverride || __require("fs");
|
|
23929
23932
|
const path4 = __require("path");
|
|
23930
23933
|
const candidates = [".flowlint.yml", ".flowlint.yaml", "flowlint.config.yml"];
|
|
23931
23934
|
const cwd = process.cwd();
|
|
@@ -24249,7 +24252,7 @@ var initCommand = new Command("init").description("Initialize FlowLint configura
|
|
|
24249
24252
|
// src/cli.ts
|
|
24250
24253
|
var import_meta = {};
|
|
24251
24254
|
var program2 = new Command();
|
|
24252
|
-
program2.name("flowlint").description("Static analysis tool for n8n workflows").version("0.8.
|
|
24255
|
+
program2.name("flowlint").description("Static analysis tool for n8n workflows").version("0.8.4");
|
|
24253
24256
|
program2.addCommand(scanCommand);
|
|
24254
24257
|
program2.addCommand(initCommand);
|
|
24255
24258
|
if (import_meta.url === `file://${process.argv[1]}`) {
|