@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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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 graph_mapping_1 = require("../../../src/core/pipeline/graph-mapping");
|
|
8
|
+
const orchestrator_1 = require("../../../src/core/pipeline/orchestrator");
|
|
9
|
+
const dedupe_1 = require("../../../src/data-flow/dedupe");
|
|
10
|
+
function shuffleDeterministic(arr, mode) {
|
|
11
|
+
// Avoid randomness to keep the test stable across runs.
|
|
12
|
+
if (mode === 1)
|
|
13
|
+
return [...arr].reverse();
|
|
14
|
+
// mode 2: rotate by 1
|
|
15
|
+
if (arr.length <= 1)
|
|
16
|
+
return arr;
|
|
17
|
+
return [arr[arr.length - 1], ...arr.slice(0, -1)];
|
|
18
|
+
}
|
|
19
|
+
describe("invariant-tests - determinism", () => {
|
|
20
|
+
it("scan() twice produces identical graph outputs", async () => {
|
|
21
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
22
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
23
|
+
deepAnalysis: false,
|
|
24
|
+
});
|
|
25
|
+
const { scanResult: scanResult1 } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
26
|
+
const { scanResult: scanResult2 } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
27
|
+
const graph1 = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult1);
|
|
28
|
+
const graph2 = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult2);
|
|
29
|
+
expect(graph1).toEqual(graph2);
|
|
30
|
+
});
|
|
31
|
+
it("dedupeDataFlows output is order-independent", () => {
|
|
32
|
+
const baseFlows = [
|
|
33
|
+
{
|
|
34
|
+
id: "flow_1",
|
|
35
|
+
sourceComponentId: "app",
|
|
36
|
+
targetComponentId: "db",
|
|
37
|
+
type: "database_query",
|
|
38
|
+
confidence: 0.7,
|
|
39
|
+
sourceLocation: { filePath: "src/db.ts", startLine: 20, endLine: 21 },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "flow_2",
|
|
43
|
+
sourceComponentId: "app",
|
|
44
|
+
targetComponentId: "db",
|
|
45
|
+
type: "database_query",
|
|
46
|
+
confidence: 0.9,
|
|
47
|
+
sourceLocation: { filePath: "src/db.ts", startLine: 10, endLine: 11 },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "flow_3",
|
|
51
|
+
sourceComponentId: "app",
|
|
52
|
+
targetComponentId: "db2",
|
|
53
|
+
type: "database_query",
|
|
54
|
+
confidence: 0.8,
|
|
55
|
+
sourceLocation: { filePath: "src/db2.ts", startLine: 5, endLine: 6 },
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
const dedupedA = (0, dedupe_1.dedupeDataFlows)(baseFlows);
|
|
59
|
+
const dedupedB = (0, dedupe_1.dedupeDataFlows)(shuffleDeterministic(baseFlows, 1));
|
|
60
|
+
const dedupedC = (0, dedupe_1.dedupeDataFlows)(shuffleDeterministic(baseFlows, 2));
|
|
61
|
+
expect(dedupedA).toEqual(dedupedB);
|
|
62
|
+
expect(dedupedA).toEqual(dedupedC);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const discover_service_sections_1 = require("../../../src/core/sectioning/discover-service-sections");
|
|
10
|
+
const classify_1 = require("../../../src/classifier/classify");
|
|
11
|
+
const application_injection_1 = require("../../../src/classifier/application-injection");
|
|
12
|
+
const enhance_1 = require("../../../src/classifier/enhance");
|
|
13
|
+
const dependency_manifests_1 = require("../../../src/analyzers/typescript/dependency-manifests");
|
|
14
|
+
const discover_service_sections_2 = require("../../../src/core/sectioning/discover-service-sections");
|
|
15
|
+
const data_flow_1 = require("../../../src/data-flow");
|
|
16
|
+
function write(p, content) {
|
|
17
|
+
fs_1.default.mkdirSync(path_1.default.dirname(p), { recursive: true });
|
|
18
|
+
fs_1.default.writeFileSync(p, content, "utf8");
|
|
19
|
+
}
|
|
20
|
+
describe("manifest package hub", () => {
|
|
21
|
+
it("creates twenty-companion hub and declared edge to Anthropic from package.json", async () => {
|
|
22
|
+
const root = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dp-companion-"));
|
|
23
|
+
try {
|
|
24
|
+
write(path_1.default.join(root, "packages", "twenty-companion", "package.json"), JSON.stringify({
|
|
25
|
+
name: "twenty-companion",
|
|
26
|
+
dependencies: {
|
|
27
|
+
"@anthropic-ai/sdk": "^0.30.0",
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
const { sections } = await (0, discover_service_sections_1.discoverServiceSections)(root);
|
|
31
|
+
const manifestFindings = await (0, dependency_manifests_1.detectTypeScriptPatternsFromDependencyManifests)(root);
|
|
32
|
+
(0, discover_service_sections_2.tagFindingsWithServiceSections)(manifestFindings, sections);
|
|
33
|
+
const classified = (0, classify_1.classifyRawFindings)(manifestFindings);
|
|
34
|
+
const withHub = (0, application_injection_1.injectApplicationAssetsPerSectionIfMissing)(classified, sections);
|
|
35
|
+
const enhanced = (0, enhance_1.enhanceComponents)(withHub);
|
|
36
|
+
const flows = (0, data_flow_1.detectDataFlows)([], enhanced, manifestFindings, sections);
|
|
37
|
+
const hub = enhanced.find((c) => c.properties?.section_id === "packages/twenty-companion" &&
|
|
38
|
+
c.properties?.isMainApplication === true);
|
|
39
|
+
const anthropic = enhanced.find((c) => c.type === "third_party" &&
|
|
40
|
+
c.properties?.section_id === "packages/twenty-companion" &&
|
|
41
|
+
c.name.toLowerCase().includes("anthropic"));
|
|
42
|
+
expect(hub?.name).toBe("twenty-companion");
|
|
43
|
+
expect(anthropic).toBeDefined();
|
|
44
|
+
const declared = flows.find((f) => f.sourceComponentId === hub?.id &&
|
|
45
|
+
f.targetComponentId === anthropic?.id);
|
|
46
|
+
expect(declared).toBeDefined();
|
|
47
|
+
expect(declared?.enrichmentNotes).toBe("declared_dependency");
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const discover_service_sections_1 = require("../../../src/core/sectioning/discover-service-sections");
|
|
10
|
+
const application_injection_1 = require("../../../src/classifier/application-injection");
|
|
11
|
+
function write(p, content) {
|
|
12
|
+
fs_1.default.mkdirSync(path_1.default.dirname(p), { recursive: true });
|
|
13
|
+
fs_1.default.writeFileSync(p, content, "utf8");
|
|
14
|
+
}
|
|
15
|
+
describe("monorepo package sections", () => {
|
|
16
|
+
it("inferMonorepoPackageSectionPathDepth picks shallowest depth with multiple packages", () => {
|
|
17
|
+
expect((0, discover_service_sections_1.inferMonorepoPackageSectionPathDepth)([
|
|
18
|
+
"packages/server/package.json",
|
|
19
|
+
"packages/front/package.json",
|
|
20
|
+
"packages/apps/nested/package.json",
|
|
21
|
+
])).toBe(2);
|
|
22
|
+
});
|
|
23
|
+
it("rollupSectionIdToMonorepoDepth trims nested package paths", () => {
|
|
24
|
+
expect((0, discover_service_sections_1.rollupSectionIdToMonorepoDepth)("packages/apps/nested", 2)).toBe("packages/apps");
|
|
25
|
+
});
|
|
26
|
+
it("uses package.json name for section label and rolls up nested packages", async () => {
|
|
27
|
+
const root = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dp-mono-"));
|
|
28
|
+
try {
|
|
29
|
+
write(path_1.default.join(root, "packages", "twenty-server", "package.json"), JSON.stringify({ name: "@twenty/twenty-server" }));
|
|
30
|
+
write(path_1.default.join(root, "packages", "twenty-front", "package.json"), JSON.stringify({ name: "@twenty/twenty-front" }));
|
|
31
|
+
write(path_1.default.join(root, "packages", "twenty-apps", "hello", "package.json"), JSON.stringify({ name: "@twenty/hello-app" }));
|
|
32
|
+
write(path_1.default.join(root, "packages", "twenty-apps", "hello", "src", "routes.ts"), "export const x = 1;\n");
|
|
33
|
+
const { sections, inferredMonorepoPackageSectionPathDepth } = await (0, discover_service_sections_1.discoverServiceSections)(root);
|
|
34
|
+
expect(inferredMonorepoPackageSectionPathDepth).toBe(2);
|
|
35
|
+
const server = sections.find((s) => s.id === "packages/twenty-server");
|
|
36
|
+
expect(server?.label).toBe("twenty-server");
|
|
37
|
+
expect(server?.isPrimaryMonorepoPackage).toBe(true);
|
|
38
|
+
const appsParent = sections.find((s) => s.id === "packages/twenty-apps");
|
|
39
|
+
expect(appsParent).toBeDefined();
|
|
40
|
+
expect(appsParent?.isPrimaryMonorepoPackage).toBe(true);
|
|
41
|
+
const nested = sections.find((s) => s.id === "packages/twenty-apps/hello");
|
|
42
|
+
expect(nested?.isPrimaryMonorepoPackage).toBe(false);
|
|
43
|
+
const findings = [
|
|
44
|
+
{
|
|
45
|
+
pattern: "express_route",
|
|
46
|
+
name: "GET /hello",
|
|
47
|
+
confidence: 0.9,
|
|
48
|
+
location: {
|
|
49
|
+
filePath: "packages/twenty-apps/hello/src/routes.ts",
|
|
50
|
+
startLine: 1,
|
|
51
|
+
endLine: 1,
|
|
52
|
+
},
|
|
53
|
+
properties: {},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
(0, discover_service_sections_1.tagFindingsWithServiceSections)(findings, sections, {
|
|
57
|
+
monorepoPackageSectionPathDepth: 2,
|
|
58
|
+
});
|
|
59
|
+
expect(findings[0]?.properties.section_id).toBe("packages/twenty-apps");
|
|
60
|
+
expect(findings[0]?.properties.section_label).toBe("twenty-apps");
|
|
61
|
+
expect(findings[0]?.properties.package_name).toBeUndefined();
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
it("discoverServiceSections honors explicit monorepoPackageSectionPathDepth override", async () => {
|
|
68
|
+
const root = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dp-mono-depth-"));
|
|
69
|
+
try {
|
|
70
|
+
write(path_1.default.join(root, "packages", "twenty-server", "package.json"), JSON.stringify({ name: "twenty-server" }));
|
|
71
|
+
write(path_1.default.join(root, "packages", "twenty-apps", "hello", "package.json"), JSON.stringify({ name: "hello" }));
|
|
72
|
+
const at2 = await (0, discover_service_sections_1.discoverServiceSections)(root, {
|
|
73
|
+
monorepoPackageSectionPathDepth: 2,
|
|
74
|
+
});
|
|
75
|
+
const helloAt2 = at2.sections.find((s) => s.id === "packages/twenty-apps/hello");
|
|
76
|
+
expect(helloAt2?.isPrimaryMonorepoPackage).toBe(false);
|
|
77
|
+
const at3 = await (0, discover_service_sections_1.discoverServiceSections)(root, {
|
|
78
|
+
monorepoPackageSectionPathDepth: 3,
|
|
79
|
+
});
|
|
80
|
+
const helloAt3 = at3.sections.find((s) => s.id === "packages/twenty-apps/hello");
|
|
81
|
+
expect(helloAt3?.isPrimaryMonorepoPackage).toBe(true);
|
|
82
|
+
expect(at3.monorepoPackageSectionPathDepth).toBe(3);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
it("injectApplicationAssetsPerSectionIfMissing only targets primary workspace packages", async () => {
|
|
89
|
+
const root = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dp-mono-inj-"));
|
|
90
|
+
try {
|
|
91
|
+
write(path_1.default.join(root, "packages", "api", "package.json"), JSON.stringify({ name: "api" }));
|
|
92
|
+
write(path_1.default.join(root, "packages", "ui", "package.json"), JSON.stringify({ name: "ui" }));
|
|
93
|
+
write(path_1.default.join(root, "packages", "ui", "widget", "package.json"), JSON.stringify({ name: "widget" }));
|
|
94
|
+
write(path_1.default.join(root, "packages", "docs", "package.json"), JSON.stringify({ name: "docs" }));
|
|
95
|
+
const { sections } = await (0, discover_service_sections_1.discoverServiceSections)(root);
|
|
96
|
+
const injected = (0, application_injection_1.injectApplicationAssetsPerSectionIfMissing)([
|
|
97
|
+
{
|
|
98
|
+
id: "cmp_1",
|
|
99
|
+
name: "Postgres",
|
|
100
|
+
type: "asset",
|
|
101
|
+
subType: "database",
|
|
102
|
+
confidence: 1,
|
|
103
|
+
detectedFrom: [],
|
|
104
|
+
sourceLocations: [],
|
|
105
|
+
properties: { section_id: "packages/api" },
|
|
106
|
+
},
|
|
107
|
+
], sections, { projectName: "ignored" });
|
|
108
|
+
const placeholderIds = injected
|
|
109
|
+
.filter((c) => c.properties?.sourceContext === "injected_project_placeholder")
|
|
110
|
+
.map((c) => c.properties?.section_id)
|
|
111
|
+
.sort();
|
|
112
|
+
expect(placeholderIds).toEqual(["packages/api"]);
|
|
113
|
+
expect(placeholderIds).not.toContain("packages/ui");
|
|
114
|
+
expect(placeholderIds).not.toContain("packages/ui/widget");
|
|
115
|
+
expect(placeholderIds).not.toContain("packages/docs");
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
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 graph_mapping_1 = require("../../../src/core/pipeline/graph-mapping");
|
|
7
|
+
const orchestrator_1 = require("../../../src/core/pipeline/orchestrator");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
function graphNodesContainCodeKey(graph) {
|
|
10
|
+
const visited = new Set();
|
|
11
|
+
const walk = (value) => {
|
|
12
|
+
if (value === null || value === undefined)
|
|
13
|
+
return false;
|
|
14
|
+
if (typeof value !== "object")
|
|
15
|
+
return false;
|
|
16
|
+
if (visited.has(value))
|
|
17
|
+
return false;
|
|
18
|
+
visited.add(value);
|
|
19
|
+
if (Array.isArray(value)) {
|
|
20
|
+
for (const v of value) {
|
|
21
|
+
if (walk(v))
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
for (const [k, v] of Object.entries(value)) {
|
|
27
|
+
if (k === "code")
|
|
28
|
+
return true;
|
|
29
|
+
if (walk(v))
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
for (const node of graph.nodes) {
|
|
35
|
+
if (node?.data && walk(node.data))
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
describe("output safety - no source code leakage (DP-P0-CLI-XXX)", () => {
|
|
41
|
+
it("does not emit `code` under graph.nodes[].data", async () => {
|
|
42
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
43
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
44
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
45
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
46
|
+
expect(graphNodesContainCodeKey(graph)).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,252 @@
|
|
|
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 promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const orchestrator_1 = require("../../../src/core/pipeline/orchestrator");
|
|
10
|
+
describe("core/pipeline/orchestrator - DP-P0-CLI-401", () => {
|
|
11
|
+
it("runs the full structural pipeline for the typescript-basic fixture", async () => {
|
|
12
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
13
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
14
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
15
|
+
expect(scanResult.components.length).toBeGreaterThan(0);
|
|
16
|
+
expect(scanResult.dataFlows.length).toBeGreaterThan(0);
|
|
17
|
+
expect(scanResult.filesScanned).toBeGreaterThan(0);
|
|
18
|
+
expect(scanResult.totalLines).toBeGreaterThan(0);
|
|
19
|
+
expect(scanResult.scanDurationMs).toBeGreaterThanOrEqual(0);
|
|
20
|
+
expect(Array.isArray(scanResult.errors)).toBe(true);
|
|
21
|
+
expect(Array.isArray(scanResult.warnings)).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it("enables Terraform and monorepo package section auto-inference by default", () => {
|
|
24
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
25
|
+
expect(config.autoInferTerraformStackSectionPathDepth).toBe(true);
|
|
26
|
+
expect(config.terraformStackSectionPathDepth).toBeUndefined();
|
|
27
|
+
expect(config.autoInferMonorepoPackageSectionPathDepth).toBe(true);
|
|
28
|
+
expect(config.monorepoPackageSectionPathDepth).toBe(2);
|
|
29
|
+
});
|
|
30
|
+
it("honors excludePaths by reducing the number of scanned files", async () => {
|
|
31
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
32
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
33
|
+
const { scanResult: baseline } = await (0, orchestrator_1.scan)(fixturesRoot, baselineConfig);
|
|
34
|
+
const configWithExcludes = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
35
|
+
excludePaths: ["**/db.ts"],
|
|
36
|
+
});
|
|
37
|
+
const { scanResult: withExcludes } = await (0, orchestrator_1.scan)(fixturesRoot, configWithExcludes);
|
|
38
|
+
expect(withExcludes.filesScanned).toBeLessThanOrEqual(baseline.filesScanned);
|
|
39
|
+
});
|
|
40
|
+
it("supports ? wildcard in excludePaths patterns", async () => {
|
|
41
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
42
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
43
|
+
const { files: baselineFiles } = await (0, orchestrator_1.scan)(fixturesRoot, baselineConfig);
|
|
44
|
+
const configWithQuestionGlob = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
45
|
+
excludePaths: ["d?.ts"],
|
|
46
|
+
});
|
|
47
|
+
const { files: withQuestionGlob } = await (0, orchestrator_1.scan)(fixturesRoot, configWithQuestionGlob);
|
|
48
|
+
const baselineHasDbTs = baselineFiles.some((file) => file.path.endsWith("db.ts"));
|
|
49
|
+
const withQuestionGlobHasDbTs = withQuestionGlob.some((file) => file.path.endsWith("db.ts"));
|
|
50
|
+
expect(baselineHasDbTs).toBe(true);
|
|
51
|
+
expect(withQuestionGlobHasDbTs).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
it("filters files by languages when languages are specified", async () => {
|
|
54
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
55
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
56
|
+
const { scanResult: baseline } = await (0, orchestrator_1.scan)(fixturesRoot, baselineConfig);
|
|
57
|
+
const configLanguagesOnlyTs = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
58
|
+
languages: ["typescript"],
|
|
59
|
+
});
|
|
60
|
+
const { scanResult: tsOnly } = await (0, orchestrator_1.scan)(fixturesRoot, configLanguagesOnlyTs);
|
|
61
|
+
expect(tsOnly.filesScanned).toBeLessThanOrEqual(baseline.filesScanned);
|
|
62
|
+
});
|
|
63
|
+
it("enforces minimumConfidence across findings, components, and flows", async () => {
|
|
64
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
65
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
66
|
+
minimumConfidence: 0,
|
|
67
|
+
});
|
|
68
|
+
const { scanResult: baseline, findings: baselineFindings } = await (0, orchestrator_1.scan)(fixturesRoot, baselineConfig);
|
|
69
|
+
const strictConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
70
|
+
minimumConfidence: 0.95,
|
|
71
|
+
});
|
|
72
|
+
const { scanResult: strict, findings: strictFindings } = await (0, orchestrator_1.scan)(fixturesRoot, strictConfig);
|
|
73
|
+
expect(strictFindings.every((f) => f.confidence >= 0.95)).toBe(true);
|
|
74
|
+
expect(strict.components.every((c) => c.confidence >= 0.95)).toBe(true);
|
|
75
|
+
expect(strict.dataFlows.every((f) => f.confidence >= 0.95)).toBe(true);
|
|
76
|
+
expect(strictFindings.length).toBeLessThanOrEqual(baselineFindings.length);
|
|
77
|
+
expect(strict.components.length).toBeLessThanOrEqual(baseline.components.length);
|
|
78
|
+
expect(strict.dataFlows.length).toBeLessThanOrEqual(baseline.dataFlows.length);
|
|
79
|
+
});
|
|
80
|
+
it("respects enableAPIDetection and enableDatabaseDetection", async () => {
|
|
81
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
82
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
83
|
+
const { findings: baselineFindings } = await (0, orchestrator_1.scan)(fixturesRoot, baselineConfig);
|
|
84
|
+
const apiDisabledConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
85
|
+
enableAPIDetection: false,
|
|
86
|
+
});
|
|
87
|
+
const { findings: apiDisabledFindings } = await (0, orchestrator_1.scan)(fixturesRoot, apiDisabledConfig);
|
|
88
|
+
const dbDisabledConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
89
|
+
enableDatabaseDetection: false,
|
|
90
|
+
});
|
|
91
|
+
const { findings: dbDisabledFindings } = await (0, orchestrator_1.scan)(fixturesRoot, dbDisabledConfig);
|
|
92
|
+
const countByPattern = (pattern, findings) => findings.filter((f) => f.pattern === pattern).length;
|
|
93
|
+
expect(countByPattern("express_route", apiDisabledFindings)).toBeLessThanOrEqual(countByPattern("express_route", baselineFindings));
|
|
94
|
+
expect(countByPattern("database_connection", dbDisabledFindings)).toBeLessThanOrEqual(countByPattern("database_connection", baselineFindings));
|
|
95
|
+
});
|
|
96
|
+
it("emits ScanProgress events in the expected phase order", async () => {
|
|
97
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
98
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
99
|
+
const phases = [];
|
|
100
|
+
await (0, orchestrator_1.scan)(fixturesRoot, config, (progress) => {
|
|
101
|
+
phases.push(progress.phase);
|
|
102
|
+
expect(progress.progress).toBeGreaterThanOrEqual(0);
|
|
103
|
+
expect(progress.progress).toBeLessThanOrEqual(1);
|
|
104
|
+
});
|
|
105
|
+
// We expect at least one occurrence of each structural phase in order.
|
|
106
|
+
const phaseString = phases.join(">");
|
|
107
|
+
expect(phaseString.indexOf("ingest")).toBeGreaterThanOrEqual(0);
|
|
108
|
+
expect(phaseString.indexOf("analyze")).toBeGreaterThan(phaseString.indexOf("ingest"));
|
|
109
|
+
expect(phaseString.indexOf("classify")).toBeGreaterThan(phaseString.indexOf("analyze"));
|
|
110
|
+
expect(phaseString.indexOf("data_flow")).toBeGreaterThan(phaseString.indexOf("classify"));
|
|
111
|
+
expect(phaseString.lastIndexOf("output")).toBeGreaterThan(phaseString.indexOf("data_flow"));
|
|
112
|
+
});
|
|
113
|
+
it("detects third-party services from Python dependency manifests", async () => {
|
|
114
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "python-dependency-manifests-basic");
|
|
115
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
116
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
117
|
+
const thirdParties = scanResult.components.filter((c) => c.type === "third_party");
|
|
118
|
+
const serviceNames = thirdParties
|
|
119
|
+
.map((c) => c.properties?.serviceName)
|
|
120
|
+
.filter((v) => typeof v === "string");
|
|
121
|
+
expect(serviceNames).toEqual(expect.arrayContaining(["openai", "sentry", "aws"]));
|
|
122
|
+
expect(serviceNames).not.toContain("anthropic");
|
|
123
|
+
});
|
|
124
|
+
it("detects third-party services from TypeScript dependency manifests", async () => {
|
|
125
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-dependency-manifests-basic");
|
|
126
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
127
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
128
|
+
const thirdParties = scanResult.components.filter((c) => c.type === "third_party");
|
|
129
|
+
const serviceNames = thirdParties
|
|
130
|
+
.map((c) => c.properties?.serviceName)
|
|
131
|
+
.filter((v) => typeof v === "string");
|
|
132
|
+
expect(serviceNames).toEqual(expect.arrayContaining(["stripe", "sendgrid", "aws", "sentry"]));
|
|
133
|
+
expect(serviceNames).not.toContain("twilio");
|
|
134
|
+
});
|
|
135
|
+
it("applies excludePaths to manifest scanning and section derivation", async () => {
|
|
136
|
+
const root = await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), "dp-orch-excludes-"));
|
|
137
|
+
try {
|
|
138
|
+
await promises_1.default.mkdir(path_1.default.join(root, "sandbox-a"), { recursive: true });
|
|
139
|
+
await promises_1.default.mkdir(path_1.default.join(root, "sandbox-b"), { recursive: true });
|
|
140
|
+
await promises_1.default.mkdir(path_1.default.join(root, "src"), { recursive: true });
|
|
141
|
+
await promises_1.default.writeFile(path_1.default.join(root, "src", "app.ts"), 'export const app = "ok";\n');
|
|
142
|
+
await promises_1.default.writeFile(path_1.default.join(root, "sandbox-a", "package.json"), JSON.stringify({
|
|
143
|
+
name: "sandbox-a",
|
|
144
|
+
dependencies: { next: "14.0.0" },
|
|
145
|
+
}));
|
|
146
|
+
await promises_1.default.writeFile(path_1.default.join(root, "sandbox-b", "package.json"), JSON.stringify({
|
|
147
|
+
name: "sandbox-b",
|
|
148
|
+
dependencies: { react: "18.0.0" },
|
|
149
|
+
}));
|
|
150
|
+
const baselineConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
151
|
+
minimumConfidence: 0,
|
|
152
|
+
});
|
|
153
|
+
const { scanResult: baseline } = await (0, orchestrator_1.scan)(root, baselineConfig);
|
|
154
|
+
const excludedConfig = (0, orchestrator_1.createDefaultScanConfiguration)({
|
|
155
|
+
minimumConfidence: 0,
|
|
156
|
+
excludePaths: ["sandbox-a/**", "sandbox-b/**"],
|
|
157
|
+
});
|
|
158
|
+
const { scanResult: excluded } = await (0, orchestrator_1.scan)(root, excludedConfig);
|
|
159
|
+
const sectionIdsBaseline = baseline.components
|
|
160
|
+
.map((c) => c.properties?.section_id)
|
|
161
|
+
.filter((v) => typeof v === "string");
|
|
162
|
+
const sectionIdsExcluded = excluded.components
|
|
163
|
+
.map((c) => c.properties?.section_id)
|
|
164
|
+
.filter((v) => typeof v === "string");
|
|
165
|
+
expect(sectionIdsBaseline).toEqual(expect.arrayContaining(["sandbox-a", "sandbox-b"]));
|
|
166
|
+
expect(sectionIdsExcluded).not.toEqual(expect.arrayContaining(["sandbox-a", "sandbox-b"]));
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
await promises_1.default.rm(root, { recursive: true, force: true });
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
it("excludes co-located test files and playwright config by default", async () => {
|
|
173
|
+
const root = await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), "dp-orch-default-excludes-"));
|
|
174
|
+
try {
|
|
175
|
+
await promises_1.default.mkdir(path_1.default.join(root, "src"), { recursive: true });
|
|
176
|
+
await promises_1.default.writeFile(path_1.default.join(root, "src", "app.ts"), "export const x = 1;\n", "utf8");
|
|
177
|
+
await promises_1.default.writeFile(path_1.default.join(root, "src", "app.spec.ts"), "import { x } from './app';\n", "utf8");
|
|
178
|
+
await promises_1.default.writeFile(path_1.default.join(root, "playwright.config.ts"), "export default {};\n", "utf8");
|
|
179
|
+
const { files } = await (0, orchestrator_1.scan)(root, (0, orchestrator_1.createDefaultScanConfiguration)());
|
|
180
|
+
const paths = files.map((f) => f.path);
|
|
181
|
+
expect(paths.some((p) => p.endsWith("app.spec.ts"))).toBe(false);
|
|
182
|
+
expect(paths.some((p) => p.includes("playwright.config"))).toBe(false);
|
|
183
|
+
expect(paths.some((p) => p.endsWith("app.ts"))).toBe(true);
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
await promises_1.default.rm(root, { recursive: true, force: true });
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
it("produces a combined ScanResult for mixed TypeScript and Python repos", async () => {
|
|
190
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "mixed-language-basic");
|
|
191
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
192
|
+
const { scanResult, files, findings } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
193
|
+
const scannedLanguages = new Set(files.map((file) => file.language));
|
|
194
|
+
expect(scannedLanguages.has("typescript")).toBe(true);
|
|
195
|
+
expect(scannedLanguages.has("python")).toBe(true);
|
|
196
|
+
const findingPaths = findings.map((finding) => finding.location.filePath);
|
|
197
|
+
expect(findingPaths.some((p) => p.endsWith(".ts"))).toBe(true);
|
|
198
|
+
expect(findingPaths.some((p) => p.endsWith(".py"))).toBe(true);
|
|
199
|
+
expect(scanResult.components.length).toBeGreaterThan(0);
|
|
200
|
+
expect(scanResult.dataFlows.length).toBeGreaterThan(0);
|
|
201
|
+
const flowTypes = new Set(scanResult.dataFlows.map((flow) => flow.type));
|
|
202
|
+
expect(flowTypes.has("database_query")).toBe(true);
|
|
203
|
+
expect(flowTypes.has("api_call")).toBe(true);
|
|
204
|
+
const statsByLanguage = new Set((scanResult.languageStats ?? []).map((stat) => stat.language));
|
|
205
|
+
expect(statsByLanguage.has("python")).toBe(true);
|
|
206
|
+
});
|
|
207
|
+
it("keeps direct app -> postgres edges end-to-end when provider nodes are absent", async () => {
|
|
208
|
+
const root = await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), "dp-orch-provider-topology-"));
|
|
209
|
+
try {
|
|
210
|
+
await promises_1.default.mkdir(path_1.default.join(root, "src"), { recursive: true });
|
|
211
|
+
await promises_1.default.writeFile(path_1.default.join(root, "package.json"), JSON.stringify({
|
|
212
|
+
name: "provider-topology-fixture",
|
|
213
|
+
version: "1.0.0",
|
|
214
|
+
dependencies: {
|
|
215
|
+
express: "^4.18.2",
|
|
216
|
+
pg: "^8.13.1",
|
|
217
|
+
},
|
|
218
|
+
}, null, 2));
|
|
219
|
+
await promises_1.default.writeFile(path_1.default.join(root, "src", "app.ts"), [
|
|
220
|
+
"import express from 'express';",
|
|
221
|
+
"import { Pool } from 'pg';",
|
|
222
|
+
"",
|
|
223
|
+
"const app = express();",
|
|
224
|
+
"const pool = new Pool({ connectionString: process.env.DATABASE_URL });",
|
|
225
|
+
"",
|
|
226
|
+
"app.get('/users', async (_req, res) => {",
|
|
227
|
+
" const result = await pool.query('SELECT * FROM users');",
|
|
228
|
+
" res.json(result.rows ?? []);",
|
|
229
|
+
"});",
|
|
230
|
+
"",
|
|
231
|
+
"export default app;",
|
|
232
|
+
"",
|
|
233
|
+
].join("\n"), "utf8");
|
|
234
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
235
|
+
const { scanResult } = await (0, orchestrator_1.scan)(root, config);
|
|
236
|
+
const postgresTargets = scanResult.components.filter((c) => c.type === "asset" &&
|
|
237
|
+
c.subType === "database" &&
|
|
238
|
+
(String(c.properties?.databaseType ?? "").toLowerCase().includes("postgres") ||
|
|
239
|
+
String(c.properties?.client ?? "").toLowerCase().includes("pg")));
|
|
240
|
+
expect(postgresTargets.length).toBeGreaterThan(0);
|
|
241
|
+
const hasDirectDbFlow = scanResult.dataFlows.some((f) => postgresTargets.some((db) => db.id === f.targetComponentId) &&
|
|
242
|
+
f.type === "database_query");
|
|
243
|
+
expect(hasDirectDbFlow).toBe(true);
|
|
244
|
+
const hasSupabaseNode = scanResult.components.some((c) => c.type === "third_party" &&
|
|
245
|
+
String(c.properties?.serviceName ?? "").toLowerCase() === "supabase");
|
|
246
|
+
expect(hasSupabaseNode).toBe(false);
|
|
247
|
+
}
|
|
248
|
+
finally {
|
|
249
|
+
await promises_1.default.rm(root, { recursive: true, force: true });
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const graph_mapping_1 = require("../../../src/core/pipeline/graph-mapping");
|
|
10
|
+
const orchestrator_1 = require("../../../src/core/pipeline/orchestrator");
|
|
11
|
+
const dataflow_wrapper_schema_1 = require("../../../src/core/schema/dataflow-wrapper.schema");
|
|
12
|
+
const json_1 = require("../../../src/output/json");
|
|
13
|
+
describe("output/json - DP-P0-CLI-403", () => {
|
|
14
|
+
it("builds and writes a validated dataflow.json wrapper for a real ScanResult", async () => {
|
|
15
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
16
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
17
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
18
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
19
|
+
const wrapper = (0, json_1.buildDataflowWrapper)(scanResult, graph);
|
|
20
|
+
const validation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(wrapper);
|
|
21
|
+
expect(validation.ok).toBe(true);
|
|
22
|
+
if (!validation.ok) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
expect(validation.value.metadata?.componentsCount).toBe(scanResult.components.length);
|
|
26
|
+
expect(validation.value.metadata?.dataFlowsCount).toBe(scanResult.dataFlows.length);
|
|
27
|
+
expect(validation.value.metadata?.filesScanned).toBe(scanResult.filesScanned);
|
|
28
|
+
expect(validation.value.metadata?.scanDurationMs).toBe(scanResult.scanDurationMs);
|
|
29
|
+
const outputPath = path_1.default.join(os_1.default.tmpdir(), `dataparade-dataflow-${Date.now()}.json`);
|
|
30
|
+
(0, json_1.writeDataflowJson)({
|
|
31
|
+
scanResult,
|
|
32
|
+
graph,
|
|
33
|
+
outputPath,
|
|
34
|
+
});
|
|
35
|
+
const contents = fs_1.default.readFileSync(outputPath, "utf8");
|
|
36
|
+
const parsed = JSON.parse(contents);
|
|
37
|
+
const fileValidation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(parsed);
|
|
38
|
+
expect(fileValidation.ok).toBe(true);
|
|
39
|
+
fs_1.default.unlinkSync(outputPath);
|
|
40
|
+
});
|
|
41
|
+
it("throws and does not write a file when validation fails", async () => {
|
|
42
|
+
const fixturesRoot = path_1.default.join(__dirname, "..", "..", "fixtures", "typescript-basic");
|
|
43
|
+
const config = (0, orchestrator_1.createDefaultScanConfiguration)();
|
|
44
|
+
const { scanResult } = await (0, orchestrator_1.scan)(fixturesRoot, config);
|
|
45
|
+
const graph = (0, graph_mapping_1.buildDiagramGraphFromScanResult)(scanResult);
|
|
46
|
+
// Create an intentionally invalid graph by clearing the first node id so
|
|
47
|
+
// that validation fails when writing the wrapper.
|
|
48
|
+
const invalidGraph = {
|
|
49
|
+
...graph,
|
|
50
|
+
nodes: graph.nodes.map((node, index) => index === 0
|
|
51
|
+
? {
|
|
52
|
+
...node,
|
|
53
|
+
id: "",
|
|
54
|
+
}
|
|
55
|
+
: node),
|
|
56
|
+
};
|
|
57
|
+
const outputPath = path_1.default.join(os_1.default.tmpdir(), `dataparade-dataflow-invalid-${Date.now()}.json`);
|
|
58
|
+
expect(() => (0, json_1.writeDataflowJson)({
|
|
59
|
+
scanResult,
|
|
60
|
+
graph: invalidGraph,
|
|
61
|
+
outputPath,
|
|
62
|
+
})).toThrow(/Invalid dataflow\.json wrapper/);
|
|
63
|
+
expect(fs_1.default.existsSync(outputPath)).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|