@dataparade/cli 0.0.1
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/LICENSE +674 -0
- package/README.md +592 -0
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.js +7 -0
- package/dist/bin/load-env.d.ts +2 -0
- package/dist/bin/load-env.js +4 -0
- package/dist/src/ai-enrichment/agent-orchestrator.d.ts +28 -0
- package/dist/src/ai-enrichment/agent-orchestrator.js +476 -0
- package/dist/src/ai-enrichment/agents/index.d.ts +4 -0
- package/dist/src/ai-enrichment/agents/index.js +50 -0
- package/dist/src/ai-enrichment/candidate-selector.d.ts +10 -0
- package/dist/src/ai-enrichment/candidate-selector.js +158 -0
- package/dist/src/ai-enrichment/fallbacks.d.ts +6 -0
- package/dist/src/ai-enrichment/fallbacks.js +762 -0
- package/dist/src/ai-enrichment/index.d.ts +15 -0
- package/dist/src/ai-enrichment/index.js +31 -0
- package/dist/src/ai-enrichment/merge-rules.d.ts +12 -0
- package/dist/src/ai-enrichment/merge-rules.js +321 -0
- package/dist/src/ai-enrichment/non-pii-signal-rules.d.ts +10 -0
- package/dist/src/ai-enrichment/non-pii-signal-rules.js +72 -0
- package/dist/src/ai-enrichment/openai-proposals-response.schema.d.ts +94 -0
- package/dist/src/ai-enrichment/openai-proposals-response.schema.js +82 -0
- package/dist/src/ai-enrichment/pii-signal-rules.d.ts +8 -0
- package/dist/src/ai-enrichment/pii-signal-rules.js +68 -0
- package/dist/src/ai-enrichment/pipeline.d.ts +2 -0
- package/dist/src/ai-enrichment/pipeline.js +48 -0
- package/dist/src/ai-enrichment/planner.d.ts +2 -0
- package/dist/src/ai-enrichment/planner.js +60 -0
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.d.ts +12 -0
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +45 -0
- package/dist/src/ai-enrichment/provider-prompt.d.ts +32 -0
- package/dist/src/ai-enrichment/provider-prompt.js +222 -0
- package/dist/src/ai-enrichment/provider-topology-rules.d.ts +52 -0
- package/dist/src/ai-enrichment/provider-topology-rules.js +190 -0
- package/dist/src/ai-enrichment/provider-topology-shared.d.ts +48 -0
- package/dist/src/ai-enrichment/provider-topology-shared.js +329 -0
- package/dist/src/ai-enrichment/providers/endpoint-resolution.d.ts +13 -0
- package/dist/src/ai-enrichment/providers/endpoint-resolution.js +41 -0
- package/dist/src/ai-enrichment/providers/families/chat-completions-family.d.ts +13 -0
- package/dist/src/ai-enrichment/providers/families/chat-completions-family.js +181 -0
- package/dist/src/ai-enrichment/providers/families/generate-content-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/generate-content-family.js +93 -0
- package/dist/src/ai-enrichment/providers/families/messages-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/messages-family.js +86 -0
- package/dist/src/ai-enrichment/providers/families/ollama-generate-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/ollama-generate-family.js +69 -0
- package/dist/src/ai-enrichment/providers/fetch-with-timeout.d.ts +2 -0
- package/dist/src/ai-enrichment/providers/fetch-with-timeout.js +22 -0
- package/dist/src/ai-enrichment/providers/index.d.ts +16 -0
- package/dist/src/ai-enrichment/providers/index.js +40 -0
- package/dist/src/ai-enrichment/providers/mock.d.ts +5 -0
- package/dist/src/ai-enrichment/providers/mock.js +12 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.d.ts +20 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.js +116 -0
- package/dist/src/ai-enrichment/providers/presets.d.ts +14 -0
- package/dist/src/ai-enrichment/providers/presets.js +50 -0
- package/dist/src/ai-enrichment/providers/provider-contract.d.ts +20 -0
- package/dist/src/ai-enrichment/providers/provider-contract.js +703 -0
- package/dist/src/ai-enrichment/providers/provider-json-parse.d.ts +23 -0
- package/dist/src/ai-enrichment/providers/provider-json-parse.js +96 -0
- package/dist/src/ai-enrichment/providers/provider-output-token-budget.d.ts +5 -0
- package/dist/src/ai-enrichment/providers/provider-output-token-budget.js +11 -0
- package/dist/src/ai-enrichment/providers/provider-pricing.d.ts +7 -0
- package/dist/src/ai-enrichment/providers/provider-pricing.js +32 -0
- package/dist/src/ai-enrichment/providers/provider-runtime.d.ts +9 -0
- package/dist/src/ai-enrichment/providers/provider-runtime.js +54 -0
- package/dist/src/ai-enrichment/providers/resolve-provider.d.ts +27 -0
- package/dist/src/ai-enrichment/providers/resolve-provider.js +41 -0
- package/dist/src/ai-enrichment/providers/types.d.ts +24 -0
- package/dist/src/ai-enrichment/providers/types.js +2 -0
- package/dist/src/ai-enrichment/scan-paths.d.ts +9 -0
- package/dist/src/ai-enrichment/scan-paths.js +28 -0
- package/dist/src/ai-enrichment/sensitive-paths.d.ts +5 -0
- package/dist/src/ai-enrichment/sensitive-paths.js +10 -0
- package/dist/src/ai-enrichment/third-party-data-flow.d.ts +27 -0
- package/dist/src/ai-enrichment/third-party-data-flow.js +518 -0
- package/dist/src/ai-enrichment/third-party-evidence.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-evidence.js +426 -0
- package/dist/src/ai-enrichment/third-party-property-matrix.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-property-matrix.js +52 -0
- package/dist/src/ai-enrichment/third-party-subtype.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-subtype.js +166 -0
- package/dist/src/ai-enrichment/tools/index.d.ts +39 -0
- package/dist/src/ai-enrichment/tools/index.js +121 -0
- package/dist/src/ai-enrichment/types.d.ts +170 -0
- package/dist/src/ai-enrichment/types.js +12 -0
- package/dist/src/analyzers/python/dependency-manifests.d.ts +8 -0
- package/dist/src/analyzers/python/dependency-manifests.js +131 -0
- package/dist/src/analyzers/python/detector.d.ts +3 -0
- package/dist/src/analyzers/python/detector.js +22 -0
- package/dist/src/analyzers/python/index.d.ts +2 -0
- package/dist/src/analyzers/python/index.js +11 -0
- package/dist/src/analyzers/python/manifest-parsers.d.ts +3 -0
- package/dist/src/analyzers/python/manifest-parsers.js +134 -0
- package/dist/src/analyzers/python/parser.d.ts +26 -0
- package/dist/src/analyzers/python/parser.js +187 -0
- package/dist/src/analyzers/python/patterns.d.ts +7 -0
- package/dist/src/analyzers/python/patterns.js +106 -0
- package/dist/src/analyzers/python/python-detection-config.d.ts +75 -0
- package/dist/src/analyzers/python/python-detection-config.js +148 -0
- package/dist/src/analyzers/registry.d.ts +13 -0
- package/dist/src/analyzers/registry.js +60 -0
- package/dist/src/analyzers/shared/manifest-budgets.d.ts +19 -0
- package/dist/src/analyzers/shared/manifest-budgets.js +21 -0
- package/dist/src/analyzers/shared/manifest-fs.d.ts +13 -0
- package/dist/src/analyzers/shared/manifest-fs.js +138 -0
- package/dist/src/analyzers/shared/property-inference.d.ts +8 -0
- package/dist/src/analyzers/shared/property-inference.js +165 -0
- package/dist/src/analyzers/terraform/detector.d.ts +10 -0
- package/dist/src/analyzers/terraform/detector.js +198 -0
- package/dist/src/analyzers/terraform/index.d.ts +2 -0
- package/dist/src/analyzers/terraform/index.js +13 -0
- package/dist/src/analyzers/terraform/parser.d.ts +29 -0
- package/dist/src/analyzers/terraform/parser.js +202 -0
- package/dist/src/analyzers/terraform/terraform-detection-config.d.ts +48 -0
- package/dist/src/analyzers/terraform/terraform-detection-config.js +218 -0
- package/dist/src/analyzers/terraform/terraform-exec.d.ts +11 -0
- package/dist/src/analyzers/terraform/terraform-exec.js +35 -0
- package/dist/src/analyzers/terraform/terraform-module-manifest.d.ts +19 -0
- package/dist/src/analyzers/terraform/terraform-module-manifest.js +75 -0
- package/dist/src/analyzers/terraform/terraform-show-json.d.ts +15 -0
- package/dist/src/analyzers/terraform/terraform-show-json.js +188 -0
- package/dist/src/analyzers/terraform/terraform-utility-resource.d.ts +12 -0
- package/dist/src/analyzers/terraform/terraform-utility-resource.js +30 -0
- package/dist/src/analyzers/types.d.ts +5 -0
- package/dist/src/analyzers/types.js +2 -0
- package/dist/src/analyzers/typescript/actor-detection.d.ts +4 -0
- package/dist/src/analyzers/typescript/actor-detection.js +15 -0
- package/dist/src/analyzers/typescript/dependency-manifests.d.ts +9 -0
- package/dist/src/analyzers/typescript/dependency-manifests.js +131 -0
- package/dist/src/analyzers/typescript/detector.d.ts +3 -0
- package/dist/src/analyzers/typescript/detector.js +23 -0
- package/dist/src/analyzers/typescript/index.d.ts +2 -0
- package/dist/src/analyzers/typescript/index.js +11 -0
- package/dist/src/analyzers/typescript/manifest-parsers.d.ts +1 -0
- package/dist/src/analyzers/typescript/manifest-parsers.js +30 -0
- package/dist/src/analyzers/typescript/parser.d.ts +44 -0
- package/dist/src/analyzers/typescript/parser.js +287 -0
- package/dist/src/analyzers/typescript/third-party-detection.d.ts +4 -0
- package/dist/src/analyzers/typescript/third-party-detection.js +16 -0
- package/dist/src/analyzers/typescript/typescript-detection-config.d.ts +68 -0
- package/dist/src/analyzers/typescript/typescript-detection-config.js +171 -0
- package/dist/src/analyzers/typescript/typescript-detection.d.ts +10 -0
- package/dist/src/analyzers/typescript/typescript-detection.js +57 -0
- package/dist/src/classifier/application-injection.d.ts +12 -0
- package/dist/src/classifier/application-injection.js +335 -0
- package/dist/src/classifier/classify.d.ts +3 -0
- package/dist/src/classifier/classify.js +15 -0
- package/dist/src/classifier/component-factory.d.ts +3 -0
- package/dist/src/classifier/component-factory.js +488 -0
- package/dist/src/classifier/config.d.ts +38 -0
- package/dist/src/classifier/config.js +260 -0
- package/dist/src/classifier/enhance-defaults.d.ts +28 -0
- package/dist/src/classifier/enhance-defaults.js +369 -0
- package/dist/src/classifier/enhance.d.ts +13 -0
- package/dist/src/classifier/enhance.js +295 -0
- package/dist/src/classifier/external-url-third-party.d.ts +26 -0
- package/dist/src/classifier/external-url-third-party.js +195 -0
- package/dist/src/classifier/grouping.d.ts +1 -0
- package/dist/src/classifier/grouping.js +2 -0
- package/dist/src/classifier/main-application-selection.d.ts +41 -0
- package/dist/src/classifier/main-application-selection.js +222 -0
- package/dist/src/classifier/naming.d.ts +4 -0
- package/dist/src/classifier/naming.js +78 -0
- package/dist/src/classifier/postprocessing.d.ts +12 -0
- package/dist/src/classifier/postprocessing.js +510 -0
- package/dist/src/classifier/sectioning.d.ts +5 -0
- package/dist/src/classifier/sectioning.js +60 -0
- package/dist/src/classifier/terraform-provider-hub.d.ts +6 -0
- package/dist/src/classifier/terraform-provider-hub.js +38 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +498 -0
- package/dist/src/config/actor-detection-config.d.ts +21 -0
- package/dist/src/config/actor-detection-config.js +97 -0
- package/dist/src/config/env.d.ts +2 -0
- package/dist/src/config/env.js +75 -0
- package/dist/src/config/file.d.ts +6 -0
- package/dist/src/config/file.js +74 -0
- package/dist/src/config/inference-scope.d.ts +2 -0
- package/dist/src/config/inference-scope.js +15 -0
- package/dist/src/config/load-cli-env.d.ts +1 -0
- package/dist/src/config/load-cli-env.js +54 -0
- package/dist/src/config/normalize-ai-provider.d.ts +5 -0
- package/dist/src/config/normalize-ai-provider.js +18 -0
- package/dist/src/config/property-detection-config.d.ts +27 -0
- package/dist/src/config/property-detection-config.js +355 -0
- package/dist/src/config/redact.d.ts +3 -0
- package/dist/src/config/redact.js +14 -0
- package/dist/src/config/resolve.d.ts +15 -0
- package/dist/src/config/resolve.js +361 -0
- package/dist/src/config/scan-env.d.ts +7 -0
- package/dist/src/config/scan-env.js +38 -0
- package/dist/src/config/third-party-detection-config.d.ts +25 -0
- package/dist/src/config/third-party-detection-config.js +97 -0
- package/dist/src/config/types.d.ts +106 -0
- package/dist/src/config/types.js +2 -0
- package/dist/src/config/validate-scan-ai.d.ts +3 -0
- package/dist/src/config/validate-scan-ai.js +33 -0
- package/dist/src/core/pipeline/ai-orchestrator-options.d.ts +6 -0
- package/dist/src/core/pipeline/ai-orchestrator-options.js +46 -0
- package/dist/src/core/pipeline/classifier-phase.d.ts +7 -0
- package/dist/src/core/pipeline/classifier-phase.js +78 -0
- package/dist/src/core/pipeline/dataflow-phase.d.ts +7 -0
- package/dist/src/core/pipeline/dataflow-phase.js +10 -0
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.d.ts +7 -0
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.js +74 -0
- package/dist/src/core/pipeline/diagram-layout/constants.d.ts +11 -0
- package/dist/src/core/pipeline/diagram-layout/constants.js +14 -0
- package/dist/src/core/pipeline/diagram-layout/edge-handles.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/edge-handles.js +26 -0
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.js +40 -0
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.d.ts +6 -0
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.js +53 -0
- package/dist/src/core/pipeline/diagram-layout/section-helpers.d.ts +30 -0
- package/dist/src/core/pipeline/diagram-layout/section-helpers.js +62 -0
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.js +109 -0
- package/dist/src/core/pipeline/diagram-layout/types.d.ts +2 -0
- package/dist/src/core/pipeline/diagram-layout/types.js +2 -0
- package/dist/src/core/pipeline/graph-mapping.d.ts +6 -0
- package/dist/src/core/pipeline/graph-mapping.js +308 -0
- package/dist/src/core/pipeline/mixed-app-terraform-scan.d.ts +13 -0
- package/dist/src/core/pipeline/mixed-app-terraform-scan.js +81 -0
- package/dist/src/core/pipeline/orchestrator-result.d.ts +6 -0
- package/dist/src/core/pipeline/orchestrator-result.js +2 -0
- package/dist/src/core/pipeline/orchestrator.d.ts +26 -0
- package/dist/src/core/pipeline/orchestrator.js +79 -0
- package/dist/src/core/pipeline/resolve-path-under-scan-root.d.ts +7 -0
- package/dist/src/core/pipeline/resolve-path-under-scan-root.js +55 -0
- package/dist/src/core/pipeline/scan-pipeline.d.ts +6 -0
- package/dist/src/core/pipeline/scan-pipeline.js +364 -0
- package/dist/src/core/pipeline/sorting.d.ts +3 -0
- package/dist/src/core/pipeline/sorting.js +48 -0
- package/dist/src/core/pipeline/stable-component-ids.d.ts +15 -0
- package/dist/src/core/pipeline/stable-component-ids.js +68 -0
- package/dist/src/core/pipeline/structural-scan.d.ts +19 -0
- package/dist/src/core/pipeline/structural-scan.js +304 -0
- package/dist/src/core/pipeline/terraform-flow-utils.d.ts +6 -0
- package/dist/src/core/pipeline/terraform-flow-utils.js +32 -0
- package/dist/src/core/pipeline/terraform-minimal-services.d.ts +31 -0
- package/dist/src/core/pipeline/terraform-minimal-services.js +225 -0
- package/dist/src/core/schema/dataflow-wrapper.schema.d.ts +83 -0
- package/dist/src/core/schema/dataflow-wrapper.schema.js +40 -0
- package/dist/src/core/schema/diagram-graph.schema.d.ts +93 -0
- package/dist/src/core/schema/diagram-graph.schema.js +55 -0
- package/dist/src/core/schema/index.d.ts +4 -0
- package/dist/src/core/schema/index.js +20 -0
- package/dist/src/core/schema/scan-config.schema.d.ts +66 -0
- package/dist/src/core/schema/scan-config.schema.js +67 -0
- package/dist/src/core/schema/scan-result.schema.d.ts +450 -0
- package/dist/src/core/schema/scan-result.schema.js +236 -0
- package/dist/src/core/sectioning/discover-service-sections.d.ts +80 -0
- package/dist/src/core/sectioning/discover-service-sections.js +468 -0
- package/dist/src/core/sectioning/section-runtime.d.ts +21 -0
- package/dist/src/core/sectioning/section-runtime.js +148 -0
- package/dist/src/core/terraform/component-predicates.d.ts +13 -0
- package/dist/src/core/terraform/component-predicates.js +71 -0
- package/dist/src/core/types/component.d.ts +18 -0
- package/dist/src/core/types/component.js +2 -0
- package/dist/src/core/types/config.d.ts +57 -0
- package/dist/src/core/types/config.js +2 -0
- package/dist/src/core/types/data-flow.d.ts +24 -0
- package/dist/src/core/types/data-flow.js +2 -0
- package/dist/src/core/types/detection.d.ts +12 -0
- package/dist/src/core/types/detection.js +19 -0
- package/dist/src/core/types/file.d.ts +14 -0
- package/dist/src/core/types/file.js +2 -0
- package/dist/src/core/types/index.d.ts +7 -0
- package/dist/src/core/types/index.js +23 -0
- package/dist/src/core/types/progress.d.ts +9 -0
- package/dist/src/core/types/progress.js +2 -0
- package/dist/src/core/types/result.d.ts +140 -0
- package/dist/src/core/types/result.js +2 -0
- package/dist/src/data-flow/application-hub.d.ts +7 -0
- package/dist/src/data-flow/application-hub.js +88 -0
- package/dist/src/data-flow/dedupe.d.ts +7 -0
- package/dist/src/data-flow/dedupe.js +92 -0
- package/dist/src/data-flow/detect.d.ts +16 -0
- package/dist/src/data-flow/detect.js +203 -0
- package/dist/src/data-flow/detector.d.ts +15 -0
- package/dist/src/data-flow/detector.js +18 -0
- package/dist/src/data-flow/drop-cross-section-flows.d.ts +8 -0
- package/dist/src/data-flow/drop-cross-section-flows.js +32 -0
- package/dist/src/data-flow/ensure-actor-flow.d.ts +16 -0
- package/dist/src/data-flow/ensure-actor-flow.js +101 -0
- package/dist/src/data-flow/ensure-manifest-declared-flows.d.ts +14 -0
- package/dist/src/data-flow/ensure-manifest-declared-flows.js +76 -0
- package/dist/src/data-flow/ensure-section-api-flows.d.ts +6 -0
- package/dist/src/data-flow/ensure-section-api-flows.js +57 -0
- package/dist/src/data-flow/flow-builder.d.ts +5 -0
- package/dist/src/data-flow/flow-builder.js +80 -0
- package/dist/src/data-flow/import-graph.d.ts +10 -0
- package/dist/src/data-flow/import-graph.js +147 -0
- package/dist/src/data-flow/index.d.ts +8 -0
- package/dist/src/data-flow/index.js +20 -0
- package/dist/src/data-flow/internal-fetch.d.ts +8 -0
- package/dist/src/data-flow/internal-fetch.js +209 -0
- package/dist/src/data-flow/postprocess.d.ts +9 -0
- package/dist/src/data-flow/postprocess.js +63 -0
- package/dist/src/data-flow/rewire.d.ts +10 -0
- package/dist/src/data-flow/rewire.js +93 -0
- package/dist/src/data-flow/source-attribution.d.ts +8 -0
- package/dist/src/data-flow/source-attribution.js +131 -0
- package/dist/src/data-flow/source-resolution.d.ts +13 -0
- package/dist/src/data-flow/source-resolution.js +61 -0
- package/dist/src/data-flow/target-matching.d.ts +21 -0
- package/dist/src/data-flow/target-matching.js +253 -0
- package/dist/src/data-flow/terraform-flows.d.ts +32 -0
- package/dist/src/data-flow/terraform-flows.js +170 -0
- package/dist/src/evals/metrics.d.ts +18 -0
- package/dist/src/evals/metrics.js +58 -0
- package/dist/src/evals/run-model-matrix.d.ts +1 -0
- package/dist/src/evals/run-model-matrix.js +68 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +20 -0
- package/dist/src/ingest/file-system.d.ts +17 -0
- package/dist/src/ingest/file-system.js +239 -0
- package/dist/src/ingest/gitignore.d.ts +12 -0
- package/dist/src/ingest/gitignore.js +127 -0
- package/dist/src/ingest/sensitive-paths.d.ts +2 -0
- package/dist/src/ingest/sensitive-paths.js +8 -0
- package/dist/src/observability/scan-sentry.d.ts +20 -0
- package/dist/src/observability/scan-sentry.js +133 -0
- package/dist/src/output/json.d.ts +51 -0
- package/dist/src/output/json.js +59 -0
- package/dist/src/patterns/config.d.ts +22 -0
- package/dist/src/patterns/config.js +119 -0
- package/dist/src/patterns/detectors/helpers.d.ts +19 -0
- package/dist/src/patterns/detectors/helpers.js +68 -0
- package/dist/src/patterns/detectors/python.d.ts +8 -0
- package/dist/src/patterns/detectors/python.js +412 -0
- package/dist/src/patterns/detectors/typescript.d.ts +8 -0
- package/dist/src/patterns/detectors/typescript.js +328 -0
- package/dist/src/patterns/engine.d.ts +40 -0
- package/dist/src/patterns/engine.js +111 -0
- package/dist/src/patterns/flow-source-patterns.d.ts +6 -0
- package/dist/src/patterns/flow-source-patterns.js +39 -0
- package/dist/src/patterns/frontend-frameworks.d.ts +4 -0
- package/dist/src/patterns/frontend-frameworks.js +25 -0
- package/dist/src/patterns/scan-exclusions.d.ts +14 -0
- package/dist/src/patterns/scan-exclusions.js +76 -0
- package/dist/src/platform-api/dataparade-api-base-url.d.ts +8 -0
- package/dist/src/platform-api/dataparade-api-base-url.js +17 -0
- package/dist/src/platform-api/estimate-scan-footprint.d.ts +8 -0
- package/dist/src/platform-api/estimate-scan-footprint.js +120 -0
- package/dist/src/platform-api/scan-quota-client.d.ts +28 -0
- package/dist/src/platform-api/scan-quota-client.js +79 -0
- package/dist/src/tracing/langsmith-tracing.d.ts +37 -0
- package/dist/src/tracing/langsmith-tracing.js +171 -0
- package/dist/tests/cli/cli.spec.d.ts +1 -0
- package/dist/tests/cli/cli.spec.js +87 -0
- package/dist/tests/fixtures/e2e-ts-sample/db-client-import.d.ts +2 -0
- package/dist/tests/fixtures/e2e-ts-sample/db-client-import.js +8 -0
- package/dist/tests/fixtures/e2e-ts-sample/db.d.ts +3 -0
- package/dist/tests/fixtures/e2e-ts-sample/db.js +7 -0
- package/dist/tests/fixtures/e2e-ts-sample/external-api.d.ts +1 -0
- package/dist/tests/fixtures/e2e-ts-sample/external-api.js +18 -0
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.d.ts +3 -0
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.js +7 -0
- package/dist/tests/fixtures/e2e-ts-sample/server.d.ts +14 -0
- package/dist/tests/fixtures/e2e-ts-sample/server.js +4 -0
- package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.d.ts +1 -0
- package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.js +24 -0
- package/dist/tests/fixtures/ingest-basic/src/index.d.ts +1 -0
- package/dist/tests/fixtures/ingest-basic/src/index.js +6 -0
- package/dist/tests/fixtures/mixed-language-basic/api.d.ts +2 -0
- package/dist/tests/fixtures/mixed-language-basic/api.js +12 -0
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.js +6 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.js +6 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.js +7 -0
- package/dist/tests/fixtures/typescript-basic/app/route.d.ts +1 -0
- package/dist/tests/fixtures/typescript-basic/app/route.js +7 -0
- package/dist/tests/fixtures/typescript-basic/db-client-import.d.ts +2 -0
- package/dist/tests/fixtures/typescript-basic/db-client-import.js +8 -0
- package/dist/tests/fixtures/typescript-basic/db.d.ts +3 -0
- package/dist/tests/fixtures/typescript-basic/db.js +7 -0
- package/dist/tests/fixtures/typescript-basic/external-api.d.ts +1 -0
- package/dist/tests/fixtures/typescript-basic/external-api.js +18 -0
- package/dist/tests/fixtures/typescript-basic/pg-client.d.ts +3 -0
- package/dist/tests/fixtures/typescript-basic/pg-client.js +7 -0
- package/dist/tests/fixtures/typescript-basic/server.d.ts +14 -0
- package/dist/tests/fixtures/typescript-basic/server.js +4 -0
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.d.ts +0 -0
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.js +2 -0
- package/dist/tests/helpers/scan-result-builders.d.ts +2 -0
- package/dist/tests/helpers/scan-result-builders.js +15 -0
- package/dist/tests/schema/dataflow-wrapper.schema.spec.d.ts +1 -0
- package/dist/tests/schema/dataflow-wrapper.schema.spec.js +89 -0
- package/dist/tests/schema/diagram-graph.schema.spec.d.ts +1 -0
- package/dist/tests/schema/diagram-graph.schema.spec.js +48 -0
- package/dist/tests/schema/scan-config.schema.spec.d.ts +1 -0
- package/dist/tests/schema/scan-config.schema.spec.js +135 -0
- package/dist/tests/schema/scan-result.schema.spec.d.ts +1 -0
- package/dist/tests/schema/scan-result.schema.spec.js +177 -0
- package/dist/tests/unit/ai-enrichment/agent-orchestrator.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/agent-orchestrator.spec.js +483 -0
- package/dist/tests/unit/ai-enrichment/candidate-selector.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/candidate-selector.spec.js +106 -0
- package/dist/tests/unit/ai-enrichment/create-ai-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/create-ai-provider.spec.js +32 -0
- package/dist/tests/unit/ai-enrichment/endpoint-resolution.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/endpoint-resolution.spec.js +47 -0
- package/dist/tests/unit/ai-enrichment/fallbacks.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/fallbacks.spec.js +1304 -0
- package/dist/tests/unit/ai-enrichment/families/chat-completions-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/chat-completions-family.spec.js +219 -0
- package/dist/tests/unit/ai-enrichment/families/generate-content-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/generate-content-family.spec.js +119 -0
- package/dist/tests/unit/ai-enrichment/families/messages-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/messages-family.spec.js +129 -0
- package/dist/tests/unit/ai-enrichment/families/ollama-generate-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/ollama-generate-family.spec.js +69 -0
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +422 -0
- package/dist/tests/unit/ai-enrichment/openai-proposals-response.schema.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/openai-proposals-response.schema.spec.js +30 -0
- package/dist/tests/unit/ai-enrichment/pipeline.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/pipeline.spec.js +120 -0
- package/dist/tests/unit/ai-enrichment/planner.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/planner.spec.js +106 -0
- package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.js +51 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.js +244 -0
- package/dist/tests/unit/ai-enrichment/provider-json-parse.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-json-parse.spec.js +24 -0
- package/dist/tests/unit/ai-enrichment/provider-output-token-budget.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-output-token-budget.spec.js +15 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt-env.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt-env.spec.js +54 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +206 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-aws.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-aws.spec.js +43 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-kubernetes.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-kubernetes.spec.js +40 -0
- package/dist/tests/unit/ai-enrichment/providers/fetch-with-timeout.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/providers/fetch-with-timeout.spec.js +22 -0
- package/dist/tests/unit/ai-enrichment/resolve-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/resolve-provider.spec.js +67 -0
- package/dist/tests/unit/ai-enrichment/scan-paths-exact.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/scan-paths-exact.spec.js +35 -0
- package/dist/tests/unit/ai-enrichment/scan-paths.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/scan-paths.spec.js +21 -0
- package/dist/tests/unit/ai-enrichment/sensitive-paths.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/sensitive-paths.spec.js +20 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +963 -0
- package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.js +117 -0
- package/dist/tests/unit/ai-enrichment/third-party-subtype.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-subtype.spec.js +45 -0
- package/dist/tests/unit/ai-enrichment/tools-validation.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/tools-validation.spec.js +66 -0
- package/dist/tests/unit/analyzers/python/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/python/parser.spec.js +104 -0
- package/dist/tests/unit/analyzers/python/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/python/patterns.spec.js +289 -0
- package/dist/tests/unit/analyzers/registry.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/registry.spec.js +234 -0
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.js +87 -0
- package/dist/tests/unit/analyzers/terraform/detector.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/detector.spec.js +110 -0
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.js +53 -0
- package/dist/tests/unit/analyzers/terraform/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/parser.spec.js +56 -0
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.js +63 -0
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.js +19 -0
- package/dist/tests/unit/analyzers/terraform-exec.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform-exec.spec.js +27 -0
- package/dist/tests/unit/analyzers/terraform-show-json.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform-show-json.spec.js +77 -0
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.js +61 -0
- package/dist/tests/unit/analyzers/typescript/detector.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/detector.spec.js +225 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.js +49 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.js +27 -0
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.js +64 -0
- package/dist/tests/unit/analyzers/typescript/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/parser.spec.js +99 -0
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.js +24 -0
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.js +138 -0
- package/dist/tests/unit/classifier/classify.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/classify.spec.js +1453 -0
- package/dist/tests/unit/classifier/enhance.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/enhance.spec.js +400 -0
- package/dist/tests/unit/classifier/external-url-third-party.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/external-url-third-party.spec.js +83 -0
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.js +44 -0
- package/dist/tests/unit/classifier/terraform-grouping.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/terraform-grouping.spec.js +96 -0
- package/dist/tests/unit/cli/config-command.spec.d.ts +1 -0
- package/dist/tests/unit/cli/config-command.spec.js +51 -0
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.d.ts +0 -0
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +149 -0
- package/dist/tests/unit/cli/scan-command-diagram-graph.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-diagram-graph.spec.js +26 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +107 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-front-back-sections.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-front-back-sections.spec.js +74 -0
- package/dist/tests/unit/cli/scan-command-e2e-python-basic.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-python-basic.spec.js +43 -0
- package/dist/tests/unit/cli/scan-command-e2e-terraform-basic.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-terraform-basic.spec.js +62 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sample.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sample.spec.js +41 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.js +85 -0
- package/dist/tests/unit/cli/scan-command-exit-code.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-exit-code.spec.js +131 -0
- package/dist/tests/unit/cli/scan-quota-flow.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-quota-flow.spec.js +76 -0
- package/dist/tests/unit/config/property-detection-config.spec.d.ts +1 -0
- package/dist/tests/unit/config/property-detection-config.spec.js +38 -0
- package/dist/tests/unit/config/redact.spec.d.ts +1 -0
- package/dist/tests/unit/config/redact.spec.js +19 -0
- package/dist/tests/unit/config/resolve-config.spec.d.ts +1 -0
- package/dist/tests/unit/config/resolve-config.spec.js +172 -0
- package/dist/tests/unit/config/scan-env-debug.spec.d.ts +1 -0
- package/dist/tests/unit/config/scan-env-debug.spec.js +17 -0
- package/dist/tests/unit/config/validate-scan-ai.spec.d.ts +1 -0
- package/dist/tests/unit/config/validate-scan-ai.spec.js +53 -0
- package/dist/tests/unit/core/classifier-phase-regressions.spec.d.ts +1 -0
- package/dist/tests/unit/core/classifier-phase-regressions.spec.js +68 -0
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.d.ts +1 -0
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.js +66 -0
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.d.ts +1 -0
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.js +132 -0
- package/dist/tests/unit/core/discover-service-sections.spec.d.ts +1 -0
- package/dist/tests/unit/core/discover-service-sections.spec.js +204 -0
- package/dist/tests/unit/core/graph-mapping.spec.d.ts +1 -0
- package/dist/tests/unit/core/graph-mapping.spec.js +779 -0
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.d.ts +1 -0
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.js +64 -0
- package/dist/tests/unit/core/manifest-package-hub.spec.d.ts +1 -0
- package/dist/tests/unit/core/manifest-package-hub.spec.js +53 -0
- package/dist/tests/unit/core/monorepo-package-sections.spec.d.ts +1 -0
- package/dist/tests/unit/core/monorepo-package-sections.spec.js +121 -0
- package/dist/tests/unit/core/no-source-code-leakage.spec.d.ts +1 -0
- package/dist/tests/unit/core/no-source-code-leakage.spec.js +48 -0
- package/dist/tests/unit/core/orchestrator.spec.d.ts +1 -0
- package/dist/tests/unit/core/orchestrator.spec.js +252 -0
- package/dist/tests/unit/core/output-json.spec.d.ts +1 -0
- package/dist/tests/unit/core/output-json.spec.js +65 -0
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.d.ts +1 -0
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.js +42 -0
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.d.ts +1 -0
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.js +54 -0
- package/dist/tests/unit/core/scan-result-language-stats.spec.d.ts +1 -0
- package/dist/tests/unit/core/scan-result-language-stats.spec.js +15 -0
- package/dist/tests/unit/core/section-discovery-excludes.spec.d.ts +1 -0
- package/dist/tests/unit/core/section-discovery-excludes.spec.js +49 -0
- package/dist/tests/unit/core/section-runtime.spec.d.ts +1 -0
- package/dist/tests/unit/core/section-runtime.spec.js +166 -0
- package/dist/tests/unit/core/stable-component-ids.spec.d.ts +1 -0
- package/dist/tests/unit/core/stable-component-ids.spec.js +112 -0
- package/dist/tests/unit/core/structural-scan.spec.d.ts +1 -0
- package/dist/tests/unit/core/structural-scan.spec.js +83 -0
- package/dist/tests/unit/core/terraform-json-overlay.spec.d.ts +1 -0
- package/dist/tests/unit/core/terraform-json-overlay.spec.js +36 -0
- package/dist/tests/unit/core/terraform-minimal-services.spec.d.ts +1 -0
- package/dist/tests/unit/core/terraform-minimal-services.spec.js +378 -0
- package/dist/tests/unit/data-flow/application-hub.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/application-hub.spec.js +48 -0
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.js +95 -0
- package/dist/tests/unit/data-flow/dedupe.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/dedupe.spec.js +134 -0
- package/dist/tests/unit/data-flow/detector.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/detector.spec.js +1254 -0
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.js +132 -0
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.js +233 -0
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.js +125 -0
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.js +40 -0
- package/dist/tests/unit/data-flow/postprocess.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/postprocess.spec.js +78 -0
- package/dist/tests/unit/data-flow/rewire.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/rewire.spec.js +194 -0
- package/dist/tests/unit/data-flow/terraform-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/terraform-flows.spec.js +199 -0
- package/dist/tests/unit/evals/metrics.spec.d.ts +1 -0
- package/dist/tests/unit/evals/metrics.spec.js +54 -0
- package/dist/tests/unit/ingest/env-exclusion.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/env-exclusion.spec.js +43 -0
- package/dist/tests/unit/ingest/file-system.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/file-system.spec.js +180 -0
- package/dist/tests/unit/ingest/gitignore.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/gitignore.spec.js +30 -0
- package/dist/tests/unit/observability/scan-sentry.spec.d.ts +1 -0
- package/dist/tests/unit/observability/scan-sentry.spec.js +60 -0
- package/dist/tests/unit/patterns/scan-exclusions.spec.d.ts +1 -0
- package/dist/tests/unit/patterns/scan-exclusions.spec.js +58 -0
- package/dist/tests/unit/pipeline/ai-orchestrator-options.spec.d.ts +1 -0
- package/dist/tests/unit/pipeline/ai-orchestrator-options.spec.js +19 -0
- package/dist/tests/unit/platform-api/dataparade-api-base-url.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/dataparade-api-base-url.spec.js +19 -0
- package/dist/tests/unit/platform-api/estimate-scan-footprint.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/estimate-scan-footprint.spec.js +50 -0
- package/dist/tests/unit/tracing/langsmith-tracing.spec.d.ts +1 -0
- package/dist/tests/unit/tracing/langsmith-tracing.spec.js +118 -0
- package/package.json +84 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const orchestrator_1 = require("../../../src/core/pipeline/orchestrator");
|
|
8
|
+
const graph_mapping_1 = require("../../../src/core/pipeline/graph-mapping");
|
|
9
|
+
const schema_1 = require("../../../src/core/schema");
|
|
10
|
+
const scan_result_builders_1 = require("../../helpers/scan-result-builders");
|
|
11
|
+
describe("core/pipeline/graph-mapping - DP-P0-CLI-402", () => {
|
|
12
|
+
it("builds a DiagramGraphJson from a real ScanResult for the typescript-basic fixture", async () => {
|
|
13
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
14
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
15
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
16
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
17
|
+
expect(graph.nodes.length).toBe(scanResult.components.length);
|
|
18
|
+
expect(graph.edges.length).toBeGreaterThan(0);
|
|
19
|
+
const validation = schema_1.diagramGraphJsonSchema.safeParse(graph);
|
|
20
|
+
expect(validation.success).toBe(true);
|
|
21
|
+
const edgeWithProperties = graph.edges.find((edge) => edge.data && edge.data.properties);
|
|
22
|
+
expect(edgeWithProperties).toBeDefined();
|
|
23
|
+
if (!edgeWithProperties?.data)
|
|
24
|
+
return;
|
|
25
|
+
const properties = edgeWithProperties.data.properties;
|
|
26
|
+
expect(properties.engineering).toBeDefined();
|
|
27
|
+
expect(properties.privacy).toBeDefined();
|
|
28
|
+
expect(properties.security).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it("maps all DetectedComponent and DetectedDataFlow properties into node data and DataFlowProperties", () => {
|
|
31
|
+
const scanResult = {
|
|
32
|
+
components: [
|
|
33
|
+
{
|
|
34
|
+
id: "component-1",
|
|
35
|
+
name: "Test Application",
|
|
36
|
+
type: "asset",
|
|
37
|
+
subType: "service",
|
|
38
|
+
description: "Main application service",
|
|
39
|
+
confidence: 0.99,
|
|
40
|
+
detectedFrom: [
|
|
41
|
+
{
|
|
42
|
+
pattern: "express_route",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
sourceLocations: [
|
|
46
|
+
{
|
|
47
|
+
filePath: "src/app.ts",
|
|
48
|
+
startLine: 10,
|
|
49
|
+
endLine: 20,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
properties: {
|
|
53
|
+
technologyStack: ["node", "express"],
|
|
54
|
+
cloudProvider: "AWS",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
dataFlows: [
|
|
59
|
+
{
|
|
60
|
+
id: "flow-1",
|
|
61
|
+
sourceComponentId: "component-1",
|
|
62
|
+
targetComponentId: "component-1",
|
|
63
|
+
type: "api_call",
|
|
64
|
+
description: "Health check endpoint",
|
|
65
|
+
confidence: 0.9,
|
|
66
|
+
sourceLocation: {
|
|
67
|
+
filePath: "src/app.ts",
|
|
68
|
+
startLine: 30,
|
|
69
|
+
endLine: 40,
|
|
70
|
+
},
|
|
71
|
+
method: "GET",
|
|
72
|
+
endpoint: "/health",
|
|
73
|
+
dataCategories: ["personal_identifiers"],
|
|
74
|
+
dataSubjectCategories: ["customers"],
|
|
75
|
+
processingPurpose: ["service_provision"],
|
|
76
|
+
actions: ["read"],
|
|
77
|
+
transformation: ["encrypted"],
|
|
78
|
+
enrichmentConfidence: 0.8,
|
|
79
|
+
enrichmentNotes: "Encrypted health-check response",
|
|
80
|
+
targetScope: "local",
|
|
81
|
+
targetScopeConfidence: "high",
|
|
82
|
+
targetScopeReason: "same-section-id",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
filesScanned: 1,
|
|
86
|
+
filesSkipped: 0,
|
|
87
|
+
totalLines: 100,
|
|
88
|
+
scanDurationMs: 5,
|
|
89
|
+
warnings: [],
|
|
90
|
+
errors: [],
|
|
91
|
+
};
|
|
92
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
93
|
+
expect(graph.nodes).toHaveLength(1);
|
|
94
|
+
expect(graph.edges).toHaveLength(1);
|
|
95
|
+
const node = graph.nodes[0];
|
|
96
|
+
const nodeData = node.data;
|
|
97
|
+
expect(nodeData.label).toBe("Test Application");
|
|
98
|
+
expect(nodeData.description).toBe("Main application service");
|
|
99
|
+
expect(nodeData.componentType).toBe("asset");
|
|
100
|
+
expect(nodeData.componentSubType).toBe("service");
|
|
101
|
+
expect(nodeData.technologyStack).toEqual(["node", "express"]);
|
|
102
|
+
expect(nodeData.cloudProvider).toBe("AWS");
|
|
103
|
+
const edge = graph.edges[0];
|
|
104
|
+
expect(edge.data).toBeDefined();
|
|
105
|
+
if (!edge.data)
|
|
106
|
+
return;
|
|
107
|
+
const properties = edge.data.properties;
|
|
108
|
+
expect(properties.engineering.transferType).toBe("api_call");
|
|
109
|
+
expect(properties.engineering.name).toContain("Test Application");
|
|
110
|
+
expect(properties.engineering.actions).toEqual(["read"]);
|
|
111
|
+
expect(properties.privacy.dataCategories).toEqual([
|
|
112
|
+
"personal_identifiers",
|
|
113
|
+
]);
|
|
114
|
+
expect(properties.privacy.dataSubjectCategories).toEqual(["customers"]);
|
|
115
|
+
expect(properties.privacy.processingPurpose).toEqual([
|
|
116
|
+
"service_provision",
|
|
117
|
+
]);
|
|
118
|
+
expect(properties.security.transformation).toBe("encrypted");
|
|
119
|
+
expect(properties.security.enrichmentConfidence).toBe(0.8);
|
|
120
|
+
expect(properties.security.enrichmentNotes).toBe("Encrypted health-check response");
|
|
121
|
+
expect(properties.targetScope).toBe("local");
|
|
122
|
+
expect(properties.targetScopeConfidence).toBe("high");
|
|
123
|
+
expect(properties.targetScopeReason).toBe("same-section-id");
|
|
124
|
+
});
|
|
125
|
+
it("places managed provider service nodes after provider in layout", () => {
|
|
126
|
+
const scanResult = {
|
|
127
|
+
components: [
|
|
128
|
+
{
|
|
129
|
+
id: "tp_supabase",
|
|
130
|
+
name: "Supabase",
|
|
131
|
+
type: "third_party",
|
|
132
|
+
confidence: 0.9,
|
|
133
|
+
detectedFrom: [],
|
|
134
|
+
sourceLocations: [],
|
|
135
|
+
properties: { section_id: "root" },
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "cmp_managed_supabase_pg_1",
|
|
139
|
+
name: "Supabase Pg",
|
|
140
|
+
type: "asset",
|
|
141
|
+
subType: "database",
|
|
142
|
+
confidence: 0.9,
|
|
143
|
+
detectedFrom: [],
|
|
144
|
+
sourceLocations: [],
|
|
145
|
+
properties: {
|
|
146
|
+
section_id: "root",
|
|
147
|
+
managed_by_provider: "tp_supabase",
|
|
148
|
+
managed_service_key: "postgres",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
dataFlows: [
|
|
153
|
+
{
|
|
154
|
+
id: "flow-1",
|
|
155
|
+
sourceComponentId: "tp_supabase",
|
|
156
|
+
targetComponentId: "cmp_managed_supabase_pg_1",
|
|
157
|
+
type: "database_query",
|
|
158
|
+
confidence: 0.8,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
filesScanned: 1,
|
|
162
|
+
filesSkipped: 0,
|
|
163
|
+
totalLines: 1,
|
|
164
|
+
scanDurationMs: 1,
|
|
165
|
+
warnings: [],
|
|
166
|
+
errors: [],
|
|
167
|
+
};
|
|
168
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
169
|
+
const provider = graph.nodes.find((n) => n.id === "tp_supabase");
|
|
170
|
+
const managed = graph.nodes.find((n) => n.id === "cmp_managed_supabase_pg_1");
|
|
171
|
+
expect(provider).toBeDefined();
|
|
172
|
+
expect(managed).toBeDefined();
|
|
173
|
+
expect((managed?.position.x ?? 0)).toBeGreaterThan(provider?.position.x ?? 0);
|
|
174
|
+
expect((managed?.position.y ?? 0)).toBeGreaterThan(provider?.position.y ?? 0);
|
|
175
|
+
const managedEdge = graph.edges.find((e) => e.id === "flow-1");
|
|
176
|
+
expect(managedEdge).toBeDefined();
|
|
177
|
+
expect(managedEdge?.sourceHandle).toBe("right-source");
|
|
178
|
+
expect(managedEdge?.targetHandle).toBe("left-target");
|
|
179
|
+
});
|
|
180
|
+
it("stacks managed nodes downward from provider with vertical spacing", () => {
|
|
181
|
+
const scanResult = {
|
|
182
|
+
components: [
|
|
183
|
+
{
|
|
184
|
+
id: "tp_supabase",
|
|
185
|
+
name: "Supabase",
|
|
186
|
+
type: "third_party",
|
|
187
|
+
confidence: 0.9,
|
|
188
|
+
detectedFrom: [],
|
|
189
|
+
sourceLocations: [],
|
|
190
|
+
properties: { section_id: "root" },
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "cmp_managed_supabase_auth",
|
|
194
|
+
name: "Supabase Auth",
|
|
195
|
+
type: "asset",
|
|
196
|
+
subType: "service",
|
|
197
|
+
confidence: 0.9,
|
|
198
|
+
detectedFrom: [],
|
|
199
|
+
sourceLocations: [],
|
|
200
|
+
properties: {
|
|
201
|
+
section_id: "root",
|
|
202
|
+
managed_by_provider: "tp_supabase",
|
|
203
|
+
managed_service_key: "auth",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: "cmp_managed_supabase_pg",
|
|
208
|
+
name: "Supabase Pg",
|
|
209
|
+
type: "asset",
|
|
210
|
+
subType: "database",
|
|
211
|
+
confidence: 0.9,
|
|
212
|
+
detectedFrom: [],
|
|
213
|
+
sourceLocations: [],
|
|
214
|
+
properties: {
|
|
215
|
+
section_id: "root",
|
|
216
|
+
managed_by_provider: "tp_supabase",
|
|
217
|
+
managed_service_key: "postgres",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: "cmp_managed_supabase_storage",
|
|
222
|
+
name: "Supabase Storage",
|
|
223
|
+
type: "asset",
|
|
224
|
+
subType: "storage",
|
|
225
|
+
confidence: 0.9,
|
|
226
|
+
detectedFrom: [],
|
|
227
|
+
sourceLocations: [],
|
|
228
|
+
properties: {
|
|
229
|
+
section_id: "root",
|
|
230
|
+
managed_by_provider: "tp_supabase",
|
|
231
|
+
managed_service_key: "storage",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
dataFlows: [],
|
|
236
|
+
filesScanned: 1,
|
|
237
|
+
filesSkipped: 0,
|
|
238
|
+
totalLines: 1,
|
|
239
|
+
scanDurationMs: 1,
|
|
240
|
+
warnings: [],
|
|
241
|
+
errors: [],
|
|
242
|
+
};
|
|
243
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
244
|
+
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
245
|
+
const provider = byId.get("tp_supabase");
|
|
246
|
+
const auth = byId.get("cmp_managed_supabase_auth");
|
|
247
|
+
const pg = byId.get("cmp_managed_supabase_pg");
|
|
248
|
+
const storage = byId.get("cmp_managed_supabase_storage");
|
|
249
|
+
expect(provider).toBeDefined();
|
|
250
|
+
expect(auth).toBeDefined();
|
|
251
|
+
expect(pg).toBeDefined();
|
|
252
|
+
expect(storage).toBeDefined();
|
|
253
|
+
const managedX = (provider?.position.x ?? 0) + 320;
|
|
254
|
+
expect(auth?.position.x).toBe(managedX);
|
|
255
|
+
expect(pg?.position.x).toBe(managedX);
|
|
256
|
+
expect(storage?.position.x).toBe(managedX);
|
|
257
|
+
expect(auth?.position.y).toBeGreaterThan(provider?.position.y ?? 0);
|
|
258
|
+
expect(pg?.position.y).toBeGreaterThan(auth?.position.y ?? 0);
|
|
259
|
+
expect(storage?.position.y).toBeGreaterThan(pg?.position.y ?? 0);
|
|
260
|
+
});
|
|
261
|
+
it("uses grid rows for monorepo app sections without Terraform (avoids stacking User and app on y=0)", () => {
|
|
262
|
+
const scanResult = {
|
|
263
|
+
components: [
|
|
264
|
+
{
|
|
265
|
+
id: "actor_apps",
|
|
266
|
+
name: "User",
|
|
267
|
+
type: "actor",
|
|
268
|
+
confidence: 0.9,
|
|
269
|
+
detectedFrom: [],
|
|
270
|
+
sourceLocations: [],
|
|
271
|
+
properties: { section_id: "packages/twenty-apps" },
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "app_apps",
|
|
275
|
+
name: "twenty-apps",
|
|
276
|
+
type: "asset",
|
|
277
|
+
subType: "service",
|
|
278
|
+
confidence: 0.9,
|
|
279
|
+
detectedFrom: [],
|
|
280
|
+
sourceLocations: [],
|
|
281
|
+
properties: {
|
|
282
|
+
section_id: "packages/twenty-apps",
|
|
283
|
+
isMainApplication: true,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: "actor_front",
|
|
288
|
+
name: "User",
|
|
289
|
+
type: "actor",
|
|
290
|
+
confidence: 0.9,
|
|
291
|
+
detectedFrom: [],
|
|
292
|
+
sourceLocations: [],
|
|
293
|
+
properties: { section_id: "packages/twenty-front" },
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
id: "app_front",
|
|
297
|
+
name: "twenty-front",
|
|
298
|
+
type: "asset",
|
|
299
|
+
subType: "service",
|
|
300
|
+
confidence: 0.9,
|
|
301
|
+
detectedFrom: [],
|
|
302
|
+
sourceLocations: [],
|
|
303
|
+
properties: {
|
|
304
|
+
section_id: "packages/twenty-front",
|
|
305
|
+
isMainApplication: true,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
dataFlows: [],
|
|
310
|
+
filesScanned: 1,
|
|
311
|
+
filesSkipped: 0,
|
|
312
|
+
totalLines: 1,
|
|
313
|
+
scanDurationMs: 1,
|
|
314
|
+
warnings: [],
|
|
315
|
+
errors: [],
|
|
316
|
+
};
|
|
317
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
318
|
+
const appsUser = graph.nodes.find((n) => n.id === "actor_apps")?.position;
|
|
319
|
+
const appsMain = graph.nodes.find((n) => n.id === "app_apps")?.position;
|
|
320
|
+
const frontUser = graph.nodes.find((n) => n.id === "actor_front")?.position;
|
|
321
|
+
expect((appsUser?.x ?? -1)).toBeLessThan(appsMain?.x ?? 0);
|
|
322
|
+
expect((frontUser?.x ?? 0)).toBeGreaterThan((appsMain?.x ?? 0));
|
|
323
|
+
});
|
|
324
|
+
it("monorepo Terraform sections keep provider left of managed resources with vertical spacing", () => {
|
|
325
|
+
const scanResult = {
|
|
326
|
+
components: [
|
|
327
|
+
{
|
|
328
|
+
id: "app_other",
|
|
329
|
+
name: "other-app",
|
|
330
|
+
type: "asset",
|
|
331
|
+
subType: "service",
|
|
332
|
+
confidence: 0.9,
|
|
333
|
+
detectedFrom: [],
|
|
334
|
+
sourceLocations: [],
|
|
335
|
+
properties: { section_id: "packages/other-app" },
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
id: "tp_k8s",
|
|
339
|
+
name: "Kubernetes",
|
|
340
|
+
type: "third_party",
|
|
341
|
+
subType: "cloud_provider",
|
|
342
|
+
confidence: 0.92,
|
|
343
|
+
detectedFrom: [],
|
|
344
|
+
sourceLocations: [],
|
|
345
|
+
properties: {
|
|
346
|
+
section_id: "packages/acme/k8s/terraform",
|
|
347
|
+
terraform_address: "provider.kubernetes",
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: "k8s_a",
|
|
352
|
+
name: "Kubernetes workload · a",
|
|
353
|
+
type: "asset",
|
|
354
|
+
subType: "service",
|
|
355
|
+
confidence: 0.9,
|
|
356
|
+
detectedFrom: [],
|
|
357
|
+
sourceLocations: [],
|
|
358
|
+
properties: {
|
|
359
|
+
section_id: "packages/acme/k8s/terraform",
|
|
360
|
+
terraform_address: "kubernetes_deployment.a",
|
|
361
|
+
managed_by_provider: "tp_k8s",
|
|
362
|
+
managed_service_key: "workload",
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "k8s_b",
|
|
367
|
+
name: "Kubernetes workload · b",
|
|
368
|
+
type: "asset",
|
|
369
|
+
subType: "service",
|
|
370
|
+
confidence: 0.9,
|
|
371
|
+
detectedFrom: [],
|
|
372
|
+
sourceLocations: [],
|
|
373
|
+
properties: {
|
|
374
|
+
section_id: "packages/acme/k8s/terraform",
|
|
375
|
+
terraform_address: "kubernetes_deployment.b",
|
|
376
|
+
managed_by_provider: "tp_k8s",
|
|
377
|
+
managed_service_key: "workload",
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
dataFlows: [],
|
|
382
|
+
filesScanned: 1,
|
|
383
|
+
filesSkipped: 0,
|
|
384
|
+
totalLines: 1,
|
|
385
|
+
scanDurationMs: 1,
|
|
386
|
+
warnings: [],
|
|
387
|
+
errors: [],
|
|
388
|
+
};
|
|
389
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
390
|
+
const provider = graph.nodes.find((n) => n.id === "tp_k8s")?.position;
|
|
391
|
+
const a = graph.nodes.find((n) => n.id === "k8s_a")?.position;
|
|
392
|
+
const b = graph.nodes.find((n) => n.id === "k8s_b")?.position;
|
|
393
|
+
expect(provider).toBeDefined();
|
|
394
|
+
expect(a).toBeDefined();
|
|
395
|
+
expect(b).toBeDefined();
|
|
396
|
+
expect((provider?.x ?? 0)).toBeLessThan(a?.x ?? 0);
|
|
397
|
+
expect(Math.abs((a?.y ?? 0) - (b?.y ?? 0))).toBeGreaterThanOrEqual(200);
|
|
398
|
+
expect((provider?.x ?? 0)).toBeLessThan(b?.x ?? 0);
|
|
399
|
+
});
|
|
400
|
+
it("orders single-section Terraform scans left-to-right: actor → main → module → provider → resource", () => {
|
|
401
|
+
const scanResult = {
|
|
402
|
+
components: [
|
|
403
|
+
{
|
|
404
|
+
id: "actor_user",
|
|
405
|
+
name: "User",
|
|
406
|
+
type: "actor",
|
|
407
|
+
confidence: 0.9,
|
|
408
|
+
detectedFrom: [],
|
|
409
|
+
sourceLocations: [],
|
|
410
|
+
properties: { section_id: "root" },
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
id: "asset_main",
|
|
414
|
+
name: "Main App",
|
|
415
|
+
type: "asset",
|
|
416
|
+
subType: "service",
|
|
417
|
+
confidence: 0.9,
|
|
418
|
+
detectedFrom: [],
|
|
419
|
+
sourceLocations: [],
|
|
420
|
+
properties: {
|
|
421
|
+
section_id: "root",
|
|
422
|
+
isMainApplication: true,
|
|
423
|
+
terraform_address: "injected_project_placeholder",
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: "mod_vpc",
|
|
428
|
+
name: "Module · vpc",
|
|
429
|
+
type: "asset",
|
|
430
|
+
subType: "application",
|
|
431
|
+
confidence: 0.88,
|
|
432
|
+
detectedFrom: [],
|
|
433
|
+
sourceLocations: [],
|
|
434
|
+
properties: {
|
|
435
|
+
section_id: "root",
|
|
436
|
+
terraform_address: "module.vpc",
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: "vpc_main",
|
|
441
|
+
name: "main (aws_vpc)",
|
|
442
|
+
type: "asset",
|
|
443
|
+
subType: "network",
|
|
444
|
+
confidence: 0.9,
|
|
445
|
+
detectedFrom: [],
|
|
446
|
+
sourceLocations: [],
|
|
447
|
+
properties: {
|
|
448
|
+
section_id: "root",
|
|
449
|
+
terraform_address: "aws_vpc.main",
|
|
450
|
+
resource_type: "aws_vpc",
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
id: "tp_aws",
|
|
455
|
+
name: "Amazon Web Services",
|
|
456
|
+
type: "third_party",
|
|
457
|
+
subType: "cloud_provider",
|
|
458
|
+
confidence: 0.92,
|
|
459
|
+
detectedFrom: [],
|
|
460
|
+
sourceLocations: [],
|
|
461
|
+
properties: {
|
|
462
|
+
section_id: "root",
|
|
463
|
+
terraform_address: "provider.aws",
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: "managed_s3",
|
|
468
|
+
name: "Aws S3",
|
|
469
|
+
type: "asset",
|
|
470
|
+
subType: "file_storage",
|
|
471
|
+
confidence: 0.9,
|
|
472
|
+
detectedFrom: [],
|
|
473
|
+
sourceLocations: [],
|
|
474
|
+
properties: {
|
|
475
|
+
section_id: "root",
|
|
476
|
+
terraform_address: "aws_s3_bucket.x",
|
|
477
|
+
resource_type: "aws_s3_bucket",
|
|
478
|
+
managed_by_provider: "tp_aws",
|
|
479
|
+
managed_service_key: "s3",
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
],
|
|
483
|
+
dataFlows: [],
|
|
484
|
+
filesScanned: 1,
|
|
485
|
+
filesSkipped: 0,
|
|
486
|
+
totalLines: 1,
|
|
487
|
+
scanDurationMs: 1,
|
|
488
|
+
warnings: [],
|
|
489
|
+
errors: [],
|
|
490
|
+
};
|
|
491
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
492
|
+
const pos = (id) => graph.nodes.find((n) => n.id === id)?.position;
|
|
493
|
+
expect((pos("actor_user")?.x ?? -1)).toBeLessThan(pos("asset_main")?.x ?? 0);
|
|
494
|
+
expect((pos("asset_main")?.x ?? -1)).toBeLessThan(pos("mod_vpc")?.x ?? 0);
|
|
495
|
+
expect((pos("mod_vpc")?.x ?? -1)).toBeLessThan(pos("tp_aws")?.x ?? 0);
|
|
496
|
+
expect((pos("tp_aws")?.x ?? -1)).toBeLessThan(pos("vpc_main")?.x ?? 0);
|
|
497
|
+
expect((pos("tp_aws")?.x ?? -1)).toBeLessThan(pos("managed_s3")?.x ?? 0);
|
|
498
|
+
});
|
|
499
|
+
it("aligns minimal Terraform like lane layout: actor, main+ECS column, provider, managed", () => {
|
|
500
|
+
const scanResult = {
|
|
501
|
+
components: [
|
|
502
|
+
{
|
|
503
|
+
id: "actor_u",
|
|
504
|
+
name: "User",
|
|
505
|
+
type: "actor",
|
|
506
|
+
subType: "customer",
|
|
507
|
+
confidence: 0.5,
|
|
508
|
+
detectedFrom: [],
|
|
509
|
+
sourceLocations: [],
|
|
510
|
+
properties: { section_id: "root" },
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
id: "main_x",
|
|
514
|
+
name: "Main App",
|
|
515
|
+
type: "asset",
|
|
516
|
+
subType: "application",
|
|
517
|
+
confidence: 0.9,
|
|
518
|
+
detectedFrom: [],
|
|
519
|
+
sourceLocations: [],
|
|
520
|
+
properties: {
|
|
521
|
+
section_id: "root",
|
|
522
|
+
isMainApplication: true,
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
id: "cmp_ecs",
|
|
527
|
+
name: "ECS Frontend",
|
|
528
|
+
type: "asset",
|
|
529
|
+
subType: "application",
|
|
530
|
+
confidence: 0.88,
|
|
531
|
+
detectedFrom: [],
|
|
532
|
+
sourceLocations: [],
|
|
533
|
+
properties: {
|
|
534
|
+
section_id: "root",
|
|
535
|
+
terraform_address: "module.ecs_frontend",
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
id: "tp_aws",
|
|
540
|
+
name: "Amazon Web Services",
|
|
541
|
+
type: "third_party",
|
|
542
|
+
subType: "cloud_provider",
|
|
543
|
+
confidence: 0.9,
|
|
544
|
+
detectedFrom: [],
|
|
545
|
+
sourceLocations: [],
|
|
546
|
+
properties: {
|
|
547
|
+
section_id: "root",
|
|
548
|
+
terraform_address: "provider.aws",
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: "cmp_s3",
|
|
553
|
+
name: "Aws S3",
|
|
554
|
+
type: "asset",
|
|
555
|
+
subType: "file_storage",
|
|
556
|
+
confidence: 0.9,
|
|
557
|
+
detectedFrom: [],
|
|
558
|
+
sourceLocations: [],
|
|
559
|
+
properties: {
|
|
560
|
+
section_id: "root",
|
|
561
|
+
managed_by_provider: "tp_aws",
|
|
562
|
+
managed_service_key: "s3",
|
|
563
|
+
terraform_address: "aws_s3_bucket.x",
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
],
|
|
567
|
+
dataFlows: [
|
|
568
|
+
{
|
|
569
|
+
id: "flow-1",
|
|
570
|
+
sourceComponentId: "cmp_ecs",
|
|
571
|
+
targetComponentId: "cmp_s3",
|
|
572
|
+
type: "file_transfer",
|
|
573
|
+
confidence: 0.8,
|
|
574
|
+
},
|
|
575
|
+
],
|
|
576
|
+
filesScanned: 1,
|
|
577
|
+
filesSkipped: 0,
|
|
578
|
+
totalLines: 1,
|
|
579
|
+
scanDurationMs: 1,
|
|
580
|
+
warnings: [],
|
|
581
|
+
errors: [],
|
|
582
|
+
};
|
|
583
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
584
|
+
const pos = (id) => graph.nodes.find((n) => n.id === id)?.position;
|
|
585
|
+
expect((pos("actor_u")?.x ?? -1)).toBeLessThan(pos("main_x")?.x ?? 0);
|
|
586
|
+
expect(pos("main_x")?.x).toBe(pos("cmp_ecs")?.x);
|
|
587
|
+
expect((pos("main_x")?.y ?? 999)).toBeLessThan(pos("cmp_ecs")?.y ?? 0);
|
|
588
|
+
expect((pos("cmp_ecs")?.x ?? -1)).toBeLessThan(pos("tp_aws")?.x ?? 0);
|
|
589
|
+
expect((pos("tp_aws")?.x ?? -1)).toBeLessThan(pos("cmp_s3")?.x ?? 0);
|
|
590
|
+
});
|
|
591
|
+
it("keeps User left of main app in root when root has no TF but another section does", () => {
|
|
592
|
+
const scanResult = {
|
|
593
|
+
components: [
|
|
594
|
+
{
|
|
595
|
+
id: "cmp_8",
|
|
596
|
+
name: "User",
|
|
597
|
+
type: "actor",
|
|
598
|
+
subType: "customer",
|
|
599
|
+
confidence: 0.5,
|
|
600
|
+
detectedFrom: [],
|
|
601
|
+
sourceLocations: [],
|
|
602
|
+
properties: { section_id: "root", section_label: "root" },
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
id: "cmp_1",
|
|
606
|
+
name: "Backend",
|
|
607
|
+
type: "asset",
|
|
608
|
+
subType: "api",
|
|
609
|
+
confidence: 0.9,
|
|
610
|
+
detectedFrom: [],
|
|
611
|
+
sourceLocations: [],
|
|
612
|
+
properties: {
|
|
613
|
+
section_id: "root",
|
|
614
|
+
section_label: "root",
|
|
615
|
+
isMainApplication: true,
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
id: "cmp_vpc",
|
|
620
|
+
name: "main (aws_vpc)",
|
|
621
|
+
type: "asset",
|
|
622
|
+
subType: "network",
|
|
623
|
+
confidence: 0.9,
|
|
624
|
+
detectedFrom: [],
|
|
625
|
+
sourceLocations: [],
|
|
626
|
+
properties: {
|
|
627
|
+
section_id: "terraform/stack-a",
|
|
628
|
+
section_label: "stack-a",
|
|
629
|
+
terraform_address: "aws_vpc.main",
|
|
630
|
+
resource_type: "aws_vpc",
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
],
|
|
634
|
+
dataFlows: [],
|
|
635
|
+
filesScanned: 1,
|
|
636
|
+
filesSkipped: 0,
|
|
637
|
+
totalLines: 1,
|
|
638
|
+
scanDurationMs: 1,
|
|
639
|
+
warnings: [],
|
|
640
|
+
errors: [],
|
|
641
|
+
};
|
|
642
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
643
|
+
const pos = (id) => graph.nodes.find((n) => n.id === id)?.position;
|
|
644
|
+
expect((pos("cmp_8")?.x ?? -1)).toBeLessThan(pos("cmp_1")?.x ?? 0);
|
|
645
|
+
});
|
|
646
|
+
it("places app sections before root and provider→module edges left-to-right for mixed app+TF", () => {
|
|
647
|
+
const scanResult = {
|
|
648
|
+
components: [
|
|
649
|
+
{
|
|
650
|
+
id: "api_reedy",
|
|
651
|
+
name: "API",
|
|
652
|
+
type: "asset",
|
|
653
|
+
subType: "api",
|
|
654
|
+
confidence: 0.9,
|
|
655
|
+
detectedFrom: [],
|
|
656
|
+
sourceLocations: [],
|
|
657
|
+
properties: { section_id: "reedy", isSectionApiNode: true },
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
id: "tp_aws",
|
|
661
|
+
name: "Amazon Web Services",
|
|
662
|
+
type: "third_party",
|
|
663
|
+
subType: "cloud_provider",
|
|
664
|
+
confidence: 0.9,
|
|
665
|
+
detectedFrom: [],
|
|
666
|
+
sourceLocations: [],
|
|
667
|
+
properties: {
|
|
668
|
+
section_id: "root",
|
|
669
|
+
terraform_address: "provider.aws",
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
(0, scan_result_builders_1.testAsset)("mod_aurora", "Module · aurora", {
|
|
673
|
+
section_id: "root",
|
|
674
|
+
terraform_address: "module.aurora",
|
|
675
|
+
}),
|
|
676
|
+
(0, scan_result_builders_1.testAsset)("mod_vpc", "Module · vpc", {
|
|
677
|
+
section_id: "root",
|
|
678
|
+
terraform_address: "module.vpc",
|
|
679
|
+
}),
|
|
680
|
+
],
|
|
681
|
+
dataFlows: [
|
|
682
|
+
{
|
|
683
|
+
id: "tf_link",
|
|
684
|
+
sourceComponentId: "tp_aws",
|
|
685
|
+
targetComponentId: "mod_aurora",
|
|
686
|
+
type: "api_call",
|
|
687
|
+
confidence: 0.72,
|
|
688
|
+
description: "mixed_app_terraform_module_shell",
|
|
689
|
+
},
|
|
690
|
+
],
|
|
691
|
+
filesScanned: 1,
|
|
692
|
+
filesSkipped: 0,
|
|
693
|
+
totalLines: 1,
|
|
694
|
+
scanDurationMs: 1,
|
|
695
|
+
warnings: [],
|
|
696
|
+
errors: [],
|
|
697
|
+
};
|
|
698
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
699
|
+
const pos = (id) => graph.nodes.find((n) => n.id === id)?.position;
|
|
700
|
+
expect((pos("api_reedy")?.x ?? 9999)).toBeLessThan(pos("tp_aws")?.x ?? 0);
|
|
701
|
+
expect((pos("tp_aws")?.x ?? -1)).toBeLessThan(pos("mod_aurora")?.x ?? 0);
|
|
702
|
+
expect((pos("tp_aws")?.x ?? -1)).toBeLessThan(pos("mod_vpc")?.x ?? 0);
|
|
703
|
+
const edge = graph.edges.find((e) => e.id === "tf_link");
|
|
704
|
+
expect(edge?.sourceHandle).toBe("right-source");
|
|
705
|
+
expect(edge?.targetHandle).toBe("left-target");
|
|
706
|
+
});
|
|
707
|
+
it("places integrations in a fourth column and managed sub-services beside their provider", () => {
|
|
708
|
+
const scanResult = {
|
|
709
|
+
components: [
|
|
710
|
+
{
|
|
711
|
+
id: "api",
|
|
712
|
+
name: "API",
|
|
713
|
+
type: "asset",
|
|
714
|
+
subType: "api",
|
|
715
|
+
confidence: 0.9,
|
|
716
|
+
detectedFrom: [],
|
|
717
|
+
sourceLocations: [],
|
|
718
|
+
properties: { section_id: "reedy", isSectionApiNode: true },
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
id: "tp_sb",
|
|
722
|
+
name: "Supabase",
|
|
723
|
+
type: "third_party",
|
|
724
|
+
subType: "saas_service",
|
|
725
|
+
confidence: 0.9,
|
|
726
|
+
detectedFrom: [],
|
|
727
|
+
sourceLocations: [],
|
|
728
|
+
properties: { section_id: "reedy" },
|
|
729
|
+
},
|
|
730
|
+
(0, scan_result_builders_1.testAsset)("pg", "Supabase Pg", {
|
|
731
|
+
section_id: "reedy",
|
|
732
|
+
managed_by_provider: "tp_sb",
|
|
733
|
+
managed_service_key: "postgres",
|
|
734
|
+
}),
|
|
735
|
+
{
|
|
736
|
+
id: "tp_auth",
|
|
737
|
+
name: "Auth0",
|
|
738
|
+
type: "third_party",
|
|
739
|
+
subType: "saas_service",
|
|
740
|
+
confidence: 0.9,
|
|
741
|
+
detectedFrom: [],
|
|
742
|
+
sourceLocations: [],
|
|
743
|
+
properties: { section_id: "reedy" },
|
|
744
|
+
},
|
|
745
|
+
],
|
|
746
|
+
dataFlows: [
|
|
747
|
+
{
|
|
748
|
+
id: "api_auth",
|
|
749
|
+
sourceComponentId: "api",
|
|
750
|
+
targetComponentId: "tp_auth",
|
|
751
|
+
type: "api_call",
|
|
752
|
+
confidence: 0.8,
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
id: "sb_pg",
|
|
756
|
+
sourceComponentId: "tp_sb",
|
|
757
|
+
targetComponentId: "pg",
|
|
758
|
+
type: "database_query",
|
|
759
|
+
confidence: 0.8,
|
|
760
|
+
},
|
|
761
|
+
],
|
|
762
|
+
filesScanned: 1,
|
|
763
|
+
filesSkipped: 0,
|
|
764
|
+
totalLines: 1,
|
|
765
|
+
scanDurationMs: 1,
|
|
766
|
+
warnings: [],
|
|
767
|
+
errors: [],
|
|
768
|
+
};
|
|
769
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
770
|
+
const pos = (id) => graph.nodes.find((n) => n.id === id)?.position;
|
|
771
|
+
expect((pos("api")?.x ?? -1)).toBeLessThan(pos("tp_auth")?.x ?? 0);
|
|
772
|
+
expect((pos("tp_sb")?.x ?? -1)).toBeLessThan(pos("pg")?.x ?? 0);
|
|
773
|
+
expect(pos("api")?.x).toBe(800);
|
|
774
|
+
expect(pos("tp_auth")?.x).toBe(1200);
|
|
775
|
+
const apiAuth = graph.edges.find((e) => e.id === "api_auth");
|
|
776
|
+
expect(apiAuth?.sourceHandle).toBe("right-source");
|
|
777
|
+
expect(apiAuth?.targetHandle).toBe("left-target");
|
|
778
|
+
});
|
|
779
|
+
});
|