@atomic-ehr/codegen 0.0.1-canary.20250819161733.93f28a4 → 0.0.1-canary.20250822114054.4ca1428
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/api/builder.d.ts +1 -1
- package/dist/api/builder.d.ts.map +1 -1
- package/dist/api/generators/base/BaseGenerator.d.ts +1 -1
- package/dist/api/generators/base/BaseGenerator.d.ts.map +1 -1
- package/dist/api/generators/base/FileManager.d.ts +0 -1
- package/dist/api/generators/base/FileManager.d.ts.map +1 -1
- package/dist/api/generators/base/PythonTypeMapper.d.ts +1 -1
- package/dist/api/generators/base/PythonTypeMapper.d.ts.map +1 -1
- package/dist/api/generators/base/TypeMapper.d.ts +1 -1
- package/dist/api/generators/base/TypeMapper.d.ts.map +1 -1
- package/dist/api/generators/base/TypeScriptTypeMapper.d.ts +1 -1
- package/dist/api/generators/base/TypeScriptTypeMapper.d.ts.map +1 -1
- package/dist/api/generators/base/builders/IndexBuilder.d.ts +1 -1
- package/dist/api/generators/base/builders/IndexBuilder.d.ts.map +1 -1
- package/dist/api/generators/base/enhanced-errors.d.ts.map +1 -1
- package/dist/api/generators/base/error-handler.d.ts +2 -2
- package/dist/api/generators/base/error-handler.d.ts.map +1 -1
- package/dist/api/generators/base/index.d.ts +0 -4
- package/dist/api/generators/base/index.d.ts.map +1 -1
- package/dist/api/generators/rest-client.d.ts +1 -1
- package/dist/api/generators/rest-client.d.ts.map +1 -1
- package/dist/api/generators/search-parameter-enhancer.d.ts +1 -5
- package/dist/api/generators/search-parameter-enhancer.d.ts.map +1 -1
- package/dist/api/generators/typescript.d.ts +9 -16
- package/dist/api/generators/typescript.d.ts.map +1 -1
- package/dist/api/generators/validation-generator.d.ts +1 -1
- package/dist/api/generators/validation-generator.d.ts.map +1 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config.d.ts +22 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/{index-ham97vbj.js → index-fgcebdva.js} +87 -214
- package/dist/index.js +3 -1
- package/dist/typeschema/cache.d.ts +1 -1
- package/dist/typeschema/cache.d.ts.map +1 -1
- package/dist/typeschema/core/transformer.d.ts +2 -1
- package/dist/typeschema/core/transformer.d.ts.map +1 -1
- package/dist/typeschema/generator.d.ts +2 -5
- package/dist/typeschema/generator.d.ts.map +1 -1
- package/dist/typeschema/index.d.ts +5 -4
- package/dist/typeschema/index.d.ts.map +1 -1
- package/dist/typeschema/parser.d.ts +2 -1
- package/dist/typeschema/parser.d.ts.map +1 -1
- package/dist/typeschema/profile/processor.d.ts +2 -1
- package/dist/typeschema/profile/processor.d.ts.map +1 -1
- package/dist/typeschema/type-schema.types.d.ts +187 -0
- package/dist/typeschema/type-schema.types.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/api/generators/base/HandlebarsTemplateEngine.d.ts +0 -60
- package/dist/api/generators/base/HandlebarsTemplateEngine.d.ts.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Profile Processor
|
|
2
|
+
* Profile Processor (DEPRECATED - Profiles not in core TypeSchema spec)
|
|
3
3
|
*
|
|
4
4
|
* Handles transformation of FHIR profiles to TypeSchema format
|
|
5
|
+
* This file is deprecated as profiles are not part of the core TypeSchema specification
|
|
5
6
|
*/
|
|
6
7
|
import type { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
|
|
7
8
|
import type { FHIRSchema } from "@atomic-ehr/fhirschema";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/typeschema/profile/processor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/typeschema/profile/processor.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EACX,WAAW,EAIX,oBAAoB,EAEpB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAC5C,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAwF/B"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript type definitions for Type Schema
|
|
3
|
+
*
|
|
4
|
+
* Generated based on type-schema.schema.json
|
|
5
|
+
* A code generation friendly representation of FHIR StructureDefinition
|
|
6
|
+
* and FHIR Schema designed to simplify SDK resource classes/types generation.
|
|
7
|
+
*/
|
|
8
|
+
export interface TypeSchemaIdentifierBase {
|
|
9
|
+
/** The FHIR package identifier (e.g., hl7.fhir.r4.core) */
|
|
10
|
+
package: string;
|
|
11
|
+
/** The version of the package */
|
|
12
|
+
version: string;
|
|
13
|
+
/** Computer friendly identifier for the element */
|
|
14
|
+
name: string;
|
|
15
|
+
/** A canonical URL identifying this resource uniquely in the FHIR ecosystem */
|
|
16
|
+
url: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WithPrimitiveTypeKind {
|
|
19
|
+
kind: "primitive-type";
|
|
20
|
+
}
|
|
21
|
+
export interface WithValueSetKind {
|
|
22
|
+
kind: "value-set";
|
|
23
|
+
}
|
|
24
|
+
export interface WithBindingKind {
|
|
25
|
+
kind: "binding";
|
|
26
|
+
}
|
|
27
|
+
export interface WithComplexTypeKind {
|
|
28
|
+
kind: "complex-type";
|
|
29
|
+
}
|
|
30
|
+
export interface WithResourceKind {
|
|
31
|
+
kind: "resource";
|
|
32
|
+
}
|
|
33
|
+
export interface WithNestedKind {
|
|
34
|
+
kind: "nested";
|
|
35
|
+
}
|
|
36
|
+
export interface WithLogicalKind {
|
|
37
|
+
kind: "logical";
|
|
38
|
+
}
|
|
39
|
+
export type TypeSchemaIdentifier = (TypeSchemaIdentifierBase & WithPrimitiveTypeKind) | (TypeSchemaIdentifierBase & WithValueSetKind) | (TypeSchemaIdentifierBase & WithBindingKind) | (TypeSchemaIdentifierBase & WithComplexTypeKind) | (TypeSchemaIdentifierBase & WithResourceKind) | (TypeSchemaIdentifierBase & WithNestedKind) | (TypeSchemaIdentifierBase & WithLogicalKind);
|
|
40
|
+
export interface RegularField {
|
|
41
|
+
/** The data type of this field */
|
|
42
|
+
type: TypeSchemaIdentifier;
|
|
43
|
+
/** Reference to other types that this field can point to */
|
|
44
|
+
reference?: TypeSchemaIdentifier[];
|
|
45
|
+
/** Whether this field must be provided in valid instances */
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/** Whether this field is prohibited in valid instances */
|
|
48
|
+
excluded?: boolean;
|
|
49
|
+
/** Whether this field can contain multiple values (cardinality > 1) */
|
|
50
|
+
array?: boolean;
|
|
51
|
+
/** Binding information for coded fields */
|
|
52
|
+
binding?: TypeSchemaIdentifierBase & WithBindingKind;
|
|
53
|
+
/** For code fields, the set of valid values when bound to a required value set */
|
|
54
|
+
enum?: string[];
|
|
55
|
+
/** Minimum limit of items for an array */
|
|
56
|
+
min?: number;
|
|
57
|
+
/** Maximum limit of items for an array */
|
|
58
|
+
max?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface PolymorphicDeclarationField {
|
|
61
|
+
/** The names of all concrete type options for this choice field */
|
|
62
|
+
choices: string[];
|
|
63
|
+
/** Whether at least one choice must be provided */
|
|
64
|
+
required?: boolean;
|
|
65
|
+
/** Whether all choices are prohibited */
|
|
66
|
+
excluded?: boolean;
|
|
67
|
+
/** Whether the selected choice can contain multiple values */
|
|
68
|
+
array?: boolean;
|
|
69
|
+
/** Minimum limit of items for an array */
|
|
70
|
+
min?: number;
|
|
71
|
+
/** Maximum limit of items for an array */
|
|
72
|
+
max?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface PolymorphicInstanceField {
|
|
75
|
+
/** The name of the choice field this instance belongs to (e.g., 'value' for valueString) */
|
|
76
|
+
choiceOf: string;
|
|
77
|
+
/** The data type of this choice option */
|
|
78
|
+
type: TypeSchemaIdentifier;
|
|
79
|
+
/** Whether this specific choice must be provided */
|
|
80
|
+
required?: boolean;
|
|
81
|
+
/** Whether this specific choice is prohibited */
|
|
82
|
+
excluded?: boolean;
|
|
83
|
+
/** Whether this choice can contain multiple values */
|
|
84
|
+
array?: boolean;
|
|
85
|
+
/** Reference to other types that this field can point to */
|
|
86
|
+
reference?: TypeSchemaIdentifier[];
|
|
87
|
+
/** For coded choices, information about the value set binding */
|
|
88
|
+
binding?: TypeSchemaIdentifierBase & WithBindingKind;
|
|
89
|
+
/** For code fields, the set of valid values when bound to a required value set */
|
|
90
|
+
enum?: string[];
|
|
91
|
+
/** Minimum limit of items for an array */
|
|
92
|
+
min?: number;
|
|
93
|
+
/** Maximum limit of items for an array */
|
|
94
|
+
max?: number;
|
|
95
|
+
}
|
|
96
|
+
export type TypeSchemaField = RegularField | PolymorphicDeclarationField | PolymorphicInstanceField;
|
|
97
|
+
export interface NestedType {
|
|
98
|
+
/** The unique identifier for this nested type */
|
|
99
|
+
identifier: TypeSchemaIdentifierBase & WithNestedKind;
|
|
100
|
+
/** The base type this nested type extends (typically BackboneElement) */
|
|
101
|
+
base: TypeSchemaIdentifier;
|
|
102
|
+
/** The fields contained in this nested type */
|
|
103
|
+
fields?: Record<string, TypeSchemaField>;
|
|
104
|
+
}
|
|
105
|
+
export interface ValueSetConcept {
|
|
106
|
+
/** The code value */
|
|
107
|
+
code: string;
|
|
108
|
+
/** The human-readable display text for this code */
|
|
109
|
+
display?: string;
|
|
110
|
+
/** The code system URL that defines this code */
|
|
111
|
+
system?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface TypeSchemaForPrimitiveType {
|
|
114
|
+
/** The unique identifier for this primitive type */
|
|
115
|
+
identifier: TypeSchemaIdentifierBase & WithPrimitiveTypeKind;
|
|
116
|
+
/** The base type this primitive type extends (typically Element) */
|
|
117
|
+
base: TypeSchemaIdentifier;
|
|
118
|
+
/** Human-readable description of the primitive type */
|
|
119
|
+
description?: string;
|
|
120
|
+
/** Other types that this primitive type depends on */
|
|
121
|
+
dependencies?: TypeSchemaIdentifier[];
|
|
122
|
+
}
|
|
123
|
+
export interface TypeSchemaForResourceComplexLogical {
|
|
124
|
+
/** The unique identifier for this resource or type */
|
|
125
|
+
identifier: (TypeSchemaIdentifierBase & WithResourceKind) | (TypeSchemaIdentifierBase & WithComplexTypeKind) | (TypeSchemaIdentifierBase & WithLogicalKind);
|
|
126
|
+
/** The base type this resource or type extends */
|
|
127
|
+
base?: TypeSchemaIdentifier;
|
|
128
|
+
/** Human-readable description of the resource or type */
|
|
129
|
+
description?: string;
|
|
130
|
+
/** The fields contained in this resource or type */
|
|
131
|
+
fields?: Record<string, TypeSchemaField>;
|
|
132
|
+
/** BackboneElement types nested within this resource or type */
|
|
133
|
+
nested?: NestedType[];
|
|
134
|
+
/** Other types that this resource or type depends on */
|
|
135
|
+
dependencies?: TypeSchemaIdentifier[];
|
|
136
|
+
}
|
|
137
|
+
export interface TypeSchemaForValueSet {
|
|
138
|
+
/** The unique identifier for this value set */
|
|
139
|
+
identifier: TypeSchemaIdentifierBase & WithValueSetKind;
|
|
140
|
+
/** Human-readable description of the value set */
|
|
141
|
+
description?: string;
|
|
142
|
+
/** The list of coded concepts contained in this value set */
|
|
143
|
+
concept?: ValueSetConcept[];
|
|
144
|
+
/** Complex value set composition rules when the value set is defined as a composition of other value sets */
|
|
145
|
+
compose?: Record<string, unknown>;
|
|
146
|
+
}
|
|
147
|
+
export interface TypeSchemaForBinding {
|
|
148
|
+
/** The unique identifier for this binding */
|
|
149
|
+
identifier: TypeSchemaIdentifierBase & WithBindingKind;
|
|
150
|
+
/** Human-readable description of the binding */
|
|
151
|
+
description?: string;
|
|
152
|
+
/** The type this binding applies to */
|
|
153
|
+
type?: TypeSchemaIdentifier;
|
|
154
|
+
/** The strength of the binding */
|
|
155
|
+
strength?: string;
|
|
156
|
+
/** The enumeration of values for the binding */
|
|
157
|
+
enum?: string[];
|
|
158
|
+
/** Reference to the value set for this binding */
|
|
159
|
+
valueset?: TypeSchemaIdentifierBase & WithValueSetKind;
|
|
160
|
+
/** Other types that this binding depends on */
|
|
161
|
+
dependencies?: TypeSchemaIdentifier[];
|
|
162
|
+
}
|
|
163
|
+
export type TypeSchema = TypeSchemaForPrimitiveType | TypeSchemaForResourceComplexLogical | TypeSchemaForValueSet | TypeSchemaForBinding;
|
|
164
|
+
export declare function isPrimitiveTypeSchema(schema: TypeSchema): schema is TypeSchemaForPrimitiveType;
|
|
165
|
+
export declare function isResourceSchema(schema: TypeSchema): schema is TypeSchemaForResourceComplexLogical;
|
|
166
|
+
export declare function isComplexTypeSchema(schema: TypeSchema): schema is TypeSchemaForResourceComplexLogical;
|
|
167
|
+
export declare function isLogicalSchema(schema: TypeSchema): schema is TypeSchemaForResourceComplexLogical;
|
|
168
|
+
export declare function isValueSetSchema(schema: TypeSchema): schema is TypeSchemaForValueSet;
|
|
169
|
+
export declare function isBindingSchema(schema: TypeSchema): schema is TypeSchemaForBinding;
|
|
170
|
+
export declare function isNestedTypeSchema(identifier: TypeSchemaIdentifier): identifier is TypeSchemaIdentifierBase & WithNestedKind;
|
|
171
|
+
export declare function isRegularField(field: TypeSchemaField): field is RegularField;
|
|
172
|
+
export declare function isPolymorphicDeclarationField(field: TypeSchemaField): field is PolymorphicDeclarationField;
|
|
173
|
+
export declare function isPolymorphicInstanceField(field: TypeSchemaField): field is PolymorphicInstanceField;
|
|
174
|
+
export type SchemaKind = TypeSchemaIdentifier["kind"];
|
|
175
|
+
export type SchemasByKind = {
|
|
176
|
+
"primitive-type": TypeSchemaForPrimitiveType;
|
|
177
|
+
resource: TypeSchemaForResourceComplexLogical;
|
|
178
|
+
"complex-type": TypeSchemaForResourceComplexLogical;
|
|
179
|
+
logical: TypeSchemaForResourceComplexLogical;
|
|
180
|
+
"value-set": TypeSchemaForValueSet;
|
|
181
|
+
binding: TypeSchemaForBinding;
|
|
182
|
+
nested: never;
|
|
183
|
+
};
|
|
184
|
+
export type GetSchemaByKind<K extends SchemaKind> = K extends keyof SchemasByKind ? SchemasByKind[K] : never;
|
|
185
|
+
export type ExtractFieldNames<T extends TypeSchema> = T extends TypeSchemaForResourceComplexLogical ? T["fields"] extends Record<string, any> ? keyof T["fields"] : never : never;
|
|
186
|
+
export type ExtractFieldType<T extends TypeSchema, F extends string> = T extends TypeSchemaForResourceComplexLogical ? T["fields"] extends Record<string, any> ? F extends keyof T["fields"] ? T["fields"][F] : never : never : never;
|
|
187
|
+
//# sourceMappingURL=type-schema.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-schema.types.d.ts","sourceRoot":"","sources":["../../src/typeschema/type-schema.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,WAAW,wBAAwB;IACxC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;CACZ;AAGD,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,gBAAgB,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,SAAS,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,UAAU,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,SAAS,CAAC;CAChB;AAGD,MAAM,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,SAAS,UAAU,IAC/C,CAAC,SAAS,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAG1D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,UAAU,IACjD,CAAC,SAAS,mCAAmC,GAC1C,CAAC,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,MAAM,CAAC,CAAC,QAAQ,CAAC,GACjB,KAAK,GACN,KAAK,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAC3B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,MAAM,IACb,CAAC,SAAS,mCAAmC,GAC9C,CAAC,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,CAAC,SAAS,MAAM,CAAC,CAAC,QAAQ,CAAC,GAC1B,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACd,KAAK,GACN,KAAK,GACN,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handlebars-based template engine implementation
|
|
3
|
-
*/
|
|
4
|
-
import Handlebars from "handlebars";
|
|
5
|
-
import type { CodegenLogger } from "../../../utils/codegen-logger";
|
|
6
|
-
import { type TemplateContext, TemplateEngine, type TemplateOptions } from "./TemplateEngine";
|
|
7
|
-
export interface HandlebarsTemplateEngineOptions {
|
|
8
|
-
logger: CodegenLogger;
|
|
9
|
-
/** Directory containing template files */
|
|
10
|
-
templateDirectory?: string;
|
|
11
|
-
/** Whether to automatically load templates from directory */
|
|
12
|
-
autoLoadTemplates?: boolean;
|
|
13
|
-
/** Custom Handlebars options */
|
|
14
|
-
handlebarsOptions?: Handlebars.RuntimeOptions;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Handlebars template engine implementation
|
|
18
|
-
*/
|
|
19
|
-
export declare class HandlebarsTemplateEngine extends TemplateEngine {
|
|
20
|
-
private readonly handlebars;
|
|
21
|
-
private readonly options;
|
|
22
|
-
constructor(options: HandlebarsTemplateEngineOptions);
|
|
23
|
-
render(templateName: string, context: TemplateContext): Promise<string>;
|
|
24
|
-
registerTemplate(name: string, template: string | Function, options?: TemplateOptions): void;
|
|
25
|
-
loadTemplatesFromDirectory(directory: string): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Get compiled template from cache or templates
|
|
28
|
-
*/
|
|
29
|
-
private getCompiledTemplate;
|
|
30
|
-
/**
|
|
31
|
-
* Setup Handlebars with custom helpers
|
|
32
|
-
*/
|
|
33
|
-
private setupHandlebars;
|
|
34
|
-
/**
|
|
35
|
-
* Discover template files in directory
|
|
36
|
-
*/
|
|
37
|
-
private discoverTemplateFiles;
|
|
38
|
-
/**
|
|
39
|
-
* Check if file is a template file
|
|
40
|
-
*/
|
|
41
|
-
private isTemplateFile;
|
|
42
|
-
/**
|
|
43
|
-
* Load a single template file
|
|
44
|
-
*/
|
|
45
|
-
private loadTemplateFile;
|
|
46
|
-
/**
|
|
47
|
-
* Extract template name from file path
|
|
48
|
-
*/
|
|
49
|
-
private getTemplateNameFromPath;
|
|
50
|
-
/**
|
|
51
|
-
* Find templates with similar names
|
|
52
|
-
*/
|
|
53
|
-
private findSimilarTemplates;
|
|
54
|
-
/**
|
|
55
|
-
* Calculate Levenshtein distance for template suggestions
|
|
56
|
-
*/
|
|
57
|
-
private levenshteinDistance;
|
|
58
|
-
}
|
|
59
|
-
export type { TemplateContext, TemplateOptions } from "./TemplateEngine";
|
|
60
|
-
//# sourceMappingURL=HandlebarsTemplateEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HandlebarsTemplateEngine.d.ts","sourceRoot":"","sources":["../../../../src/api/generators/base/HandlebarsTemplateEngine.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MA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