cgraphx 2.0.2 → 2.0.3
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/core/code/engine/cli/analyze-config.js +320 -0
- package/dist/core/code/engine/cli/analyze.js +1086 -0
- package/dist/core/code/engine/cli/cli-message.js +83 -0
- package/dist/core/code/engine/cli/detect-changes-format.js +58 -0
- package/dist/core/code/engine/cli/embedding-dims.js +43 -0
- package/dist/core/code/engine/cli/format-elapsed.js +12 -0
- package/dist/core/code/engine/cli/help-i18n.js +144 -0
- package/dist/core/code/engine/cli/i18n/en.js +110 -0
- package/dist/core/code/engine/cli/i18n/index.js +47 -0
- package/dist/core/code/engine/cli/i18n/resources.js +9 -0
- package/dist/core/code/engine/cli/i18n/zh-CN.js +110 -0
- package/dist/core/code/engine/cli/lazy-action.js +67 -0
- package/dist/core/code/engine/cli/optional-grammars.js +136 -0
- package/dist/core/code/engine/cli/resolve-invocation.js +76 -0
- package/dist/core/code/engine/cli/status.js +156 -0
- package/dist/core/code/engine/cli/tool.js +384 -0
- package/dist/core/code/engine/config/ignore-service.js +511 -0
- package/dist/core/code/engine/config/supported-languages.js +17 -0
- package/dist/core/code/engine/core/analysis-features.js +64 -0
- package/dist/core/code/engine/core/analyzer-identity.js +2171 -0
- package/dist/core/code/engine/core/git-staleness.js +180 -0
- package/dist/core/code/engine/core/graph/graph.js +180 -0
- package/dist/core/code/engine/core/graph/import-cycles.js +106 -0
- package/dist/core/code/engine/core/graph/types.js +2 -0
- package/dist/core/code/engine/core/index-freshness.js +12 -0
- package/dist/core/code/engine/core/ingestion/binding-accumulator.js +341 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/c-cpp.js +168 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/csharp.js +9 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/dart.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/go.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/jvm.js +54 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/php.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/python.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/ruby.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/rust.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/swift.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/typescript-javascript.js +11 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/generic.js +62 -0
- package/dist/core/code/engine/core/ingestion/call-processor.js +503 -0
- package/dist/core/code/engine/core/ingestion/call-routing.js +98 -0
- package/dist/core/code/engine/core/ingestion/call-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/cfg/callee-cell-format.js +45 -0
- package/dist/core/code/engine/core/ingestion/cfg/cfg-builder.js +202 -0
- package/dist/core/code/engine/core/ingestion/cfg/collect.js +81 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-dependence.js +185 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-flow-context.js +130 -0
- package/dist/core/code/engine/core/ingestion/cfg/emit.js +646 -0
- package/dist/core/code/engine/core/ingestion/cfg/post-dominators.js +182 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-def-reason-codec.js +139 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs-graph.js +322 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs.js +792 -0
- package/dist/core/code/engine/core/ingestion/cfg/synthetic-escape.js +305 -0
- package/dist/core/code/engine/core/ingestion/cfg/traversal-result.js +6 -0
- package/dist/core/code/engine/core/ingestion/cfg/types.js +14 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp-harvest.js +545 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp.js +590 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/call-site-harvest.js +356 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp-harvest.js +593 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp.js +871 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart-harvest.js +874 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart.js +840 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go-harvest.js +625 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go.js +642 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java-harvest.js +517 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java.js +816 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin-harvest.js +723 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin.js +813 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php-harvest.js +630 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php.js +725 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python-harvest.js +776 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby-harvest.js +591 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby.js +760 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust-harvest.js +877 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/scope-tree-harvest.js +120 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift-harvest.js +683 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift.js +791 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript-harvest.js +1060 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript.js +587 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/c-cpp.js +77 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/csharp.js +24 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/dart.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/go.js +28 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/jvm.js +67 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/php.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/python.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/ruby.js +13 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/rust.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/swift.js +21 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/typescript-javascript.js +31 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/generic.js +144 -0
- package/dist/core/code/engine/core/ingestion/class-types.js +2 -0
- package/dist/core/code/engine/core/ingestion/cluster-enricher.js +174 -0
- package/dist/core/code/engine/core/ingestion/community-processor.js +604 -0
- package/dist/core/code/engine/core/ingestion/constants.js +26 -0
- package/dist/core/code/engine/core/ingestion/cpp-ue-preprocessor.js +263 -0
- package/dist/core/code/engine/core/ingestion/csharp-namespace-gate.js +133 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/index.js +38 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/spring.js +310 -0
- package/dist/core/code/engine/core/ingestion/emit-references.js +244 -0
- package/dist/core/code/engine/core/ingestion/entry-point-scoring.js +201 -0
- package/dist/core/code/engine/core/ingestion/export-detection.js +244 -0
- package/dist/core/code/engine/core/ingestion/field-extractor.js +29 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/c-cpp.js +107 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/csharp.js +124 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/dart.js +99 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/go.js +102 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/helpers.js +198 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/jvm.js +172 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/php.js +67 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/python.js +94 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/ruby.js +79 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/rust.js +55 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/swift.js +93 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/typescript-javascript.js +59 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/generic.js +147 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/typescript.js +266 -0
- package/dist/core/code/engine/core/ingestion/field-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/filesystem-walker.js +136 -0
- package/dist/core/code/engine/core/ingestion/finalize-orchestrator.js +159 -0
- package/dist/core/code/engine/core/ingestion/framework-detection.js +432 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/analysis-features.js +38 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/annotation-arguments.js +234 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop-candidates.js +88 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop.js +487 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/auto-configuration.js +21 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-candidates.js +189 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-catalog.js +32 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-factories.js +73 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/conditionals.js +323 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/config-bindings.js +119 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/di-metadata.js +385 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/resource-injection.js +96 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/c-cpp.js +17 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/csharp.js +46 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/dart.js +59 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/go.js +30 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/jvm.js +73 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/php.js +19 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/python.js +45 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/rust.js +58 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/swift.js +94 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/typescript-javascript.js +26 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/csharp.js +128 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/go.js +50 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/jvm.js +112 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/php.js +80 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/python.js +75 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/resolver-factory.js +36 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/standard.js +180 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/types.js +7 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/utils.js +153 -0
- package/dist/core/code/engine/core/ingestion/import-target-adapter.js +99 -0
- package/dist/core/code/engine/core/ingestion/language-config.js +391 -0
- package/dist/core/code/engine/core/ingestion/language-provider.js +25 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity-metadata.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/c/capture-side-channel.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/c/captures.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/c/header-scan.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-decomposer.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/c/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/c/interpret.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/c/merge-bindings.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/c/query.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/c/scope-resolver.js +112 -0
- package/dist/core/code/engine/core/ingestion/languages/c/simple-hooks.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/c/static-linkage.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/c-cpp.js +506 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/adl.js +804 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity-metadata.js +258 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/capture-side-channel.js +89 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/captures.js +1975 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-extractor.js +311 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-filter.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/conversion-rank.js +163 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/file-local-linkage.js +327 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/header-scan.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-decomposer.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-target.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/inline-namespaces.js +379 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/interpret.js +239 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/member-lookup.js +470 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/merge-bindings.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/query.js +763 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/range-bindings.js +230 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/scope-resolver.js +354 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/simple-hooks.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/two-phase-lookup.js +348 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/type-classifier.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/user-defined-conversions.js +128 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/accessor-unwrap.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/captures.js +557 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-decomposer.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-target.js +176 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/index.js +95 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/interpret.js +150 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/merge-bindings.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/namespace-siblings.js +708 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/qualified-type-names.js +62 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/query.js +578 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/receiver-binding.js +142 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/resolution-config.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/scope-resolver.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/simple-hooks.js +81 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp.js +204 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity-metadata.js +38 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/built-ins.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/cache-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/captures.js +1096 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/expand-wildcards.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/extension-type-preprocess.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/import-target.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/index.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/interpret.js +101 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/merge-bindings.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/query.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/receiver-binding.js +90 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/scope-resolver.js +197 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/signature-bindings.js +54 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/simple-hooks.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/dart.js +138 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity-metadata.js +71 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity.js +17 -0
- package/dist/core/code/engine/core/ingestion/languages/go/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/captures.js +492 -0
- package/dist/core/code/engine/core/ingestion/languages/go/expand-wildcards.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/go/generic-type-parameters.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-decomposer.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-target.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/go/index.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interface-impls.js +955 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interpret.js +177 -0
- package/dist/core/code/engine/core/ingestion/languages/go/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/method-owners.js +131 -0
- package/dist/core/code/engine/core/ingestion/languages/go/namespace-mirror.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-clause.js +79 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-siblings.js +83 -0
- package/dist/core/code/engine/core/ingestion/languages/go/query.js +298 -0
- package/dist/core/code/engine/core/ingestion/languages/go/range-binding.js +127 -0
- package/dist/core/code/engine/core/ingestion/languages/go/receiver-binding.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/go/scope-resolver.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/go/simple-hooks.js +31 -0
- package/dist/core/code/engine/core/ingestion/languages/go/type-binding.js +279 -0
- package/dist/core/code/engine/core/ingestion/languages/go.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/index.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/java/analysis-features.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity-metadata.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity.js +27 -0
- package/dist/core/code/engine/core/ingestion/languages/java/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/java/capture-side-channel.js +123 -0
- package/dist/core/code/engine/core/ingestion/languages/java/captures.js +791 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-decomposer.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/java/index.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/interpret.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/java/merge-bindings.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/query.js +319 -0
- package/dist/core/code/engine/core/ingestion/languages/java/receiver-binding.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/java/scope-resolver.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/java/simple-hooks.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-aop.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-conditionals.js +52 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-config-bindings.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-di.js +165 -0
- package/dist/core/code/engine/core/ingestion/languages/java.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/arity.js +15 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/captures.js +1122 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/import-target.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/index.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/interpret.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/query.js +659 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/scope-resolver.js +78 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/simple-hooks.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-facts.js +46 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-siblings.js +200 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity-metadata.js +23 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/capture-side-channel.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/captures.js +1262 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/companion-scopes.js +72 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-decomposer.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-target.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/index.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/interpret.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/merge-bindings.js +28 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/owners.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/query.js +243 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/receiver-binding.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/scope-resolver.js +207 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/simple-hooks.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-aop.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-conditionals.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-di.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity-metadata.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/php/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/php/captures.js +1166 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-decomposer.js +238 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-target.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/php/index.js +85 -0
- package/dist/core/code/engine/core/ingestion/languages/php/interpret.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/php/merge-bindings.js +50 -0
- package/dist/core/code/engine/core/ingestion/languages/php/namespace-siblings.js +353 -0
- package/dist/core/code/engine/core/ingestion/languages/php/query.js +391 -0
- package/dist/core/code/engine/core/ingestion/languages/php/receiver-binding.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/php/scope-resolver.js +361 -0
- package/dist/core/code/engine/core/ingestion/languages/php/simple-hooks.js +116 -0
- package/dist/core/code/engine/core/ingestion/languages/php.js +302 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/python/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/python/captures.js +299 -0
- package/dist/core/code/engine/core/ingestion/languages/python/depends-references.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-decomposer.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-target.js +440 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/python/interpret.js +430 -0
- package/dist/core/code/engine/core/ingestion/languages/python/merge-bindings.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/python/query.js +323 -0
- package/dist/core/code/engine/core/ingestion/languages/python/receiver-binding.js +310 -0
- package/dist/core/code/engine/core/ingestion/languages/python/scope-resolver.js +80 -0
- package/dist/core/code/engine/core/ingestion/languages/python/simple-hooks.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/python.js +140 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/captures.js +864 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/import-target.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/interpret.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/query.js +349 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/receiver-binding.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/scope-resolver.js +263 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/simple-hooks.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby.js +215 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/arity.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/captures.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-decomposer.js +167 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-target.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/interpret.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/method-owners.js +76 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/module-path.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/qualified-call.js +482 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/query.js +280 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/range-binding.js +687 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/receiver-binding.js +148 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/scope-resolver.js +151 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/simple-hooks.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/rust.js +183 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity-metadata.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/base-type.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/captures.js +594 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/conditional-directive-preprocess.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/implicit-imports.js +60 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-decomposer.js +87 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-target.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/index.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/interpret.js +93 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/merge-bindings.js +51 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/query.js +226 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/receiver-binding.js +169 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/scope-resolver.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/sibling-type-bindings.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/signature-bindings.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/simple-hooks.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-grouping.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-siblings.js +74 -0
- package/dist/core/code/engine/core/ingestion/languages/swift.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity-metadata.js +106 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity.js +57 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/array-callback.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/captures.js +956 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-export-assignment.js +535 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-module-exports.js +196 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-decomposer.js +374 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-target.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/index.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/interpret.js +344 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/merge-bindings.js +161 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/nuxt-auto-imports.js +325 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/query.js +1328 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/receiver-binding.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/scope-resolver.js +293 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/simple-hooks.js +139 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript.js +455 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/captures.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/import-target.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/index.js +55 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/scope-resolver.js +295 -0
- package/dist/core/code/engine/core/ingestion/languages/vue.js +96 -0
- package/dist/core/code/engine/core/ingestion/local-symbol-pruner.js +68 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/csharp.js +290 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/dart.js +392 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/go.js +179 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/jvm.js +350 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/php.js +306 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/python.js +312 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/ruby.js +289 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/rust.js +198 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/swift.js +286 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/typescript-javascript.js +341 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/generic.js +209 -0
- package/dist/core/code/engine/core/ingestion/method-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/model/field-registry.js +41 -0
- package/dist/core/code/engine/core/ingestion/model/index.js +52 -0
- package/dist/core/code/engine/core/ingestion/model/method-registry.js +138 -0
- package/dist/core/code/engine/core/ingestion/model/owned-members-lookup.js +46 -0
- package/dist/core/code/engine/core/ingestion/model/registration-table.js +234 -0
- package/dist/core/code/engine/core/ingestion/model/resolve.js +183 -0
- package/dist/core/code/engine/core/ingestion/model/scope-resolution-indexes.js +43 -0
- package/dist/core/code/engine/core/ingestion/model/semantic-model.js +179 -0
- package/dist/core/code/engine/core/ingestion/model/symbol-table.js +216 -0
- package/dist/core/code/engine/core/ingestion/model/type-registry.js +84 -0
- package/dist/core/code/engine/core/ingestion/mro-processor.js +709 -0
- package/dist/core/code/engine/core/ingestion/parsing-processor.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/communities.js +69 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/cross-file.js +71 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/di.js +338 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/http-api-calls.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/index.js +54 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/mro.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/orm.js +78 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse-impl.js +1286 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse.js +41 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/processes.js +193 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/prune-local-symbols.js +29 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/registry.js +52 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/routes.js +409 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/rpc-edges.js +301 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/runner.js +207 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/scan.js +49 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-aop.js +442 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-auto-configuration.js +264 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-config.js +440 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/structure.js +38 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/tools.js +89 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/types.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline.js +152 -0
- package/dist/core/code/engine/core/ingestion/process-processor.js +325 -0
- package/dist/core/code/engine/core/ingestion/resolve-references.js +205 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/constant-resolver.js +135 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django-root-discovery.js +221 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django.js +428 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/expo.js +39 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/fastapi-router-bindings.js +264 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/laravel.js +501 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/middleware.js +175 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/nextjs.js +81 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/php.js +25 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/python-const-resolver.js +307 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/response-shapes.js +299 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/route-path.js +71 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring-shared.js +310 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor-bridge.js +60 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor.js +1373 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/contract/scope-resolver.js +282 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +72 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/edges.js +194 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/ids.js +472 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +43 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +274 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +93 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/callable-value-flow.js +1240 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/compound-receiver.js +1174 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/free-call-fallback.js +873 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/imported-return-types.js +226 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/mro.js +107 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/overload-narrowing.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/property-dispatch.js +122 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1720 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/phase.js +395 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +208 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/registry.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/run.js +632 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +112 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/resolution-outcome.js +41 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/namespace-targets.js +81 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/walkers.js +1835 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/unresolved-receivers.js +242 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/utils/definition-id.js +22 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/workspace-index.js +151 -0
- package/dist/core/code/engine/core/ingestion/structure-processor.js +40 -0
- package/dist/core/code/engine/core/ingestion/tree-sitter-queries.js +2244 -0
- package/dist/core/code/engine/core/ingestion/ts-js-hoc-utils.js +115 -0
- package/dist/core/code/engine/core/ingestion/type-env.js +1136 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/c-cpp.js +555 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/csharp.js +570 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/dart.js +372 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/go.js +508 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/jvm.js +875 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/php.js +537 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/python.js +477 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/ruby.js +380 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/rust.js +502 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/shared.js +843 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/swift.js +490 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/types.js +2 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/typescript.js +690 -0
- package/dist/core/code/engine/core/ingestion/utils/ast-helpers.js +1693 -0
- package/dist/core/code/engine/core/ingestion/utils/call-analysis.js +779 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-flow-captures.js +932 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-labels.js +49 -0
- package/dist/core/code/engine/core/ingestion/utils/deferred-resolution-profile.js +151 -0
- package/dist/core/code/engine/core/ingestion/utils/effective-ram.js +67 -0
- package/dist/core/code/engine/core/ingestion/utils/env.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/event-loop.js +9 -0
- package/dist/core/code/engine/core/ingestion/utils/graph-sort.js +103 -0
- package/dist/core/code/engine/core/ingestion/utils/heap-probe.js +45 -0
- package/dist/core/code/engine/core/ingestion/utils/heritage-marker.js +47 -0
- package/dist/core/code/engine/core/ingestion/utils/line-base.js +24 -0
- package/dist/core/code/engine/core/ingestion/utils/max-file-size.js +59 -0
- package/dist/core/code/engine/core/ingestion/utils/method-props.js +198 -0
- package/dist/core/code/engine/core/ingestion/utils/qualified-name.js +73 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-captures.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-codec.js +188 -0
- package/dist/core/code/engine/core/ingestion/utils/scope-tree-walk.js +36 -0
- package/dist/core/code/engine/core/ingestion/utils/symbol-labels.js +48 -0
- package/dist/core/code/engine/core/ingestion/utils/template-arguments.js +187 -0
- package/dist/core/code/engine/core/ingestion/utils/type-parameters.js +209 -0
- package/dist/core/code/engine/core/ingestion/utils/verbose.js +6 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/c-cpp.js +133 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/csharp.js +66 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/dart.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/go.js +153 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/jvm.js +145 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/php.js +61 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/python.js +104 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/ruby.js +55 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/swift.js +91 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/typescript-javascript.js +86 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/generic.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/vue-sfc-extractor.js +544 -0
- package/dist/core/code/engine/core/ingestion/workers/callable-id.js +122 -0
- package/dist/core/code/engine/core/ingestion/workers/clone-safety.js +470 -0
- package/dist/core/code/engine/core/ingestion/workers/parse-worker.js +2456 -0
- package/dist/core/code/engine/core/ingestion/workers/post-result.js +90 -0
- package/dist/core/code/engine/core/ingestion/workers/quarantine.js +41 -0
- package/dist/core/code/engine/core/ingestion/workers/result-merge.js +59 -0
- package/dist/core/code/engine/core/ingestion/workers/worker-pool.js +1725 -0
- package/dist/core/code/engine/core/ingestion/workspace-config.js +139 -0
- package/dist/core/code/engine/core/lbug/conn-lock.js +72 -0
- package/dist/core/code/engine/core/lbug/csv-generator.js +710 -0
- package/dist/core/code/engine/core/lbug/cypher-escape.js +24 -0
- package/dist/core/code/engine/core/lbug/extension-load-error.js +339 -0
- package/dist/core/code/engine/core/lbug/extension-loader.js +261 -0
- package/dist/core/code/engine/core/lbug/graph-emit-sink.js +584 -0
- package/dist/core/code/engine/core/lbug/lbug-adapter.js +2703 -0
- package/dist/core/code/engine/core/lbug/lbug-config.js +1029 -0
- package/dist/core/code/engine/core/lbug/native-check.js +435 -0
- package/dist/core/code/engine/core/lbug/pool-adapter.js +973 -0
- package/dist/core/code/engine/core/lbug/query-params.js +25 -0
- package/dist/core/code/engine/core/lbug/query-result-utils.js +31 -0
- package/dist/core/code/engine/core/lbug/rel-pair-routing.js +373 -0
- package/dist/core/code/engine/core/lbug/schema.js +771 -0
- package/dist/core/code/engine/core/lbug/shutdown-helpers.js +40 -0
- package/dist/core/code/engine/core/lbug/sidecar-recovery.js +716 -0
- package/dist/core/code/engine/core/lbug/stdio-capture.js +49 -0
- package/dist/core/code/engine/core/lbug/sync-csv-writer.js +115 -0
- package/dist/core/code/engine/core/lbug/wal-checkpoint-driver.js +215 -0
- package/dist/core/code/engine/core/lbug/wal-driver-state.js +28 -0
- package/dist/core/code/engine/core/logger.js +339 -0
- package/dist/core/code/engine/core/platform/capabilities.js +91 -0
- package/dist/core/code/engine/core/run-analyze.js +1098 -0
- package/dist/core/code/engine/core/tree-sitter/parser-loader.js +281 -0
- package/dist/core/code/engine/core/tree-sitter/safe-parse.js +258 -0
- package/dist/core/code/engine/core/tree-sitter/vendored-grammars.js +64 -0
- package/dist/core/code/engine/lib/utils.js +121 -0
- package/dist/core/code/engine/mcp/core/lbug-adapter.js +27 -0
- package/dist/core/code/engine/mcp/local/aop-metadata.js +230 -0
- package/dist/core/code/engine/mcp/local/bean-metadata.js +49 -0
- package/dist/core/code/engine/mcp/local/limits.js +15 -0
- package/dist/core/code/engine/mcp/local/line-display.js +6 -0
- package/dist/core/code/engine/mcp/local/local-backend.js +4142 -0
- package/dist/core/code/engine/storage/branch-index.js +72 -0
- package/dist/core/code/engine/storage/file-hash.js +95 -0
- package/dist/core/code/engine/storage/fs-atomic.js +34 -0
- package/dist/core/code/engine/storage/git.js +555 -0
- package/dist/core/code/engine/storage/index-lock.js +664 -0
- package/dist/core/code/engine/storage/parse-cache.js +650 -0
- package/dist/core/code/engine/storage/parsedfile-store.js +620 -0
- package/dist/core/code/engine/storage/repo-manager.js +1061 -0
- package/dist/core/code/engine/storage/scope-index-store.js +247 -0
- package/dist/core/code/engine/types/pipeline.js +2 -0
- package/dist/core/code/scripts/install-duckdb-extension.mjs +125 -0
- package/dist/core/code/scripts/resolve-analyze-cmd.cjs +346 -0
- package/dist/core/code/shared/graph/types.js +8 -0
- package/dist/core/code/shared/index.js +105 -0
- package/dist/core/code/shared/integrations/circuit-breaker.js +242 -0
- package/dist/core/code/shared/integrations/resilient-fetch.js +224 -0
- package/dist/core/code/shared/integrations/retry.js +70 -0
- package/dist/core/code/shared/integrations/understand-quickly.js +145 -0
- package/dist/core/code/shared/language-detection.js +162 -0
- package/dist/core/code/shared/languages.js +27 -0
- package/dist/core/code/shared/lbug/schema-constants.js +98 -0
- package/dist/core/code/shared/mro-strategy.js +2 -0
- package/dist/core/code/shared/pipeline.js +5 -0
- package/dist/core/code/shared/scope-resolution/callable-flow-site.js +11 -0
- package/dist/core/code/shared/scope-resolution/def-index.js +53 -0
- package/dist/core/code/shared/scope-resolution/evidence-weights.js +87 -0
- package/dist/core/code/shared/scope-resolution/finalize-algorithm.js +807 -0
- package/dist/core/code/shared/scope-resolution/language-classification.js +46 -0
- package/dist/core/code/shared/scope-resolution/method-dispatch-index.js +100 -0
- package/dist/core/code/shared/scope-resolution/module-scope-index.js +59 -0
- package/dist/core/code/shared/scope-resolution/origin-priority.js +23 -0
- package/dist/core/code/shared/scope-resolution/parsed-file.js +54 -0
- package/dist/core/code/shared/scope-resolution/position-index.js +136 -0
- package/dist/core/code/shared/scope-resolution/qualified-name-index.js +77 -0
- package/dist/core/code/shared/scope-resolution/reference-site.js +24 -0
- package/dist/core/code/shared/scope-resolution/registries/class-registry.js +32 -0
- package/dist/core/code/shared/scope-resolution/registries/context.js +52 -0
- package/dist/core/code/shared/scope-resolution/registries/evidence.js +152 -0
- package/dist/core/code/shared/scope-resolution/registries/field-registry.js +33 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-core.js +392 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-qualified.js +58 -0
- package/dist/core/code/shared/scope-resolution/registries/macro-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/method-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/tie-breaks.js +63 -0
- package/dist/core/code/shared/scope-resolution/resolve-type-ref.js +128 -0
- package/dist/core/code/shared/scope-resolution/scope-id.js +49 -0
- package/dist/core/code/shared/scope-resolution/scope-tree.js +225 -0
- package/dist/core/code/shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/core/code/shared/scope-resolution/types.js +25 -0
- package/dist/core/code/shared/test-helpers.js +17 -0
- package/dist/core/code/vendor/leiden/index.cjs +355 -0
- package/dist/core/code/vendor/leiden/utils.cjs +419 -0
- package/dist/core/timeline/cli.d.ts.map +1 -1
- package/dist/core/timeline/cli.js +13 -6
- package/dist/core/timeline/cli.js.map +1 -1
- package/dist/core/timeline/debris.d.ts +20 -0
- package/dist/core/timeline/debris.d.ts.map +1 -0
- package/dist/core/timeline/debris.js +124 -0
- package/dist/core/timeline/debris.js.map +1 -0
- package/dist/core/timeline/hook-runner.d.ts.map +1 -1
- package/dist/core/timeline/hook-runner.js +3 -1
- package/dist/core/timeline/hook-runner.js.map +1 -1
- package/dist/core/timeline/hooks.d.ts.map +1 -1
- package/dist/core/timeline/hooks.js +13 -5
- package/dist/core/timeline/hooks.js.map +1 -1
- package/dist/core/timeline/installer.d.ts +2 -0
- package/dist/core/timeline/installer.d.ts.map +1 -1
- package/dist/core/timeline/installer.js +12 -0
- package/dist/core/timeline/installer.js.map +1 -1
- package/dist/core/timeline/project-root.d.ts +21 -0
- package/dist/core/timeline/project-root.d.ts.map +1 -0
- package/dist/core/timeline/project-root.js +83 -0
- package/dist/core/timeline/project-root.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Response shape extraction from route handler file content.
|
|
4
|
+
* Detects .json() calls (JS/TS) and json_encode() calls (PHP),
|
|
5
|
+
* extracts top-level keys, and classifies by HTTP status code.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.detectStatusCode = detectStatusCode;
|
|
9
|
+
exports.extractResponseShapes = extractResponseShapes;
|
|
10
|
+
exports.extractPHPResponseShapes = extractPHPResponseShapes;
|
|
11
|
+
/** Return the status code (group 1) from the last match, or undefined. */
|
|
12
|
+
function lastMatchGroup(text, pattern) {
|
|
13
|
+
const matches = [...text.matchAll(pattern)];
|
|
14
|
+
if (matches.length === 0)
|
|
15
|
+
return undefined;
|
|
16
|
+
return parseInt(matches[matches.length - 1][1], 10);
|
|
17
|
+
}
|
|
18
|
+
/** Build the {responseKeys, errorKeys} result, deduplicating and omitting empty. */
|
|
19
|
+
function buildShapeResult(successKeys, errKeys) {
|
|
20
|
+
return {
|
|
21
|
+
...(successKeys.length > 0 ? { responseKeys: [...new Set(successKeys)] } : {}),
|
|
22
|
+
...(errKeys.length > 0 ? { errorKeys: [...new Set(errKeys)] } : {}),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Detect an HTTP status code associated with a .json() call.
|
|
27
|
+
*/
|
|
28
|
+
function detectStatusCode(content, jsonMatchPos, closingBracePos) {
|
|
29
|
+
const lookbackStart = Math.max(0, jsonMatchPos - 200);
|
|
30
|
+
const before = content.slice(lookbackStart, jsonMatchPos);
|
|
31
|
+
const statusChainMatch = before.match(/\.status\s*\(\s*(\d{3})\s*\)\s*$/);
|
|
32
|
+
if (statusChainMatch) {
|
|
33
|
+
return parseInt(statusChainMatch[1], 10);
|
|
34
|
+
}
|
|
35
|
+
if (closingBracePos > 0) {
|
|
36
|
+
const afterFirstArg = content.slice(closingBracePos + 1, closingBracePos + 150);
|
|
37
|
+
const secondArgMatch = afterFirstArg.match(/^\s*,\s*\{[^}]*status\s*:\s*(\d{3})/);
|
|
38
|
+
if (secondArgMatch) {
|
|
39
|
+
return parseInt(secondArgMatch[1], 10);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const extendedBefore = content.slice(Math.max(0, jsonMatchPos - 300), jsonMatchPos);
|
|
43
|
+
if (/new\s+Response\s*\(\s*JSON\s*\.stringify\s*$/.test(extendedBefore) && closingBracePos > 0) {
|
|
44
|
+
const afterStringify = content.slice(closingBracePos + 1, closingBracePos + 200);
|
|
45
|
+
const respStatusMatch = afterStringify.match(/^\s*\)\s*,\s*\{[^}]*status\s*:\s*(\d{3})/);
|
|
46
|
+
if (respStatusMatch) {
|
|
47
|
+
return parseInt(respStatusMatch[1], 10);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extract response shapes from JS/TS handler file content.
|
|
54
|
+
*/
|
|
55
|
+
function extractResponseShapes(content) {
|
|
56
|
+
const successKeys = [];
|
|
57
|
+
const errKeys = [];
|
|
58
|
+
const jsonPattern = /\.json\s*\(/g;
|
|
59
|
+
let jsonMatch;
|
|
60
|
+
while ((jsonMatch = jsonPattern.exec(content)) !== null) {
|
|
61
|
+
const matchPos = jsonMatch.index;
|
|
62
|
+
const startIdx = matchPos + jsonMatch[0].length;
|
|
63
|
+
let i = startIdx;
|
|
64
|
+
while (i < content.length && content[i] !== '{' && content[i] !== ')')
|
|
65
|
+
i++;
|
|
66
|
+
if (i >= content.length || content[i] !== '{')
|
|
67
|
+
continue;
|
|
68
|
+
const callKeys = [];
|
|
69
|
+
let depth = 0;
|
|
70
|
+
let keyStart = -1;
|
|
71
|
+
let inString = null;
|
|
72
|
+
let closingBracePos = -1;
|
|
73
|
+
for (let j = i; j < content.length; j++) {
|
|
74
|
+
const ch = content[j];
|
|
75
|
+
if (inString) {
|
|
76
|
+
if (ch === '\\') {
|
|
77
|
+
j++;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (ch === inString)
|
|
81
|
+
inString = null;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
85
|
+
// Quoted string at depth 1 before ':' is a property key (e.g., { 'courses': data })
|
|
86
|
+
// The original parser only handled unquoted identifiers.
|
|
87
|
+
if (depth === 1 && keyStart === -1) {
|
|
88
|
+
const quote = ch;
|
|
89
|
+
const strStart = j + 1;
|
|
90
|
+
let strEnd = -1;
|
|
91
|
+
for (let s = strStart; s < content.length; s++) {
|
|
92
|
+
if (content[s] === '\\') {
|
|
93
|
+
s++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (content[s] === quote) {
|
|
97
|
+
strEnd = s;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (strEnd !== -1) {
|
|
102
|
+
// Scan forward for ':' without allocating a substring
|
|
103
|
+
let p = strEnd + 1;
|
|
104
|
+
while (p < content.length &&
|
|
105
|
+
(content[p] === ' ' ||
|
|
106
|
+
content[p] === '\t' ||
|
|
107
|
+
content[p] === '\n' ||
|
|
108
|
+
content[p] === '\r'))
|
|
109
|
+
p++;
|
|
110
|
+
if (content[p] === ':') {
|
|
111
|
+
callKeys.push(content.slice(strStart, strEnd));
|
|
112
|
+
}
|
|
113
|
+
j = strEnd;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
inString = ch;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (ch === '{') {
|
|
121
|
+
depth++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (ch === '}') {
|
|
125
|
+
depth--;
|
|
126
|
+
if (depth === 0) {
|
|
127
|
+
closingBracePos = j;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (depth !== 1)
|
|
133
|
+
continue;
|
|
134
|
+
if (keyStart === -1 && /[a-zA-Z_$]/.test(ch)) {
|
|
135
|
+
keyStart = j;
|
|
136
|
+
}
|
|
137
|
+
else if (keyStart !== -1 && !/[a-zA-Z0-9_$]/.test(ch)) {
|
|
138
|
+
const key = content.slice(keyStart, j);
|
|
139
|
+
const rest = content.slice(j).trimStart();
|
|
140
|
+
if (rest[0] === ':' || rest[0] === ',' || rest[0] === '}') {
|
|
141
|
+
callKeys.push(key);
|
|
142
|
+
}
|
|
143
|
+
keyStart = -1;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (callKeys.length === 0)
|
|
147
|
+
continue;
|
|
148
|
+
const status = detectStatusCode(content, matchPos, closingBracePos);
|
|
149
|
+
if (status !== undefined && status >= 400) {
|
|
150
|
+
errKeys.push(...callKeys);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
successKeys.push(...callKeys);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return buildShapeResult(successKeys, errKeys);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Find the last exit/die boundary in a string.
|
|
160
|
+
* Matches: exit; exit(N); die; die('msg'); die($var);
|
|
161
|
+
* Returns the index AFTER the boundary.
|
|
162
|
+
*/
|
|
163
|
+
function findLastExitBoundary(text) {
|
|
164
|
+
const pattern = /\b(exit|die)\s*(\([^)]*\))?\s*;/g;
|
|
165
|
+
let lastEnd = -1;
|
|
166
|
+
let m;
|
|
167
|
+
while ((m = pattern.exec(text)) !== null) {
|
|
168
|
+
lastEnd = m.index + m[0].length;
|
|
169
|
+
}
|
|
170
|
+
return lastEnd;
|
|
171
|
+
}
|
|
172
|
+
function detectPHPStatusCode(content, jsonEncodePos) {
|
|
173
|
+
const lookbackStart = Math.max(0, jsonEncodePos - 300);
|
|
174
|
+
let before = content.slice(lookbackStart, jsonEncodePos);
|
|
175
|
+
const boundaryEnd = findLastExitBoundary(before);
|
|
176
|
+
if (boundaryEnd !== -1) {
|
|
177
|
+
before = before.slice(boundaryEnd);
|
|
178
|
+
}
|
|
179
|
+
return (lastMatchGroup(before, /http_response_code\s*\(\s*(\d{3})\s*\)/g) ??
|
|
180
|
+
lastMatchGroup(before, /header\s*\(\s*['"]HTTP\/[\d.]+\s+(\d{3})/g) ??
|
|
181
|
+
// CGI/FastCGI format
|
|
182
|
+
lastMatchGroup(before, /header\s*\(\s*['"]Status:\s*(\d{3})/g));
|
|
183
|
+
}
|
|
184
|
+
function findMatchingBracket(content, openPos, open, close) {
|
|
185
|
+
let depth = 0;
|
|
186
|
+
let inString = null;
|
|
187
|
+
for (let j = openPos; j < content.length; j++) {
|
|
188
|
+
const ch = content[j];
|
|
189
|
+
if (inString) {
|
|
190
|
+
if (ch === '\\') {
|
|
191
|
+
j++;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (ch === inString)
|
|
195
|
+
inString = null;
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (ch === '"' || ch === "'") {
|
|
199
|
+
inString = ch;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (ch === open) {
|
|
203
|
+
depth++;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (ch === close) {
|
|
207
|
+
depth--;
|
|
208
|
+
if (depth === 0)
|
|
209
|
+
return j;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return -1;
|
|
214
|
+
}
|
|
215
|
+
function extractPHPArrayKeys(arrayContent) {
|
|
216
|
+
const keys = [];
|
|
217
|
+
let depth = 0;
|
|
218
|
+
let inString = null;
|
|
219
|
+
const topLevelRanges = [];
|
|
220
|
+
let rangeStart = 0;
|
|
221
|
+
for (let i = 0; i < arrayContent.length; i++) {
|
|
222
|
+
const ch = arrayContent[i];
|
|
223
|
+
if (inString) {
|
|
224
|
+
if (ch === '\\') {
|
|
225
|
+
i++;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
if (ch === inString)
|
|
229
|
+
inString = null;
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (ch === '"' || ch === "'") {
|
|
233
|
+
inString = ch;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (ch === '[' || ch === '(' || ch === '{') {
|
|
237
|
+
if (depth === 0)
|
|
238
|
+
topLevelRanges.push([rangeStart, i]);
|
|
239
|
+
depth++;
|
|
240
|
+
}
|
|
241
|
+
else if (ch === ']' || ch === ')' || ch === '}') {
|
|
242
|
+
depth--;
|
|
243
|
+
if (depth === 0)
|
|
244
|
+
rangeStart = i + 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (depth === 0)
|
|
248
|
+
topLevelRanges.push([rangeStart, arrayContent.length]);
|
|
249
|
+
for (const [start, end] of topLevelRanges) {
|
|
250
|
+
const segment = arrayContent.slice(start, end);
|
|
251
|
+
const localPattern = /(['"])([a-zA-Z_][a-zA-Z0-9_]*)\1\s*=>/g;
|
|
252
|
+
let m;
|
|
253
|
+
while ((m = localPattern.exec(segment)) !== null) {
|
|
254
|
+
keys.push(m[2]);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return keys;
|
|
258
|
+
}
|
|
259
|
+
function extractPHPResponseShapes(content) {
|
|
260
|
+
const successKeys = [];
|
|
261
|
+
const errKeys = [];
|
|
262
|
+
const jsonEncodePattern = /json_encode\s*\(/g;
|
|
263
|
+
let match;
|
|
264
|
+
while ((match = jsonEncodePattern.exec(content)) !== null) {
|
|
265
|
+
const matchPos = match.index;
|
|
266
|
+
const startIdx = matchPos + match[0].length;
|
|
267
|
+
let i = startIdx;
|
|
268
|
+
while (i < content.length && /\s/.test(content[i]))
|
|
269
|
+
i++;
|
|
270
|
+
if (i >= content.length)
|
|
271
|
+
continue;
|
|
272
|
+
let arrayEnd = -1;
|
|
273
|
+
const openChar = content[i];
|
|
274
|
+
if (openChar === '[') {
|
|
275
|
+
arrayEnd = findMatchingBracket(content, i, '[', ']');
|
|
276
|
+
}
|
|
277
|
+
else if (content.slice(i, i + 6) === 'array(') {
|
|
278
|
+
i += 5;
|
|
279
|
+
arrayEnd = findMatchingBracket(content, i, '(', ')');
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (arrayEnd === -1)
|
|
285
|
+
continue;
|
|
286
|
+
const arrayContent = content.slice(i + 1, arrayEnd);
|
|
287
|
+
const callKeys = extractPHPArrayKeys(arrayContent);
|
|
288
|
+
if (callKeys.length === 0)
|
|
289
|
+
continue;
|
|
290
|
+
const status = detectPHPStatusCode(content, matchPos);
|
|
291
|
+
if (status !== undefined && status >= 400) {
|
|
292
|
+
errKeys.push(...callKeys);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
successKeys.push(...callKeys);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return buildShapeResult(successKeys, errKeys);
|
|
299
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared route-path normalization.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from the routes phase so both the routes phase (which creates the
|
|
6
|
+
* `Route` graph node, keyed by `(method, url)` via `routeNodeKey` — #2289) and
|
|
7
|
+
* the parse phase (which resolves each route's handler symbol and needs the
|
|
8
|
+
* SAME key to associate the resolved id back to the route) can compute an
|
|
9
|
+
* identical route identity without a phase-to-phase import cycle. Pure string
|
|
10
|
+
* logic, no dependencies.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.normalizeExtractedRoutePath = normalizeExtractedRoutePath;
|
|
14
|
+
exports.normalizeRouteMethod = normalizeRouteMethod;
|
|
15
|
+
exports.routeNodeKey = routeNodeKey;
|
|
16
|
+
/**
|
|
17
|
+
* Join a route's path with its (optional) prefix into a normalized,
|
|
18
|
+
* leading-slash URL used as the Route node identity. Collapses duplicate
|
|
19
|
+
* slashes and strips trailing ones; an empty result degrades to `/`.
|
|
20
|
+
*/
|
|
21
|
+
function normalizeExtractedRoutePath(routePath, prefix) {
|
|
22
|
+
const pathPart = routePath.trim().replace(/^\/+/, '').replace(/\/+$/g, '');
|
|
23
|
+
const prefixPart = prefix?.trim().replace(/^\/+/, '').replace(/\/+$/g, '');
|
|
24
|
+
const joined = prefixPart ? `/${prefixPart}${pathPart ? `/${pathPart}` : ''}` : `/${pathPart}`;
|
|
25
|
+
return joined.replace(/\/+/g, '/') || '/';
|
|
26
|
+
}
|
|
27
|
+
const VALID_HTTP_METHODS = new Set([
|
|
28
|
+
'GET',
|
|
29
|
+
'POST',
|
|
30
|
+
'PUT',
|
|
31
|
+
'PATCH',
|
|
32
|
+
'DELETE',
|
|
33
|
+
'HEAD',
|
|
34
|
+
'OPTIONS',
|
|
35
|
+
'TRACE',
|
|
36
|
+
'CONNECT',
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* Canonicalize a route's HTTP verb for persistence on the Route node and for
|
|
40
|
+
* the route identity key. Returns an upper-cased standard method, `'*'` for a
|
|
41
|
+
* method-agnostic route (e.g. a Django function view), or `undefined` when the
|
|
42
|
+
* value is not a real HTTP verb. Laravel `Route::resource` / `apiResource`
|
|
43
|
+
* surface values like `resource` / `apiResource` (they expand to several verbs
|
|
44
|
+
* at runtime), so they come back `undefined` — keeping the column clean and
|
|
45
|
+
* letting the contract extractor fall back to its source-scan path.
|
|
46
|
+
*/
|
|
47
|
+
function normalizeRouteMethod(raw) {
|
|
48
|
+
if (typeof raw !== 'string')
|
|
49
|
+
return undefined;
|
|
50
|
+
const verb = raw.trim().toUpperCase();
|
|
51
|
+
// '*' marks a method-agnostic route. Preserve it so the contract layer emits a
|
|
52
|
+
// wildcard provider that matches consumers of any method.
|
|
53
|
+
if (verb === '*')
|
|
54
|
+
return '*';
|
|
55
|
+
return VALID_HTTP_METHODS.has(verb) ? verb : undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The Route node identity (#2289): `(method, path)` when the verb is known and
|
|
59
|
+
* specific, falling back to URL-only when the method is `undefined` (filesystem
|
|
60
|
+
* routes, Laravel `resource`/`apiResource`) or `'*'` (method-agnostic routes,
|
|
61
|
+
* e.g. Django function views). The URL-fallback keeps those byte-identical to
|
|
62
|
+
* the pre-#2289 URL-only ids, so only genuine declaration-style multi-verb
|
|
63
|
+
* routes (`GET /x` + `POST /x`) split into separate nodes.
|
|
64
|
+
*
|
|
65
|
+
* Used by the routes phase (node id + registry key), the processes phase
|
|
66
|
+
* (ENTRY_POINT_OF), and the handler-symbol resolver — all three must key
|
|
67
|
+
* identically.
|
|
68
|
+
*/
|
|
69
|
+
function routeNodeKey(method, url) {
|
|
70
|
+
return method && method !== '*' ? `${method} ${url}` : url;
|
|
71
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Spring route-annotation primitives.
|
|
4
|
+
*
|
|
5
|
+
* These are the low-level building blocks the two Spring route extractors —
|
|
6
|
+
* the ingestion-layer `route-extractors/spring.ts` (produces graph `Route`
|
|
7
|
+
* nodes) and the group-layer `group/extractors/http-patterns/java.ts`
|
|
8
|
+
* (produces cross-repo HTTP contracts) — would otherwise each maintain
|
|
9
|
+
* independently. Centralising the annotation→method map, the enclosing-class
|
|
10
|
+
* lookup, and the route-key filter keeps those semantics in one place so the
|
|
11
|
+
* two extractors can't drift apart.
|
|
12
|
+
*
|
|
13
|
+
* This module lives in `ingestion/` (the lower layer); the group layer imports
|
|
14
|
+
* from it, matching the existing `group → ingestion` dependency direction
|
|
15
|
+
* (e.g. `group/extractors/include-extractor.ts` already imports
|
|
16
|
+
* `ingestion/import-resolvers/utils.ts`). It MUST NOT import anything from
|
|
17
|
+
* `group/` to avoid a dependency cycle.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.METHOD_ANNOTATION_TO_HTTP = void 0;
|
|
21
|
+
exports.springAnnotationHttpMethods = springAnnotationHttpMethods;
|
|
22
|
+
exports.intersectSpringHttpMethods = intersectSpringHttpMethods;
|
|
23
|
+
exports.isRouteMemberKey = isRouteMemberKey;
|
|
24
|
+
exports.findEnclosingClass = findEnclosingClass;
|
|
25
|
+
exports.findEnclosingType = findEnclosingType;
|
|
26
|
+
exports.unquoteSpringLiteral = unquoteSpringLiteral;
|
|
27
|
+
exports.joinPath = joinPath;
|
|
28
|
+
exports.joinInheritedSpringPath = joinInheritedSpringPath;
|
|
29
|
+
exports.resolveInheritedSpringRoutes = resolveInheritedSpringRoutes;
|
|
30
|
+
const annotation_arguments_js_1 = require("../frameworks/spring/annotation-arguments.js");
|
|
31
|
+
/**
|
|
32
|
+
* Spring shortcut method-annotation → HTTP verb.
|
|
33
|
+
*
|
|
34
|
+
* `@RequestMapping` is intentionally absent: on a method it carries no implicit
|
|
35
|
+
* verb (the verb lives in its `method = RequestMethod.X` attribute), and on a
|
|
36
|
+
* class it is a URL prefix rather than a route. Callers handle `@RequestMapping`
|
|
37
|
+
* separately.
|
|
38
|
+
*/
|
|
39
|
+
exports.METHOD_ANNOTATION_TO_HTTP = {
|
|
40
|
+
GetMapping: 'GET',
|
|
41
|
+
PostMapping: 'POST',
|
|
42
|
+
PutMapping: 'PUT',
|
|
43
|
+
DeleteMapping: 'DELETE',
|
|
44
|
+
PatchMapping: 'PATCH',
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Parse one `RequestMethod.X` literal or a Java annotation array of literals.
|
|
48
|
+
* An empty array is valid and means Spring's unrestricted/default method set.
|
|
49
|
+
* Runtime expressions fail closed instead of producing a guessed route.
|
|
50
|
+
*/
|
|
51
|
+
function parseRequestMethodValues(value) {
|
|
52
|
+
let trimmed = '';
|
|
53
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
54
|
+
const char = value[index];
|
|
55
|
+
const next = value[index + 1];
|
|
56
|
+
if (/\s/.test(char))
|
|
57
|
+
continue;
|
|
58
|
+
if (char === '/' && next === '*') {
|
|
59
|
+
const commentEnd = value.indexOf('*/', index + 2);
|
|
60
|
+
if (commentEnd < 0)
|
|
61
|
+
return null;
|
|
62
|
+
index = commentEnd + 1;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (char === '/' && next === '/') {
|
|
66
|
+
const lineEnd = value.slice(index + 2).search(/[\r\n]/);
|
|
67
|
+
if (lineEnd < 0)
|
|
68
|
+
return null;
|
|
69
|
+
index += lineEnd + 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
trimmed += char;
|
|
73
|
+
}
|
|
74
|
+
const hasOpeningBrace = trimmed.startsWith('{');
|
|
75
|
+
const hasClosingBrace = trimmed.endsWith('}');
|
|
76
|
+
if (hasOpeningBrace !== hasClosingBrace)
|
|
77
|
+
return null;
|
|
78
|
+
const body = hasOpeningBrace ? trimmed.slice(1, -1).trim() : trimmed;
|
|
79
|
+
if (body.length === 0)
|
|
80
|
+
return [];
|
|
81
|
+
if (!hasOpeningBrace && body.includes(','))
|
|
82
|
+
return null;
|
|
83
|
+
const methods = [];
|
|
84
|
+
const parts = body.split(',');
|
|
85
|
+
if (hasOpeningBrace && parts[parts.length - 1].trim() === '')
|
|
86
|
+
parts.pop();
|
|
87
|
+
for (const rawPart of parts) {
|
|
88
|
+
const part = rawPart.trim();
|
|
89
|
+
const match = /^(?:(?:[A-Za-z_$][A-Za-z0-9_$]*\.)*RequestMethod\.)?(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS|TRACE)$/.exec(part);
|
|
90
|
+
if (!match)
|
|
91
|
+
return null;
|
|
92
|
+
if (!methods.includes(match[1]))
|
|
93
|
+
methods.push(match[1]);
|
|
94
|
+
}
|
|
95
|
+
return methods;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolve a method-level Spring mapping annotation to its HTTP method(s).
|
|
99
|
+
*
|
|
100
|
+
* Shortcut annotations have one implicit verb. `@RequestMapping` may declare
|
|
101
|
+
* one or more static `RequestMethod.X` values; when its `method` member is
|
|
102
|
+
* absent or an empty array, `'*'` preserves Spring's method-agnostic semantics.
|
|
103
|
+
* A present but non-static method expression yields no methods (fail closed).
|
|
104
|
+
*/
|
|
105
|
+
function springAnnotationHttpMethods(annotationName, annotationText) {
|
|
106
|
+
const shortcut = exports.METHOD_ANNOTATION_TO_HTTP[annotationName];
|
|
107
|
+
if (shortcut)
|
|
108
|
+
return [shortcut];
|
|
109
|
+
if (annotationName !== 'RequestMapping')
|
|
110
|
+
return [];
|
|
111
|
+
const args = (0, annotation_arguments_js_1.parseSpringAnnotationArguments)(annotationText);
|
|
112
|
+
if (args === null)
|
|
113
|
+
return [];
|
|
114
|
+
const methodArgs = args.filter((arg) => arg.name === 'method');
|
|
115
|
+
if (methodArgs.length === 0)
|
|
116
|
+
return ['*'];
|
|
117
|
+
if (methodArgs.length !== 1)
|
|
118
|
+
return [];
|
|
119
|
+
const methods = parseRequestMethodValues(methodArgs[0].value);
|
|
120
|
+
if (methods === null)
|
|
121
|
+
return [];
|
|
122
|
+
return methods.length > 0 ? methods : ['*'];
|
|
123
|
+
}
|
|
124
|
+
/** Intersect class- and method-level Spring mapping constraints. */
|
|
125
|
+
function intersectSpringHttpMethods(classMethods, methodMethods) {
|
|
126
|
+
if (classMethods.length === 0 || methodMethods.length === 0)
|
|
127
|
+
return [];
|
|
128
|
+
if (classMethods.includes('*'))
|
|
129
|
+
return methodMethods;
|
|
130
|
+
if (methodMethods.includes('*'))
|
|
131
|
+
return classMethods;
|
|
132
|
+
return methodMethods.filter((method) => classMethods.includes(method));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A named annotation argument contributes a route only when its member key is
|
|
136
|
+
* `path` or `value`; a positional argument (no key node) always qualifies.
|
|
137
|
+
* Drops Spring's non-route string attributes (`produces`, `consumes`,
|
|
138
|
+
* `headers`, `name`, `params`) that would otherwise be mis-read as routes.
|
|
139
|
+
*/
|
|
140
|
+
function isRouteMemberKey(keyNode) {
|
|
141
|
+
if (!keyNode)
|
|
142
|
+
return true;
|
|
143
|
+
return keyNode.text === 'path' || keyNode.text === 'value';
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Find the nearest enclosing `class_declaration` ancestor for a node, or null
|
|
147
|
+
* if the node is top-level. Tree-sitter's `SyntaxNode.parent` walks one level
|
|
148
|
+
* at a time.
|
|
149
|
+
*/
|
|
150
|
+
function findEnclosingClass(node) {
|
|
151
|
+
let cur = node.parent;
|
|
152
|
+
while (cur) {
|
|
153
|
+
if (cur.type === 'class_declaration')
|
|
154
|
+
return cur;
|
|
155
|
+
cur = cur.parent;
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Find the nearest enclosing Java type declaration (class OR interface) for a
|
|
161
|
+
* node, reporting its kind. Used by the ingestion route extractor to tell an
|
|
162
|
+
* interface-declared `@*Mapping` (handled by the cross-file inheritance pass,
|
|
163
|
+
* #2288) apart from a concrete class route, and by the type collector.
|
|
164
|
+
*/
|
|
165
|
+
function findEnclosingType(node) {
|
|
166
|
+
let cur = node.parent;
|
|
167
|
+
while (cur) {
|
|
168
|
+
if (cur.type === 'class_declaration')
|
|
169
|
+
return { node: cur, kind: 'class' };
|
|
170
|
+
if (cur.type === 'interface_declaration')
|
|
171
|
+
return { node: cur, kind: 'interface' };
|
|
172
|
+
cur = cur.parent;
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Strip enclosing quotes from a tree-sitter string-literal node's text.
|
|
178
|
+
* Handles single / double / template (backtick) quotes and triple-quoted
|
|
179
|
+
* strings. Mirrors the safer semantics of the group layer's `unquoteLiteral`:
|
|
180
|
+
* returns `null` for empty / nullish input so callers can uniformly skip
|
|
181
|
+
* captures whose value is missing, and returns the text unchanged when it
|
|
182
|
+
* carries no recognisable surrounding quotes (some grammars expose string
|
|
183
|
+
* content without quotes already).
|
|
184
|
+
*/
|
|
185
|
+
function unquoteSpringLiteral(raw) {
|
|
186
|
+
if (!raw)
|
|
187
|
+
return null;
|
|
188
|
+
if ((raw.startsWith('"""') && raw.endsWith('"""')) ||
|
|
189
|
+
(raw.startsWith("'''") && raw.endsWith("'''"))) {
|
|
190
|
+
return raw.slice(3, -3);
|
|
191
|
+
}
|
|
192
|
+
const first = raw[0];
|
|
193
|
+
const last = raw[raw.length - 1];
|
|
194
|
+
if ((first === '"' || first === "'" || first === '`') && last === first && raw.length >= 2) {
|
|
195
|
+
return raw.slice(1, -1);
|
|
196
|
+
}
|
|
197
|
+
return raw;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Join a class/interface-level prefix and a method-level path into a single
|
|
201
|
+
* URL path: strip leading/trailing slashes on the prefix and leading slashes
|
|
202
|
+
* on the method path, then ensure exactly one slash between them.
|
|
203
|
+
*
|
|
204
|
+
* Lives here (the lower shared layer) so the ingestion route extractor and the
|
|
205
|
+
* group-layer Spring/Kotlin plugins join prefixes identically; the group
|
|
206
|
+
* `spring-consumer-shared.ts` re-exports it for its existing importers.
|
|
207
|
+
*/
|
|
208
|
+
function joinPath(prefix, methodPath) {
|
|
209
|
+
const cleanPrefix = prefix.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
210
|
+
const cleanSub = methodPath.replace(/^\/+/, '');
|
|
211
|
+
if (!cleanPrefix)
|
|
212
|
+
return `/${cleanSub}`;
|
|
213
|
+
return `/${cleanPrefix}/${cleanSub}`;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Join a controller's own class prefix with a route inherited from an interface
|
|
217
|
+
* (interface-based controllers, #1743). The inherited path already has the
|
|
218
|
+
* interface's own class prefix (`inheritedOwnerPrefix`) baked in; when the
|
|
219
|
+
* controller repeats that same prefix we must NOT prepend it twice (#2057).
|
|
220
|
+
*/
|
|
221
|
+
function joinInheritedSpringPath(controllerPrefix, inheritedPath, inheritedOwnerPrefix = '') {
|
|
222
|
+
const joined = joinPath(controllerPrefix, inheritedPath);
|
|
223
|
+
const cleanPrefix = controllerPrefix.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
224
|
+
const cleanOwnerPrefix = inheritedOwnerPrefix.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
225
|
+
const cleanInherited = inheritedPath.replace(/^\/+/, '');
|
|
226
|
+
if (!cleanPrefix)
|
|
227
|
+
return joined;
|
|
228
|
+
if (cleanPrefix === cleanOwnerPrefix &&
|
|
229
|
+
(cleanInherited === cleanPrefix || cleanInherited.startsWith(`${cleanPrefix}/`))) {
|
|
230
|
+
return `/${cleanInherited}`;
|
|
231
|
+
}
|
|
232
|
+
return joined;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Resolve interface-based-controller provider routes (#1743): a concrete
|
|
236
|
+
* `@RestController`/`@Controller` class inherits the `@(Get|...)Mapping` routes
|
|
237
|
+
* declared on the interface it implements. Pure and language-agnostic — shared
|
|
238
|
+
* by the ingestion route extractor and the group Java/Kotlin plugins so all
|
|
239
|
+
* three emit the same inherited routes.
|
|
240
|
+
*
|
|
241
|
+
* An interface name that resolves to two distinct interfaces is ambiguous and
|
|
242
|
+
* its routes are dropped (the `null` marker). The controller's own class
|
|
243
|
+
* prefix(es) cross-product the inherited routes; `joinInheritedSpringPath`
|
|
244
|
+
* avoids doubling a prefix the interface already baked in (#2057). Duplicate
|
|
245
|
+
* `(method, path)` results per controller method are de-duped.
|
|
246
|
+
*/
|
|
247
|
+
function resolveInheritedSpringRoutes(types) {
|
|
248
|
+
// interface name → (method name → routes). `null` marks an ambiguous
|
|
249
|
+
// (duplicated) interface name. `IntermediateRoute` is declared at module scope.
|
|
250
|
+
const interfaceRoutes = new Map();
|
|
251
|
+
for (const type of types) {
|
|
252
|
+
if (type.kind !== 'interface')
|
|
253
|
+
continue;
|
|
254
|
+
if (interfaceRoutes.has(type.name)) {
|
|
255
|
+
interfaceRoutes.set(type.name, null);
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
const prefixes = type.classPrefixes.length ? type.classPrefixes : [''];
|
|
259
|
+
const methodMap = new Map();
|
|
260
|
+
for (const method of type.methods) {
|
|
261
|
+
// Cross-product the interface's class prefixes with each method route, so a
|
|
262
|
+
// multi-element `@RequestMapping(["/a","/b"])` interface yields N bindings.
|
|
263
|
+
const routes = method.routes.flatMap((route) => prefixes.map((prefix) => ({
|
|
264
|
+
method: route.method,
|
|
265
|
+
path: prefix ? joinPath(prefix, route.path) : route.path,
|
|
266
|
+
ownerPrefix: prefix,
|
|
267
|
+
})));
|
|
268
|
+
if (routes.length > 0)
|
|
269
|
+
methodMap.set(method.name, routes);
|
|
270
|
+
}
|
|
271
|
+
interfaceRoutes.set(type.name, methodMap);
|
|
272
|
+
}
|
|
273
|
+
const out = [];
|
|
274
|
+
for (const type of types) {
|
|
275
|
+
if (type.kind !== 'class' || !type.isController)
|
|
276
|
+
continue;
|
|
277
|
+
// Cross-product the controller's own class prefixes with each inherited
|
|
278
|
+
// route; `['']` keeps the common no-prefix controller emitting the
|
|
279
|
+
// interface path unchanged.
|
|
280
|
+
const controllerPrefixes = type.classPrefixes.length ? type.classPrefixes : [''];
|
|
281
|
+
for (const method of type.methods) {
|
|
282
|
+
if (method.routes.length > 0)
|
|
283
|
+
continue; // own @*Mapping → already a provider
|
|
284
|
+
const inherited = type.implementedInterfaces.flatMap((iface) => {
|
|
285
|
+
const routeMap = interfaceRoutes.get(iface);
|
|
286
|
+
if (!routeMap)
|
|
287
|
+
return [];
|
|
288
|
+
const routes = routeMap.get(method.name) ?? [];
|
|
289
|
+
return routes.flatMap((route) => controllerPrefixes.map((controllerPrefix) => ({
|
|
290
|
+
method: route.method,
|
|
291
|
+
path: joinInheritedSpringPath(controllerPrefix, route.path, route.ownerPrefix),
|
|
292
|
+
})));
|
|
293
|
+
});
|
|
294
|
+
const seen = new Set();
|
|
295
|
+
for (const route of inherited) {
|
|
296
|
+
const key = `${route.method} ${route.path}`;
|
|
297
|
+
if (seen.has(key))
|
|
298
|
+
continue;
|
|
299
|
+
seen.add(key);
|
|
300
|
+
out.push({
|
|
301
|
+
filePath: type.filePath,
|
|
302
|
+
methodName: method.name,
|
|
303
|
+
method: route.method,
|
|
304
|
+
path: route.path,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return out;
|
|
310
|
+
}
|