@dataparade/cli 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -8
- package/dist/src/ai-enrichment/candidate-selector.d.ts +1 -1
- package/dist/src/ai-enrichment/fallbacks.d.ts +2 -2
- package/dist/src/ai-enrichment/fallbacks.js +97 -80
- package/dist/src/ai-enrichment/merge-rules.d.ts +2 -0
- package/dist/src/ai-enrichment/merge-rules.js +116 -4
- package/dist/src/ai-enrichment/non-pii-signal-rules.js +2 -6
- package/dist/src/ai-enrichment/openai-proposals-response.schema.d.ts +1 -1
- package/dist/src/ai-enrichment/pii-signal-rules.js +2 -6
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.d.ts +1 -1
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +1 -1
- package/dist/src/ai-enrichment/provider-prompt.d.ts +1 -1
- package/dist/src/ai-enrichment/provider-prompt.js +4 -0
- package/dist/src/ai-enrichment/provider-topology-rules.js +2 -6
- package/dist/src/ai-enrichment/providers/provider-contract.d.ts +6 -0
- package/dist/src/ai-enrichment/providers/provider-contract.js +62 -2
- package/dist/src/ai-enrichment/sensitive-paths.d.ts +1 -1
- package/dist/src/ai-enrichment/sensitive-paths.js +3 -3
- package/dist/src/ai-enrichment/third-party-data-flow.js +3 -3
- package/dist/src/ai-enrichment/third-party-subtype.js +2 -2
- package/dist/src/ai-enrichment/tools/index.d.ts +1 -1
- package/dist/src/ai-enrichment/types.d.ts +1 -1
- package/dist/src/cli.js +6 -5
- package/dist/src/config/file.d.ts +1 -1
- package/dist/src/config/file.js +21 -20
- package/dist/src/config/resolve.d.ts +1 -1
- package/dist/src/config/resolve.js +75 -69
- package/dist/src/core/pipeline/graph-mapping.d.ts +1 -6
- package/dist/src/core/pipeline/graph-mapping.js +3 -314
- package/dist/src/core/pipeline/orchestrator-result.d.ts +1 -6
- package/dist/src/core/pipeline/orchestrator.d.ts +2 -26
- package/dist/src/core/pipeline/orchestrator.js +4 -77
- package/dist/src/core/pipeline/scan-pipeline.d.ts +2 -1
- package/dist/src/core/pipeline/scan-pipeline.js +39 -97
- package/dist/src/core/schema/index.d.ts +2 -2
- package/dist/src/core/schema/index.js +4 -2
- package/dist/src/core/schema/scan-config.schema.d.ts +4 -3
- package/dist/src/core/schema/scan-config.schema.js +18 -17
- package/dist/src/core/schema/scan-result.schema.d.ts +2 -456
- package/dist/src/core/schema/scan-result.schema.js +12 -240
- package/dist/src/core/types/component.d.ts +1 -18
- package/dist/src/core/types/component.js +15 -0
- package/dist/src/core/types/config.d.ts +1 -64
- package/dist/src/core/types/config.js +15 -0
- package/dist/src/core/types/data-flow.d.ts +1 -24
- package/dist/src/core/types/data-flow.js +15 -0
- package/dist/src/core/types/detection.d.ts +1 -12
- package/dist/src/core/types/detection.js +15 -17
- package/dist/src/core/types/file.d.ts +1 -14
- package/dist/src/core/types/file.js +15 -0
- package/dist/src/core/types/index.d.ts +1 -7
- package/dist/src/core/types/index.js +1 -7
- package/dist/src/core/types/progress.d.ts +1 -9
- package/dist/src/core/types/progress.js +15 -0
- package/dist/src/core/types/result.d.ts +1 -140
- package/dist/src/core/types/result.js +15 -0
- package/dist/src/evals/run-model-matrix.js +2 -1
- package/dist/src/platform-api/estimate-scan-footprint.js +9 -10
- package/dist/src/scanner-package-root.d.ts +2 -0
- package/dist/src/scanner-package-root.js +12 -0
- package/dist/tests/cli/cli.spec.js +18 -15
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +246 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.js +78 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +2 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +2 -2
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +5 -3
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +2 -2
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.js +2 -1
- package/dist/tests/unit/cli/scan-command-exit-code.spec.js +7 -5
- package/dist/tests/unit/core/cpp-dotnet-scan.spec.js +4 -3
- package/dist/tests/unit/core/go-scan.spec.js +7 -6
- package/dist/tests/unit/core/graph-mapping.spec.js +2 -1
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.js +7 -6
- package/dist/tests/unit/core/jvm-scan.spec.js +6 -5
- package/dist/tests/unit/core/no-source-code-leakage.spec.js +2 -1
- package/dist/tests/unit/core/orchestrator.spec.js +21 -20
- package/dist/tests/unit/core/output-json.spec.js +3 -2
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.js +2 -1
- package/dist/tests/unit/core/scan-result-language-stats.spec.js +2 -1
- package/dist/tests/unit/core/terraform-json-overlay.spec.js +2 -1
- package/dist/tests/unit/publish-manifest.spec.js +3 -2
- package/package.json +5 -8
- package/dist/src/analyzers/cpp/cpp-detection-config.d.ts +0 -73
- package/dist/src/analyzers/cpp/cpp-detection-config.js +0 -137
- package/dist/src/analyzers/cpp/dependency-manifests.d.ts +0 -8
- package/dist/src/analyzers/cpp/dependency-manifests.js +0 -130
- package/dist/src/analyzers/cpp/detector.d.ts +0 -3
- package/dist/src/analyzers/cpp/detector.js +0 -21
- package/dist/src/analyzers/cpp/index.d.ts +0 -2
- package/dist/src/analyzers/cpp/index.js +0 -11
- package/dist/src/analyzers/cpp/manifest-parsers.d.ts +0 -13
- package/dist/src/analyzers/cpp/manifest-parsers.js +0 -104
- package/dist/src/analyzers/cpp/parser.d.ts +0 -35
- package/dist/src/analyzers/cpp/parser.js +0 -206
- package/dist/src/analyzers/cpp/patterns.d.ts +0 -3
- package/dist/src/analyzers/cpp/patterns.js +0 -37
- package/dist/src/analyzers/csharp/csharp-detection-config.d.ts +0 -100
- package/dist/src/analyzers/csharp/csharp-detection-config.js +0 -160
- package/dist/src/analyzers/csharp/dependency-manifests.d.ts +0 -13
- package/dist/src/analyzers/csharp/dependency-manifests.js +0 -184
- package/dist/src/analyzers/csharp/detector.d.ts +0 -3
- package/dist/src/analyzers/csharp/detector.js +0 -21
- package/dist/src/analyzers/csharp/index.d.ts +0 -2
- package/dist/src/analyzers/csharp/index.js +0 -11
- package/dist/src/analyzers/csharp/manifest-parsers.d.ts +0 -34
- package/dist/src/analyzers/csharp/manifest-parsers.js +0 -130
- package/dist/src/analyzers/csharp/parser.d.ts +0 -48
- package/dist/src/analyzers/csharp/parser.js +0 -277
- package/dist/src/analyzers/csharp/patterns.d.ts +0 -3
- package/dist/src/analyzers/csharp/patterns.js +0 -57
- package/dist/src/analyzers/go/dependency-manifests.d.ts +0 -10
- package/dist/src/analyzers/go/dependency-manifests.js +0 -117
- package/dist/src/analyzers/go/detector.d.ts +0 -3
- package/dist/src/analyzers/go/detector.js +0 -21
- package/dist/src/analyzers/go/go-detection-config.d.ts +0 -97
- package/dist/src/analyzers/go/go-detection-config.js +0 -164
- package/dist/src/analyzers/go/index.d.ts +0 -2
- package/dist/src/analyzers/go/index.js +0 -11
- package/dist/src/analyzers/go/manifest-parsers.d.ts +0 -20
- package/dist/src/analyzers/go/manifest-parsers.js +0 -104
- package/dist/src/analyzers/go/parser.d.ts +0 -40
- package/dist/src/analyzers/go/parser.js +0 -186
- package/dist/src/analyzers/go/patterns.d.ts +0 -3
- package/dist/src/analyzers/go/patterns.js +0 -50
- package/dist/src/analyzers/jvm/dependency-manifests.d.ts +0 -16
- package/dist/src/analyzers/jvm/dependency-manifests.js +0 -205
- package/dist/src/analyzers/jvm/detector.d.ts +0 -3
- package/dist/src/analyzers/jvm/detector.js +0 -21
- package/dist/src/analyzers/jvm/index.d.ts +0 -9
- package/dist/src/analyzers/jvm/index.js +0 -18
- package/dist/src/analyzers/jvm/jvm-detection-config.d.ts +0 -136
- package/dist/src/analyzers/jvm/jvm-detection-config.js +0 -195
- package/dist/src/analyzers/jvm/manifest-parsers.d.ts +0 -61
- package/dist/src/analyzers/jvm/manifest-parsers.js +0 -246
- package/dist/src/analyzers/jvm/parser.d.ts +0 -54
- package/dist/src/analyzers/jvm/parser.js +0 -419
- package/dist/src/analyzers/jvm/patterns.d.ts +0 -3
- package/dist/src/analyzers/jvm/patterns.js +0 -64
- package/dist/src/analyzers/php/dependency-manifests.d.ts +0 -10
- package/dist/src/analyzers/php/dependency-manifests.js +0 -117
- package/dist/src/analyzers/php/detector.d.ts +0 -3
- package/dist/src/analyzers/php/detector.js +0 -20
- package/dist/src/analyzers/php/index.d.ts +0 -2
- package/dist/src/analyzers/php/index.js +0 -11
- package/dist/src/analyzers/php/manifest-parsers.d.ts +0 -14
- package/dist/src/analyzers/php/manifest-parsers.js +0 -40
- package/dist/src/analyzers/php/parser.d.ts +0 -42
- package/dist/src/analyzers/php/parser.js +0 -297
- package/dist/src/analyzers/php/patterns.d.ts +0 -3
- package/dist/src/analyzers/php/patterns.js +0 -49
- package/dist/src/analyzers/php/php-detection-config.d.ts +0 -104
- package/dist/src/analyzers/php/php-detection-config.js +0 -192
- package/dist/src/analyzers/python/dependency-manifests.d.ts +0 -8
- package/dist/src/analyzers/python/dependency-manifests.js +0 -131
- package/dist/src/analyzers/python/detector.d.ts +0 -3
- package/dist/src/analyzers/python/detector.js +0 -22
- package/dist/src/analyzers/python/index.d.ts +0 -2
- package/dist/src/analyzers/python/index.js +0 -11
- package/dist/src/analyzers/python/manifest-parsers.d.ts +0 -3
- package/dist/src/analyzers/python/manifest-parsers.js +0 -134
- package/dist/src/analyzers/python/parser.d.ts +0 -27
- package/dist/src/analyzers/python/parser.js +0 -194
- package/dist/src/analyzers/python/patterns.d.ts +0 -8
- package/dist/src/analyzers/python/patterns.js +0 -51
- package/dist/src/analyzers/python/python-detection-config.d.ts +0 -93
- package/dist/src/analyzers/python/python-detection-config.js +0 -168
- package/dist/src/analyzers/registry.d.ts +0 -13
- package/dist/src/analyzers/registry.js +0 -78
- package/dist/src/analyzers/shared/c-family-calls.d.ts +0 -26
- package/dist/src/analyzers/shared/c-family-calls.js +0 -118
- package/dist/src/analyzers/shared/manifest-budgets.d.ts +0 -19
- package/dist/src/analyzers/shared/manifest-budgets.js +0 -21
- package/dist/src/analyzers/shared/manifest-fs.d.ts +0 -13
- package/dist/src/analyzers/shared/manifest-fs.js +0 -138
- package/dist/src/analyzers/shared/property-inference.d.ts +0 -8
- package/dist/src/analyzers/shared/property-inference.js +0 -165
- package/dist/src/analyzers/shared/strip-comments.d.ts +0 -32
- package/dist/src/analyzers/shared/strip-comments.js +0 -168
- package/dist/src/analyzers/terraform/detector.d.ts +0 -10
- package/dist/src/analyzers/terraform/detector.js +0 -198
- package/dist/src/analyzers/terraform/index.d.ts +0 -2
- package/dist/src/analyzers/terraform/index.js +0 -13
- package/dist/src/analyzers/terraform/parser.d.ts +0 -29
- package/dist/src/analyzers/terraform/parser.js +0 -202
- package/dist/src/analyzers/terraform/terraform-detection-config.d.ts +0 -48
- package/dist/src/analyzers/terraform/terraform-detection-config.js +0 -218
- package/dist/src/analyzers/terraform/terraform-exec.d.ts +0 -11
- package/dist/src/analyzers/terraform/terraform-exec.js +0 -35
- package/dist/src/analyzers/terraform/terraform-module-manifest.d.ts +0 -19
- package/dist/src/analyzers/terraform/terraform-module-manifest.js +0 -75
- package/dist/src/analyzers/terraform/terraform-show-json.d.ts +0 -15
- package/dist/src/analyzers/terraform/terraform-show-json.js +0 -188
- package/dist/src/analyzers/terraform/terraform-utility-resource.d.ts +0 -12
- package/dist/src/analyzers/terraform/terraform-utility-resource.js +0 -30
- package/dist/src/analyzers/types.d.ts +0 -5
- package/dist/src/analyzers/types.js +0 -2
- package/dist/src/analyzers/typescript/actor-detection.d.ts +0 -4
- package/dist/src/analyzers/typescript/actor-detection.js +0 -15
- package/dist/src/analyzers/typescript/dependency-manifests.d.ts +0 -9
- package/dist/src/analyzers/typescript/dependency-manifests.js +0 -131
- package/dist/src/analyzers/typescript/detector.d.ts +0 -3
- package/dist/src/analyzers/typescript/detector.js +0 -23
- package/dist/src/analyzers/typescript/index.d.ts +0 -2
- package/dist/src/analyzers/typescript/index.js +0 -11
- package/dist/src/analyzers/typescript/manifest-parsers.d.ts +0 -1
- package/dist/src/analyzers/typescript/manifest-parsers.js +0 -30
- package/dist/src/analyzers/typescript/parser.d.ts +0 -44
- package/dist/src/analyzers/typescript/parser.js +0 -287
- package/dist/src/analyzers/typescript/third-party-detection.d.ts +0 -4
- package/dist/src/analyzers/typescript/third-party-detection.js +0 -16
- package/dist/src/analyzers/typescript/typescript-detection-config.d.ts +0 -105
- package/dist/src/analyzers/typescript/typescript-detection-config.js +0 -219
- package/dist/src/analyzers/typescript/typescript-detection.d.ts +0 -11
- package/dist/src/analyzers/typescript/typescript-detection.js +0 -55
- package/dist/src/classifier/application-injection.d.ts +0 -12
- package/dist/src/classifier/application-injection.js +0 -335
- package/dist/src/classifier/classify.d.ts +0 -3
- package/dist/src/classifier/classify.js +0 -15
- package/dist/src/classifier/component-factory.d.ts +0 -3
- package/dist/src/classifier/component-factory.js +0 -488
- package/dist/src/classifier/config.d.ts +0 -38
- package/dist/src/classifier/config.js +0 -260
- package/dist/src/classifier/enhance-defaults.d.ts +0 -28
- package/dist/src/classifier/enhance-defaults.js +0 -369
- package/dist/src/classifier/enhance.d.ts +0 -13
- package/dist/src/classifier/enhance.js +0 -295
- package/dist/src/classifier/external-url-third-party.d.ts +0 -26
- package/dist/src/classifier/external-url-third-party.js +0 -195
- package/dist/src/classifier/grouping.d.ts +0 -1
- package/dist/src/classifier/grouping.js +0 -2
- package/dist/src/classifier/main-application-selection.d.ts +0 -41
- package/dist/src/classifier/main-application-selection.js +0 -222
- package/dist/src/classifier/naming.d.ts +0 -4
- package/dist/src/classifier/naming.js +0 -78
- package/dist/src/classifier/postprocessing.d.ts +0 -18
- package/dist/src/classifier/postprocessing.js +0 -565
- package/dist/src/classifier/sectioning.d.ts +0 -5
- package/dist/src/classifier/sectioning.js +0 -60
- package/dist/src/classifier/terraform-provider-hub.d.ts +0 -6
- package/dist/src/classifier/terraform-provider-hub.js +0 -38
- package/dist/src/config/actor-detection-config.d.ts +0 -21
- package/dist/src/config/actor-detection-config.js +0 -97
- package/dist/src/config/property-detection-config.d.ts +0 -27
- package/dist/src/config/property-detection-config.js +0 -355
- package/dist/src/config/third-party-detection-config.d.ts +0 -25
- package/dist/src/config/third-party-detection-config.js +0 -97
- package/dist/src/core/pipeline/classifier-phase.d.ts +0 -7
- package/dist/src/core/pipeline/classifier-phase.js +0 -78
- package/dist/src/core/pipeline/dataflow-phase.d.ts +0 -7
- package/dist/src/core/pipeline/dataflow-phase.js +0 -10
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.d.ts +0 -7
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.js +0 -74
- package/dist/src/core/pipeline/diagram-layout/constants.d.ts +0 -11
- package/dist/src/core/pipeline/diagram-layout/constants.js +0 -14
- package/dist/src/core/pipeline/diagram-layout/edge-handles.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/edge-handles.js +0 -26
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.js +0 -40
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.d.ts +0 -6
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.js +0 -53
- package/dist/src/core/pipeline/diagram-layout/section-helpers.d.ts +0 -30
- package/dist/src/core/pipeline/diagram-layout/section-helpers.js +0 -62
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.js +0 -109
- package/dist/src/core/pipeline/diagram-layout/types.d.ts +0 -2
- package/dist/src/core/pipeline/diagram-layout/types.js +0 -2
- package/dist/src/core/pipeline/infer-data-flow-protocol.d.ts +0 -7
- package/dist/src/core/pipeline/infer-data-flow-protocol.js +0 -39
- package/dist/src/core/pipeline/mixed-app-terraform-scan.d.ts +0 -13
- package/dist/src/core/pipeline/mixed-app-terraform-scan.js +0 -81
- package/dist/src/core/pipeline/resolve-path-under-scan-root.d.ts +0 -7
- package/dist/src/core/pipeline/resolve-path-under-scan-root.js +0 -55
- package/dist/src/core/pipeline/sorting.d.ts +0 -3
- package/dist/src/core/pipeline/sorting.js +0 -48
- package/dist/src/core/pipeline/stable-component-ids.d.ts +0 -15
- package/dist/src/core/pipeline/stable-component-ids.js +0 -68
- package/dist/src/core/pipeline/structural-scan.d.ts +0 -19
- package/dist/src/core/pipeline/structural-scan.js +0 -452
- package/dist/src/core/pipeline/terraform-flow-utils.d.ts +0 -6
- package/dist/src/core/pipeline/terraform-flow-utils.js +0 -32
- package/dist/src/core/pipeline/terraform-minimal-services.d.ts +0 -31
- package/dist/src/core/pipeline/terraform-minimal-services.js +0 -225
- package/dist/src/core/sectioning/discover-service-sections.d.ts +0 -80
- package/dist/src/core/sectioning/discover-service-sections.js +0 -497
- package/dist/src/core/sectioning/section-runtime.d.ts +0 -21
- package/dist/src/core/sectioning/section-runtime.js +0 -148
- package/dist/src/core/terraform/component-predicates.d.ts +0 -13
- package/dist/src/core/terraform/component-predicates.js +0 -71
- package/dist/src/data-flow/application-hub.d.ts +0 -7
- package/dist/src/data-flow/application-hub.js +0 -88
- package/dist/src/data-flow/dedupe.d.ts +0 -7
- package/dist/src/data-flow/dedupe.js +0 -92
- package/dist/src/data-flow/detect.d.ts +0 -16
- package/dist/src/data-flow/detect.js +0 -203
- package/dist/src/data-flow/detector.d.ts +0 -15
- package/dist/src/data-flow/detector.js +0 -18
- package/dist/src/data-flow/drop-cross-section-flows.d.ts +0 -8
- package/dist/src/data-flow/drop-cross-section-flows.js +0 -32
- package/dist/src/data-flow/ensure-actor-flow.d.ts +0 -16
- package/dist/src/data-flow/ensure-actor-flow.js +0 -101
- package/dist/src/data-flow/ensure-manifest-declared-flows.d.ts +0 -14
- package/dist/src/data-flow/ensure-manifest-declared-flows.js +0 -76
- package/dist/src/data-flow/ensure-section-api-flows.d.ts +0 -6
- package/dist/src/data-flow/ensure-section-api-flows.js +0 -57
- package/dist/src/data-flow/flow-builder.d.ts +0 -5
- package/dist/src/data-flow/flow-builder.js +0 -80
- package/dist/src/data-flow/import-graph.d.ts +0 -10
- package/dist/src/data-flow/import-graph.js +0 -147
- package/dist/src/data-flow/index.d.ts +0 -8
- package/dist/src/data-flow/index.js +0 -20
- package/dist/src/data-flow/internal-fetch.d.ts +0 -8
- package/dist/src/data-flow/internal-fetch.js +0 -209
- package/dist/src/data-flow/postprocess.d.ts +0 -9
- package/dist/src/data-flow/postprocess.js +0 -63
- package/dist/src/data-flow/rewire.d.ts +0 -10
- package/dist/src/data-flow/rewire.js +0 -93
- package/dist/src/data-flow/source-attribution.d.ts +0 -8
- package/dist/src/data-flow/source-attribution.js +0 -131
- package/dist/src/data-flow/source-resolution.d.ts +0 -13
- package/dist/src/data-flow/source-resolution.js +0 -61
- package/dist/src/data-flow/target-matching.d.ts +0 -21
- package/dist/src/data-flow/target-matching.js +0 -253
- package/dist/src/data-flow/terraform-flows.d.ts +0 -32
- package/dist/src/data-flow/terraform-flows.js +0 -170
- package/dist/src/ingest/file-system.d.ts +0 -17
- package/dist/src/ingest/file-system.js +0 -269
- package/dist/src/ingest/gitignore.d.ts +0 -12
- package/dist/src/ingest/gitignore.js +0 -127
- package/dist/src/ingest/sensitive-paths.d.ts +0 -2
- package/dist/src/ingest/sensitive-paths.js +0 -8
- package/dist/src/patterns/config.d.ts +0 -32
- package/dist/src/patterns/config.js +0 -286
- package/dist/src/patterns/detectors/cpp.d.ts +0 -8
- package/dist/src/patterns/detectors/cpp.js +0 -243
- package/dist/src/patterns/detectors/csharp.d.ts +0 -9
- package/dist/src/patterns/detectors/csharp.js +0 -385
- package/dist/src/patterns/detectors/go.d.ts +0 -9
- package/dist/src/patterns/detectors/go.js +0 -298
- package/dist/src/patterns/detectors/helpers.d.ts +0 -22
- package/dist/src/patterns/detectors/helpers.js +0 -73
- package/dist/src/patterns/detectors/jvm.d.ts +0 -15
- package/dist/src/patterns/detectors/jvm.js +0 -537
- package/dist/src/patterns/detectors/php.d.ts +0 -9
- package/dist/src/patterns/detectors/php.js +0 -466
- package/dist/src/patterns/detectors/python.d.ts +0 -9
- package/dist/src/patterns/detectors/python.js +0 -499
- package/dist/src/patterns/detectors/typescript.d.ts +0 -10
- package/dist/src/patterns/detectors/typescript.js +0 -480
- package/dist/src/patterns/engine.d.ts +0 -58
- package/dist/src/patterns/engine.js +0 -148
- package/dist/src/patterns/flow-source-patterns.d.ts +0 -6
- package/dist/src/patterns/flow-source-patterns.js +0 -39
- package/dist/src/patterns/frontend-frameworks.d.ts +0 -4
- package/dist/src/patterns/frontend-frameworks.js +0 -25
- package/dist/src/patterns/scan-exclusions.d.ts +0 -14
- package/dist/src/patterns/scan-exclusions.js +0 -96
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.js +0 -66
- package/dist/tests/unit/analyzers/cpp/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/parser.spec.js +0 -80
- package/dist/tests/unit/analyzers/cpp/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/patterns.spec.js +0 -141
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.js +0 -75
- package/dist/tests/unit/analyzers/csharp/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/parser.spec.js +0 -118
- package/dist/tests/unit/analyzers/csharp/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/patterns.spec.js +0 -210
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.js +0 -96
- package/dist/tests/unit/analyzers/go/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/parser.spec.js +0 -110
- package/dist/tests/unit/analyzers/go/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/patterns.spec.js +0 -239
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.js +0 -179
- package/dist/tests/unit/analyzers/jvm/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/parser.spec.js +0 -195
- package/dist/tests/unit/analyzers/jvm/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/patterns.spec.js +0 -284
- package/dist/tests/unit/analyzers/php/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/dependency-manifests.spec.js +0 -54
- package/dist/tests/unit/analyzers/php/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/parser.spec.js +0 -128
- package/dist/tests/unit/analyzers/php/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/patterns.spec.js +0 -334
- package/dist/tests/unit/analyzers/python/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/python/parser.spec.js +0 -104
- package/dist/tests/unit/analyzers/python/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/python/patterns.spec.js +0 -458
- package/dist/tests/unit/analyzers/registry.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/registry.spec.js +0 -234
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.js +0 -87
- package/dist/tests/unit/analyzers/terraform/detector.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/detector.spec.js +0 -110
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.js +0 -53
- package/dist/tests/unit/analyzers/terraform/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/parser.spec.js +0 -56
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.js +0 -63
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.js +0 -19
- package/dist/tests/unit/analyzers/terraform-exec.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform-exec.spec.js +0 -27
- package/dist/tests/unit/analyzers/terraform-show-json.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform-show-json.spec.js +0 -77
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.js +0 -61
- package/dist/tests/unit/analyzers/typescript/detector.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/detector.spec.js +0 -413
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.js +0 -49
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.js +0 -27
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.js +0 -64
- package/dist/tests/unit/analyzers/typescript/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/parser.spec.js +0 -99
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.js +0 -24
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.js +0 -160
- package/dist/tests/unit/classifier/classify.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/classify.spec.js +0 -1521
- package/dist/tests/unit/classifier/enhance.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/enhance.spec.js +0 -400
- package/dist/tests/unit/classifier/external-url-third-party.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/external-url-third-party.spec.js +0 -83
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.js +0 -44
- package/dist/tests/unit/classifier/terraform-grouping.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/terraform-grouping.spec.js +0 -96
- package/dist/tests/unit/config/property-detection-config.spec.d.ts +0 -1
- package/dist/tests/unit/config/property-detection-config.spec.js +0 -38
- package/dist/tests/unit/core/classifier-phase-regressions.spec.d.ts +0 -1
- package/dist/tests/unit/core/classifier-phase-regressions.spec.js +0 -68
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.js +0 -46
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.d.ts +0 -1
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.js +0 -66
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.d.ts +0 -1
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.js +0 -132
- package/dist/tests/unit/core/discover-service-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/discover-service-sections.spec.js +0 -204
- package/dist/tests/unit/core/infer-data-flow-protocol.spec.d.ts +0 -1
- package/dist/tests/unit/core/infer-data-flow-protocol.spec.js +0 -37
- package/dist/tests/unit/core/manifest-package-hub.spec.d.ts +0 -1
- package/dist/tests/unit/core/manifest-package-hub.spec.js +0 -53
- package/dist/tests/unit/core/monorepo-package-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/monorepo-package-sections.spec.js +0 -121
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.d.ts +0 -1
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.js +0 -54
- package/dist/tests/unit/core/section-discovery-excludes.spec.d.ts +0 -1
- package/dist/tests/unit/core/section-discovery-excludes.spec.js +0 -49
- package/dist/tests/unit/core/section-runtime.spec.d.ts +0 -1
- package/dist/tests/unit/core/section-runtime.spec.js +0 -166
- package/dist/tests/unit/core/stable-component-ids.spec.d.ts +0 -1
- package/dist/tests/unit/core/stable-component-ids.spec.js +0 -112
- package/dist/tests/unit/core/structural-scan.spec.d.ts +0 -1
- package/dist/tests/unit/core/structural-scan.spec.js +0 -83
- package/dist/tests/unit/core/terraform-minimal-services.spec.d.ts +0 -1
- package/dist/tests/unit/core/terraform-minimal-services.spec.js +0 -378
- package/dist/tests/unit/data-flow/application-hub.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/application-hub.spec.js +0 -48
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.js +0 -95
- package/dist/tests/unit/data-flow/dedupe.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/dedupe.spec.js +0 -134
- package/dist/tests/unit/data-flow/detector.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/detector.spec.js +0 -1254
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.js +0 -132
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.js +0 -233
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.js +0 -125
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.js +0 -40
- package/dist/tests/unit/data-flow/postprocess.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/postprocess.spec.js +0 -78
- package/dist/tests/unit/data-flow/rewire.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/rewire.spec.js +0 -194
- package/dist/tests/unit/data-flow/terraform-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/terraform-flows.spec.js +0 -199
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.js +0 -56
- package/dist/tests/unit/ingest/env-exclusion.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/env-exclusion.spec.js +0 -43
- package/dist/tests/unit/ingest/file-system.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/file-system.spec.js +0 -180
- package/dist/tests/unit/ingest/gitignore.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/gitignore.spec.js +0 -30
- package/dist/tests/unit/ingest/jvm-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/jvm-languages.spec.js +0 -47
- package/dist/tests/unit/ingest/php-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/php-languages.spec.js +0 -40
- package/dist/tests/unit/patterns/scan-exclusions.spec.d.ts +0 -1
- package/dist/tests/unit/patterns/scan-exclusions.spec.js +0 -58
- package/patterns/README.md +0 -322
- package/patterns/actor.patterns.yaml +0 -51
- package/patterns/aws-terraform-catalog.snapshot.json +0 -1760
- package/patterns/aws-terraform-service-hints.generated.json +0 -1446
- package/patterns/azure-terraform-catalog.snapshot.json +0 -1195
- package/patterns/azure-terraform-service-hints.generated.json +0 -864
- package/patterns/classifier/actors.classifier.yaml +0 -17
- package/patterns/classifier/components.classifier.yaml +0 -110
- package/patterns/classifier/third-party.classifier.yaml +0 -169
- package/patterns/cpp.md +0 -176
- package/patterns/cpp.patterns.yaml +0 -314
- package/patterns/csharp.md +0 -211
- package/patterns/csharp.patterns.yaml +0 -375
- package/patterns/go.md +0 -211
- package/patterns/go.patterns.yaml +0 -429
- package/patterns/jvm.md +0 -160
- package/patterns/jvm.patterns.yaml +0 -884
- package/patterns/kubernetes-terraform-catalog.snapshot.json +0 -94
- package/patterns/kubernetes-terraform-service-hints.generated.json +0 -258
- package/patterns/non-pii-signals.rules.yaml +0 -84
- package/patterns/php.md +0 -74
- package/patterns/php.patterns.yaml +0 -311
- package/patterns/pii-signals.rules.yaml +0 -115
- package/patterns/property.patterns.yaml +0 -431
- package/patterns/provider-topology.rules.yaml +0 -765
- package/patterns/python.md +0 -211
- package/patterns/python.patterns.yaml +0 -337
- package/patterns/terraform.md +0 -37
- package/patterns/terraform.patterns.yaml +0 -495
- package/patterns/third-party.patterns.yaml +0 -182
- package/patterns/typescript.patterns.yaml +0 -361
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.resolveScanFilesystemEntry = resolveScanFilesystemEntry;
|
|
37
|
-
exports.ingestFileSystem = ingestFileSystem;
|
|
38
|
-
const fs_1 = require("fs");
|
|
39
|
-
const path = __importStar(require("path"));
|
|
40
|
-
const scan_exclusions_1 = require("../patterns/scan-exclusions");
|
|
41
|
-
const gitignore_1 = require("./gitignore");
|
|
42
|
-
const sensitive_paths_1 = require("./sensitive-paths");
|
|
43
|
-
const DEFAULT_MAX_FILE_SIZE_BYTES = 2 * 1024 * 1024; // 2MB
|
|
44
|
-
const DEFAULT_MAX_FILE_COUNT = 20_000;
|
|
45
|
-
const DEFAULT_MAX_TOTAL_BYTES = 200 * 1024 * 1024; // 200MB
|
|
46
|
-
function normalizeUserPattern(pattern) {
|
|
47
|
-
return (0, gitignore_1.toPosixPath)(pattern.replace(/^\.\/+/, "").trim());
|
|
48
|
-
}
|
|
49
|
-
function isExcludedByUserPatterns(relativePath, isDirectory, excludePaths) {
|
|
50
|
-
const rel = (0, gitignore_1.toPosixPath)(relativePath);
|
|
51
|
-
for (const rawPattern of excludePaths) {
|
|
52
|
-
const pattern = normalizeUserPattern(rawPattern);
|
|
53
|
-
if (!pattern)
|
|
54
|
-
continue;
|
|
55
|
-
// Treat "dir/**" as excluding the directory itself and all descendants.
|
|
56
|
-
if (pattern.endsWith("/**")) {
|
|
57
|
-
const prefix = pattern.slice(0, -3).replace(/\/$/, "");
|
|
58
|
-
if (rel === prefix || rel.startsWith(`${prefix}/`))
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
const regex = (0, gitignore_1.gitignorePatternToRegex)(pattern, isDirectory);
|
|
62
|
-
if (regex.test(rel))
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
function getFileLanguage(filePath) {
|
|
68
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
69
|
-
const base = path.basename(filePath).toLowerCase();
|
|
70
|
-
if (ext === ".ts" || ext === ".tsx") {
|
|
71
|
-
return "typescript";
|
|
72
|
-
}
|
|
73
|
-
if (ext === ".js" || ext === ".jsx" || ext === ".mjs" || ext === ".cjs") {
|
|
74
|
-
return "javascript";
|
|
75
|
-
}
|
|
76
|
-
if (ext === ".py") {
|
|
77
|
-
return "python";
|
|
78
|
-
}
|
|
79
|
-
if (ext === ".cpp" ||
|
|
80
|
-
ext === ".cc" ||
|
|
81
|
-
ext === ".cxx" ||
|
|
82
|
-
ext === ".c++" ||
|
|
83
|
-
ext === ".hpp" ||
|
|
84
|
-
ext === ".hh" ||
|
|
85
|
-
ext === ".hxx" ||
|
|
86
|
-
ext === ".ipp" ||
|
|
87
|
-
ext === ".inl" ||
|
|
88
|
-
ext === ".h") {
|
|
89
|
-
return "cpp";
|
|
90
|
-
}
|
|
91
|
-
if (ext === ".cs" || ext === ".cshtml" || ext === ".razor") {
|
|
92
|
-
return "csharp";
|
|
93
|
-
}
|
|
94
|
-
if (ext === ".go") {
|
|
95
|
-
return "go";
|
|
96
|
-
}
|
|
97
|
-
if (ext === ".php" || ext === ".phtml") {
|
|
98
|
-
return "php";
|
|
99
|
-
}
|
|
100
|
-
if (ext === ".java") {
|
|
101
|
-
return "java";
|
|
102
|
-
}
|
|
103
|
-
// `.kts` covers Kotlin scripts, including Gradle build scripts — those are
|
|
104
|
-
// build configuration rather than application code, but they are also where
|
|
105
|
-
// a Kotlin service declares its dependencies.
|
|
106
|
-
if (ext === ".kt" || ext === ".kts") {
|
|
107
|
-
return "kotlin";
|
|
108
|
-
}
|
|
109
|
-
if (ext === ".json") {
|
|
110
|
-
return "json";
|
|
111
|
-
}
|
|
112
|
-
if (ext === ".yaml" || ext === ".yml") {
|
|
113
|
-
return "yaml";
|
|
114
|
-
}
|
|
115
|
-
if (ext === ".tf" || ext === ".tfvars") {
|
|
116
|
-
return "terraform";
|
|
117
|
-
}
|
|
118
|
-
// Handle .env, .env.local, etc. (basename starts with .env)
|
|
119
|
-
if (base === ".env" || base.startsWith(".env.")) {
|
|
120
|
-
return "env";
|
|
121
|
-
}
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Resolve a user-supplied scan path to a directory (for config, Terraform cwd,
|
|
126
|
-
* section discovery) and an ingest target (directory walk or a single file).
|
|
127
|
-
*/
|
|
128
|
-
async function resolveScanFilesystemEntry(rootPath) {
|
|
129
|
-
const abs = path.resolve(rootPath);
|
|
130
|
-
const st = await fs_1.promises.stat(abs);
|
|
131
|
-
if (st.isDirectory()) {
|
|
132
|
-
return { scanRootDir: abs, ingestTarget: abs };
|
|
133
|
-
}
|
|
134
|
-
if (st.isFile()) {
|
|
135
|
-
return { scanRootDir: path.dirname(abs), ingestTarget: abs };
|
|
136
|
-
}
|
|
137
|
-
throw new Error(`Scan path is not a file or directory: ${abs}`);
|
|
138
|
-
}
|
|
139
|
-
async function ingestSingleFile(fileAbs, options) {
|
|
140
|
-
const scanRootDir = path.dirname(fileAbs);
|
|
141
|
-
const relativePath = (0, gitignore_1.toPosixPath)(path.relative(scanRootDir, fileAbs));
|
|
142
|
-
const basename = path.basename(fileAbs);
|
|
143
|
-
const excludePaths = options.excludePaths ?? [];
|
|
144
|
-
if ((0, sensitive_paths_1.isSensitiveEnvPath)(relativePath) || (0, sensitive_paths_1.isSensitiveEnvPath)(basename)) {
|
|
145
|
-
options.onWarning?.(`Skipped "${basename}" (excluded for security).`);
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
if (relativePath &&
|
|
149
|
-
isExcludedByUserPatterns(relativePath, false, excludePaths)) {
|
|
150
|
-
options.onWarning?.(`Skipped "${relativePath}" (matched exclude pattern).`);
|
|
151
|
-
return [];
|
|
152
|
-
}
|
|
153
|
-
const language = getFileLanguage(fileAbs);
|
|
154
|
-
if (!language) {
|
|
155
|
-
options.onWarning?.(`Skipping unsupported file type: ${basename}`);
|
|
156
|
-
return [];
|
|
157
|
-
}
|
|
158
|
-
const stat = await fs_1.promises.stat(fileAbs);
|
|
159
|
-
if (stat.size > options.maxFileSizeBytes) {
|
|
160
|
-
options.onWarning?.(`Skipped "${path.basename(fileAbs)}" (${stat.size} bytes) because it exceeds max file size (${options.maxFileSizeBytes} bytes).`);
|
|
161
|
-
return [];
|
|
162
|
-
}
|
|
163
|
-
if (stat.size > options.maxTotalBytes) {
|
|
164
|
-
options.onWarning?.(`Skipped "${path.basename(fileAbs)}" because ingest byte budget (${options.maxTotalBytes} bytes) would be exceeded.`);
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
const content = await fs_1.promises.readFile(fileAbs, "utf8");
|
|
168
|
-
return [
|
|
169
|
-
{
|
|
170
|
-
path: relativePath,
|
|
171
|
-
name: basename,
|
|
172
|
-
content,
|
|
173
|
-
language,
|
|
174
|
-
size: stat.size,
|
|
175
|
-
},
|
|
176
|
-
];
|
|
177
|
-
}
|
|
178
|
-
async function walkDirectory(currentDir, rootDir, accumulatedRules, files, options, state) {
|
|
179
|
-
if (state.fileCountLimitReached)
|
|
180
|
-
return;
|
|
181
|
-
const excludePaths = options.excludePaths ?? [];
|
|
182
|
-
const rules = await (0, gitignore_1.gitignoreRulesForDir)(currentDir, accumulatedRules);
|
|
183
|
-
const entries = await fs_1.promises.readdir(currentDir, { withFileTypes: true });
|
|
184
|
-
for (const entry of entries) {
|
|
185
|
-
if (state.fileCountLimitReached)
|
|
186
|
-
return;
|
|
187
|
-
const entryPath = path.join(currentDir, entry.name);
|
|
188
|
-
const relativePath = (0, gitignore_1.toPosixPath)(path.relative(rootDir, entryPath));
|
|
189
|
-
if (entry.isDirectory()) {
|
|
190
|
-
if ((0, scan_exclusions_1.shouldSkipDirectoryName)(entry.name)) {
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
if (relativePath &&
|
|
194
|
-
isExcludedByUserPatterns(relativePath, true, excludePaths)) {
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if ((0, gitignore_1.isPathIgnored)(entryPath, true, rules)) {
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
await walkDirectory(entryPath, rootDir, rules, files, options, state);
|
|
201
|
-
}
|
|
202
|
-
else if (entry.isFile()) {
|
|
203
|
-
if (relativePath &&
|
|
204
|
-
isExcludedByUserPatterns(relativePath, false, excludePaths)) {
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
if ((0, gitignore_1.isPathIgnored)(entryPath, false, rules)) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
const language = getFileLanguage(entryPath);
|
|
211
|
-
if (!language)
|
|
212
|
-
continue;
|
|
213
|
-
const stat = await fs_1.promises.stat(entryPath);
|
|
214
|
-
if (stat.size > options.maxFileSizeBytes) {
|
|
215
|
-
options.onWarning?.(`Skipped "${relativePath}" (${stat.size} bytes) because it exceeds max file size (${options.maxFileSizeBytes} bytes).`);
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
if (state.totalBytesIncluded + stat.size >
|
|
219
|
-
options.maxTotalBytes) {
|
|
220
|
-
options.onWarning?.(`Skipped "${relativePath}" because ingest byte budget (${options.maxTotalBytes} bytes) would be exceeded.`);
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
if (state.filesIncluded >= options.maxFileCount) {
|
|
224
|
-
state.fileCountLimitReached = true;
|
|
225
|
-
options.onWarning?.(`Stopped ingest after ${state.filesIncluded} files because max file count (${options.maxFileCount}) was reached.`);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const content = await fs_1.promises.readFile(entryPath, "utf8");
|
|
229
|
-
files.push({
|
|
230
|
-
path: relativePath,
|
|
231
|
-
name: entry.name,
|
|
232
|
-
content,
|
|
233
|
-
language,
|
|
234
|
-
size: stat.size,
|
|
235
|
-
});
|
|
236
|
-
state.filesIncluded += 1;
|
|
237
|
-
state.totalBytesIncluded += stat.size;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
async function ingestFileSystem(rootPath, options = {}) {
|
|
242
|
-
const abs = path.resolve(rootPath);
|
|
243
|
-
const st = await fs_1.promises.stat(abs);
|
|
244
|
-
const resolvedOptions = {
|
|
245
|
-
maxFileSizeBytes: options.maxFileSizeBytes ?? DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
246
|
-
maxFileCount: options.maxFileCount ?? DEFAULT_MAX_FILE_COUNT,
|
|
247
|
-
maxTotalBytes: options.maxTotalBytes ?? DEFAULT_MAX_TOTAL_BYTES,
|
|
248
|
-
excludePaths: [
|
|
249
|
-
...scan_exclusions_1.DEFAULT_EXCLUDED_FILE_GLOBS,
|
|
250
|
-
...(options.excludePaths ?? []),
|
|
251
|
-
],
|
|
252
|
-
onWarning: options.onWarning,
|
|
253
|
-
};
|
|
254
|
-
if (st.isFile()) {
|
|
255
|
-
return ingestSingleFile(abs, resolvedOptions);
|
|
256
|
-
}
|
|
257
|
-
if (!st.isDirectory()) {
|
|
258
|
-
throw new Error(`Scan path is not a file or directory: ${abs}`);
|
|
259
|
-
}
|
|
260
|
-
const rootDir = abs;
|
|
261
|
-
const files = [];
|
|
262
|
-
const state = {
|
|
263
|
-
filesIncluded: 0,
|
|
264
|
-
totalBytesIncluded: 0,
|
|
265
|
-
fileCountLimitReached: false,
|
|
266
|
-
};
|
|
267
|
-
await walkDirectory(rootDir, rootDir, [], files, resolvedOptions, state);
|
|
268
|
-
return files;
|
|
269
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type IgnoreRule = {
|
|
2
|
-
baseDir: string;
|
|
3
|
-
pattern: string;
|
|
4
|
-
negate: boolean;
|
|
5
|
-
dirOnly: boolean;
|
|
6
|
-
regex: RegExp;
|
|
7
|
-
};
|
|
8
|
-
export declare function toPosixPath(p: string): string;
|
|
9
|
-
export declare function gitignorePatternToRegex(pattern: string, dirOnly: boolean): RegExp;
|
|
10
|
-
export declare function readGitignore(dir: string): Promise<IgnoreRule[]>;
|
|
11
|
-
export declare function gitignoreRulesForDir(currentDir: string, accumulatedRules: IgnoreRule[]): Promise<IgnoreRule[]>;
|
|
12
|
-
export declare function isPathIgnored(absolutePath: string, isDirectory: boolean, rules: IgnoreRule[]): boolean;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.toPosixPath = toPosixPath;
|
|
37
|
-
exports.gitignorePatternToRegex = gitignorePatternToRegex;
|
|
38
|
-
exports.readGitignore = readGitignore;
|
|
39
|
-
exports.gitignoreRulesForDir = gitignoreRulesForDir;
|
|
40
|
-
exports.isPathIgnored = isPathIgnored;
|
|
41
|
-
const fs_1 = require("fs");
|
|
42
|
-
const path = __importStar(require("path"));
|
|
43
|
-
function toPosixPath(p) {
|
|
44
|
-
return p.split(path.sep).join("/");
|
|
45
|
-
}
|
|
46
|
-
function gitignorePatternToRegex(pattern, dirOnly) {
|
|
47
|
-
// Very small subset of .gitignore-style patterns:
|
|
48
|
-
// - * matches any chars except path separator
|
|
49
|
-
// - ** matches across directories
|
|
50
|
-
// - ? matches a single non-separator
|
|
51
|
-
// - pattern without leading slash matches anywhere under baseDir
|
|
52
|
-
let escaped = pattern.replace(/[-\\^$+?.()|[\]{}*?]/g, "\\$&");
|
|
53
|
-
// Restore globs
|
|
54
|
-
escaped = escaped.replace(/\\\*\\\*/g, ".*"); // **
|
|
55
|
-
escaped = escaped.replace(/\\\*/g, "[^/]*"); // *
|
|
56
|
-
escaped = escaped.replace(/\\\?/g, "[^/]"); // ?
|
|
57
|
-
const suffix = dirOnly ? "(?:/.*)?$" : "$";
|
|
58
|
-
// Match from start of the relative path
|
|
59
|
-
return new RegExp(`^${escaped}${suffix}`);
|
|
60
|
-
}
|
|
61
|
-
async function readGitignore(dir) {
|
|
62
|
-
const gitignorePath = path.join(dir, ".gitignore");
|
|
63
|
-
try {
|
|
64
|
-
const content = await fs_1.promises.readFile(gitignorePath, "utf8");
|
|
65
|
-
const lines = content.split(/\r?\n/);
|
|
66
|
-
const rules = [];
|
|
67
|
-
for (const rawLine of lines) {
|
|
68
|
-
let line = rawLine.trim();
|
|
69
|
-
if (!line || line.startsWith("#"))
|
|
70
|
-
continue;
|
|
71
|
-
let negate = false;
|
|
72
|
-
if (line.startsWith("!")) {
|
|
73
|
-
negate = true;
|
|
74
|
-
line = line.slice(1).trim();
|
|
75
|
-
if (!line)
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
let dirOnly = false;
|
|
79
|
-
if (line.endsWith("/")) {
|
|
80
|
-
dirOnly = true;
|
|
81
|
-
line = line.slice(0, -1);
|
|
82
|
-
if (!line)
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
const regex = gitignorePatternToRegex(toPosixPath(line), dirOnly);
|
|
86
|
-
rules.push({
|
|
87
|
-
baseDir: dir,
|
|
88
|
-
pattern: line,
|
|
89
|
-
negate,
|
|
90
|
-
dirOnly,
|
|
91
|
-
regex,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return rules;
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
// If .gitignore does not exist, ignore silently
|
|
98
|
-
if (error.code === "ENOENT") {
|
|
99
|
-
return [];
|
|
100
|
-
}
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async function gitignoreRulesForDir(currentDir, accumulatedRules) {
|
|
105
|
-
const localRules = await readGitignore(currentDir);
|
|
106
|
-
return accumulatedRules.concat(localRules);
|
|
107
|
-
}
|
|
108
|
-
function isPathIgnored(absolutePath, isDirectory, rules) {
|
|
109
|
-
const normalizedPath = toPosixPath(absolutePath);
|
|
110
|
-
let ignored = false;
|
|
111
|
-
for (const rule of rules) {
|
|
112
|
-
const base = toPosixPath(rule.baseDir);
|
|
113
|
-
if (!normalizedPath.startsWith(base.endsWith("/") ? base : `${base}/`)) {
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
const rel = normalizedPath.slice(base.length + (base.endsWith("/") ? 0 : 1));
|
|
117
|
-
if (!rel)
|
|
118
|
-
continue;
|
|
119
|
-
if (rule.dirOnly && !isDirectory) {
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
if (rule.regex.test(rel)) {
|
|
123
|
-
ignored = !rule.negate;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return ignored;
|
|
127
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSensitiveEnvPath = isSensitiveEnvPath;
|
|
4
|
-
/** True for `.env`, `.env.local`, `.env.production`, etc. */
|
|
5
|
-
function isSensitiveEnvPath(filePath) {
|
|
6
|
-
const base = filePath.split(/[/\\]/).pop() ?? filePath;
|
|
7
|
-
return base === ".env" || base.startsWith(".env.");
|
|
8
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ActorDetectionConfig } from "../config/actor-detection-config";
|
|
2
|
-
import type { PropertyDetectionConfig } from "../config/property-detection-config";
|
|
3
|
-
import type { ThirdPartyDetectionConfig } from "../config/third-party-detection-config";
|
|
4
|
-
import type { TypeScriptPatternConfig } from "../analyzers/typescript/typescript-detection-config";
|
|
5
|
-
import type { ClassifierConfig } from "../classifier/config";
|
|
6
|
-
import type { PythonPatternConfig } from "../analyzers/python/python-detection-config";
|
|
7
|
-
import type { GoPatternConfig } from "../analyzers/go/go-detection-config";
|
|
8
|
-
import type { PhpPatternConfig } from "../analyzers/php/php-detection-config";
|
|
9
|
-
import type { JvmPatternConfig } from "../analyzers/jvm/jvm-detection-config";
|
|
10
|
-
import type { CppPatternConfig } from "../analyzers/cpp/cpp-detection-config";
|
|
11
|
-
import type { CSharpPatternConfig } from "../analyzers/csharp/csharp-detection-config";
|
|
12
|
-
import type { TerraformPatternConfig } from "../analyzers/terraform/terraform-detection-config";
|
|
13
|
-
export interface UnifiedPatternConfig {
|
|
14
|
-
actors: ActorDetectionConfig;
|
|
15
|
-
properties: PropertyDetectionConfig;
|
|
16
|
-
thirdParty: ThirdPartyDetectionConfig;
|
|
17
|
-
typescript: TypeScriptPatternConfig;
|
|
18
|
-
classifier: ClassifierConfig;
|
|
19
|
-
python: PythonPatternConfig;
|
|
20
|
-
go: GoPatternConfig;
|
|
21
|
-
php: PhpPatternConfig;
|
|
22
|
-
jvm: JvmPatternConfig;
|
|
23
|
-
cpp: CppPatternConfig;
|
|
24
|
-
csharp: CSharpPatternConfig;
|
|
25
|
-
terraform: TerraformPatternConfig;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Loads all pattern/classifier YAML configs into a single in-memory object
|
|
29
|
-
* so analyzers and the shared pattern engine can access them in a
|
|
30
|
-
* language-agnostic way.
|
|
31
|
-
*/
|
|
32
|
-
export declare function loadUnifiedPatternConfig(): UnifiedPatternConfig;
|