driftdetect-core 0.1.2 → 0.3.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/boundary-store.d.ts +92 -0
- package/dist/boundaries/boundary-store.d.ts.map +1 -0
- package/dist/boundaries/boundary-store.js +458 -0
- package/dist/boundaries/boundary-store.js.map +1 -0
- package/dist/boundaries/index.d.ts +8 -0
- package/dist/boundaries/index.d.ts.map +1 -0
- package/dist/boundaries/index.js +8 -0
- package/dist/boundaries/index.js.map +1 -0
- package/dist/boundaries/types.d.ts +237 -0
- package/dist/boundaries/types.d.ts.map +1 -0
- package/dist/boundaries/types.js +8 -0
- package/dist/boundaries/types.js.map +1 -0
- package/dist/dna/ai-context.d.ts +10 -0
- package/dist/dna/ai-context.d.ts.map +1 -0
- package/dist/dna/ai-context.js +46 -0
- package/dist/dna/ai-context.js.map +1 -0
- package/dist/dna/dna-analyzer.d.ts +34 -0
- package/dist/dna/dna-analyzer.d.ts.map +1 -0
- package/dist/dna/dna-analyzer.js +110 -0
- package/dist/dna/dna-analyzer.js.map +1 -0
- package/dist/dna/dna-store.d.ts +13 -0
- package/dist/dna/dna-store.d.ts.map +1 -0
- package/dist/dna/dna-store.js +43 -0
- package/dist/dna/dna-store.js.map +1 -0
- package/dist/dna/gene-extractors/animation-approach.d.ts +15 -0
- package/dist/dna/gene-extractors/animation-approach.d.ts.map +1 -0
- package/dist/dna/gene-extractors/animation-approach.js +97 -0
- package/dist/dna/gene-extractors/animation-approach.js.map +1 -0
- package/dist/dna/gene-extractors/base-extractor.d.ts +53 -0
- package/dist/dna/gene-extractors/base-extractor.d.ts.map +1 -0
- package/dist/dna/gene-extractors/base-extractor.js +76 -0
- package/dist/dna/gene-extractors/base-extractor.js.map +1 -0
- package/dist/dna/gene-extractors/index.d.ts +16 -0
- package/dist/dna/gene-extractors/index.d.ts.map +1 -0
- package/dist/dna/gene-extractors/index.js +38 -0
- package/dist/dna/gene-extractors/index.js.map +1 -0
- package/dist/dna/gene-extractors/responsive-approach.d.ts +10 -0
- package/dist/dna/gene-extractors/responsive-approach.d.ts.map +1 -0
- package/dist/dna/gene-extractors/responsive-approach.js +30 -0
- package/dist/dna/gene-extractors/responsive-approach.js.map +1 -0
- package/dist/dna/gene-extractors/spacing-philosophy.d.ts +10 -0
- package/dist/dna/gene-extractors/spacing-philosophy.d.ts.map +1 -0
- package/dist/dna/gene-extractors/spacing-philosophy.js +30 -0
- package/dist/dna/gene-extractors/spacing-philosophy.js.map +1 -0
- package/dist/dna/gene-extractors/state-styling.d.ts +10 -0
- package/dist/dna/gene-extractors/state-styling.d.ts.map +1 -0
- package/dist/dna/gene-extractors/state-styling.js +29 -0
- package/dist/dna/gene-extractors/state-styling.js.map +1 -0
- package/dist/dna/gene-extractors/theming.d.ts +10 -0
- package/dist/dna/gene-extractors/theming.d.ts.map +1 -0
- package/dist/dna/gene-extractors/theming.js +30 -0
- package/dist/dna/gene-extractors/theming.js.map +1 -0
- package/dist/dna/gene-extractors/variant-handling.d.ts +13 -0
- package/dist/dna/gene-extractors/variant-handling.d.ts.map +1 -0
- package/dist/dna/gene-extractors/variant-handling.js +38 -0
- package/dist/dna/gene-extractors/variant-handling.js.map +1 -0
- package/dist/dna/health-calculator.d.ts +21 -0
- package/dist/dna/health-calculator.d.ts.map +1 -0
- package/dist/dna/health-calculator.js +113 -0
- package/dist/dna/health-calculator.js.map +1 -0
- package/dist/dna/index.d.ts +21 -0
- package/dist/dna/index.d.ts.map +1 -0
- package/dist/dna/index.js +19 -0
- package/dist/dna/index.js.map +1 -0
- package/dist/dna/mutation-detector.d.ts +10 -0
- package/dist/dna/mutation-detector.d.ts.map +1 -0
- package/dist/dna/mutation-detector.js +39 -0
- package/dist/dna/mutation-detector.js.map +1 -0
- package/dist/dna/playbook-generator.d.ts +6 -0
- package/dist/dna/playbook-generator.d.ts.map +1 -0
- package/dist/dna/playbook-generator.js +53 -0
- package/dist/dna/playbook-generator.js.map +1 -0
- package/dist/dna/types.d.ts +95 -0
- package/dist/dna/types.d.ts.map +1 -0
- package/dist/dna/types.js +8 -0
- package/dist/dna/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/parsers/parser-manager.d.ts.map +1 -1
- package/dist/parsers/parser-manager.js +2 -0
- package/dist/parsers/parser-manager.js.map +1 -1
- package/dist/parsers/tree-sitter/config.d.ts +82 -0
- package/dist/parsers/tree-sitter/config.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/config.js +200 -0
- package/dist/parsers/tree-sitter/config.js.map +1 -0
- package/dist/parsers/tree-sitter/csharp-ast-converter.d.ts +64 -0
- package/dist/parsers/tree-sitter/csharp-ast-converter.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/csharp-ast-converter.js +271 -0
- package/dist/parsers/tree-sitter/csharp-ast-converter.js.map +1 -0
- package/dist/parsers/tree-sitter/csharp-loader.d.ts +43 -0
- package/dist/parsers/tree-sitter/csharp-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/csharp-loader.js +146 -0
- package/dist/parsers/tree-sitter/csharp-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/index.d.ts +26 -0
- package/dist/parsers/tree-sitter/index.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/index.js +47 -0
- package/dist/parsers/tree-sitter/index.js.map +1 -0
- package/dist/parsers/tree-sitter/java/annotation-extractor.d.ts +79 -0
- package/dist/parsers/tree-sitter/java/annotation-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/java/annotation-extractor.js +540 -0
- package/dist/parsers/tree-sitter/java/annotation-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/java/class-extractor.d.ts +40 -0
- package/dist/parsers/tree-sitter/java/class-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/java/class-extractor.js +770 -0
- package/dist/parsers/tree-sitter/java/class-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/java/index.d.ts +14 -0
- package/dist/parsers/tree-sitter/java/index.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/java/index.js +25 -0
- package/dist/parsers/tree-sitter/java/index.js.map +1 -0
- package/dist/parsers/tree-sitter/java/method-extractor.d.ts +88 -0
- package/dist/parsers/tree-sitter/java/method-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/java/method-extractor.js +551 -0
- package/dist/parsers/tree-sitter/java/method-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/java/types.d.ts +545 -0
- package/dist/parsers/tree-sitter/java/types.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/java/types.js +81 -0
- package/dist/parsers/tree-sitter/java/types.js.map +1 -0
- package/dist/parsers/tree-sitter/loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/loader.js +156 -0
- package/dist/parsers/tree-sitter/loader.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/config-extractor.d.ts +78 -0
- package/dist/parsers/tree-sitter/pydantic/config-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/config-extractor.js +278 -0
- package/dist/parsers/tree-sitter/pydantic/config-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/constraint-parser.d.ts +84 -0
- package/dist/parsers/tree-sitter/pydantic/constraint-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/constraint-parser.js +321 -0
- package/dist/parsers/tree-sitter/pydantic/constraint-parser.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/field-extractor.d.ts +74 -0
- package/dist/parsers/tree-sitter/pydantic/field-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/field-extractor.js +285 -0
- package/dist/parsers/tree-sitter/pydantic/field-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/index.d.ts +18 -0
- package/dist/parsers/tree-sitter/pydantic/index.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/index.js +23 -0
- package/dist/parsers/tree-sitter/pydantic/index.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/inheritance-resolver.d.ts +70 -0
- package/dist/parsers/tree-sitter/pydantic/inheritance-resolver.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/inheritance-resolver.js +251 -0
- package/dist/parsers/tree-sitter/pydantic/inheritance-resolver.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/pydantic-extractor.d.ts +102 -0
- package/dist/parsers/tree-sitter/pydantic/pydantic-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/pydantic-extractor.js +399 -0
- package/dist/parsers/tree-sitter/pydantic/pydantic-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/type-resolver.d.ts +89 -0
- package/dist/parsers/tree-sitter/pydantic/type-resolver.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/type-resolver.js +426 -0
- package/dist/parsers/tree-sitter/pydantic/type-resolver.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/types.d.ts +177 -0
- package/dist/parsers/tree-sitter/pydantic/types.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/types.js +139 -0
- package/dist/parsers/tree-sitter/pydantic/types.js.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/validator-extractor.d.ts +88 -0
- package/dist/parsers/tree-sitter/pydantic/validator-extractor.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/pydantic/validator-extractor.js +315 -0
- package/dist/parsers/tree-sitter/pydantic/validator-extractor.js.map +1 -0
- package/dist/parsers/tree-sitter/python-ast-converter.d.ts +140 -0
- package/dist/parsers/tree-sitter/python-ast-converter.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/python-ast-converter.js +360 -0
- package/dist/parsers/tree-sitter/python-ast-converter.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-csharp-parser.d.ts +465 -0
- package/dist/parsers/tree-sitter/tree-sitter-csharp-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-csharp-parser.js +1146 -0
- package/dist/parsers/tree-sitter/tree-sitter-csharp-parser.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-python-parser.d.ts +86 -0
- package/dist/parsers/tree-sitter/tree-sitter-python-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-python-parser.js +177 -0
- package/dist/parsers/tree-sitter/tree-sitter-python-parser.js.map +1 -0
- package/dist/parsers/tree-sitter/types.d.ts +399 -0
- package/dist/parsers/tree-sitter/types.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/types.js +20 -0
- package/dist/parsers/tree-sitter/types.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- package/dist/scanner/file-walker.d.ts.map +1 -1
- package/dist/scanner/file-walker.js +5 -0
- package/dist/scanner/file-walker.js.map +1 -1
- package/dist/store/history-store.d.ts +85 -269
- package/dist/store/history-store.d.ts.map +1 -1
- package/dist/store/history-store.js +272 -624
- package/dist/store/history-store.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/java-type-mapping.d.ts +79 -0
- package/dist/types/java-type-mapping.d.ts.map +1 -0
- package/dist/types/java-type-mapping.js +290 -0
- package/dist/types/java-type-mapping.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Parser Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* TypeScript types for Java parsing using tree-sitter-java.
|
|
5
|
+
* Annotations are FIRST-CLASS CITIZENS - they're the primary signal
|
|
6
|
+
* for Spring pattern detection.
|
|
7
|
+
*
|
|
8
|
+
* @requirements Java/Spring Boot Language Support
|
|
9
|
+
*/
|
|
10
|
+
import type { Position, ParseResult } from '../../types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Java access and non-access modifiers.
|
|
13
|
+
* Used on classes, methods, fields, and constructors.
|
|
14
|
+
*/
|
|
15
|
+
export type JavaModifier = 'public' | 'private' | 'protected' | 'static' | 'final' | 'abstract' | 'synchronized' | 'volatile' | 'transient' | 'native' | 'strictfp' | 'default' | 'sealed' | 'non-sealed';
|
|
16
|
+
/**
|
|
17
|
+
* Java accessibility levels derived from modifiers.
|
|
18
|
+
*/
|
|
19
|
+
export type JavaAccessibility = 'public' | 'private' | 'protected' | 'package-private';
|
|
20
|
+
/**
|
|
21
|
+
* Package declaration information.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* package com.example.service;
|
|
25
|
+
*/
|
|
26
|
+
export interface PackageInfo {
|
|
27
|
+
/** Full package name (e.g., "com.example.service") */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Start position in source */
|
|
30
|
+
startPosition: Position;
|
|
31
|
+
/** End position in source */
|
|
32
|
+
endPosition: Position;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Import statement information.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import org.springframework.web.bind.annotation.GetMapping;
|
|
39
|
+
* import static org.junit.Assert.*;
|
|
40
|
+
*/
|
|
41
|
+
export interface JavaImportInfo {
|
|
42
|
+
/** Full import path (e.g., "org.springframework.web.bind.annotation.GetMapping") */
|
|
43
|
+
path: string;
|
|
44
|
+
/** Whether this is a static import */
|
|
45
|
+
isStatic: boolean;
|
|
46
|
+
/** Whether this is a wildcard import (e.g., import java.util.*) */
|
|
47
|
+
isWildcard: boolean;
|
|
48
|
+
/** Start position in source */
|
|
49
|
+
startPosition: Position;
|
|
50
|
+
/** End position in source */
|
|
51
|
+
endPosition: Position;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Annotation argument value types.
|
|
55
|
+
* Used to understand the structure of annotation arguments.
|
|
56
|
+
*/
|
|
57
|
+
export type AnnotationValueType = 'string' | 'number' | 'boolean' | 'enum' | 'class' | 'array' | 'annotation';
|
|
58
|
+
/**
|
|
59
|
+
* Annotation argument information.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* @RequestMapping(value = "/api", method = RequestMethod.GET)
|
|
63
|
+
* ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
64
|
+
* name="value" name="method"
|
|
65
|
+
* value="/api" value="RequestMethod.GET"
|
|
66
|
+
*/
|
|
67
|
+
export interface AnnotationArgument {
|
|
68
|
+
/**
|
|
69
|
+
* Argument name (null for single-value annotations).
|
|
70
|
+
* @example "value", "method", "roles", null (for @GetMapping("/api"))
|
|
71
|
+
*/
|
|
72
|
+
name: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* Argument value as string representation.
|
|
75
|
+
* @example "/users", "RequestMethod.GET", "ADMIN", "true"
|
|
76
|
+
*/
|
|
77
|
+
value: string;
|
|
78
|
+
/**
|
|
79
|
+
* Value type hint for semantic understanding.
|
|
80
|
+
*/
|
|
81
|
+
valueType: AnnotationValueType;
|
|
82
|
+
/**
|
|
83
|
+
* For array values, the individual elements.
|
|
84
|
+
* @example ["ADMIN", "USER"] for roles = {"ADMIN", "USER"}
|
|
85
|
+
*/
|
|
86
|
+
arrayElements?: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Target of an annotation - what element it's applied to.
|
|
90
|
+
*/
|
|
91
|
+
export type AnnotationTarget = 'class' | 'interface' | 'enum' | 'record' | 'method' | 'constructor' | 'field' | 'parameter' | 'local_variable' | 'annotation_type';
|
|
92
|
+
/**
|
|
93
|
+
* Annotation usage information.
|
|
94
|
+
*
|
|
95
|
+
* This is THE KEY TYPE for Spring pattern detection.
|
|
96
|
+
* Annotations drive everything in Spring: DI, security, web, data, etc.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* @GetMapping("/users/{id}")
|
|
100
|
+
* @PreAuthorize("hasRole('ADMIN')")
|
|
101
|
+
* @Transactional(readOnly = true, propagation = Propagation.REQUIRED)
|
|
102
|
+
*/
|
|
103
|
+
export interface AnnotationUsage {
|
|
104
|
+
/**
|
|
105
|
+
* Simple annotation name without @ symbol.
|
|
106
|
+
* @example "GetMapping", "Service", "Transactional"
|
|
107
|
+
*/
|
|
108
|
+
name: string;
|
|
109
|
+
/**
|
|
110
|
+
* Fully qualified name if resolvable from imports.
|
|
111
|
+
* @example "org.springframework.web.bind.annotation.GetMapping"
|
|
112
|
+
*/
|
|
113
|
+
fullName: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* Annotation arguments (empty for marker annotations).
|
|
116
|
+
*/
|
|
117
|
+
arguments: AnnotationArgument[];
|
|
118
|
+
/**
|
|
119
|
+
* What element this annotation is applied to.
|
|
120
|
+
*/
|
|
121
|
+
target: AnnotationTarget;
|
|
122
|
+
/** Start position in source */
|
|
123
|
+
startPosition: Position;
|
|
124
|
+
/** End position in source */
|
|
125
|
+
endPosition: Position;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Method parameter information.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* public User getUser(@PathVariable Long id, @RequestBody UserDto dto)
|
|
132
|
+
* ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
|
|
133
|
+
*/
|
|
134
|
+
export interface JavaParameterInfo {
|
|
135
|
+
/** Parameter name */
|
|
136
|
+
name: string;
|
|
137
|
+
/** Parameter type as string (e.g., "Long", "List<String>") */
|
|
138
|
+
type: string;
|
|
139
|
+
/**
|
|
140
|
+
* Annotations on the parameter.
|
|
141
|
+
* Critical for @PathVariable, @RequestBody, @RequestParam, etc.
|
|
142
|
+
*/
|
|
143
|
+
annotations: AnnotationUsage[];
|
|
144
|
+
/** Whether this is a varargs parameter (String... args) */
|
|
145
|
+
isVarargs: boolean;
|
|
146
|
+
/** Whether this parameter has the final modifier */
|
|
147
|
+
isFinal: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Method information.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* @GetMapping("/users/{id}")
|
|
154
|
+
* @PreAuthorize("hasRole('USER')")
|
|
155
|
+
* public ResponseEntity<UserDto> getUser(@PathVariable Long id) throws NotFoundException {
|
|
156
|
+
* ...
|
|
157
|
+
* }
|
|
158
|
+
*/
|
|
159
|
+
export interface JavaMethodInfo {
|
|
160
|
+
/** Method name */
|
|
161
|
+
name: string;
|
|
162
|
+
/**
|
|
163
|
+
* Annotations on the method.
|
|
164
|
+
* Critical for @GetMapping, @Transactional, @PreAuthorize, etc.
|
|
165
|
+
*/
|
|
166
|
+
annotations: AnnotationUsage[];
|
|
167
|
+
/** Return type as string (e.g., "ResponseEntity<UserDto>", "void") */
|
|
168
|
+
returnType: string;
|
|
169
|
+
/** Method parameters with their annotations */
|
|
170
|
+
parameters: JavaParameterInfo[];
|
|
171
|
+
/** Modifiers (public, static, final, etc.) */
|
|
172
|
+
modifiers: JavaModifier[];
|
|
173
|
+
/** Generic type parameters (e.g., ["T", "U"] for <T, U>) */
|
|
174
|
+
typeParameters: string[];
|
|
175
|
+
/** Exception types in throws clause */
|
|
176
|
+
throwsTypes: string[];
|
|
177
|
+
/** Accessibility level derived from modifiers */
|
|
178
|
+
accessibility: JavaAccessibility;
|
|
179
|
+
/** Whether method is static */
|
|
180
|
+
isStatic: boolean;
|
|
181
|
+
/** Whether method is abstract */
|
|
182
|
+
isAbstract: boolean;
|
|
183
|
+
/** Whether method is final */
|
|
184
|
+
isFinal: boolean;
|
|
185
|
+
/** Whether method is synchronized */
|
|
186
|
+
isSynchronized: boolean;
|
|
187
|
+
/** Whether method is native */
|
|
188
|
+
isNative: boolean;
|
|
189
|
+
/** Whether method is a default interface method */
|
|
190
|
+
isDefault: boolean;
|
|
191
|
+
/** Start position in source */
|
|
192
|
+
startPosition: Position;
|
|
193
|
+
/** End position in source */
|
|
194
|
+
endPosition: Position;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Constructor information.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* @Autowired
|
|
201
|
+
* public UserService(UserRepository userRepo, EmailService emailService) {
|
|
202
|
+
* this.userRepo = userRepo;
|
|
203
|
+
* this.emailService = emailService;
|
|
204
|
+
* }
|
|
205
|
+
*/
|
|
206
|
+
export interface JavaConstructorInfo {
|
|
207
|
+
/** Annotations on the constructor (e.g., @Autowired) */
|
|
208
|
+
annotations: AnnotationUsage[];
|
|
209
|
+
/** Constructor parameters */
|
|
210
|
+
parameters: JavaParameterInfo[];
|
|
211
|
+
/** Modifiers (public, private, protected) */
|
|
212
|
+
modifiers: JavaModifier[];
|
|
213
|
+
/** Exception types in throws clause */
|
|
214
|
+
throwsTypes: string[];
|
|
215
|
+
/** Accessibility level */
|
|
216
|
+
accessibility: JavaAccessibility;
|
|
217
|
+
/** Start position in source */
|
|
218
|
+
startPosition: Position;
|
|
219
|
+
/** End position in source */
|
|
220
|
+
endPosition: Position;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Field information.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* @Autowired
|
|
227
|
+
* private UserRepository userRepository;
|
|
228
|
+
*
|
|
229
|
+
* @Value("${app.name}")
|
|
230
|
+
* private String appName;
|
|
231
|
+
*/
|
|
232
|
+
export interface JavaFieldInfo {
|
|
233
|
+
/** Field name */
|
|
234
|
+
name: string;
|
|
235
|
+
/** Field type as string */
|
|
236
|
+
type: string;
|
|
237
|
+
/**
|
|
238
|
+
* Annotations on the field.
|
|
239
|
+
* Critical for @Autowired, @Value, @Id, @Column, etc.
|
|
240
|
+
*/
|
|
241
|
+
annotations: AnnotationUsage[];
|
|
242
|
+
/** Modifiers (private, static, final, etc.) */
|
|
243
|
+
modifiers: JavaModifier[];
|
|
244
|
+
/** Initial value if present (as string) */
|
|
245
|
+
initializer: string | null;
|
|
246
|
+
/** Accessibility level */
|
|
247
|
+
accessibility: JavaAccessibility;
|
|
248
|
+
/** Whether field is static */
|
|
249
|
+
isStatic: boolean;
|
|
250
|
+
/** Whether field is final */
|
|
251
|
+
isFinal: boolean;
|
|
252
|
+
/** Whether field is volatile */
|
|
253
|
+
isVolatile: boolean;
|
|
254
|
+
/** Whether field is transient */
|
|
255
|
+
isTransient: boolean;
|
|
256
|
+
/** Start position in source */
|
|
257
|
+
startPosition: Position;
|
|
258
|
+
/** End position in source */
|
|
259
|
+
endPosition: Position;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Class information.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* @Service
|
|
266
|
+
* @Transactional
|
|
267
|
+
* public class UserService implements IUserService {
|
|
268
|
+
* ...
|
|
269
|
+
* }
|
|
270
|
+
*/
|
|
271
|
+
export interface JavaClassInfo {
|
|
272
|
+
/** Class name */
|
|
273
|
+
name: string;
|
|
274
|
+
/** Containing package (null if in default package) */
|
|
275
|
+
packageName: string | null;
|
|
276
|
+
/**
|
|
277
|
+
* Annotations on the class.
|
|
278
|
+
* Critical for @Service, @Controller, @Entity, @Configuration, etc.
|
|
279
|
+
*/
|
|
280
|
+
annotations: AnnotationUsage[];
|
|
281
|
+
/** Modifiers (public, abstract, final, etc.) */
|
|
282
|
+
modifiers: JavaModifier[];
|
|
283
|
+
/** Superclass name if extends another class */
|
|
284
|
+
superclass: string | null;
|
|
285
|
+
/** Implemented interface names */
|
|
286
|
+
interfaces: string[];
|
|
287
|
+
/** Generic type parameters */
|
|
288
|
+
typeParameters: string[];
|
|
289
|
+
/** Permitted subclasses for sealed classes (Java 17+) */
|
|
290
|
+
permittedSubclasses: string[];
|
|
291
|
+
/** Fields declared in the class */
|
|
292
|
+
fields: JavaFieldInfo[];
|
|
293
|
+
/** Methods declared in the class */
|
|
294
|
+
methods: JavaMethodInfo[];
|
|
295
|
+
/** Constructors declared in the class */
|
|
296
|
+
constructors: JavaConstructorInfo[];
|
|
297
|
+
/** Nested/inner class names */
|
|
298
|
+
innerClasses: string[];
|
|
299
|
+
/** Accessibility level */
|
|
300
|
+
accessibility: JavaAccessibility;
|
|
301
|
+
/** Whether class is abstract */
|
|
302
|
+
isAbstract: boolean;
|
|
303
|
+
/** Whether class is final */
|
|
304
|
+
isFinal: boolean;
|
|
305
|
+
/** Whether class is static (for inner classes) */
|
|
306
|
+
isStatic: boolean;
|
|
307
|
+
/** Whether class is sealed (Java 17+) */
|
|
308
|
+
isSealed: boolean;
|
|
309
|
+
/** Whether class is non-sealed (Java 17+) */
|
|
310
|
+
isNonSealed: boolean;
|
|
311
|
+
/** Start position in source */
|
|
312
|
+
startPosition: Position;
|
|
313
|
+
/** End position in source */
|
|
314
|
+
endPosition: Position;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Interface information.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* @Repository
|
|
321
|
+
* public interface UserRepository extends JpaRepository<User, Long> {
|
|
322
|
+
* @Query("SELECT u FROM User u WHERE u.email = :email")
|
|
323
|
+
* Optional<User> findByEmail(@Param("email") String email);
|
|
324
|
+
* }
|
|
325
|
+
*/
|
|
326
|
+
export interface JavaInterfaceInfo {
|
|
327
|
+
/** Interface name */
|
|
328
|
+
name: string;
|
|
329
|
+
/** Containing package */
|
|
330
|
+
packageName: string | null;
|
|
331
|
+
/** Annotations on the interface */
|
|
332
|
+
annotations: AnnotationUsage[];
|
|
333
|
+
/** Modifiers */
|
|
334
|
+
modifiers: JavaModifier[];
|
|
335
|
+
/** Extended interface names */
|
|
336
|
+
extendsInterfaces: string[];
|
|
337
|
+
/** Generic type parameters */
|
|
338
|
+
typeParameters: string[];
|
|
339
|
+
/** Permitted subclasses for sealed interfaces (Java 17+) */
|
|
340
|
+
permittedSubclasses: string[];
|
|
341
|
+
/** Method signatures (including default methods) */
|
|
342
|
+
methods: JavaMethodInfo[];
|
|
343
|
+
/** Constant fields (implicitly public static final) */
|
|
344
|
+
fields: JavaFieldInfo[];
|
|
345
|
+
/** Accessibility level */
|
|
346
|
+
accessibility: JavaAccessibility;
|
|
347
|
+
/** Whether interface is sealed (Java 17+) */
|
|
348
|
+
isSealed: boolean;
|
|
349
|
+
/** Whether interface is non-sealed (Java 17+) */
|
|
350
|
+
isNonSealed: boolean;
|
|
351
|
+
/** Start position in source */
|
|
352
|
+
startPosition: Position;
|
|
353
|
+
/** End position in source */
|
|
354
|
+
endPosition: Position;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Enum constant information.
|
|
358
|
+
*/
|
|
359
|
+
export interface JavaEnumConstant {
|
|
360
|
+
/** Constant name */
|
|
361
|
+
name: string;
|
|
362
|
+
/** Annotations on the constant */
|
|
363
|
+
annotations: AnnotationUsage[];
|
|
364
|
+
/** Constructor arguments if any */
|
|
365
|
+
arguments: string[];
|
|
366
|
+
/** Start position in source */
|
|
367
|
+
startPosition: Position;
|
|
368
|
+
/** End position in source */
|
|
369
|
+
endPosition: Position;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Enum information.
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* public enum OrderStatus {
|
|
376
|
+
* PENDING("Pending"),
|
|
377
|
+
* COMPLETED("Completed"),
|
|
378
|
+
* CANCELLED("Cancelled");
|
|
379
|
+
*
|
|
380
|
+
* private final String displayName;
|
|
381
|
+
* OrderStatus(String displayName) { this.displayName = displayName; }
|
|
382
|
+
* }
|
|
383
|
+
*/
|
|
384
|
+
export interface JavaEnumInfo {
|
|
385
|
+
/** Enum name */
|
|
386
|
+
name: string;
|
|
387
|
+
/** Containing package */
|
|
388
|
+
packageName: string | null;
|
|
389
|
+
/** Annotations on the enum */
|
|
390
|
+
annotations: AnnotationUsage[];
|
|
391
|
+
/** Modifiers */
|
|
392
|
+
modifiers: JavaModifier[];
|
|
393
|
+
/** Implemented interface names */
|
|
394
|
+
interfaces: string[];
|
|
395
|
+
/** Enum constants */
|
|
396
|
+
constants: JavaEnumConstant[];
|
|
397
|
+
/** Fields declared in the enum */
|
|
398
|
+
fields: JavaFieldInfo[];
|
|
399
|
+
/** Methods declared in the enum */
|
|
400
|
+
methods: JavaMethodInfo[];
|
|
401
|
+
/** Constructors declared in the enum */
|
|
402
|
+
constructors: JavaConstructorInfo[];
|
|
403
|
+
/** Accessibility level */
|
|
404
|
+
accessibility: JavaAccessibility;
|
|
405
|
+
/** Start position in source */
|
|
406
|
+
startPosition: Position;
|
|
407
|
+
/** End position in source */
|
|
408
|
+
endPosition: Position;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Record component information (the parameters in record declaration).
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* public record UserDto(Long id, String name, @Email String email) {}
|
|
415
|
+
* ^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
|
|
416
|
+
*/
|
|
417
|
+
export interface JavaRecordComponent {
|
|
418
|
+
/** Component name */
|
|
419
|
+
name: string;
|
|
420
|
+
/** Component type */
|
|
421
|
+
type: string;
|
|
422
|
+
/** Annotations on the component */
|
|
423
|
+
annotations: AnnotationUsage[];
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Record information (Java 16+).
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* @JsonSerialize
|
|
430
|
+
* public record UserDto(
|
|
431
|
+
* Long id,
|
|
432
|
+
* @NotBlank String name,
|
|
433
|
+
* @Email String email
|
|
434
|
+
* ) implements Serializable {
|
|
435
|
+
* // Compact constructor
|
|
436
|
+
* public UserDto {
|
|
437
|
+
* Objects.requireNonNull(name);
|
|
438
|
+
* }
|
|
439
|
+
* }
|
|
440
|
+
*/
|
|
441
|
+
export interface JavaRecordInfo {
|
|
442
|
+
/** Record name */
|
|
443
|
+
name: string;
|
|
444
|
+
/** Containing package */
|
|
445
|
+
packageName: string | null;
|
|
446
|
+
/** Annotations on the record */
|
|
447
|
+
annotations: AnnotationUsage[];
|
|
448
|
+
/** Modifiers */
|
|
449
|
+
modifiers: JavaModifier[];
|
|
450
|
+
/** Record components (the primary constructor parameters) */
|
|
451
|
+
components: JavaRecordComponent[];
|
|
452
|
+
/** Implemented interface names */
|
|
453
|
+
interfaces: string[];
|
|
454
|
+
/** Generic type parameters */
|
|
455
|
+
typeParameters: string[];
|
|
456
|
+
/** Additional methods (beyond auto-generated ones) */
|
|
457
|
+
methods: JavaMethodInfo[];
|
|
458
|
+
/** Additional constructors (compact or canonical) */
|
|
459
|
+
constructors: JavaConstructorInfo[];
|
|
460
|
+
/** Accessibility level */
|
|
461
|
+
accessibility: JavaAccessibility;
|
|
462
|
+
/** Start position in source */
|
|
463
|
+
startPosition: Position;
|
|
464
|
+
/** End position in source */
|
|
465
|
+
endPosition: Position;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Annotation element (method in annotation type).
|
|
469
|
+
*/
|
|
470
|
+
export interface AnnotationElement {
|
|
471
|
+
/** Element name */
|
|
472
|
+
name: string;
|
|
473
|
+
/** Element type */
|
|
474
|
+
type: string;
|
|
475
|
+
/** Default value if specified */
|
|
476
|
+
defaultValue: string | null;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Annotation type definition (@interface).
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* @Retention(RetentionPolicy.RUNTIME)
|
|
483
|
+
* @Target(ElementType.METHOD)
|
|
484
|
+
* public @interface Cacheable {
|
|
485
|
+
* String value() default "";
|
|
486
|
+
* String key() default "";
|
|
487
|
+
* }
|
|
488
|
+
*/
|
|
489
|
+
export interface AnnotationDefinition {
|
|
490
|
+
/** Annotation type name */
|
|
491
|
+
name: string;
|
|
492
|
+
/** Containing package */
|
|
493
|
+
packageName: string | null;
|
|
494
|
+
/** Meta-annotations on this annotation type */
|
|
495
|
+
annotations: AnnotationUsage[];
|
|
496
|
+
/** Annotation elements (methods) */
|
|
497
|
+
elements: AnnotationElement[];
|
|
498
|
+
/** Accessibility level */
|
|
499
|
+
accessibility: JavaAccessibility;
|
|
500
|
+
/** Start position in source */
|
|
501
|
+
startPosition: Position;
|
|
502
|
+
/** End position in source */
|
|
503
|
+
endPosition: Position;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Extended parse result with Java-specific semantic information.
|
|
507
|
+
*
|
|
508
|
+
* This is the main output of the Java parser, containing all
|
|
509
|
+
* extracted semantic information needed for pattern detection.
|
|
510
|
+
*/
|
|
511
|
+
export interface JavaParseResult extends ParseResult {
|
|
512
|
+
/** Package declaration (null if default package) */
|
|
513
|
+
package: PackageInfo | null;
|
|
514
|
+
/** Import statements */
|
|
515
|
+
imports: JavaImportInfo[];
|
|
516
|
+
/** Class declarations */
|
|
517
|
+
classes: JavaClassInfo[];
|
|
518
|
+
/** Interface declarations */
|
|
519
|
+
interfaces: JavaInterfaceInfo[];
|
|
520
|
+
/** Enum declarations */
|
|
521
|
+
enums: JavaEnumInfo[];
|
|
522
|
+
/** Record declarations (Java 16+) */
|
|
523
|
+
records: JavaRecordInfo[];
|
|
524
|
+
/** Annotation type definitions (@interface) */
|
|
525
|
+
annotationDefinitions: AnnotationDefinition[];
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Options for annotation extraction.
|
|
529
|
+
*/
|
|
530
|
+
export interface AnnotationExtractionOptions {
|
|
531
|
+
/** Whether to resolve full annotation names from imports */
|
|
532
|
+
resolveFullNames: boolean;
|
|
533
|
+
/** Whether to parse array values into individual elements */
|
|
534
|
+
parseArrayElements: boolean;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Default annotation extraction options.
|
|
538
|
+
*/
|
|
539
|
+
export declare const DEFAULT_ANNOTATION_OPTIONS: AnnotationExtractionOptions;
|
|
540
|
+
/**
|
|
541
|
+
* Map of simple annotation names to their common full qualified names.
|
|
542
|
+
* Used for resolution when imports are not available.
|
|
543
|
+
*/
|
|
544
|
+
export declare const COMMON_SPRING_ANNOTATIONS: Record<string, string>;
|
|
545
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@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oB,EAAE,CAAC;CAC/C;AAMD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAE1B,6DAA6D;IAC7D,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,2BAGxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkE5D,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Parser Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* TypeScript types for Java parsing using tree-sitter-java.
|
|
5
|
+
* Annotations are FIRST-CLASS CITIZENS - they're the primary signal
|
|
6
|
+
* for Spring pattern detection.
|
|
7
|
+
*
|
|
8
|
+
* @requirements Java/Spring Boot Language Support
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Default annotation extraction options.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_ANNOTATION_OPTIONS = {
|
|
14
|
+
resolveFullNames: true,
|
|
15
|
+
parseArrayElements: true,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Map of simple annotation names to their common full qualified names.
|
|
19
|
+
* Used for resolution when imports are not available.
|
|
20
|
+
*/
|
|
21
|
+
export const COMMON_SPRING_ANNOTATIONS = {
|
|
22
|
+
// Stereotype annotations
|
|
23
|
+
'Component': 'org.springframework.stereotype.Component',
|
|
24
|
+
'Service': 'org.springframework.stereotype.Service',
|
|
25
|
+
'Repository': 'org.springframework.stereotype.Repository',
|
|
26
|
+
'Controller': 'org.springframework.stereotype.Controller',
|
|
27
|
+
'RestController': 'org.springframework.web.bind.annotation.RestController',
|
|
28
|
+
'Configuration': 'org.springframework.context.annotation.Configuration',
|
|
29
|
+
// Web annotations
|
|
30
|
+
'RequestMapping': 'org.springframework.web.bind.annotation.RequestMapping',
|
|
31
|
+
'GetMapping': 'org.springframework.web.bind.annotation.GetMapping',
|
|
32
|
+
'PostMapping': 'org.springframework.web.bind.annotation.PostMapping',
|
|
33
|
+
'PutMapping': 'org.springframework.web.bind.annotation.PutMapping',
|
|
34
|
+
'DeleteMapping': 'org.springframework.web.bind.annotation.DeleteMapping',
|
|
35
|
+
'PatchMapping': 'org.springframework.web.bind.annotation.PatchMapping',
|
|
36
|
+
'PathVariable': 'org.springframework.web.bind.annotation.PathVariable',
|
|
37
|
+
'RequestParam': 'org.springframework.web.bind.annotation.RequestParam',
|
|
38
|
+
'RequestBody': 'org.springframework.web.bind.annotation.RequestBody',
|
|
39
|
+
'ResponseBody': 'org.springframework.web.bind.annotation.ResponseBody',
|
|
40
|
+
// DI annotations
|
|
41
|
+
'Autowired': 'org.springframework.beans.factory.annotation.Autowired',
|
|
42
|
+
'Qualifier': 'org.springframework.beans.factory.annotation.Qualifier',
|
|
43
|
+
'Value': 'org.springframework.beans.factory.annotation.Value',
|
|
44
|
+
'Bean': 'org.springframework.context.annotation.Bean',
|
|
45
|
+
// Security annotations
|
|
46
|
+
'PreAuthorize': 'org.springframework.security.access.prepost.PreAuthorize',
|
|
47
|
+
'PostAuthorize': 'org.springframework.security.access.prepost.PostAuthorize',
|
|
48
|
+
'Secured': 'org.springframework.security.access.annotation.Secured',
|
|
49
|
+
// Data annotations
|
|
50
|
+
'Transactional': 'org.springframework.transaction.annotation.Transactional',
|
|
51
|
+
'Query': 'org.springframework.data.jpa.repository.Query',
|
|
52
|
+
'Param': 'org.springframework.data.repository.query.Param',
|
|
53
|
+
// JPA annotations
|
|
54
|
+
'Entity': 'jakarta.persistence.Entity',
|
|
55
|
+
'Table': 'jakarta.persistence.Table',
|
|
56
|
+
'Id': 'jakarta.persistence.Id',
|
|
57
|
+
'Column': 'jakarta.persistence.Column',
|
|
58
|
+
'GeneratedValue': 'jakarta.persistence.GeneratedValue',
|
|
59
|
+
'ManyToOne': 'jakarta.persistence.ManyToOne',
|
|
60
|
+
'OneToMany': 'jakarta.persistence.OneToMany',
|
|
61
|
+
'ManyToMany': 'jakarta.persistence.ManyToMany',
|
|
62
|
+
'OneToOne': 'jakarta.persistence.OneToOne',
|
|
63
|
+
'JoinColumn': 'jakarta.persistence.JoinColumn',
|
|
64
|
+
// Validation annotations
|
|
65
|
+
'Valid': 'jakarta.validation.Valid',
|
|
66
|
+
'NotNull': 'jakarta.validation.constraints.NotNull',
|
|
67
|
+
'NotBlank': 'jakarta.validation.constraints.NotBlank',
|
|
68
|
+
'NotEmpty': 'jakarta.validation.constraints.NotEmpty',
|
|
69
|
+
'Size': 'jakarta.validation.constraints.Size',
|
|
70
|
+
'Email': 'jakarta.validation.constraints.Email',
|
|
71
|
+
'Min': 'jakarta.validation.constraints.Min',
|
|
72
|
+
'Max': 'jakarta.validation.constraints.Max',
|
|
73
|
+
'Pattern': 'jakarta.validation.constraints.Pattern',
|
|
74
|
+
// Test annotations
|
|
75
|
+
'Test': 'org.junit.jupiter.api.Test',
|
|
76
|
+
'SpringBootTest': 'org.springframework.boot.test.context.SpringBootTest',
|
|
77
|
+
'MockBean': 'org.springframework.boot.test.mock.mockito.MockBean',
|
|
78
|
+
'WebMvcTest': 'org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest',
|
|
79
|
+
'DataJpaTest': 'org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest',
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/parsers/tree-sitter/java/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmuBH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAgC;IACrE,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAC/D,yBAAyB;IACzB,WAAW,EAAE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