driftdetect-core 0.4.6 → 0.6.0
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/boundaries/types.d.ts +1 -1
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +1 -0
- package/dist/call-graph/analysis/graph-builder.js.map +1 -1
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.js +362 -4
- package/dist/call-graph/extractors/csharp-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts +37 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js +408 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts +80 -0
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js +457 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-extractor.d.ts +103 -0
- package/dist/call-graph/extractors/go-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-extractor.js +509 -0
- package/dist/call-graph/extractors/go-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts +97 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js +496 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.d.ts +102 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.d.ts.map +1 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js +289 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js.map +1 -0
- package/dist/call-graph/extractors/index.d.ts +17 -13
- package/dist/call-graph/extractors/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/index.js +24 -23
- package/dist/call-graph/extractors/index.js.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-extractor.d.ts +15 -0
- package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-extractor.js +120 -4
- package/dist/call-graph/extractors/java-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts +36 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js +426 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-extractor.d.ts +48 -1
- package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-extractor.js +460 -6
- package/dist/call-graph/extractors/php-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js +393 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/python-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts +85 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js +462 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts +154 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js +346 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.js +393 -0
- package/dist/call-graph/extractors/regex/csharp-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts +51 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.js +435 -0
- package/dist/call-graph/extractors/regex/go-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +26 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/index.js +74 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.js +327 -0
- package/dist/call-graph/extractors/regex/java-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts +30 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.js +333 -0
- package/dist/call-graph/extractors/regex/php-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts +46 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.js +380 -0
- package/dist/call-graph/extractors/regex/python-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts +27 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js +349 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js.map +1 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +7 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -1
- package/dist/call-graph/extractors/semantic-data-access-scanner.js +7 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -1
- package/dist/call-graph/extractors/types.d.ts +111 -0
- package/dist/call-graph/extractors/types.d.ts.map +1 -0
- package/dist/call-graph/extractors/types.js +68 -0
- package/dist/call-graph/extractors/types.js.map +1 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/typescript-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts +116 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js +635 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/index.d.ts +3 -0
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +5 -0
- package/dist/call-graph/index.js.map +1 -1
- package/dist/call-graph/types.d.ts +1 -1
- package/dist/call-graph/types.d.ts.map +1 -1
- package/dist/constraints/extraction/constraint-synthesizer.d.ts +72 -0
- package/dist/constraints/extraction/constraint-synthesizer.d.ts.map +1 -0
- package/dist/constraints/extraction/constraint-synthesizer.js +336 -0
- package/dist/constraints/extraction/constraint-synthesizer.js.map +1 -0
- package/dist/constraints/extraction/index.d.ts +10 -0
- package/dist/constraints/extraction/index.d.ts.map +1 -0
- package/dist/constraints/extraction/index.js +10 -0
- package/dist/constraints/extraction/index.js.map +1 -0
- package/dist/constraints/extraction/invariant-detector.d.ts +109 -0
- package/dist/constraints/extraction/invariant-detector.d.ts.map +1 -0
- package/dist/constraints/extraction/invariant-detector.js +979 -0
- package/dist/constraints/extraction/invariant-detector.js.map +1 -0
- package/dist/constraints/index.d.ts +15 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +16 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/constraints/store/constraint-store.d.ts +110 -0
- package/dist/constraints/store/constraint-store.d.ts.map +1 -0
- package/dist/constraints/store/constraint-store.js +584 -0
- package/dist/constraints/store/constraint-store.js.map +1 -0
- package/dist/constraints/types.d.ts +605 -0
- package/dist/constraints/types.d.ts.map +1 -0
- package/dist/constraints/types.js +57 -0
- package/dist/constraints/types.js.map +1 -0
- package/dist/constraints/verification/constraint-verifier.d.ts +100 -0
- package/dist/constraints/verification/constraint-verifier.d.ts.map +1 -0
- package/dist/constraints/verification/constraint-verifier.js +638 -0
- package/dist/constraints/verification/constraint-verifier.js.map +1 -0
- package/dist/constraints/verification/index.d.ts +8 -0
- package/dist/constraints/verification/index.d.ts.map +1 -0
- package/dist/constraints/verification/index.js +8 -0
- package/dist/constraints/verification/index.js.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts +121 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js +904 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -0
- package/dist/decisions/analyzer/index.d.ts +5 -0
- package/dist/decisions/analyzer/index.d.ts.map +1 -0
- package/dist/decisions/analyzer/index.js +5 -0
- package/dist/decisions/analyzer/index.js.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts +104 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.js +305 -0
- package/dist/decisions/extractors/base-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js +281 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/index.d.ts +31 -0
- package/dist/decisions/extractors/index.d.ts.map +1 -0
- package/dist/decisions/extractors/index.js +63 -0
- package/dist/decisions/extractors/index.js.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.js +248 -0
- package/dist/decisions/extractors/java-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.js +280 -0
- package/dist/decisions/extractors/php-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.js +248 -0
- package/dist/decisions/extractors/python-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts +37 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js +229 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js.map +1 -0
- package/dist/decisions/git/commit-parser.d.ts +58 -0
- package/dist/decisions/git/commit-parser.d.ts.map +1 -0
- package/dist/decisions/git/commit-parser.js +344 -0
- package/dist/decisions/git/commit-parser.js.map +1 -0
- package/dist/decisions/git/diff-analyzer.d.ts +30 -0
- package/dist/decisions/git/diff-analyzer.d.ts.map +1 -0
- package/dist/decisions/git/diff-analyzer.js +492 -0
- package/dist/decisions/git/diff-analyzer.js.map +1 -0
- package/dist/decisions/git/git-walker.d.ts +64 -0
- package/dist/decisions/git/git-walker.d.ts.map +1 -0
- package/dist/decisions/git/git-walker.js +441 -0
- package/dist/decisions/git/git-walker.js.map +1 -0
- package/dist/decisions/git/index.d.ts +11 -0
- package/dist/decisions/git/index.d.ts.map +1 -0
- package/dist/decisions/git/index.js +13 -0
- package/dist/decisions/git/index.js.map +1 -0
- package/dist/decisions/git/types.d.ts +223 -0
- package/dist/decisions/git/types.d.ts.map +1 -0
- package/dist/decisions/git/types.js +7 -0
- package/dist/decisions/git/types.js.map +1 -0
- package/dist/decisions/index.d.ts +27 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/index.js +45 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/types.d.ts +530 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/decisions/types.js +8 -0
- package/dist/decisions/types.js.map +1 -0
- package/dist/error-handling/error-handling-analyzer.d.ts +73 -0
- package/dist/error-handling/error-handling-analyzer.d.ts.map +1 -0
- package/dist/error-handling/error-handling-analyzer.js +706 -0
- package/dist/error-handling/error-handling-analyzer.js.map +1 -0
- package/dist/error-handling/index.d.ts +8 -0
- package/dist/error-handling/index.d.ts.map +1 -0
- package/dist/error-handling/index.js +8 -0
- package/dist/error-handling/index.js.map +1 -0
- package/dist/error-handling/types.d.ts +307 -0
- package/dist/error-handling/types.d.ts.map +1 -0
- package/dist/error-handling/types.js +7 -0
- package/dist/error-handling/types.js.map +1 -0
- package/dist/go/go-analyzer.d.ts +203 -0
- package/dist/go/go-analyzer.d.ts.map +1 -0
- package/dist/go/go-analyzer.js +509 -0
- package/dist/go/go-analyzer.js.map +1 -0
- package/dist/go/index.d.ts +7 -0
- package/dist/go/index.d.ts.map +1 -0
- package/dist/go/index.js +8 -0
- package/dist/go/index.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -1
- package/dist/lake/pattern-shard-store.d.ts +6 -0
- package/dist/lake/pattern-shard-store.d.ts.map +1 -1
- package/dist/lake/pattern-shard-store.js +6 -0
- package/dist/lake/pattern-shard-store.js.map +1 -1
- package/dist/module-coupling/coupling-analyzer.d.ts +73 -0
- package/dist/module-coupling/coupling-analyzer.d.ts.map +1 -0
- package/dist/module-coupling/coupling-analyzer.js +668 -0
- package/dist/module-coupling/coupling-analyzer.js.map +1 -0
- package/dist/module-coupling/index.d.ts +9 -0
- package/dist/module-coupling/index.d.ts.map +1 -0
- package/dist/module-coupling/index.js +9 -0
- package/dist/module-coupling/index.js.map +1 -0
- package/dist/module-coupling/types.d.ts +273 -0
- package/dist/module-coupling/types.d.ts.map +1 -0
- package/dist/module-coupling/types.js +8 -0
- package/dist/module-coupling/types.js.map +1 -0
- package/dist/parsers/tree-sitter/go-loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/go-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/go-loader.js +161 -0
- package/dist/parsers/tree-sitter/go-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts +250 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js +707 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- package/dist/patterns/adapters/index.d.ts +11 -0
- package/dist/patterns/adapters/index.d.ts.map +1 -0
- package/dist/patterns/adapters/index.js +11 -0
- package/dist/patterns/adapters/index.js.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts +59 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.js +468 -0
- package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -0
- package/dist/patterns/adapters/service-factory.d.ts +40 -0
- package/dist/patterns/adapters/service-factory.d.ts.map +1 -0
- package/dist/patterns/adapters/service-factory.js +144 -0
- package/dist/patterns/adapters/service-factory.js.map +1 -0
- package/dist/patterns/errors.d.ts +32 -0
- package/dist/patterns/errors.d.ts.map +1 -0
- package/dist/patterns/errors.js +45 -0
- package/dist/patterns/errors.js.map +1 -0
- package/dist/patterns/impl/cached-repository.d.ts +79 -0
- package/dist/patterns/impl/cached-repository.d.ts.map +1 -0
- package/dist/patterns/impl/cached-repository.js +296 -0
- package/dist/patterns/impl/cached-repository.js.map +1 -0
- package/dist/patterns/impl/file-repository.d.ts +75 -0
- package/dist/patterns/impl/file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/file-repository.js +507 -0
- package/dist/patterns/impl/file-repository.js.map +1 -0
- package/dist/patterns/impl/index.d.ts +16 -0
- package/dist/patterns/impl/index.d.ts.map +1 -0
- package/dist/patterns/impl/index.js +21 -0
- package/dist/patterns/impl/index.js.map +1 -0
- package/dist/patterns/impl/memory-repository.d.ts +56 -0
- package/dist/patterns/impl/memory-repository.d.ts.map +1 -0
- package/dist/patterns/impl/memory-repository.js +323 -0
- package/dist/patterns/impl/memory-repository.js.map +1 -0
- package/dist/patterns/impl/pattern-service.d.ts +52 -0
- package/dist/patterns/impl/pattern-service.d.ts.map +1 -0
- package/dist/patterns/impl/pattern-service.js +382 -0
- package/dist/patterns/impl/pattern-service.js.map +1 -0
- package/dist/patterns/impl/repository-factory.d.ts +44 -0
- package/dist/patterns/impl/repository-factory.d.ts.map +1 -0
- package/dist/patterns/impl/repository-factory.js +140 -0
- package/dist/patterns/impl/repository-factory.js.map +1 -0
- package/dist/patterns/impl/unified-file-repository.d.ts +111 -0
- package/dist/patterns/impl/unified-file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/unified-file-repository.js +677 -0
- package/dist/patterns/impl/unified-file-repository.js.map +1 -0
- package/dist/patterns/index.d.ts +23 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +41 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/repository.d.ts +241 -0
- package/dist/patterns/repository.d.ts.map +1 -0
- package/dist/patterns/repository.js +23 -0
- package/dist/patterns/repository.js.map +1 -0
- package/dist/patterns/service.d.ts +245 -0
- package/dist/patterns/service.d.ts.map +1 -0
- package/dist/patterns/service.js +25 -0
- package/dist/patterns/service.js.map +1 -0
- package/dist/patterns/types.d.ts +227 -0
- package/dist/patterns/types.d.ts.map +1 -0
- package/dist/patterns/types.js +117 -0
- package/dist/patterns/types.js.map +1 -0
- package/dist/simulation/approach-generator.d.ts +73 -0
- package/dist/simulation/approach-generator.d.ts.map +1 -0
- package/dist/simulation/approach-generator.js +371 -0
- package/dist/simulation/approach-generator.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +19 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.js +118 -0
- package/dist/simulation/language-strategies/csharp-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/index.d.ts +41 -0
- package/dist/simulation/language-strategies/index.d.ts.map +1 -0
- package/dist/simulation/language-strategies/index.js +92 -0
- package/dist/simulation/language-strategies/index.js.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.js +119 -0
- package/dist/simulation/language-strategies/java-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.js +129 -0
- package/dist/simulation/language-strategies/php-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.js +208 -0
- package/dist/simulation/language-strategies/python-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/types.d.ts +67 -0
- package/dist/simulation/language-strategies/types.d.ts.map +1 -0
- package/dist/simulation/language-strategies/types.js +23 -0
- package/dist/simulation/language-strategies/types.js.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.js +251 -0
- package/dist/simulation/language-strategies/typescript-strategies.js.map +1 -0
- package/dist/simulation/scorers/friction-scorer.d.ts +45 -0
- package/dist/simulation/scorers/friction-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/friction-scorer.js +336 -0
- package/dist/simulation/scorers/friction-scorer.js.map +1 -0
- package/dist/simulation/scorers/impact-scorer.d.ts +56 -0
- package/dist/simulation/scorers/impact-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/impact-scorer.js +273 -0
- package/dist/simulation/scorers/impact-scorer.js.map +1 -0
- package/dist/simulation/scorers/index.d.ts +12 -0
- package/dist/simulation/scorers/index.d.ts.map +1 -0
- package/dist/simulation/scorers/index.js +12 -0
- package/dist/simulation/scorers/index.js.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts +83 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js +367 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js.map +1 -0
- package/dist/simulation/scorers/security-scorer.d.ts +63 -0
- package/dist/simulation/scorers/security-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/security-scorer.js +346 -0
- package/dist/simulation/scorers/security-scorer.js.map +1 -0
- package/dist/simulation/simulation-engine.d.ts +89 -0
- package/dist/simulation/simulation-engine.d.ts.map +1 -0
- package/dist/simulation/simulation-engine.js +480 -0
- package/dist/simulation/simulation-engine.js.map +1 -0
- package/dist/simulation/types.d.ts +200 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +23 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/speculative/approach-generator.d.ts +2 -0
- package/dist/speculative/approach-generator.d.ts.map +1 -0
- package/dist/speculative/approach-generator.js +2 -0
- package/dist/speculative/approach-generator.js.map +1 -0
- package/dist/speculative/templates/types.d.ts +133 -0
- package/dist/speculative/templates/types.d.ts.map +1 -0
- package/dist/speculative/templates/types.js +208 -0
- package/dist/speculative/templates/types.js.map +1 -0
- package/dist/speculative/types.d.ts +523 -0
- package/dist/speculative/types.d.ts.map +1 -0
- package/dist/speculative/types.js +71 -0
- package/dist/speculative/types.js.map +1 -0
- package/dist/store/pattern-store.d.ts +6 -0
- package/dist/store/pattern-store.d.ts.map +1 -1
- package/dist/store/pattern-store.js +6 -0
- package/dist/store/pattern-store.js.map +1 -1
- package/dist/test-topology/extractors/base-test-extractor.d.ts +89 -0
- package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/base-test-extractor.js +187 -0
- package/dist/test-topology/extractors/base-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js +367 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/go-test-extractor.d.ts +33 -0
- package/dist/test-topology/extractors/go-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/go-test-extractor.js +436 -0
- package/dist/test-topology/extractors/go-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +13 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/index.js +13 -0
- package/dist/test-topology/extractors/index.js.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts +20 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.js +275 -0
- package/dist/test-topology/extractors/java-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.js +409 -0
- package/dist/test-topology/extractors/php-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.js +342 -0
- package/dist/test-topology/extractors/python-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts +51 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js +383 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts +62 -0
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js +528 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts +19 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/index.js +47 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts +50 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js +370 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts +56 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js +503 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts +57 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js +381 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts +60 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js +368 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js +266 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts +98 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js +556 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/index.d.ts +16 -0
- package/dist/test-topology/index.d.ts.map +1 -0
- package/dist/test-topology/index.js +19 -0
- package/dist/test-topology/index.js.map +1 -0
- package/dist/test-topology/test-topology-analyzer.d.ts +85 -0
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/test-topology-analyzer.js +539 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/types.d.ts +300 -0
- package/dist/test-topology/types.d.ts.map +1 -0
- package/dist/test-topology/types.js +7 -0
- package/dist/test-topology/types.js.map +1 -0
- package/dist/unified-provider/matching/database-sql-matcher.d.ts +42 -0
- package/dist/unified-provider/matching/database-sql-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/database-sql-matcher.js +282 -0
- package/dist/unified-provider/matching/database-sql-matcher.js.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts +41 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.js +222 -0
- package/dist/unified-provider/matching/gorm-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +3 -0
- package/dist/unified-provider/matching/index.d.ts.map +1 -1
- package/dist/unified-provider/matching/index.js +4 -0
- package/dist/unified-provider/matching/index.js.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.js +7 -0
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
- package/dist/unified-provider/matching/sqlx-matcher.d.ts +40 -0
- package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sqlx-matcher.js +214 -0
- package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts +62 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.js +608 -0
- package/dist/unified-provider/normalization/go-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +1 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -1
- package/dist/unified-provider/normalization/index.js +6 -1
- package/dist/unified-provider/normalization/index.js.map +1 -1
- package/dist/unified-provider/types.d.ts +1 -1
- package/dist/unified-provider/types.d.ts.map +1 -1
- package/dist/wpf/extractors/binding-error-detector.d.ts +75 -0
- package/dist/wpf/extractors/binding-error-detector.d.ts.map +1 -0
- package/dist/wpf/extractors/binding-error-detector.js +290 -0
- package/dist/wpf/extractors/binding-error-detector.js.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts +70 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.js +172 -0
- package/dist/wpf/extractors/code-behind-linker.js.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts +61 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.js +201 -0
- package/dist/wpf/extractors/dependency-property-extractor.js.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts +82 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js +412 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts +77 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.js +353 -0
- package/dist/wpf/extractors/regex/xaml-regex.js.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts +103 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js +296 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts +128 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.js +312 -0
- package/dist/wpf/extractors/value-converter-extractor.js.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts +104 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js +513 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts +98 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js +444 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js.map +1 -0
- package/dist/wpf/index.d.ts +25 -0
- package/dist/wpf/index.d.ts.map +1 -0
- package/dist/wpf/index.js +31 -0
- package/dist/wpf/index.js.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts +82 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js +311 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts +129 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js +367 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts +66 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.js +240 -0
- package/dist/wpf/linkers/datacontext-resolver.js.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts +71 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.js +268 -0
- package/dist/wpf/linkers/viewmodel-linker.js.map +1 -0
- package/dist/wpf/types.d.ts +451 -0
- package/dist/wpf/types.d.ts.map +1 -0
- package/dist/wpf/types.js +8 -0
- package/dist/wpf/types.js.map +1 -0
- package/dist/wpf/wpf-analyzer.d.ts +114 -0
- package/dist/wpf/wpf-analyzer.d.ts.map +1 -0
- package/dist/wpf/wpf-analyzer.js +332 -0
- package/dist/wpf/wpf-analyzer.js.map +1 -0
- package/dist/wrappers/clustering/clusterer.d.ts +43 -0
- package/dist/wrappers/clustering/clusterer.d.ts.map +1 -0
- package/dist/wrappers/clustering/clusterer.js +374 -0
- package/dist/wrappers/clustering/clusterer.js.map +1 -0
- package/dist/wrappers/clustering/exclusions.d.ts +47 -0
- package/dist/wrappers/clustering/exclusions.d.ts.map +1 -0
- package/dist/wrappers/clustering/exclusions.js +318 -0
- package/dist/wrappers/clustering/exclusions.js.map +1 -0
- package/dist/wrappers/clustering/index.d.ts +6 -0
- package/dist/wrappers/clustering/index.d.ts.map +1 -0
- package/dist/wrappers/clustering/index.js +6 -0
- package/dist/wrappers/clustering/index.js.map +1 -0
- package/dist/wrappers/detection/detector.d.ts +69 -0
- package/dist/wrappers/detection/detector.d.ts.map +1 -0
- package/dist/wrappers/detection/detector.js +279 -0
- package/dist/wrappers/detection/detector.js.map +1 -0
- package/dist/wrappers/detection/index.d.ts +5 -0
- package/dist/wrappers/detection/index.d.ts.map +1 -0
- package/dist/wrappers/detection/index.js +5 -0
- package/dist/wrappers/detection/index.js.map +1 -0
- package/dist/wrappers/export/index.d.ts +5 -0
- package/dist/wrappers/export/index.d.ts.map +1 -0
- package/dist/wrappers/export/index.js +5 -0
- package/dist/wrappers/export/index.js.map +1 -0
- package/dist/wrappers/export/json.d.ts +127 -0
- package/dist/wrappers/export/json.d.ts.map +1 -0
- package/dist/wrappers/export/json.js +160 -0
- package/dist/wrappers/export/json.js.map +1 -0
- package/dist/wrappers/index.d.ts +56 -0
- package/dist/wrappers/index.d.ts.map +1 -0
- package/dist/wrappers/index.js +159 -0
- package/dist/wrappers/index.js.map +1 -0
- package/dist/wrappers/integration/adapter.d.ts +52 -0
- package/dist/wrappers/integration/adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/adapter.js +210 -0
- package/dist/wrappers/integration/adapter.js.map +1 -0
- package/dist/wrappers/integration/index.d.ts +9 -0
- package/dist/wrappers/integration/index.d.ts.map +1 -0
- package/dist/wrappers/integration/index.js +12 -0
- package/dist/wrappers/integration/index.js.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts +52 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.js +192 -0
- package/dist/wrappers/integration/pattern-adapter.js.map +1 -0
- package/dist/wrappers/integration/scanner.d.ts +85 -0
- package/dist/wrappers/integration/scanner.d.ts.map +1 -0
- package/dist/wrappers/integration/scanner.js +367 -0
- package/dist/wrappers/integration/scanner.js.map +1 -0
- package/dist/wrappers/primitives/discovery.d.ts +57 -0
- package/dist/wrappers/primitives/discovery.d.ts.map +1 -0
- package/dist/wrappers/primitives/discovery.js +389 -0
- package/dist/wrappers/primitives/discovery.js.map +1 -0
- package/dist/wrappers/primitives/index.d.ts +6 -0
- package/dist/wrappers/primitives/index.d.ts.map +1 -0
- package/dist/wrappers/primitives/index.js +6 -0
- package/dist/wrappers/primitives/index.js.map +1 -0
- package/dist/wrappers/primitives/registry.d.ts +63 -0
- package/dist/wrappers/primitives/registry.d.ts.map +1 -0
- package/dist/wrappers/primitives/registry.js +447 -0
- package/dist/wrappers/primitives/registry.js.map +1 -0
- package/dist/wrappers/types.d.ts +137 -0
- package/dist/wrappers/types.d.ts.map +1 -0
- package/dist/wrappers/types.js +7 -0
- package/dist/wrappers/types.js.map +1 -0
- package/package.json +33 -18
- package/LICENSE +0 -21
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Factory
|
|
3
|
+
*
|
|
4
|
+
* Factory functions for creating PatternService instances from legacy stores.
|
|
5
|
+
* This is the recommended way to migrate consumers to the new pattern system.
|
|
6
|
+
*
|
|
7
|
+
* @module patterns/adapters/service-factory
|
|
8
|
+
*/
|
|
9
|
+
import type { PatternStore } from '../../store/pattern-store.js';
|
|
10
|
+
import type { IPatternService, PatternServiceConfig } from '../service.js';
|
|
11
|
+
/**
|
|
12
|
+
* Create a PatternService from an existing PatternStore.
|
|
13
|
+
*
|
|
14
|
+
* This is the recommended migration path for consumers currently using
|
|
15
|
+
* PatternStore directly. The service provides a higher-level API with
|
|
16
|
+
* caching, metrics, and business logic.
|
|
17
|
+
*
|
|
18
|
+
* The returned service auto-initializes on first use, so you don't need
|
|
19
|
+
* to call initialize() manually.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Before (direct PatternStore usage)
|
|
24
|
+
* const store = new PatternStore({ rootDir });
|
|
25
|
+
* await store.initialize();
|
|
26
|
+
* const patterns = store.getAll();
|
|
27
|
+
*
|
|
28
|
+
* // After (using PatternService)
|
|
29
|
+
* const store = new PatternStore({ rootDir });
|
|
30
|
+
* const service = createPatternServiceFromStore(store, rootDir);
|
|
31
|
+
* const result = await service.listPatterns(); // Auto-initializes
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param store The existing PatternStore instance
|
|
35
|
+
* @param rootDir The project root directory (for reading code examples)
|
|
36
|
+
* @param config Optional service configuration
|
|
37
|
+
* @returns A PatternService instance wrapping the store
|
|
38
|
+
*/
|
|
39
|
+
export declare function createPatternServiceFromStore(store: PatternStore, rootDir: string, config?: Partial<PatternServiceConfig>): IPatternService;
|
|
40
|
+
//# sourceMappingURL=service-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-factory.d.ts","sourceRoot":"","sources":["../../../src/patterns/adapters/service-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAkI3E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACrC,eAAe,CAGjB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Factory
|
|
3
|
+
*
|
|
4
|
+
* Factory functions for creating PatternService instances from legacy stores.
|
|
5
|
+
* This is the recommended way to migrate consumers to the new pattern system.
|
|
6
|
+
*
|
|
7
|
+
* @module patterns/adapters/service-factory
|
|
8
|
+
*/
|
|
9
|
+
import { PatternStoreAdapter } from './pattern-store-adapter.js';
|
|
10
|
+
import { PatternService } from '../impl/pattern-service.js';
|
|
11
|
+
/**
|
|
12
|
+
* A wrapper that auto-initializes the repository on first use.
|
|
13
|
+
* This provides a seamless experience for consumers who don't want
|
|
14
|
+
* to manually call initialize().
|
|
15
|
+
*/
|
|
16
|
+
class AutoInitPatternService {
|
|
17
|
+
inner;
|
|
18
|
+
repository;
|
|
19
|
+
initPromise = null;
|
|
20
|
+
constructor(repository, rootDir, config) {
|
|
21
|
+
this.repository = repository;
|
|
22
|
+
this.inner = new PatternService(repository, rootDir, config);
|
|
23
|
+
}
|
|
24
|
+
async ensureInitialized() {
|
|
25
|
+
if (!this.initPromise) {
|
|
26
|
+
this.initPromise = this.repository.initialize();
|
|
27
|
+
}
|
|
28
|
+
await this.initPromise;
|
|
29
|
+
}
|
|
30
|
+
async getStatus() {
|
|
31
|
+
await this.ensureInitialized();
|
|
32
|
+
return this.inner.getStatus();
|
|
33
|
+
}
|
|
34
|
+
async getCategories() {
|
|
35
|
+
await this.ensureInitialized();
|
|
36
|
+
return this.inner.getCategories();
|
|
37
|
+
}
|
|
38
|
+
async listPatterns(options) {
|
|
39
|
+
await this.ensureInitialized();
|
|
40
|
+
return this.inner.listPatterns(options);
|
|
41
|
+
}
|
|
42
|
+
async listByCategory(...args) {
|
|
43
|
+
await this.ensureInitialized();
|
|
44
|
+
return this.inner.listByCategory(...args);
|
|
45
|
+
}
|
|
46
|
+
async listByStatus(...args) {
|
|
47
|
+
await this.ensureInitialized();
|
|
48
|
+
return this.inner.listByStatus(...args);
|
|
49
|
+
}
|
|
50
|
+
async getPattern(id) {
|
|
51
|
+
await this.ensureInitialized();
|
|
52
|
+
return this.inner.getPattern(id);
|
|
53
|
+
}
|
|
54
|
+
async getPatternWithExamples(id, maxExamples) {
|
|
55
|
+
await this.ensureInitialized();
|
|
56
|
+
return this.inner.getPatternWithExamples(id, maxExamples);
|
|
57
|
+
}
|
|
58
|
+
async getPatternsByFile(file) {
|
|
59
|
+
await this.ensureInitialized();
|
|
60
|
+
return this.inner.getPatternsByFile(file);
|
|
61
|
+
}
|
|
62
|
+
async approvePattern(id, approvedBy) {
|
|
63
|
+
await this.ensureInitialized();
|
|
64
|
+
return this.inner.approvePattern(id, approvedBy);
|
|
65
|
+
}
|
|
66
|
+
async ignorePattern(id) {
|
|
67
|
+
await this.ensureInitialized();
|
|
68
|
+
return this.inner.ignorePattern(id);
|
|
69
|
+
}
|
|
70
|
+
async approveMany(ids, approvedBy) {
|
|
71
|
+
await this.ensureInitialized();
|
|
72
|
+
return this.inner.approveMany(ids, approvedBy);
|
|
73
|
+
}
|
|
74
|
+
async ignoreMany(ids) {
|
|
75
|
+
await this.ensureInitialized();
|
|
76
|
+
return this.inner.ignoreMany(ids);
|
|
77
|
+
}
|
|
78
|
+
async search(...args) {
|
|
79
|
+
await this.ensureInitialized();
|
|
80
|
+
return this.inner.search(...args);
|
|
81
|
+
}
|
|
82
|
+
async query(...args) {
|
|
83
|
+
await this.ensureInitialized();
|
|
84
|
+
return this.inner.query(...args);
|
|
85
|
+
}
|
|
86
|
+
// === Write Operations ===
|
|
87
|
+
async addPattern(...args) {
|
|
88
|
+
await this.ensureInitialized();
|
|
89
|
+
return this.inner.addPattern(...args);
|
|
90
|
+
}
|
|
91
|
+
async addPatterns(...args) {
|
|
92
|
+
await this.ensureInitialized();
|
|
93
|
+
return this.inner.addPatterns(...args);
|
|
94
|
+
}
|
|
95
|
+
async updatePattern(...args) {
|
|
96
|
+
await this.ensureInitialized();
|
|
97
|
+
return this.inner.updatePattern(...args);
|
|
98
|
+
}
|
|
99
|
+
async deletePattern(...args) {
|
|
100
|
+
await this.ensureInitialized();
|
|
101
|
+
return this.inner.deletePattern(...args);
|
|
102
|
+
}
|
|
103
|
+
async save() {
|
|
104
|
+
await this.ensureInitialized();
|
|
105
|
+
return this.inner.save();
|
|
106
|
+
}
|
|
107
|
+
async clear() {
|
|
108
|
+
await this.ensureInitialized();
|
|
109
|
+
return this.inner.clear();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Create a PatternService from an existing PatternStore.
|
|
114
|
+
*
|
|
115
|
+
* This is the recommended migration path for consumers currently using
|
|
116
|
+
* PatternStore directly. The service provides a higher-level API with
|
|
117
|
+
* caching, metrics, and business logic.
|
|
118
|
+
*
|
|
119
|
+
* The returned service auto-initializes on first use, so you don't need
|
|
120
|
+
* to call initialize() manually.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* // Before (direct PatternStore usage)
|
|
125
|
+
* const store = new PatternStore({ rootDir });
|
|
126
|
+
* await store.initialize();
|
|
127
|
+
* const patterns = store.getAll();
|
|
128
|
+
*
|
|
129
|
+
* // After (using PatternService)
|
|
130
|
+
* const store = new PatternStore({ rootDir });
|
|
131
|
+
* const service = createPatternServiceFromStore(store, rootDir);
|
|
132
|
+
* const result = await service.listPatterns(); // Auto-initializes
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @param store The existing PatternStore instance
|
|
136
|
+
* @param rootDir The project root directory (for reading code examples)
|
|
137
|
+
* @param config Optional service configuration
|
|
138
|
+
* @returns A PatternService instance wrapping the store
|
|
139
|
+
*/
|
|
140
|
+
export function createPatternServiceFromStore(store, rootDir, config) {
|
|
141
|
+
const adapter = new PatternStoreAdapter(store);
|
|
142
|
+
return new AutoInitPatternService(adapter, rootDir, config);
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=service-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-factory.js","sourceRoot":"","sources":["../../../src/patterns/adapters/service-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,mBAAmB,E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AAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAAmB,EACnB,OAAe,EACf,MAAsC;IAEtC,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern System Errors
|
|
3
|
+
*
|
|
4
|
+
* Shared error classes for the pattern system.
|
|
5
|
+
*
|
|
6
|
+
* @module patterns/errors
|
|
7
|
+
*/
|
|
8
|
+
import type { PatternStatus } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Error thrown when a pattern is not found
|
|
11
|
+
*/
|
|
12
|
+
export declare class PatternNotFoundError extends Error {
|
|
13
|
+
readonly patternId: string;
|
|
14
|
+
constructor(patternId: string);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Error thrown when an invalid state transition is attempted
|
|
18
|
+
*/
|
|
19
|
+
export declare class InvalidStatusTransitionError extends Error {
|
|
20
|
+
readonly patternId: string;
|
|
21
|
+
readonly fromStatus: PatternStatus;
|
|
22
|
+
readonly toStatus: PatternStatus;
|
|
23
|
+
constructor(patternId: string, fromStatus: PatternStatus, toStatus: PatternStatus);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when trying to add a pattern that already exists
|
|
27
|
+
*/
|
|
28
|
+
export declare class PatternAlreadyExistsError extends Error {
|
|
29
|
+
readonly patternId: string;
|
|
30
|
+
constructor(patternId: string);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/patterns/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aACjB,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;CAI9C;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;aAEnC,SAAS,EAAE,MAAM;aACjB,UAAU,EAAE,aAAa;aACzB,QAAQ,EAAE,aAAa;gBAFvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,aAAa;CAK1C;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;CAI9C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern System Errors
|
|
3
|
+
*
|
|
4
|
+
* Shared error classes for the pattern system.
|
|
5
|
+
*
|
|
6
|
+
* @module patterns/errors
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when a pattern is not found
|
|
10
|
+
*/
|
|
11
|
+
export class PatternNotFoundError extends Error {
|
|
12
|
+
patternId;
|
|
13
|
+
constructor(patternId) {
|
|
14
|
+
super(`Pattern not found: ${patternId}`);
|
|
15
|
+
this.patternId = patternId;
|
|
16
|
+
this.name = 'PatternNotFoundError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Error thrown when an invalid state transition is attempted
|
|
21
|
+
*/
|
|
22
|
+
export class InvalidStatusTransitionError extends Error {
|
|
23
|
+
patternId;
|
|
24
|
+
fromStatus;
|
|
25
|
+
toStatus;
|
|
26
|
+
constructor(patternId, fromStatus, toStatus) {
|
|
27
|
+
super(`Invalid status transition for pattern ${patternId}: ${fromStatus} → ${toStatus}`);
|
|
28
|
+
this.patternId = patternId;
|
|
29
|
+
this.fromStatus = fromStatus;
|
|
30
|
+
this.toStatus = toStatus;
|
|
31
|
+
this.name = 'InvalidStatusTransitionError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Error thrown when trying to add a pattern that already exists
|
|
36
|
+
*/
|
|
37
|
+
export class PatternAlreadyExistsError extends Error {
|
|
38
|
+
patternId;
|
|
39
|
+
constructor(patternId) {
|
|
40
|
+
super(`Pattern already exists: ${patternId}`);
|
|
41
|
+
this.patternId = patternId;
|
|
42
|
+
this.name = 'PatternAlreadyExistsError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/patterns/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACjB;IAA5B,YAA4B,SAAiB;QAC3C,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;QADf,cAAS,GAAT,SAAS,CAAQ;QAE3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAEnC;IACA;IACA;IAHlB,YACkB,SAAiB,EACjB,UAAyB,EACzB,QAAuB;QAEvC,KAAK,CAAC,yCAAyC,SAAS,KAAK,UAAU,MAAM,QAAQ,EAAE,CAAC,CAAC;QAJzE,cAAS,GAAT,SAAS,CAAQ;QACjB,eAAU,GAAV,UAAU,CAAe;QACzB,aAAQ,GAAR,QAAQ,CAAe;QAGvC,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC7C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACtB;IAA5B,YAA4B,SAAiB;QAC3C,KAAK,CAAC,2BAA2B,SAAS,EAAE,CAAC,CAAC;QADpB,cAAS,GAAT,SAAS,CAAQ;QAE3C,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cached Pattern Repository
|
|
3
|
+
*
|
|
4
|
+
* Decorator implementation of IPatternRepository that adds caching
|
|
5
|
+
* on top of any other repository implementation.
|
|
6
|
+
*
|
|
7
|
+
* @module patterns/impl/cached-repository
|
|
8
|
+
*/
|
|
9
|
+
import { EventEmitter } from 'node:events';
|
|
10
|
+
import type { Pattern, PatternCategory, PatternStatus, PatternSummary } from '../types.js';
|
|
11
|
+
import type { IPatternRepository, PatternRepositoryEventType, PatternRepositoryEventHandler, PatternQueryOptions, PatternQueryResult, PatternFilter } from '../repository.js';
|
|
12
|
+
interface CacheConfig {
|
|
13
|
+
/** TTL for pattern cache in milliseconds */
|
|
14
|
+
patternTtlMs: number;
|
|
15
|
+
/** TTL for query cache in milliseconds */
|
|
16
|
+
queryTtlMs: number;
|
|
17
|
+
/** Maximum number of cached queries */
|
|
18
|
+
maxCachedQueries: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Cached pattern repository decorator.
|
|
22
|
+
*
|
|
23
|
+
* Wraps any IPatternRepository implementation and adds caching.
|
|
24
|
+
* Cache is automatically invalidated on write operations.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CachedPatternRepository extends EventEmitter implements IPatternRepository {
|
|
27
|
+
private readonly inner;
|
|
28
|
+
private readonly config;
|
|
29
|
+
private patternCache;
|
|
30
|
+
private queryCache;
|
|
31
|
+
private allPatternsCache;
|
|
32
|
+
private countCache;
|
|
33
|
+
constructor(inner: IPatternRepository, config?: Partial<CacheConfig>);
|
|
34
|
+
private setupEventForwarding;
|
|
35
|
+
private isExpired;
|
|
36
|
+
private setPatternCache;
|
|
37
|
+
private getPatternCache;
|
|
38
|
+
private setQueryCache;
|
|
39
|
+
private getQueryCache;
|
|
40
|
+
private serializeQueryOptions;
|
|
41
|
+
private invalidateAllCaches;
|
|
42
|
+
private invalidatePatternCaches;
|
|
43
|
+
initialize(): Promise<void>;
|
|
44
|
+
close(): Promise<void>;
|
|
45
|
+
add(pattern: Pattern): Promise<void>;
|
|
46
|
+
addMany(patterns: Pattern[]): Promise<void>;
|
|
47
|
+
get(id: string): Promise<Pattern | null>;
|
|
48
|
+
update(id: string, updates: Partial<Pattern>): Promise<Pattern>;
|
|
49
|
+
delete(id: string): Promise<boolean>;
|
|
50
|
+
query(options: PatternQueryOptions): Promise<PatternQueryResult>;
|
|
51
|
+
getByCategory(category: PatternCategory): Promise<Pattern[]>;
|
|
52
|
+
getByStatus(status: PatternStatus): Promise<Pattern[]>;
|
|
53
|
+
getByFile(file: string): Promise<Pattern[]>;
|
|
54
|
+
getAll(): Promise<Pattern[]>;
|
|
55
|
+
count(filter?: PatternFilter): Promise<number>;
|
|
56
|
+
approve(id: string, approvedBy?: string): Promise<Pattern>;
|
|
57
|
+
ignore(id: string): Promise<Pattern>;
|
|
58
|
+
saveAll(): Promise<void>;
|
|
59
|
+
clear(): Promise<void>;
|
|
60
|
+
on(event: PatternRepositoryEventType, handler: PatternRepositoryEventHandler): this;
|
|
61
|
+
off(event: PatternRepositoryEventType, handler: PatternRepositoryEventHandler): this;
|
|
62
|
+
exists(id: string): Promise<boolean>;
|
|
63
|
+
getSummaries(options?: PatternQueryOptions): Promise<PatternSummary[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Clear all caches.
|
|
66
|
+
*/
|
|
67
|
+
clearCache(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get cache statistics.
|
|
70
|
+
*/
|
|
71
|
+
getCacheStats(): {
|
|
72
|
+
patternCacheSize: number;
|
|
73
|
+
queryCacheSize: number;
|
|
74
|
+
countCacheSize: number;
|
|
75
|
+
hasAllPatternsCache: boolean;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=cached-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached-repository.d.ts","sourceRoot":"","sources":["../../../src/patterns/impl/cached-repository.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAW1B,UAAU,WAAW;IACnB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IAErB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAYD;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,YAAa,YAAW,kBAAkB;IACrF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IAGrC,OAAO,CAAC,YAAY,CAA+C;IAGnE,OAAO,CAAC,UAAU,CAA0D;IAG5E,OAAO,CAAC,gBAAgB,CAAsC;IAG9D,OAAO,CAAC,UAAU,CAA8C;gBAEpD,KAAK,EAAE,kBAAkB,EAAE,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM;IASxE,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,qBAAq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AK,EAAE,0BAA0B,EAAE,OAAO,EAAE,6BAA6B,GAAG,IAAI;IAInF,GAAG,CAAC,KAAK,EAAE,0BAA0B,EAAE,OAAO,EAAE,6BAA6B,GAAG,IAAI;IAQvF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpC,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAQ5E;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,aAAa,IAAI;QACf,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,mBAAmB,EAAE,OAAO,CAAC;KAC9B;CAQF"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cached Pattern Repository
|
|
3
|
+
*
|
|
4
|
+
* Decorator implementation of IPatternRepository that adds caching
|
|
5
|
+
* on top of any other repository implementation.
|
|
6
|
+
*
|
|
7
|
+
* @module patterns/impl/cached-repository
|
|
8
|
+
*/
|
|
9
|
+
import { EventEmitter } from 'node:events';
|
|
10
|
+
const DEFAULT_CACHE_CONFIG = {
|
|
11
|
+
patternTtlMs: 60000, // 1 minute
|
|
12
|
+
queryTtlMs: 30000, // 30 seconds
|
|
13
|
+
maxCachedQueries: 100,
|
|
14
|
+
};
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Cached Pattern Repository
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Cached pattern repository decorator.
|
|
20
|
+
*
|
|
21
|
+
* Wraps any IPatternRepository implementation and adds caching.
|
|
22
|
+
* Cache is automatically invalidated on write operations.
|
|
23
|
+
*/
|
|
24
|
+
export class CachedPatternRepository extends EventEmitter {
|
|
25
|
+
inner;
|
|
26
|
+
config;
|
|
27
|
+
// Pattern cache: id -> Pattern
|
|
28
|
+
patternCache = new Map();
|
|
29
|
+
// Query cache: serialized query -> result
|
|
30
|
+
queryCache = new Map();
|
|
31
|
+
// All patterns cache
|
|
32
|
+
allPatternsCache = null;
|
|
33
|
+
// Count cache
|
|
34
|
+
countCache = new Map();
|
|
35
|
+
constructor(inner, config = {}) {
|
|
36
|
+
super();
|
|
37
|
+
this.inner = inner;
|
|
38
|
+
this.config = { ...DEFAULT_CACHE_CONFIG, ...config };
|
|
39
|
+
// Forward events from inner repository
|
|
40
|
+
this.setupEventForwarding();
|
|
41
|
+
}
|
|
42
|
+
setupEventForwarding() {
|
|
43
|
+
const events = [
|
|
44
|
+
'pattern:added',
|
|
45
|
+
'pattern:updated',
|
|
46
|
+
'pattern:deleted',
|
|
47
|
+
'pattern:approved',
|
|
48
|
+
'pattern:ignored',
|
|
49
|
+
'patterns:loaded',
|
|
50
|
+
'patterns:saved',
|
|
51
|
+
];
|
|
52
|
+
for (const event of events) {
|
|
53
|
+
this.inner.on(event, (pattern, metadata) => {
|
|
54
|
+
this.emit(event, pattern, metadata);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// ==========================================================================
|
|
59
|
+
// Cache Utilities
|
|
60
|
+
// ==========================================================================
|
|
61
|
+
isExpired(entry) {
|
|
62
|
+
return Date.now() > entry.expiresAt;
|
|
63
|
+
}
|
|
64
|
+
setPatternCache(pattern) {
|
|
65
|
+
this.patternCache.set(pattern.id, {
|
|
66
|
+
value: pattern,
|
|
67
|
+
expiresAt: Date.now() + this.config.patternTtlMs,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
getPatternCache(id) {
|
|
71
|
+
const entry = this.patternCache.get(id);
|
|
72
|
+
if (!entry || this.isExpired(entry)) {
|
|
73
|
+
this.patternCache.delete(id);
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return entry.value;
|
|
77
|
+
}
|
|
78
|
+
setQueryCache(key, result) {
|
|
79
|
+
// Evict oldest entries if at capacity
|
|
80
|
+
if (this.queryCache.size >= this.config.maxCachedQueries) {
|
|
81
|
+
const oldestKey = this.queryCache.keys().next().value;
|
|
82
|
+
if (oldestKey) {
|
|
83
|
+
this.queryCache.delete(oldestKey);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
this.queryCache.set(key, {
|
|
87
|
+
value: result,
|
|
88
|
+
expiresAt: Date.now() + this.config.queryTtlMs,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getQueryCache(key) {
|
|
92
|
+
const entry = this.queryCache.get(key);
|
|
93
|
+
if (!entry || this.isExpired(entry)) {
|
|
94
|
+
this.queryCache.delete(key);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return entry.value;
|
|
98
|
+
}
|
|
99
|
+
serializeQueryOptions(options) {
|
|
100
|
+
return JSON.stringify(options);
|
|
101
|
+
}
|
|
102
|
+
invalidateAllCaches() {
|
|
103
|
+
this.patternCache.clear();
|
|
104
|
+
this.queryCache.clear();
|
|
105
|
+
this.allPatternsCache = null;
|
|
106
|
+
this.countCache.clear();
|
|
107
|
+
}
|
|
108
|
+
invalidatePatternCaches(id) {
|
|
109
|
+
this.patternCache.delete(id);
|
|
110
|
+
this.queryCache.clear(); // Queries may include this pattern
|
|
111
|
+
this.allPatternsCache = null;
|
|
112
|
+
this.countCache.clear();
|
|
113
|
+
}
|
|
114
|
+
// ==========================================================================
|
|
115
|
+
// Lifecycle
|
|
116
|
+
// ==========================================================================
|
|
117
|
+
async initialize() {
|
|
118
|
+
await this.inner.initialize();
|
|
119
|
+
}
|
|
120
|
+
async close() {
|
|
121
|
+
this.invalidateAllCaches();
|
|
122
|
+
await this.inner.close();
|
|
123
|
+
}
|
|
124
|
+
// ==========================================================================
|
|
125
|
+
// CRUD Operations
|
|
126
|
+
// ==========================================================================
|
|
127
|
+
async add(pattern) {
|
|
128
|
+
await this.inner.add(pattern);
|
|
129
|
+
this.setPatternCache(pattern);
|
|
130
|
+
this.invalidatePatternCaches(pattern.id);
|
|
131
|
+
}
|
|
132
|
+
async addMany(patterns) {
|
|
133
|
+
await this.inner.addMany(patterns);
|
|
134
|
+
for (const pattern of patterns) {
|
|
135
|
+
this.setPatternCache(pattern);
|
|
136
|
+
}
|
|
137
|
+
this.invalidateAllCaches();
|
|
138
|
+
}
|
|
139
|
+
async get(id) {
|
|
140
|
+
// Check cache first
|
|
141
|
+
const cached = this.getPatternCache(id);
|
|
142
|
+
if (cached) {
|
|
143
|
+
return cached;
|
|
144
|
+
}
|
|
145
|
+
// Fetch from inner repository
|
|
146
|
+
const pattern = await this.inner.get(id);
|
|
147
|
+
if (pattern) {
|
|
148
|
+
this.setPatternCache(pattern);
|
|
149
|
+
}
|
|
150
|
+
return pattern;
|
|
151
|
+
}
|
|
152
|
+
async update(id, updates) {
|
|
153
|
+
const updated = await this.inner.update(id, updates);
|
|
154
|
+
this.setPatternCache(updated);
|
|
155
|
+
this.invalidatePatternCaches(id);
|
|
156
|
+
return updated;
|
|
157
|
+
}
|
|
158
|
+
async delete(id) {
|
|
159
|
+
const result = await this.inner.delete(id);
|
|
160
|
+
if (result) {
|
|
161
|
+
this.invalidatePatternCaches(id);
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
// ==========================================================================
|
|
166
|
+
// Querying
|
|
167
|
+
// ==========================================================================
|
|
168
|
+
async query(options) {
|
|
169
|
+
const cacheKey = this.serializeQueryOptions(options);
|
|
170
|
+
// Check cache first
|
|
171
|
+
const cached = this.getQueryCache(cacheKey);
|
|
172
|
+
if (cached) {
|
|
173
|
+
return cached;
|
|
174
|
+
}
|
|
175
|
+
// Fetch from inner repository
|
|
176
|
+
const result = await this.inner.query(options);
|
|
177
|
+
this.setQueryCache(cacheKey, result);
|
|
178
|
+
// Also cache individual patterns
|
|
179
|
+
for (const pattern of result.patterns) {
|
|
180
|
+
this.setPatternCache(pattern);
|
|
181
|
+
}
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
async getByCategory(category) {
|
|
185
|
+
return this.inner.getByCategory(category);
|
|
186
|
+
}
|
|
187
|
+
async getByStatus(status) {
|
|
188
|
+
return this.inner.getByStatus(status);
|
|
189
|
+
}
|
|
190
|
+
async getByFile(file) {
|
|
191
|
+
return this.inner.getByFile(file);
|
|
192
|
+
}
|
|
193
|
+
async getAll() {
|
|
194
|
+
// Check cache first
|
|
195
|
+
if (this.allPatternsCache && !this.isExpired(this.allPatternsCache)) {
|
|
196
|
+
return this.allPatternsCache.value;
|
|
197
|
+
}
|
|
198
|
+
// Fetch from inner repository
|
|
199
|
+
const patterns = await this.inner.getAll();
|
|
200
|
+
this.allPatternsCache = {
|
|
201
|
+
value: patterns,
|
|
202
|
+
expiresAt: Date.now() + this.config.queryTtlMs,
|
|
203
|
+
};
|
|
204
|
+
// Also cache individual patterns
|
|
205
|
+
for (const pattern of patterns) {
|
|
206
|
+
this.setPatternCache(pattern);
|
|
207
|
+
}
|
|
208
|
+
return patterns;
|
|
209
|
+
}
|
|
210
|
+
async count(filter) {
|
|
211
|
+
const cacheKey = filter ? JSON.stringify(filter) : '__all__';
|
|
212
|
+
// Check cache first
|
|
213
|
+
const entry = this.countCache.get(cacheKey);
|
|
214
|
+
if (entry && !this.isExpired(entry)) {
|
|
215
|
+
return entry.value;
|
|
216
|
+
}
|
|
217
|
+
// Fetch from inner repository
|
|
218
|
+
const count = await this.inner.count(filter);
|
|
219
|
+
this.countCache.set(cacheKey, {
|
|
220
|
+
value: count,
|
|
221
|
+
expiresAt: Date.now() + this.config.queryTtlMs,
|
|
222
|
+
});
|
|
223
|
+
return count;
|
|
224
|
+
}
|
|
225
|
+
// ==========================================================================
|
|
226
|
+
// Status Transitions
|
|
227
|
+
// ==========================================================================
|
|
228
|
+
async approve(id, approvedBy) {
|
|
229
|
+
const updated = await this.inner.approve(id, approvedBy);
|
|
230
|
+
this.setPatternCache(updated);
|
|
231
|
+
this.invalidatePatternCaches(id);
|
|
232
|
+
return updated;
|
|
233
|
+
}
|
|
234
|
+
async ignore(id) {
|
|
235
|
+
const updated = await this.inner.ignore(id);
|
|
236
|
+
this.setPatternCache(updated);
|
|
237
|
+
this.invalidatePatternCaches(id);
|
|
238
|
+
return updated;
|
|
239
|
+
}
|
|
240
|
+
// ==========================================================================
|
|
241
|
+
// Batch Operations
|
|
242
|
+
// ==========================================================================
|
|
243
|
+
async saveAll() {
|
|
244
|
+
await this.inner.saveAll();
|
|
245
|
+
}
|
|
246
|
+
async clear() {
|
|
247
|
+
await this.inner.clear();
|
|
248
|
+
this.invalidateAllCaches();
|
|
249
|
+
}
|
|
250
|
+
// ==========================================================================
|
|
251
|
+
// Events
|
|
252
|
+
// ==========================================================================
|
|
253
|
+
on(event, handler) {
|
|
254
|
+
return super.on(event, handler);
|
|
255
|
+
}
|
|
256
|
+
off(event, handler) {
|
|
257
|
+
return super.off(event, handler);
|
|
258
|
+
}
|
|
259
|
+
// ==========================================================================
|
|
260
|
+
// Utilities
|
|
261
|
+
// ==========================================================================
|
|
262
|
+
async exists(id) {
|
|
263
|
+
// Check cache first
|
|
264
|
+
if (this.patternCache.has(id)) {
|
|
265
|
+
const entry = this.patternCache.get(id);
|
|
266
|
+
if (!this.isExpired(entry)) {
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return this.inner.exists(id);
|
|
271
|
+
}
|
|
272
|
+
async getSummaries(options) {
|
|
273
|
+
return this.inner.getSummaries(options);
|
|
274
|
+
}
|
|
275
|
+
// ==========================================================================
|
|
276
|
+
// Cache Management
|
|
277
|
+
// ==========================================================================
|
|
278
|
+
/**
|
|
279
|
+
* Clear all caches.
|
|
280
|
+
*/
|
|
281
|
+
clearCache() {
|
|
282
|
+
this.invalidateAllCaches();
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get cache statistics.
|
|
286
|
+
*/
|
|
287
|
+
getCacheStats() {
|
|
288
|
+
return {
|
|
289
|
+
patternCacheSize: this.patternCache.size,
|
|
290
|
+
queryCacheSize: this.queryCache.size,
|
|
291
|
+
countCacheSize: this.countCache.size,
|
|
292
|
+
hasAllPatternsCache: this.allPatternsCache !== null,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=cached-repository.js.map
|