cloudburn 0.9.9 → 0.9.11

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.
Files changed (2) hide show
  1. package/dist/cli.js +48 -31
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -557,6 +557,15 @@ var scanColumns = [
557
557
  { key: "column", header: "Column" },
558
558
  { key: "message", header: "Message" }
559
559
  ];
560
+ var diagnosticColumns = [
561
+ { key: "provider", header: "Provider" },
562
+ { key: "status", header: "Status" },
563
+ { key: "ruleId", header: "RuleId" },
564
+ { key: "source", header: "Source" },
565
+ { key: "service", header: "Service" },
566
+ { key: "region", header: "Region" },
567
+ { key: "message", header: "Message" }
568
+ ];
560
569
  var ruleListColumns = [
561
570
  { key: "ruleId", header: "RuleId" },
562
571
  { key: "provider", header: "Provider" },
@@ -637,8 +646,22 @@ ${regionsTable}`;
637
646
  case "rule-list":
638
647
  return renderRuleTable(response.rules, response.emptyMessage);
639
648
  case "scan-result": {
640
- const rows = projectScanRows(response.result);
641
- return rows.length === 0 ? "No findings." : renderAsciiTable(rows, scanColumns);
649
+ const findingRows = projectFindingRows(response.result);
650
+ const diagnosticRows = projectDiagnosticRows(response.result);
651
+ if (findingRows.length === 0 && diagnosticRows.length === 0) {
652
+ return "No findings.";
653
+ }
654
+ if (findingRows.length === 0) {
655
+ return `Diagnostics
656
+ ${renderAsciiTable(diagnosticRows, diagnosticColumns)}`;
657
+ }
658
+ if (diagnosticRows.length === 0) {
659
+ return renderAsciiTable(findingRows, scanColumns);
660
+ }
661
+ return `${renderAsciiTable(findingRows, scanColumns)}
662
+
663
+ Diagnostics
664
+ ${renderAsciiTable(diagnosticRows, diagnosticColumns)}`;
642
665
  }
643
666
  case "status":
644
667
  return renderAsciiTable(
@@ -655,34 +678,28 @@ ${regionsTable}`;
655
678
  );
656
679
  }
657
680
  };
658
- var projectScanRows = (result) => [
659
- ...flattenScanResult(result).map(({ finding, message, provider, ruleId, service, source }) => ({
660
- accountId: finding.accountId ?? "",
661
- message,
662
- path: finding.location?.path ?? "",
663
- provider,
664
- region: finding.region ?? "",
665
- resourceId: finding.resourceId,
666
- ruleId,
667
- service,
668
- source,
669
- column: finding.location?.column ?? "",
670
- line: finding.location?.line ?? ""
671
- })),
672
- ...getScanDiagnostics(result).map((diagnostic) => ({
673
- accountId: "",
674
- column: "",
675
- line: "",
676
- message: diagnostic.message,
677
- path: "",
678
- provider: diagnostic.provider,
679
- region: diagnostic.region ?? "",
680
- resourceId: "",
681
- ruleId: "",
682
- service: diagnostic.service,
683
- source: diagnostic.source
684
- }))
685
- ];
681
+ var projectFindingRows = (result) => flattenScanResult(result).map(({ finding, message, provider, ruleId, service, source }) => ({
682
+ accountId: finding.accountId ?? "",
683
+ message,
684
+ path: finding.location?.path ?? "",
685
+ provider,
686
+ region: finding.region ?? "",
687
+ resourceId: finding.resourceId,
688
+ ruleId,
689
+ service,
690
+ source,
691
+ column: finding.location?.column ?? "",
692
+ line: finding.location?.line ?? ""
693
+ }));
694
+ var projectDiagnosticRows = (result) => getScanDiagnostics(result).map((diagnostic) => ({
695
+ message: diagnostic.message,
696
+ provider: diagnostic.provider,
697
+ region: diagnostic.region ?? "",
698
+ ruleId: diagnostic.ruleId ?? "",
699
+ service: diagnostic.service,
700
+ source: diagnostic.source,
701
+ status: diagnostic.status
702
+ }));
686
703
  var inferColumns = (rows) => {
687
704
  const keys = Array.from(new Set(rows.flatMap((row) => Object.keys(row)))).sort(
688
705
  (left, right) => left.localeCompare(right)
@@ -1474,7 +1491,7 @@ var isCliEntrypoint = (moduleUrl, argvEntry = process.argv[1]) => {
1474
1491
  };
1475
1492
  var createProgram = () => {
1476
1493
  const program = createCliCommand();
1477
- program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.9.9").option("--debug", "Write execution trace messages to stderr").option("--format <format>", OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat);
1494
+ program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.9.11").option("--debug", "Write execution trace messages to stderr").option("--format <format>", OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat);
1478
1495
  configureCliHelp(program);
1479
1496
  registerCompletionCommand(program);
1480
1497
  registerConfigCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudburn",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
4
4
  "description": "Cloudburn CLI for cloud cost optimization",
5
5
  "homepage": "https://cloudburn.io/docs",
6
6
  "bugs": {
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "commander": "^13.1.0",
23
- "@cloudburn/sdk": "0.21.1"
23
+ "@cloudburn/sdk": "0.22.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@biomejs/biome": "^2.4.6",