@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,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runClassifierPhase = runClassifierPhase;
|
|
4
|
-
const classify_1 = require("../../classifier/classify");
|
|
5
|
-
const enhance_1 = require("../../classifier/enhance");
|
|
6
|
-
const frontend_frameworks_1 = require("../../patterns/frontend-frameworks");
|
|
7
|
-
function frameworkValues(value) {
|
|
8
|
-
if (typeof value === "string" && value.trim())
|
|
9
|
-
return [value.trim()];
|
|
10
|
-
if (Array.isArray(value)) {
|
|
11
|
-
return value.filter((v) => typeof v === "string" && v.trim().length > 0);
|
|
12
|
-
}
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
function mergeUniqueStringValues(current, incoming) {
|
|
16
|
-
const existing = frameworkValues(current);
|
|
17
|
-
const merged = Array.from(new Set([...existing, ...incoming]));
|
|
18
|
-
if (merged.length === 0)
|
|
19
|
-
return current;
|
|
20
|
-
return merged;
|
|
21
|
-
}
|
|
22
|
-
function collapseManifestFrontendFrameworkAssets(components) {
|
|
23
|
-
if (components.length === 0)
|
|
24
|
-
return components;
|
|
25
|
-
const mainBySection = new Map();
|
|
26
|
-
for (const component of components) {
|
|
27
|
-
if (component.type !== "asset")
|
|
28
|
-
continue;
|
|
29
|
-
if (component.properties?.isMainApplication === true ||
|
|
30
|
-
component.properties?.isMainApplication === "true") {
|
|
31
|
-
const sectionId = typeof component.properties?.section_id === "string"
|
|
32
|
-
? component.properties.section_id
|
|
33
|
-
: "";
|
|
34
|
-
if (sectionId)
|
|
35
|
-
mainBySection.set(sectionId, component);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const removeIds = new Set();
|
|
39
|
-
const updatesById = new Map();
|
|
40
|
-
for (const component of components) {
|
|
41
|
-
if (component.type !== "asset" || component.subType !== "api")
|
|
42
|
-
continue;
|
|
43
|
-
if (component.properties?.sourceContext !== "dependency_manifest")
|
|
44
|
-
continue;
|
|
45
|
-
const sectionId = typeof component.properties?.section_id === "string"
|
|
46
|
-
? component.properties.section_id
|
|
47
|
-
: "";
|
|
48
|
-
if (!sectionId)
|
|
49
|
-
continue;
|
|
50
|
-
const main = mainBySection.get(sectionId);
|
|
51
|
-
if (!main || main.id === component.id)
|
|
52
|
-
continue;
|
|
53
|
-
const frameworks = frameworkValues(component.properties?.framework).filter((fw) => frontend_frameworks_1.FRONTEND_FRAMEWORK_HINTS_SET.has(fw.toLowerCase()));
|
|
54
|
-
if (frameworks.length === 0)
|
|
55
|
-
continue;
|
|
56
|
-
const currentMain = updatesById.get(main.id) ?? main;
|
|
57
|
-
const nextProps = { ...currentMain.properties };
|
|
58
|
-
nextProps.framework = mergeUniqueStringValues(nextProps.framework, frameworks);
|
|
59
|
-
nextProps.technology_stack = mergeUniqueStringValues(nextProps.technology_stack, frameworks);
|
|
60
|
-
updatesById.set(main.id, { ...currentMain, properties: nextProps });
|
|
61
|
-
removeIds.add(component.id);
|
|
62
|
-
}
|
|
63
|
-
return components
|
|
64
|
-
.filter((component) => !removeIds.has(component.id))
|
|
65
|
-
.map((component) => updatesById.get(component.id) ?? component);
|
|
66
|
-
}
|
|
67
|
-
function runClassifierPhase(findings, sections, options) {
|
|
68
|
-
const classified = (0, classify_1.classifyRawFindings)(findings);
|
|
69
|
-
const dedupedComponents = (0, classify_1.dedupeComponents)(classified);
|
|
70
|
-
const mergedDbComponents = (0, classify_1.mergeDatabaseAssetsByType)(dedupedComponents);
|
|
71
|
-
const withPerSectionApplication = (0, classify_1.injectApplicationAssetsPerSectionIfMissing)(mergedDbComponents, sections, { projectName: options.projectName });
|
|
72
|
-
const withApplication = (0, classify_1.injectApplicationAssetIfMissing)(withPerSectionApplication, { projectName: options.projectName });
|
|
73
|
-
const enhanced = (0, enhance_1.enhanceComponents)(withApplication);
|
|
74
|
-
const mergedFrameworkHelpers = collapseManifestFrontendFrameworkAssets(enhanced);
|
|
75
|
-
const withSectionApiNodes = (0, classify_1.synthesizeSectionApiNodes)(mergedFrameworkHelpers);
|
|
76
|
-
const compactedAuthComponents = (0, classify_1.compactAuthServiceComponents)(withSectionApiNodes);
|
|
77
|
-
return (0, classify_1.injectActorIfMissing)(compactedAuthComponents).filter((component) => component.confidence >= options.minimumConfidence);
|
|
78
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DetectedComponent, DetectedDataFlow, FileInfo, RawFinding } from "../types";
|
|
2
|
-
import type { ServiceSection } from "../sectioning/discover-service-sections";
|
|
3
|
-
export interface DataFlowPhaseOptions {
|
|
4
|
-
enableDataFlowDetection: boolean;
|
|
5
|
-
minimumConfidence: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function runDataFlowPhase(files: FileInfo[], components: DetectedComponent[], findings: RawFinding[], sections: ServiceSection[], options: DataFlowPhaseOptions): DetectedDataFlow[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runDataFlowPhase = runDataFlowPhase;
|
|
4
|
-
const data_flow_1 = require("../../data-flow");
|
|
5
|
-
function runDataFlowPhase(files, components, findings, sections, options) {
|
|
6
|
-
if (!options.enableDataFlowDetection)
|
|
7
|
-
return [];
|
|
8
|
-
const flows = (0, data_flow_1.detectDataFlows)(files, components, findings, sections);
|
|
9
|
-
return flows.filter((flow) => flow.confidence >= options.minimumConfidence);
|
|
10
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DiagramNodeSchema } from "../../schema";
|
|
2
|
-
import type { ComponentByIdMap } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Monorepo app sections: actor → main app → section API → integrations;
|
|
5
|
-
* managed sub-services are positioned beside their provider hub afterward.
|
|
6
|
-
*/
|
|
7
|
-
export declare function applyAppSectionStackLayout(nodes: DiagramNodeSchema[], componentsById: ComponentByIdMap, sectionIds: string[]): void;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyAppSectionStackLayout = applyAppSectionStackLayout;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const section_helpers_1 = require("./section-helpers");
|
|
6
|
-
/**
|
|
7
|
-
* Monorepo app sections: actor → main app → section API → integrations;
|
|
8
|
-
* managed sub-services are positioned beside their provider hub afterward.
|
|
9
|
-
*/
|
|
10
|
-
function applyAppSectionStackLayout(nodes, componentsById, sectionIds) {
|
|
11
|
-
const allComponents = [...componentsById.values()];
|
|
12
|
-
for (const sectionId of sectionIds) {
|
|
13
|
-
const sectionIndex = sectionIds.indexOf(sectionId);
|
|
14
|
-
const baseX = Math.max(0, sectionIndex) * constants_1.SECTION_BLOCK_WIDTH;
|
|
15
|
-
const sectionComponents = allComponents.filter((c) => (0, section_helpers_1.getSectionIdFromComponent)(c) === sectionId);
|
|
16
|
-
if ((0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(sectionComponents))
|
|
17
|
-
continue;
|
|
18
|
-
const sectionNodes = (0, section_helpers_1.filterSectionNodes)(nodes, componentsById, sectionId);
|
|
19
|
-
if (sectionNodes.length === 0)
|
|
20
|
-
continue;
|
|
21
|
-
const actors = [];
|
|
22
|
-
const mains = [];
|
|
23
|
-
const sectionApis = [];
|
|
24
|
-
const integrations = [];
|
|
25
|
-
const otherAssets = [];
|
|
26
|
-
for (const node of sectionNodes) {
|
|
27
|
-
const c = componentsById.get(node.id);
|
|
28
|
-
if (!c)
|
|
29
|
-
continue;
|
|
30
|
-
if (c.type === "actor")
|
|
31
|
-
actors.push(node);
|
|
32
|
-
else if (c.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(c)) {
|
|
33
|
-
mains.push(node);
|
|
34
|
-
}
|
|
35
|
-
else if ((0, section_helpers_1.isSectionApiNodeComponent)(c)) {
|
|
36
|
-
sectionApis.push(node);
|
|
37
|
-
}
|
|
38
|
-
else if ((0, section_helpers_1.isManagedSubserviceComponent)(c))
|
|
39
|
-
continue;
|
|
40
|
-
else if (c.type === "third_party")
|
|
41
|
-
integrations.push(node);
|
|
42
|
-
else
|
|
43
|
-
otherAssets.push(node);
|
|
44
|
-
}
|
|
45
|
-
actors.sort(section_helpers_1.sortNodesByLabel);
|
|
46
|
-
mains.sort(section_helpers_1.sortNodesByLabel);
|
|
47
|
-
sectionApis.sort(section_helpers_1.sortNodesByLabel);
|
|
48
|
-
integrations.sort(section_helpers_1.sortNodesByLabel);
|
|
49
|
-
otherAssets.sort(section_helpers_1.sortNodesByLabel);
|
|
50
|
-
const integrationColumnX = baseX + 3 * constants_1.TERRAFORM_LANE_X_STEP;
|
|
51
|
-
actors.forEach((node, i) => {
|
|
52
|
-
node.position = { x: baseX, y: i * constants_1.NODE_VERTICAL_SPACING };
|
|
53
|
-
});
|
|
54
|
-
mains.forEach((node, i) => {
|
|
55
|
-
node.position = {
|
|
56
|
-
x: baseX + constants_1.TERRAFORM_LANE_X_STEP,
|
|
57
|
-
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
sectionApis.forEach((node, i) => {
|
|
61
|
-
node.position = {
|
|
62
|
-
x: baseX + 2 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
63
|
-
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
const integrationStack = [...integrations, ...otherAssets];
|
|
67
|
-
integrationStack.forEach((node, i) => {
|
|
68
|
-
node.position = {
|
|
69
|
-
x: integrationColumnX,
|
|
70
|
-
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const NODE_HORIZONTAL_SPACING = 350;
|
|
2
|
-
export declare const NODE_VERTICAL_SPACING = 200;
|
|
3
|
-
export declare const NODES_PER_ROW = 4;
|
|
4
|
-
export declare const MANAGED_NODE_X_OFFSET = 320;
|
|
5
|
-
export declare const MANAGED_NODE_Y_BASE_OFFSET = 40;
|
|
6
|
-
/** Match {@link NODE_VERTICAL_SPACING} so managed service cards do not overlap. */
|
|
7
|
-
export declare const MANAGED_NODE_Y_STEP = 200;
|
|
8
|
-
/** Horizontal step between Terraform layout lanes (single-section TF scans). */
|
|
9
|
-
export declare const TERRAFORM_LANE_X_STEP = 400;
|
|
10
|
-
/** Horizontal space per section (TF lanes + optional managed column beside provider). */
|
|
11
|
-
export declare const SECTION_BLOCK_WIDTH: number;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SECTION_BLOCK_WIDTH = exports.TERRAFORM_LANE_X_STEP = exports.MANAGED_NODE_Y_STEP = exports.MANAGED_NODE_Y_BASE_OFFSET = exports.MANAGED_NODE_X_OFFSET = exports.NODES_PER_ROW = exports.NODE_VERTICAL_SPACING = exports.NODE_HORIZONTAL_SPACING = void 0;
|
|
4
|
-
exports.NODE_HORIZONTAL_SPACING = 350;
|
|
5
|
-
exports.NODE_VERTICAL_SPACING = 200;
|
|
6
|
-
exports.NODES_PER_ROW = 4;
|
|
7
|
-
exports.MANAGED_NODE_X_OFFSET = 320;
|
|
8
|
-
exports.MANAGED_NODE_Y_BASE_OFFSET = 40;
|
|
9
|
-
/** Match {@link NODE_VERTICAL_SPACING} so managed service cards do not overlap. */
|
|
10
|
-
exports.MANAGED_NODE_Y_STEP = exports.NODE_VERTICAL_SPACING;
|
|
11
|
-
/** Horizontal step between Terraform layout lanes (single-section TF scans). */
|
|
12
|
-
exports.TERRAFORM_LANE_X_STEP = 400;
|
|
13
|
-
/** Horizontal space per section (TF lanes + optional managed column beside provider). */
|
|
14
|
-
exports.SECTION_BLOCK_WIDTH = Math.max(exports.NODES_PER_ROW * exports.NODE_HORIZONTAL_SPACING, 5 * exports.TERRAFORM_LANE_X_STEP + exports.MANAGED_NODE_X_OFFSET + 120);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DetectedComponent } from "../../types";
|
|
2
|
-
import type { DiagramEdgeSchema } from "../../schema";
|
|
3
|
-
export declare function applyDirectionalEdgeHandles(edge: DiagramEdgeSchema, sourceComponent: DetectedComponent | undefined, targetComponent: DetectedComponent | undefined): void;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyDirectionalEdgeHandles = applyDirectionalEdgeHandles;
|
|
4
|
-
const main_application_selection_1 = require("../../../classifier/main-application-selection");
|
|
5
|
-
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
6
|
-
const section_helpers_1 = require("./section-helpers");
|
|
7
|
-
function applyDirectionalEdgeHandles(edge, sourceComponent, targetComponent) {
|
|
8
|
-
const isProviderToManagedServiceEdge = sourceComponent?.type === "third_party" &&
|
|
9
|
-
typeof targetComponent?.properties?.managed_by_provider === "string" &&
|
|
10
|
-
targetComponent.properties.managed_by_provider === sourceComponent?.id;
|
|
11
|
-
const isProviderToModuleShellEdge = sourceComponent !== undefined &&
|
|
12
|
-
targetComponent !== undefined &&
|
|
13
|
-
(0, component_predicates_1.isTerraformProviderComponent)(sourceComponent) &&
|
|
14
|
-
(0, main_application_selection_1.isTerraformModuleCallShellAsset)(targetComponent);
|
|
15
|
-
const isHubToIntegrationEdge = sourceComponent !== undefined &&
|
|
16
|
-
targetComponent?.type === "third_party" &&
|
|
17
|
-
((sourceComponent.type === "asset" &&
|
|
18
|
-
(0, section_helpers_1.isMainApplicationComponent)(sourceComponent)) ||
|
|
19
|
-
(0, section_helpers_1.isSectionApiNodeComponent)(sourceComponent));
|
|
20
|
-
if (isProviderToManagedServiceEdge ||
|
|
21
|
-
isProviderToModuleShellEdge ||
|
|
22
|
-
isHubToIntegrationEdge) {
|
|
23
|
-
edge.sourceHandle = "right-source";
|
|
24
|
-
edge.targetHandle = "left-target";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.repositionManagedProviderNodes = repositionManagedProviderNodes;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
function repositionManagedProviderNodes(nodes, componentsById) {
|
|
6
|
-
const nodeById = new Map(nodes.map((node) => [node.id, node]));
|
|
7
|
-
const managedByProvider = new Map();
|
|
8
|
-
for (const component of componentsById.values()) {
|
|
9
|
-
const providerId = component.properties?.managed_by_provider;
|
|
10
|
-
if (typeof providerId !== "string" || !providerId.trim())
|
|
11
|
-
continue;
|
|
12
|
-
const list = managedByProvider.get(providerId) ?? [];
|
|
13
|
-
list.push(component);
|
|
14
|
-
managedByProvider.set(providerId, list);
|
|
15
|
-
}
|
|
16
|
-
for (const [providerId, managedComponents] of managedByProvider.entries()) {
|
|
17
|
-
const providerNode = nodeById.get(providerId);
|
|
18
|
-
if (!providerNode)
|
|
19
|
-
continue;
|
|
20
|
-
const sortedManaged = [...managedComponents].sort((a, b) => {
|
|
21
|
-
const aKey = String(a.properties?.managed_service_key ?? a.name ?? "");
|
|
22
|
-
const bKey = String(b.properties?.managed_service_key ?? b.name ?? "");
|
|
23
|
-
const keyCmp = aKey.localeCompare(bKey);
|
|
24
|
-
if (keyCmp !== 0)
|
|
25
|
-
return keyCmp;
|
|
26
|
-
return a.id.localeCompare(b.id);
|
|
27
|
-
});
|
|
28
|
-
sortedManaged.forEach((managedComponent, index) => {
|
|
29
|
-
const managedNode = nodeById.get(managedComponent.id);
|
|
30
|
-
if (!managedNode)
|
|
31
|
-
return;
|
|
32
|
-
managedNode.position = {
|
|
33
|
-
x: providerNode.position.x + constants_1.MANAGED_NODE_X_OFFSET,
|
|
34
|
-
y: providerNode.position.y +
|
|
35
|
-
constants_1.MANAGED_NODE_Y_BASE_OFFSET +
|
|
36
|
-
index * constants_1.MANAGED_NODE_Y_STEP,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DiagramNodeSchema } from "../../schema";
|
|
2
|
-
import type { ComponentByIdMap } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Minimal Terraform view: User (0) → main app + ECS shells (1) → provider (2).
|
|
5
|
-
*/
|
|
6
|
-
export declare function applyTerraformMinimalServiceDiagramLayout(nodes: DiagramNodeSchema[], componentsById: ComponentByIdMap): void;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyTerraformMinimalServiceDiagramLayout = applyTerraformMinimalServiceDiagramLayout;
|
|
4
|
-
const terraform_minimal_services_1 = require("../terraform-minimal-services");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const section_helpers_1 = require("./section-helpers");
|
|
7
|
-
/**
|
|
8
|
-
* Minimal Terraform view: User (0) → main app + ECS shells (1) → provider (2).
|
|
9
|
-
*/
|
|
10
|
-
function applyTerraformMinimalServiceDiagramLayout(nodes, componentsById) {
|
|
11
|
-
const actorNodes = [];
|
|
12
|
-
const mainNodes = [];
|
|
13
|
-
const ecsNodes = [];
|
|
14
|
-
const providerNodes = [];
|
|
15
|
-
for (const node of nodes) {
|
|
16
|
-
const c = componentsById.get(node.id);
|
|
17
|
-
const bucket = (0, terraform_minimal_services_1.terraformMinimalLayoutBucket)(c);
|
|
18
|
-
if (bucket === "actor")
|
|
19
|
-
actorNodes.push(node);
|
|
20
|
-
else if (bucket === "main")
|
|
21
|
-
mainNodes.push(node);
|
|
22
|
-
else if (bucket === "ecs")
|
|
23
|
-
ecsNodes.push(node);
|
|
24
|
-
else if (bucket === "provider")
|
|
25
|
-
providerNodes.push(node);
|
|
26
|
-
}
|
|
27
|
-
actorNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
28
|
-
mainNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
29
|
-
ecsNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
30
|
-
providerNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
31
|
-
actorNodes.forEach((node, i) => {
|
|
32
|
-
node.position = { x: 0 * constants_1.TERRAFORM_LANE_X_STEP, y: i * constants_1.NODE_VERTICAL_SPACING };
|
|
33
|
-
});
|
|
34
|
-
mainNodes.forEach((node, i) => {
|
|
35
|
-
node.position = {
|
|
36
|
-
x: 1 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
37
|
-
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
const mainCount = mainNodes.length;
|
|
41
|
-
ecsNodes.forEach((node, i) => {
|
|
42
|
-
node.position = {
|
|
43
|
-
x: 1 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
44
|
-
y: (mainCount + i) * constants_1.NODE_VERTICAL_SPACING,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
providerNodes.forEach((node, i) => {
|
|
48
|
-
node.position = {
|
|
49
|
-
x: 2 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
50
|
-
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { DetectedComponent } from "../../types";
|
|
2
|
-
import type { ComponentByIdMap } from "./types";
|
|
3
|
-
export declare function getSectionIdFromComponent(component: DetectedComponent): string;
|
|
4
|
-
export declare function getSectionLabelFromComponent(component: DetectedComponent): string;
|
|
5
|
-
export declare function componentSortKey(component: DetectedComponent): string;
|
|
6
|
-
/** Lane layout applies only to sections with Terraform resources (not every User actor). */
|
|
7
|
-
export declare function sectionQualifiesForTerraformLaneLayout(sectionComponents: DetectedComponent[]): boolean;
|
|
8
|
-
export declare function isMainApplicationComponent(component: DetectedComponent): boolean;
|
|
9
|
-
export declare function isSectionApiNodeComponent(component: DetectedComponent): boolean;
|
|
10
|
-
export declare function isManagedSubserviceComponent(component: DetectedComponent): boolean;
|
|
11
|
-
export declare function sortNodesByLabel(a: {
|
|
12
|
-
id: string;
|
|
13
|
-
data?: {
|
|
14
|
-
label?: string;
|
|
15
|
-
};
|
|
16
|
-
}, b: {
|
|
17
|
-
id: string;
|
|
18
|
-
data?: {
|
|
19
|
-
label?: string;
|
|
20
|
-
};
|
|
21
|
-
}): number;
|
|
22
|
-
export declare function filterSectionNodes(nodes: Array<{
|
|
23
|
-
id: string;
|
|
24
|
-
}>, componentsById: ComponentByIdMap, sectionId: string): Array<{
|
|
25
|
-
id: string;
|
|
26
|
-
position?: {
|
|
27
|
-
x: number;
|
|
28
|
-
y: number;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSectionIdFromComponent = getSectionIdFromComponent;
|
|
4
|
-
exports.getSectionLabelFromComponent = getSectionLabelFromComponent;
|
|
5
|
-
exports.componentSortKey = componentSortKey;
|
|
6
|
-
exports.sectionQualifiesForTerraformLaneLayout = sectionQualifiesForTerraformLaneLayout;
|
|
7
|
-
exports.isMainApplicationComponent = isMainApplicationComponent;
|
|
8
|
-
exports.isSectionApiNodeComponent = isSectionApiNodeComponent;
|
|
9
|
-
exports.isManagedSubserviceComponent = isManagedSubserviceComponent;
|
|
10
|
-
exports.sortNodesByLabel = sortNodesByLabel;
|
|
11
|
-
exports.filterSectionNodes = filterSectionNodes;
|
|
12
|
-
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
13
|
-
function getSectionIdFromComponent(component) {
|
|
14
|
-
const sid = component.properties?.section_id;
|
|
15
|
-
return typeof sid === "string" && sid.trim() ? sid.trim() : "<unsectioned>";
|
|
16
|
-
}
|
|
17
|
-
function getSectionLabelFromComponent(component) {
|
|
18
|
-
const label = component.properties?.section_label;
|
|
19
|
-
if (typeof label === "string" && label.trim())
|
|
20
|
-
return label.trim();
|
|
21
|
-
return getSectionIdFromComponent(component);
|
|
22
|
-
}
|
|
23
|
-
function componentSortKey(component) {
|
|
24
|
-
const managedBy = String(component.properties?.managed_by_provider ?? "");
|
|
25
|
-
const managedKey = String(component.properties?.managed_service_key ?? "");
|
|
26
|
-
if (managedBy) {
|
|
27
|
-
return `2|${managedBy}|${managedKey}|${component.name}`;
|
|
28
|
-
}
|
|
29
|
-
if (component.type === "third_party") {
|
|
30
|
-
return `1|${component.id}|${component.name}`;
|
|
31
|
-
}
|
|
32
|
-
return `0|${component.id}|${component.name}`;
|
|
33
|
-
}
|
|
34
|
-
/** Lane layout applies only to sections with Terraform resources (not every User actor). */
|
|
35
|
-
function sectionQualifiesForTerraformLaneLayout(sectionComponents) {
|
|
36
|
-
return (0, component_predicates_1.scanHasTerraformAddress)(sectionComponents);
|
|
37
|
-
}
|
|
38
|
-
function isMainApplicationComponent(component) {
|
|
39
|
-
const v = component.properties?.isMainApplication;
|
|
40
|
-
return v === true || v === "true";
|
|
41
|
-
}
|
|
42
|
-
function isSectionApiNodeComponent(component) {
|
|
43
|
-
return (component.type === "asset" &&
|
|
44
|
-
component.subType === "api" &&
|
|
45
|
-
(component.properties?.isSectionApiNode === true ||
|
|
46
|
-
component.properties?.isSectionApiNode === "true"));
|
|
47
|
-
}
|
|
48
|
-
function isManagedSubserviceComponent(component) {
|
|
49
|
-
const providerId = component.properties?.managed_by_provider;
|
|
50
|
-
return typeof providerId === "string" && providerId.trim().length > 0;
|
|
51
|
-
}
|
|
52
|
-
function sortNodesByLabel(a, b) {
|
|
53
|
-
const la = String(a.data?.label ?? a.id);
|
|
54
|
-
const lb = String(b.data?.label ?? b.id);
|
|
55
|
-
return la.localeCompare(lb);
|
|
56
|
-
}
|
|
57
|
-
function filterSectionNodes(nodes, componentsById, sectionId) {
|
|
58
|
-
return nodes.filter((n) => {
|
|
59
|
-
const c = componentsById.get(n.id);
|
|
60
|
-
return c && getSectionIdFromComponent(c) === sectionId;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyTerraformLaneLayout = applyTerraformLaneLayout;
|
|
4
|
-
const main_application_selection_1 = require("../../../classifier/main-application-selection");
|
|
5
|
-
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
6
|
-
const constants_1 = require("./constants");
|
|
7
|
-
const section_helpers_1 = require("./section-helpers");
|
|
8
|
-
/**
|
|
9
|
-
* Mixed-app Terraform root: only `provider.*` + `module.*` shells (no actor/main).
|
|
10
|
-
*/
|
|
11
|
-
function sectionUsesProviderHubBeforeModuleShells(sectionComponents) {
|
|
12
|
-
let hasProvider = false;
|
|
13
|
-
let hasModuleShell = false;
|
|
14
|
-
for (const c of sectionComponents) {
|
|
15
|
-
if (c.type === "actor")
|
|
16
|
-
return false;
|
|
17
|
-
if (c.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(c))
|
|
18
|
-
return false;
|
|
19
|
-
if ((0, component_predicates_1.isTerraformProviderComponent)(c))
|
|
20
|
-
hasProvider = true;
|
|
21
|
-
else if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(c))
|
|
22
|
-
hasModuleShell = true;
|
|
23
|
-
}
|
|
24
|
-
return hasProvider && hasModuleShell;
|
|
25
|
-
}
|
|
26
|
-
function terraformLaneTier(component, opts) {
|
|
27
|
-
if (component.type === "actor")
|
|
28
|
-
return 0;
|
|
29
|
-
if (component.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(component)) {
|
|
30
|
-
return 1;
|
|
31
|
-
}
|
|
32
|
-
if (opts?.providerBeforeModuleShells) {
|
|
33
|
-
if ((0, component_predicates_1.isTerraformProviderComponent)(component))
|
|
34
|
-
return 2;
|
|
35
|
-
if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(component))
|
|
36
|
-
return 3;
|
|
37
|
-
if (component.type === "asset")
|
|
38
|
-
return 4;
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(component))
|
|
42
|
-
return 2;
|
|
43
|
-
if (component.type === "third_party")
|
|
44
|
-
return 3;
|
|
45
|
-
if (component.type === "asset")
|
|
46
|
-
return 4;
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
function applyTerraformLaneLayout(nodes, componentsById, sectionIds) {
|
|
50
|
-
const allComponents = [...componentsById.values()];
|
|
51
|
-
const targetSectionIds = sectionIds.length <= 1
|
|
52
|
-
? sectionIds
|
|
53
|
-
: sectionIds.filter((sid) => {
|
|
54
|
-
const inSection = allComponents.filter((c) => (0, section_helpers_1.getSectionIdFromComponent)(c) === sid);
|
|
55
|
-
return (0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(inSection);
|
|
56
|
-
});
|
|
57
|
-
if (targetSectionIds.length === 0)
|
|
58
|
-
return;
|
|
59
|
-
for (const sectionId of targetSectionIds) {
|
|
60
|
-
const sectionIndex = sectionIds.indexOf(sectionId);
|
|
61
|
-
const baseX = Math.max(0, sectionIndex) * constants_1.SECTION_BLOCK_WIDTH;
|
|
62
|
-
const sectionNodes = nodes.filter((n) => {
|
|
63
|
-
const c = componentsById.get(n.id);
|
|
64
|
-
return c && (0, section_helpers_1.getSectionIdFromComponent)(c) === sectionId;
|
|
65
|
-
});
|
|
66
|
-
if (sectionNodes.length === 0)
|
|
67
|
-
continue;
|
|
68
|
-
const sectionComponents = sectionNodes
|
|
69
|
-
.map((n) => componentsById.get(n.id))
|
|
70
|
-
.filter((c) => Boolean(c));
|
|
71
|
-
if (!(0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(sectionComponents))
|
|
72
|
-
continue;
|
|
73
|
-
const providerBeforeModuleShells = sectionUsesProviderHubBeforeModuleShells(sectionComponents);
|
|
74
|
-
const byTier = new Map();
|
|
75
|
-
for (const node of sectionNodes) {
|
|
76
|
-
const c = componentsById.get(node.id);
|
|
77
|
-
if (!c)
|
|
78
|
-
continue;
|
|
79
|
-
const tier = terraformLaneTier(c, { providerBeforeModuleShells });
|
|
80
|
-
if (tier === undefined)
|
|
81
|
-
continue;
|
|
82
|
-
const list = byTier.get(tier) ?? [];
|
|
83
|
-
list.push(node);
|
|
84
|
-
byTier.set(tier, list);
|
|
85
|
-
}
|
|
86
|
-
const tierOrder = [0, 1, 2, 3, 4];
|
|
87
|
-
for (const tier of tierOrder) {
|
|
88
|
-
const list = byTier.get(tier);
|
|
89
|
-
if (!list)
|
|
90
|
-
continue;
|
|
91
|
-
list.sort((a, b) => {
|
|
92
|
-
const ca = componentsById.get(a.id);
|
|
93
|
-
const cb = componentsById.get(b.id);
|
|
94
|
-
const na = ca?.name ?? a.id;
|
|
95
|
-
const nb = cb?.name ?? b.id;
|
|
96
|
-
const cmp = na.localeCompare(nb);
|
|
97
|
-
if (cmp !== 0)
|
|
98
|
-
return cmp;
|
|
99
|
-
return a.id.localeCompare(b.id);
|
|
100
|
-
});
|
|
101
|
-
list.forEach((node, idx) => {
|
|
102
|
-
node.position = {
|
|
103
|
-
x: baseX + tier * constants_1.TERRAFORM_LANE_X_STEP,
|
|
104
|
-
y: idx * constants_1.NODE_VERTICAL_SPACING,
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DetectedDataFlow } from "../types/data-flow";
|
|
2
|
-
export type InferredDataFlowProtocol = "rest" | "graphql";
|
|
3
|
-
/**
|
|
4
|
-
* Infer engineering.protocol for a scanned data flow (rest | graphql).
|
|
5
|
-
* Returns undefined when the flow type is not HTTP/API-shaped or there is no signal.
|
|
6
|
-
*/
|
|
7
|
-
export declare function inferDataFlowProtocol(flow: DetectedDataFlow): InferredDataFlowProtocol | undefined;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inferDataFlowProtocol = inferDataFlowProtocol;
|
|
4
|
-
const GRAPHQL_SIGNAL = /\bgraphql\b|\/graphql\b/i;
|
|
5
|
-
function textSuggestsGraphql(text) {
|
|
6
|
-
return GRAPHQL_SIGNAL.test(text);
|
|
7
|
-
}
|
|
8
|
-
function flowCodeSuggestsGraphql(flow) {
|
|
9
|
-
const locations = [
|
|
10
|
-
flow.sourceLocation,
|
|
11
|
-
...(flow.sourceLocations ?? []),
|
|
12
|
-
].filter((loc) => loc != null);
|
|
13
|
-
for (const loc of locations) {
|
|
14
|
-
if (typeof loc.code === "string" && textSuggestsGraphql(loc.code)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Infer engineering.protocol for a scanned data flow (rest | graphql).
|
|
22
|
-
* Returns undefined when the flow type is not HTTP/API-shaped or there is no signal.
|
|
23
|
-
*/
|
|
24
|
-
function inferDataFlowProtocol(flow) {
|
|
25
|
-
const endpoint = flow.endpoint?.trim() ?? "";
|
|
26
|
-
if (endpoint && textSuggestsGraphql(endpoint)) {
|
|
27
|
-
return "graphql";
|
|
28
|
-
}
|
|
29
|
-
if (flowCodeSuggestsGraphql(flow)) {
|
|
30
|
-
return "graphql";
|
|
31
|
-
}
|
|
32
|
-
if (flow.type !== "api_call") {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
if (endpoint || flow.method?.trim()) {
|
|
36
|
-
return "rest";
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DetectedComponent } from "../types/component";
|
|
2
|
-
import type { ScanResult } from "../types/result";
|
|
3
|
-
/**
|
|
4
|
-
* Repo has deployable application code outside the Terraform stack (monorepo apps).
|
|
5
|
-
*/
|
|
6
|
-
export declare function isMixedAppTerraformScan(components: DetectedComponent[]): boolean;
|
|
7
|
-
/** In mixed scans, keep app nodes plus Terraform provider hub and module call shells only. */
|
|
8
|
-
export declare function shouldKeepComponentInMixedAppTerraformScan(component: DetectedComponent): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* When application packages and a Terraform stack coexist, drop per-resource
|
|
11
|
-
* Terraform nodes (VPC subnets, RDS instances, etc.) and keep provider + module shells.
|
|
12
|
-
*/
|
|
13
|
-
export declare function applyMixedAppTerraformScanResult(scanResult: ScanResult): ScanResult;
|