@atomic-ehr/codegen 0.0.1-canary.20251006092200.fdb4a88 → 0.0.1-canary.20251006094042.7f0be72
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/cli/index.js +45 -124
- package/dist/index.d.ts +2130 -62
- package/dist/index.js +5865 -84
- package/dist/index.js.map +1 -0
- package/package.json +3 -7
- package/dist/api/builder.d.ts +0 -154
- package/dist/api/builder.js +0 -341
- package/dist/api/generators/base/BaseGenerator.d.ts +0 -186
- package/dist/api/generators/base/BaseGenerator.js +0 -565
- package/dist/api/generators/base/FileManager.d.ts +0 -88
- package/dist/api/generators/base/FileManager.js +0 -202
- package/dist/api/generators/base/PythonTypeMapper.d.ts +0 -16
- package/dist/api/generators/base/PythonTypeMapper.js +0 -71
- package/dist/api/generators/base/TemplateEngine.d.ts +0 -126
- package/dist/api/generators/base/TemplateEngine.js +0 -133
- package/dist/api/generators/base/TypeMapper.d.ts +0 -129
- package/dist/api/generators/base/TypeMapper.js +0 -153
- package/dist/api/generators/base/TypeScriptTypeMapper.d.ts +0 -51
- package/dist/api/generators/base/TypeScriptTypeMapper.js +0 -232
- package/dist/api/generators/base/builders/DirectoryBuilder.d.ts +0 -99
- package/dist/api/generators/base/builders/DirectoryBuilder.js +0 -215
- package/dist/api/generators/base/builders/FileBuilder.d.ts +0 -160
- package/dist/api/generators/base/builders/FileBuilder.js +0 -406
- package/dist/api/generators/base/builders/IndexBuilder.d.ts +0 -126
- package/dist/api/generators/base/builders/IndexBuilder.js +0 -290
- package/dist/api/generators/base/enhanced-errors.d.ts +0 -84
- package/dist/api/generators/base/enhanced-errors.js +0 -259
- package/dist/api/generators/base/error-handler.d.ts +0 -89
- package/dist/api/generators/base/error-handler.js +0 -243
- package/dist/api/generators/base/errors.d.ts +0 -251
- package/dist/api/generators/base/errors.js +0 -692
- package/dist/api/generators/base/index.d.ts +0 -99
- package/dist/api/generators/base/index.js +0 -160
- package/dist/api/generators/base/types.d.ts +0 -433
- package/dist/api/generators/base/types.js +0 -12
- package/dist/api/generators/types.d.ts +0 -53
- package/dist/api/generators/types.js +0 -4
- package/dist/api/generators/typescript.d.ts +0 -190
- package/dist/api/generators/typescript.js +0 -819
- package/dist/api/index.d.ts +0 -51
- package/dist/api/index.js +0 -50
- package/dist/cli/commands/generate/typescript.d.ts +0 -10
- package/dist/cli/commands/generate/typescript.js +0 -52
- package/dist/cli/commands/generate.d.ts +0 -15
- package/dist/cli/commands/generate.js +0 -159
- package/dist/cli/commands/index.d.ts +0 -29
- package/dist/cli/commands/index.js +0 -100
- package/dist/cli/commands/typeschema/generate.d.ts +0 -19
- package/dist/cli/commands/typeschema/generate.js +0 -124
- package/dist/cli/commands/typeschema.d.ts +0 -10
- package/dist/cli/commands/typeschema.js +0 -47
- package/dist/cli/index.d.ts +0 -9
- package/dist/cli/utils/log.d.ts +0 -10
- package/dist/cli/utils/log.js +0 -23
- package/dist/cli/utils/prompts.d.ts +0 -56
- package/dist/cli/utils/prompts.js +0 -202
- package/dist/cli/utils/spinner.d.ts +0 -110
- package/dist/cli/utils/spinner.js +0 -266
- package/dist/config.d.ts +0 -217
- package/dist/config.js +0 -591
- package/dist/logger.d.ts +0 -157
- package/dist/logger.js +0 -281
- package/dist/typeschema/cache.d.ts +0 -80
- package/dist/typeschema/cache.js +0 -239
- package/dist/typeschema/core/binding.d.ts +0 -11
- package/dist/typeschema/core/binding.js +0 -143
- package/dist/typeschema/core/field-builder.d.ts +0 -12
- package/dist/typeschema/core/field-builder.js +0 -123
- package/dist/typeschema/core/identifier.d.ts +0 -13
- package/dist/typeschema/core/identifier.js +0 -94
- package/dist/typeschema/core/nested-types.d.ts +0 -9
- package/dist/typeschema/core/nested-types.js +0 -93
- package/dist/typeschema/core/transformer.d.ts +0 -11
- package/dist/typeschema/core/transformer.js +0 -235
- package/dist/typeschema/generator.d.ts +0 -36
- package/dist/typeschema/generator.js +0 -243
- package/dist/typeschema/index.d.ts +0 -15
- package/dist/typeschema/index.js +0 -15
- package/dist/typeschema/parser.d.ts +0 -79
- package/dist/typeschema/parser.js +0 -274
- package/dist/typeschema/profile/processor.d.ts +0 -14
- package/dist/typeschema/profile/processor.js +0 -261
- package/dist/typeschema/register.d.ts +0 -21
- package/dist/typeschema/register.js +0 -117
- package/dist/typeschema/types.d.ts +0 -240
- package/dist/typeschema/types.js +0 -19
- package/dist/utils/codegen-logger.d.ts +0 -102
- package/dist/utils/codegen-logger.js +0 -196
- package/dist/utils.d.ts +0 -22
- package/dist/utils.js +0 -42
package/dist/config.d.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* New Config Schema for High-Level API
|
|
3
|
-
*
|
|
4
|
-
* Simple configuration system compatible ONLY with the new high-level APIBuilder.
|
|
5
|
-
* All legacy config functionality has been removed.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* TypeScript generator configuration options
|
|
9
|
-
*/
|
|
10
|
-
export interface TypeScriptGeneratorConfig {
|
|
11
|
-
moduleFormat?: "esm" | "cjs";
|
|
12
|
-
generateIndex?: boolean;
|
|
13
|
-
includeDocuments?: boolean;
|
|
14
|
-
namingConvention?: "PascalCase" | "camelCase";
|
|
15
|
-
strictMode?: boolean;
|
|
16
|
-
includeProfiles?: boolean;
|
|
17
|
-
includeExtensions?: boolean;
|
|
18
|
-
includeCodeSystems?: boolean;
|
|
19
|
-
includeOperations?: boolean;
|
|
20
|
-
/** Generate individual TypeScript files for value sets (default: false) */
|
|
21
|
-
generateValueSets?: boolean;
|
|
22
|
-
/** Include helper validation functions in value set files (default: false) */
|
|
23
|
-
includeValueSetHelpers?: boolean;
|
|
24
|
-
/** Which binding strengths to generate value sets for (default: ['required']) */
|
|
25
|
-
valueSetStrengths?: ("required" | "preferred" | "extensible" | "example")[];
|
|
26
|
-
/** Directory name for value set files (relative to outputDir) (default: 'valuesets') */
|
|
27
|
-
valueSetDirectory?: string;
|
|
28
|
-
/** Value set generation mode (default: 'required-only') */
|
|
29
|
-
valueSetMode?: "all" | "required-only" | "custom";
|
|
30
|
-
fhirVersion?: "R4" | "R5";
|
|
31
|
-
resourceTypes?: string[];
|
|
32
|
-
maxDepth?: number;
|
|
33
|
-
profileOptions?: {
|
|
34
|
-
generateKind?: "interface" | "type" | "both";
|
|
35
|
-
includeConstraints?: boolean;
|
|
36
|
-
includeDocumentation?: boolean;
|
|
37
|
-
strictMode?: boolean;
|
|
38
|
-
subfolder?: string;
|
|
39
|
-
};
|
|
40
|
-
generateBuilders?: boolean;
|
|
41
|
-
builderOptions?: {
|
|
42
|
-
includeValidation?: boolean;
|
|
43
|
-
includeFactoryMethods?: boolean;
|
|
44
|
-
includeInterfaces?: boolean;
|
|
45
|
-
generateNestedBuilders?: boolean;
|
|
46
|
-
includeHelperMethods?: boolean;
|
|
47
|
-
supportPartialBuild?: boolean;
|
|
48
|
-
includeJSDoc?: boolean;
|
|
49
|
-
generateFactories?: boolean;
|
|
50
|
-
includeTypeGuards?: boolean;
|
|
51
|
-
handleChoiceTypes?: boolean;
|
|
52
|
-
generateArrayHelpers?: boolean;
|
|
53
|
-
};
|
|
54
|
-
validatorOptions?: {
|
|
55
|
-
includeCardinality?: boolean;
|
|
56
|
-
includeTypes?: boolean;
|
|
57
|
-
includeConstraints?: boolean;
|
|
58
|
-
includeInvariants?: boolean;
|
|
59
|
-
validateRequired?: boolean;
|
|
60
|
-
allowAdditional?: boolean;
|
|
61
|
-
strictValidation?: boolean;
|
|
62
|
-
collectMetrics?: boolean;
|
|
63
|
-
generateAssertions?: boolean;
|
|
64
|
-
generatePartialValidators?: boolean;
|
|
65
|
-
optimizePerformance?: boolean;
|
|
66
|
-
includeJSDoc?: boolean;
|
|
67
|
-
generateCompositeValidators?: boolean;
|
|
68
|
-
};
|
|
69
|
-
guardOptions?: {
|
|
70
|
-
includeRuntimeValidation?: boolean;
|
|
71
|
-
includeErrorMessages?: boolean;
|
|
72
|
-
treeShakeable?: boolean;
|
|
73
|
-
targetTSVersion?: "3.8" | "4.0" | "4.5" | "5.0";
|
|
74
|
-
strictGuards?: boolean;
|
|
75
|
-
includeNullChecks?: boolean;
|
|
76
|
-
verbose?: boolean;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* TypeSchema Configuration
|
|
81
|
-
* Controls TypeSchema generation and caching behavior
|
|
82
|
-
*/
|
|
83
|
-
export interface TypeSchemaConfig {
|
|
84
|
-
/** Enable persistent caching of generated TypeSchemas */
|
|
85
|
-
enablePersistence?: boolean;
|
|
86
|
-
/** Directory to store cached TypeSchemas (relative to outputDir) */
|
|
87
|
-
cacheDir?: string;
|
|
88
|
-
/** Maximum age of cached schemas in milliseconds before regeneration */
|
|
89
|
-
maxAge?: number;
|
|
90
|
-
/** Whether to validate cached schemas before reuse */
|
|
91
|
-
validateCached?: boolean;
|
|
92
|
-
/** Force regeneration of schemas even if cached */
|
|
93
|
-
forceRegenerate?: boolean;
|
|
94
|
-
/** Share cache across multiple codegen runs */
|
|
95
|
-
shareCache?: boolean;
|
|
96
|
-
/** Cache key prefix for namespacing */
|
|
97
|
-
cacheKeyPrefix?: string;
|
|
98
|
-
/** Only generate TypeSchemas for specific ResourceTypes (treeshaking) */
|
|
99
|
-
treeshake?: string[];
|
|
100
|
-
/** Generate single TypeSchema file instead of multiple files */
|
|
101
|
-
singleFile?: boolean;
|
|
102
|
-
/** Profile packages configuration */
|
|
103
|
-
profiles?: {
|
|
104
|
-
/** Auto-detect profiles in packages */
|
|
105
|
-
autoDetect?: boolean;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Main configuration schema for the new high-level API
|
|
110
|
-
*/
|
|
111
|
-
export interface Config {
|
|
112
|
-
outputDir?: string;
|
|
113
|
-
verbose?: boolean;
|
|
114
|
-
overwrite?: boolean;
|
|
115
|
-
validate?: boolean;
|
|
116
|
-
cache?: boolean;
|
|
117
|
-
typescript?: TypeScriptGeneratorConfig;
|
|
118
|
-
typeSchema?: TypeSchemaConfig;
|
|
119
|
-
packages?: string[];
|
|
120
|
-
files?: string[];
|
|
121
|
-
$schema?: string;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Default configuration values
|
|
125
|
-
*/
|
|
126
|
-
export declare const DEFAULT_CONFIG: Required<Config>;
|
|
127
|
-
/**
|
|
128
|
-
* Configuration file names to search for
|
|
129
|
-
*/
|
|
130
|
-
export declare const CONFIG_FILE_NAMES: string[];
|
|
131
|
-
/**
|
|
132
|
-
* Validation error interface
|
|
133
|
-
*/
|
|
134
|
-
export interface ConfigValidationError {
|
|
135
|
-
path: string;
|
|
136
|
-
message: string;
|
|
137
|
-
value?: unknown;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Configuration validation result
|
|
141
|
-
*/
|
|
142
|
-
export interface ConfigValidationResult {
|
|
143
|
-
valid: boolean;
|
|
144
|
-
errors: ConfigValidationError[];
|
|
145
|
-
warnings: string[];
|
|
146
|
-
config?: Config;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Simple configuration validator
|
|
150
|
-
*/
|
|
151
|
-
export declare class ConfigValidator {
|
|
152
|
-
/**
|
|
153
|
-
* Validate a configuration object
|
|
154
|
-
*/
|
|
155
|
-
validate(config: unknown): ConfigValidationResult;
|
|
156
|
-
private validateTypeScriptConfig;
|
|
157
|
-
private validateValidatorOptions;
|
|
158
|
-
private validateGuardOptions;
|
|
159
|
-
private validateProfileOptions;
|
|
160
|
-
private validateTypeSchemaConfig;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Configuration loader with autoloading capabilities
|
|
164
|
-
*/
|
|
165
|
-
export declare class ConfigLoader {
|
|
166
|
-
private validator;
|
|
167
|
-
/**
|
|
168
|
-
* Auto-load configuration from the current working directory
|
|
169
|
-
*/
|
|
170
|
-
autoload(workingDir?: string): Promise<Config>;
|
|
171
|
-
/**
|
|
172
|
-
* Load configuration from a specific file
|
|
173
|
-
*/
|
|
174
|
-
loadFromFile(filePath: string): Promise<Config>;
|
|
175
|
-
/**
|
|
176
|
-
* Find configuration file in the given directory
|
|
177
|
-
*/
|
|
178
|
-
private findConfigFile;
|
|
179
|
-
/**
|
|
180
|
-
* Merge user config with defaults
|
|
181
|
-
*/
|
|
182
|
-
private mergeWithDefaults;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Global config loader instance
|
|
186
|
-
*/
|
|
187
|
-
export declare const configLoader: ConfigLoader;
|
|
188
|
-
/**
|
|
189
|
-
* Convenience function to auto-load configuration
|
|
190
|
-
*/
|
|
191
|
-
export declare function loadConfig(workingDir?: string): Promise<Config>;
|
|
192
|
-
/**
|
|
193
|
-
* Type guard to check if an object is a valid Config
|
|
194
|
-
*/
|
|
195
|
-
export declare function isConfig(obj: unknown): obj is Config;
|
|
196
|
-
/**
|
|
197
|
-
* Define configuration with type safety and IntelliSense support.
|
|
198
|
-
* Similar to Vite's defineConfig function pattern.
|
|
199
|
-
*
|
|
200
|
-
* @example
|
|
201
|
-
* ```typescript
|
|
202
|
-
* import { defineConfig } from "@atomic-ehr/codegen";
|
|
203
|
-
*
|
|
204
|
-
* export default defineConfig({
|
|
205
|
-
* outputDir: "./generated",
|
|
206
|
-
* packages: [
|
|
207
|
-
* "hl7.fhir.r4.core@4.0.1",
|
|
208
|
-
* "hl7.fhir.us.core@6.1.0"
|
|
209
|
-
* ],
|
|
210
|
-
* typescript: {
|
|
211
|
-
* generateIndex: true,
|
|
212
|
-
* strictMode: true
|
|
213
|
-
* }
|
|
214
|
-
* });
|
|
215
|
-
* ```
|
|
216
|
-
*/
|
|
217
|
-
export declare function defineConfig(config: Config): Config;
|