flowlint 0.8.2 → 0.8.3

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 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
- let isHandled = false;
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
  }
@@ -24249,7 +24251,7 @@ var initCommand = new Command("init").description("Initialize FlowLint configura
24249
24251
  // src/cli.ts
24250
24252
  var import_meta = {};
24251
24253
  var program2 = new Command();
24252
- program2.name("flowlint").description("Static analysis tool for n8n workflows").version("0.8.2");
24254
+ program2.name("flowlint").description("Static analysis tool for n8n workflows").version("0.8.3");
24253
24255
  program2.addCommand(scanCommand);
24254
24256
  program2.addCommand(initCommand);
24255
24257
  if (import_meta.url === `file://${process.argv[1]}`) {