@dataparade/cli 0.0.29 → 0.0.31

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 (24) hide show
  1. package/dist/package.json +3 -3
  2. package/dist/src/ai-enrichment/providers/platform-proxy-provider.js +6 -1
  3. package/dist/src/cli/scan-interrupt-handlers.d.ts +34 -0
  4. package/dist/src/cli/scan-interrupt-handlers.js +105 -0
  5. package/dist/src/cli.js +99 -28
  6. package/dist/src/config/scan-env.d.ts +5 -2
  7. package/dist/src/config/scan-env.js +8 -2
  8. package/dist/src/platform-api/scan-quota-client.d.ts +3 -1
  9. package/dist/src/platform-api/scan-quota-client.js +41 -28
  10. package/dist/src/ui/scan-progress-renderer.d.ts +24 -0
  11. package/dist/src/ui/scan-progress-renderer.js +91 -0
  12. package/dist/src/ui/types.d.ts +5 -0
  13. package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.js +26 -0
  14. package/dist/tests/unit/cli/scan-interrupt-handlers.spec.d.ts +1 -0
  15. package/dist/tests/unit/cli/scan-interrupt-handlers.spec.js +154 -0
  16. package/dist/tests/unit/cli/scan-quota-flow.spec.js +2 -2
  17. package/dist/tests/unit/platform-api/read-cli-api-error-message.spec.js +2 -2
  18. package/dist/tests/unit/ui/scan-progress-renderer.spec.js +134 -0
  19. package/dist/vendor/scanner/dist/src/core/pipeline/diagram-layout/constants.d.ts +2 -0
  20. package/dist/vendor/scanner/dist/src/core/pipeline/diagram-layout/constants.js +3 -1
  21. package/dist/vendor/scanner/dist/src/core/pipeline/diagram-layout/section-packing.d.ts +9 -0
  22. package/dist/vendor/scanner/dist/src/core/pipeline/diagram-layout/section-packing.js +40 -0
  23. package/dist/vendor/scanner/dist/src/core/pipeline/graph-mapping.js +2 -0
  24. package/package.json +3 -3
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.packSectionsHorizontally = packSectionsHorizontally;
4
+ const constants_1 = require("./constants");
5
+ const section_helpers_1 = require("./section-helpers");
6
+ /**
7
+ * Section layouts start each section at a fixed `SECTION_BLOCK_WIDTH` offset,
8
+ * which leaves wide empty bands after sparse sections. Shift every section left
9
+ * so it starts `SECTION_GAP_X` after the previous one actually ends; the shape
10
+ * inside each section is unchanged.
11
+ */
12
+ function packSectionsHorizontally(nodes, componentsById, sectionIds) {
13
+ const nodesBySection = new Map();
14
+ for (const node of nodes) {
15
+ const component = componentsById.get(node.id);
16
+ if (!component)
17
+ continue;
18
+ const sectionId = (0, section_helpers_1.getSectionIdFromComponent)(component);
19
+ const list = nodesBySection.get(sectionId) ?? [];
20
+ list.push(node);
21
+ nodesBySection.set(sectionId, list);
22
+ }
23
+ let nextX = null;
24
+ for (const sectionId of sectionIds) {
25
+ const sectionNodes = nodesBySection.get(sectionId);
26
+ if (!sectionNodes?.length)
27
+ continue;
28
+ const xs = sectionNodes.map((node) => node.position.x);
29
+ const minX = Math.min(...xs);
30
+ const maxX = Math.max(...xs);
31
+ // Only ever pull sections left, so packing can't push them into each other.
32
+ const shift = nextX === null ? 0 : Math.min(0, nextX - minX);
33
+ if (shift < 0) {
34
+ for (const node of sectionNodes) {
35
+ node.position = { x: node.position.x + shift, y: node.position.y };
36
+ }
37
+ }
38
+ nextX = maxX + shift + constants_1.SECTION_GAP_X;
39
+ }
40
+ }
@@ -10,6 +10,7 @@ const edge_handles_1 = require("./diagram-layout/edge-handles");
10
10
  const managed_provider_layout_1 = require("./diagram-layout/managed-provider-layout");
11
11
  const minimal_terraform_layout_1 = require("./diagram-layout/minimal-terraform-layout");
12
12
  const section_helpers_1 = require("./diagram-layout/section-helpers");
13
+ const section_packing_1 = require("./diagram-layout/section-packing");
13
14
  const terraform_lane_layout_1 = require("./diagram-layout/terraform-lane-layout");
14
15
  const terraform_minimal_services_1 = require("./terraform-minimal-services");
15
16
  const infer_data_flow_protocol_1 = require("./infer-data-flow-protocol");
@@ -341,6 +342,7 @@ function buildDiagramGraphFromScanResult(scanResult) {
341
342
  (0, terraform_lane_layout_1.applyTerraformLaneLayout)(nodes, componentsById, sectionIds);
342
343
  (0, app_section_layout_1.applyAppSectionStackLayout)(nodes, componentsById, sectionIds);
343
344
  (0, managed_provider_layout_1.repositionManagedProviderNodes)(nodes, componentsById);
345
+ (0, section_packing_1.packSectionsHorizontally)(nodes, componentsById, sectionIds);
344
346
  }
345
347
  for (const flow of scanResult.dataFlows) {
346
348
  const edge = mapDataFlowToEdge(flow, componentsById);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataparade/cli",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "dataPARADE CLI — scan codebases for privacy and security data flows",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@clack/prompts": "^1.8.1",
58
- "@sentry/node": "^10.38.0",
58
+ "@sentry/node": "^10.75.2",
59
59
  "commander": "^14.0.3",
60
60
  "dotenv": "^16.4.7",
61
61
  "langsmith": "^0.10.13",
@@ -66,7 +66,7 @@
66
66
  "zod": "^4.3.5"
67
67
  },
68
68
  "devDependencies": {
69
- "@dataparade/scanner": "github:DataParade-io/scanner#6a5a95897fe9ccd60230b0636f3a91b2e21a1ab1",
69
+ "@dataparade/scanner": "github:DataParade-io/scanner#dc6104f9108cbb3647eb595861e73090f3cc257a",
70
70
  "@eslint/js": "^9.18.0",
71
71
  "@types/jest": "^30.0.0",
72
72
  "@types/node": "^22.0.0",