@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
|
@@ -326,10 +326,10 @@ var init_errors = __esm(() => {
|
|
|
326
326
|
for (let j = 1;j <= str2.length; j++) {
|
|
327
327
|
for (let i = 1;i <= str1.length; i++) {
|
|
328
328
|
const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
|
|
329
|
-
matrix[j][i] = Math.min(matrix[j][i - 1] + 1, matrix[j - 1][i] + 1, matrix[j - 1][i - 1] + indicator);
|
|
329
|
+
matrix[j][i] = Math.min(matrix[j]?.[i - 1] + 1, matrix[j - 1]?.[i] + 1, matrix[j - 1]?.[i - 1] + indicator);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
return matrix[str2.length][str1.length];
|
|
332
|
+
return matrix[str2.length]?.[str1.length];
|
|
333
333
|
}
|
|
334
334
|
isRecoverable() {
|
|
335
335
|
return true;
|
|
@@ -547,7 +547,7 @@ var init_errors = __esm(() => {
|
|
|
547
547
|
if (!errorGroups.has(type)) {
|
|
548
548
|
errorGroups.set(type, []);
|
|
549
549
|
}
|
|
550
|
-
errorGroups.get(type)
|
|
550
|
+
errorGroups.get(type)?.push(error2);
|
|
551
551
|
});
|
|
552
552
|
suggestions.push("");
|
|
553
553
|
suggestions.push("\uD83D\uDD0D Error breakdown:");
|
|
@@ -632,7 +632,7 @@ class FileBuilder {
|
|
|
632
632
|
exports: this.exports,
|
|
633
633
|
filename: this.config.filename
|
|
634
634
|
});
|
|
635
|
-
} catch (
|
|
635
|
+
} catch (_error) {
|
|
636
636
|
throw new TemplateError(`Failed to render template '${templateName}'`, templateName, context, {
|
|
637
637
|
availableTemplates: this.config.templateEngine.getAvailableTemplates?.() || []
|
|
638
638
|
});
|
|
@@ -771,7 +771,7 @@ class FileBuilder {
|
|
|
771
771
|
if (!importsByPath.has(resolvedPath)) {
|
|
772
772
|
importsByPath.set(resolvedPath, []);
|
|
773
773
|
}
|
|
774
|
-
importsByPath.get(resolvedPath)
|
|
774
|
+
importsByPath.get(resolvedPath)?.push(symbol);
|
|
775
775
|
}
|
|
776
776
|
for (const [path9, symbols] of importsByPath) {
|
|
777
777
|
if (symbols.length === 1) {
|
|
@@ -933,7 +933,7 @@ class DirectoryBuilder {
|
|
|
933
933
|
for (const filename of this.files.keys()) {
|
|
934
934
|
files.push(`${this.config.path}/${filename}`);
|
|
935
935
|
}
|
|
936
|
-
for (const [
|
|
936
|
+
for (const [_name, subdir] of this.subdirectories) {
|
|
937
937
|
const subdirFiles = subdir.getFileList();
|
|
938
938
|
files.push(...subdirFiles);
|
|
939
939
|
}
|
|
@@ -1055,7 +1055,7 @@ class IndexBuilder {
|
|
|
1055
1055
|
this.sortFunction = fn;
|
|
1056
1056
|
return this;
|
|
1057
1057
|
}
|
|
1058
|
-
async autoDiscover(
|
|
1058
|
+
async autoDiscover(_filePattern) {
|
|
1059
1059
|
this.config.logger.debug(`Auto-discovering exports in ${this.config.directory}`);
|
|
1060
1060
|
this.config.logger.warn("Auto-discovery not yet implemented - manually add exports");
|
|
1061
1061
|
return this;
|
|
@@ -1106,7 +1106,7 @@ class IndexBuilder {
|
|
|
1106
1106
|
`).replace(/\n{3,}/g, `
|
|
1107
1107
|
|
|
1108
1108
|
`).trim();
|
|
1109
|
-
return content
|
|
1109
|
+
return `${content}
|
|
1110
1110
|
`;
|
|
1111
1111
|
}
|
|
1112
1112
|
generateSimpleExports(lines) {
|
|
@@ -1122,7 +1122,7 @@ class IndexBuilder {
|
|
|
1122
1122
|
if (!exportsByPath.has(fromPath)) {
|
|
1123
1123
|
exportsByPath.set(fromPath, []);
|
|
1124
1124
|
}
|
|
1125
|
-
exportsByPath.get(fromPath)
|
|
1125
|
+
exportsByPath.get(fromPath)?.push(exportName);
|
|
1126
1126
|
}
|
|
1127
1127
|
for (const [path9, exports] of exportsByPath) {
|
|
1128
1128
|
const sortedExports = exports.sort();
|
|
@@ -1153,7 +1153,7 @@ class IndexBuilder {
|
|
|
1153
1153
|
if (!groupMap.has(fromPath)) {
|
|
1154
1154
|
groupMap.set(fromPath, []);
|
|
1155
1155
|
}
|
|
1156
|
-
groupMap.get(fromPath)
|
|
1156
|
+
groupMap.get(fromPath)?.push(exportName);
|
|
1157
1157
|
}
|
|
1158
1158
|
const sortedGroups = Array.from(groups.entries()).sort();
|
|
1159
1159
|
for (const [groupName, groupExports] of sortedGroups) {
|
|
@@ -3887,62 +3887,6 @@ class TypeSchemaGenerator {
|
|
|
3887
3887
|
const match = url.match(/\/([^/]+)$/);
|
|
3888
3888
|
return match ? match[1] ?? null : null;
|
|
3889
3889
|
}
|
|
3890
|
-
extractDependencies(schema) {
|
|
3891
|
-
const dependencies = new Set;
|
|
3892
|
-
if ("dependencies" in schema && schema.dependencies) {
|
|
3893
|
-
for (const dep of schema.dependencies) {
|
|
3894
|
-
dependencies.add(dep.name);
|
|
3895
|
-
}
|
|
3896
|
-
}
|
|
3897
|
-
if ("base" in schema && schema.base && typeof schema.base === "object" && "name" in schema.base && typeof schema.base.name === "string") {
|
|
3898
|
-
dependencies.add(schema.base.name);
|
|
3899
|
-
}
|
|
3900
|
-
if ("fields" in schema && schema.fields) {
|
|
3901
|
-
for (const field of Object.values(schema.fields)) {
|
|
3902
|
-
if (typeof field === "object" && field) {
|
|
3903
|
-
if ("type" in field && field.type && typeof field.type === "object" && "name" in field.type && typeof field.type.name === "string") {
|
|
3904
|
-
dependencies.add(field.type.name);
|
|
3905
|
-
}
|
|
3906
|
-
if ("reference" in field && Array.isArray(field.reference)) {
|
|
3907
|
-
for (const ref of field.reference) {
|
|
3908
|
-
if (typeof ref === "object" && ref && "name" in ref && typeof ref.name === "string") {
|
|
3909
|
-
dependencies.add(ref.name);
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
}
|
|
3913
|
-
if ("binding" in field && field.binding && typeof field.binding === "object" && "name" in field.binding && typeof field.binding.name === "string") {
|
|
3914
|
-
dependencies.add(field.binding.name);
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
}
|
|
3918
|
-
}
|
|
3919
|
-
if ("nested" in schema && Array.isArray(schema.nested)) {
|
|
3920
|
-
for (const nested of schema.nested) {
|
|
3921
|
-
if (typeof nested === "object" && nested) {
|
|
3922
|
-
if ("base" in nested && nested.base && typeof nested.base === "object" && "name" in nested.base && typeof nested.base.name === "string") {
|
|
3923
|
-
dependencies.add(nested.base.name);
|
|
3924
|
-
}
|
|
3925
|
-
if ("fields" in nested && nested.fields && typeof nested.fields === "object") {
|
|
3926
|
-
for (const field of Object.values(nested.fields)) {
|
|
3927
|
-
if (typeof field === "object" && field) {
|
|
3928
|
-
if ("type" in field && field.type && typeof field.type === "object" && "name" in field.type && typeof field.type.name === "string") {
|
|
3929
|
-
dependencies.add(field.type.name);
|
|
3930
|
-
}
|
|
3931
|
-
if ("reference" in field && Array.isArray(field.reference)) {
|
|
3932
|
-
for (const ref of field.reference) {
|
|
3933
|
-
if (typeof ref === "object" && ref && "name" in ref && typeof ref.name === "string") {
|
|
3934
|
-
dependencies.add(ref.name);
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
}
|
|
3938
|
-
}
|
|
3939
|
-
}
|
|
3940
|
-
}
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
}
|
|
3944
|
-
return Array.from(dependencies);
|
|
3945
|
-
}
|
|
3946
3890
|
}
|
|
3947
3891
|
|
|
3948
3892
|
// src/typeschema/parser.ts
|
|
@@ -4599,14 +4543,6 @@ ${mappingLines}
|
|
|
4599
4543
|
break;
|
|
4600
4544
|
}
|
|
4601
4545
|
}
|
|
4602
|
-
generateValueSetUnionTypes() {
|
|
4603
|
-
return `/**
|
|
4604
|
-
* Curated ValueSet unions (string literal types)
|
|
4605
|
-
*/
|
|
4606
|
-
export type PatientGender = 'male' | 'female' | 'other' | 'unknown';
|
|
4607
|
-
export type ObservationStatus = 'registered' | 'preliminary' | 'final' | 'amended' | 'corrected' | 'cancelled' | 'entered-in-error' | 'unknown';
|
|
4608
|
-
export type ImmunizationStatus = 'completed' | 'entered-in-error' | 'not-done';`;
|
|
4609
|
-
}
|
|
4610
4546
|
preprocessEnumTypes() {
|
|
4611
4547
|
this.availableEnumTypes.clear();
|
|
4612
4548
|
for (const [
|
|
@@ -6077,7 +6013,7 @@ export interface FHIRError extends Error {
|
|
|
6077
6013
|
return this.request<void>('DELETE', url, undefined, options);
|
|
6078
6014
|
}`;
|
|
6079
6015
|
}
|
|
6080
|
-
generateValidationCode(
|
|
6016
|
+
generateValidationCode(_operation, resourceVar) {
|
|
6081
6017
|
return `// Client-side validation if enabled
|
|
6082
6018
|
if (this.config.validation?.enabled && this.config.validation?.validateBeforeRequest) {
|
|
6083
6019
|
const validationResult = ResourceValidator.validate(${resourceVar}, {
|
|
@@ -6275,7 +6211,7 @@ class ErrorHandler {
|
|
|
6275
6211
|
this.handleUnknownError(error2);
|
|
6276
6212
|
});
|
|
6277
6213
|
}
|
|
6278
|
-
handleGeneratorError(error2,
|
|
6214
|
+
handleGeneratorError(error2, _context) {
|
|
6279
6215
|
switch (this.options.outputFormat) {
|
|
6280
6216
|
case "json":
|
|
6281
6217
|
this.reportErrorAsJson(error2);
|
|
@@ -6368,7 +6304,7 @@ class ErrorHandler {
|
|
|
6368
6304
|
if (!errorGroups.has(type)) {
|
|
6369
6305
|
errorGroups.set(type, []);
|
|
6370
6306
|
}
|
|
6371
|
-
errorGroups.get(type)
|
|
6307
|
+
errorGroups.get(type)?.push(error2);
|
|
6372
6308
|
});
|
|
6373
6309
|
for (const [type, groupErrors] of errorGroups) {
|
|
6374
6310
|
console.error(`
|
|
@@ -6423,7 +6359,7 @@ class GeneratorErrorBoundary {
|
|
|
6423
6359
|
throw error2;
|
|
6424
6360
|
}
|
|
6425
6361
|
}
|
|
6426
|
-
async withBatchErrorBoundary(operations,
|
|
6362
|
+
async withBatchErrorBoundary(operations, _context) {
|
|
6427
6363
|
const results = [];
|
|
6428
6364
|
const errors = [];
|
|
6429
6365
|
for (const operation of operations) {
|
|
@@ -6453,7 +6389,6 @@ import { dirname as dirname2, join as join11, relative } from "node:path";
|
|
|
6453
6389
|
class FileManager {
|
|
6454
6390
|
options;
|
|
6455
6391
|
logger;
|
|
6456
|
-
pendingOperations = new Map;
|
|
6457
6392
|
constructor(options) {
|
|
6458
6393
|
this.options = {
|
|
6459
6394
|
overwrite: true,
|
|
@@ -6543,7 +6478,7 @@ class FileManager {
|
|
|
6543
6478
|
const to = join11(this.options.outputDir, toFile);
|
|
6544
6479
|
let relativePath = relative(from, to);
|
|
6545
6480
|
if (!relativePath.startsWith(".")) {
|
|
6546
|
-
relativePath =
|
|
6481
|
+
relativePath = `./${relativePath}`;
|
|
6547
6482
|
}
|
|
6548
6483
|
return relativePath.replace(/\.(d\.ts|ts|tsx|js|jsx)$/, "");
|
|
6549
6484
|
}
|
|
@@ -6740,7 +6675,7 @@ class BaseGenerator {
|
|
|
6740
6675
|
if (options.validate !== undefined && typeof options.validate !== "boolean") {
|
|
6741
6676
|
errors.push("validate must be a boolean");
|
|
6742
6677
|
}
|
|
6743
|
-
if (options.outputDir && !__require("path").isAbsolute(options.outputDir)) {
|
|
6678
|
+
if (options.outputDir && !__require("node:path").isAbsolute(options.outputDir)) {
|
|
6744
6679
|
warnings.push("Using relative path for outputDir - consider using absolute path");
|
|
6745
6680
|
suggestions.push("Use path.resolve() to convert to absolute path");
|
|
6746
6681
|
}
|
|
@@ -7267,9 +7202,9 @@ class TypeScriptTypeMapper extends TypeMapper {
|
|
|
7267
7202
|
return `const { ${type.name} } = require('${type.importPath}');`;
|
|
7268
7203
|
}
|
|
7269
7204
|
}
|
|
7270
|
-
getRequiredImports(
|
|
7205
|
+
getRequiredImports(types3) {
|
|
7271
7206
|
const imports = new Set;
|
|
7272
|
-
for (const type of
|
|
7207
|
+
for (const type of types3) {
|
|
7273
7208
|
const importStatement = this.generateImportStatement(type);
|
|
7274
7209
|
if (importStatement) {
|
|
7275
7210
|
imports.add(importStatement);
|
|
@@ -7284,12 +7219,8 @@ function toCamelCase2(str) {
|
|
|
7284
7219
|
|
|
7285
7220
|
// src/api/generators/typescript.ts
|
|
7286
7221
|
class TypeScriptGenerator extends BaseGenerator {
|
|
7287
|
-
enumTypes = new Map;
|
|
7288
7222
|
profilesByPackage = new Map;
|
|
7289
7223
|
resourceTypes = new Set;
|
|
7290
|
-
constructor(options) {
|
|
7291
|
-
super(options);
|
|
7292
|
-
}
|
|
7293
7224
|
get tsOptions() {
|
|
7294
7225
|
return this.options;
|
|
7295
7226
|
}
|
|
@@ -7315,22 +7246,23 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7315
7246
|
if (schema.identifier.kind === "resource") {
|
|
7316
7247
|
this.resourceTypes.add(this.typeMapper.formatTypeName(schema.identifier.name));
|
|
7317
7248
|
}
|
|
7318
|
-
if (schema.identifier.kind === "profile") {
|
|
7319
|
-
const sanitizedPackage = this.sanitizePackageName(schema.identifier.package || "unknown");
|
|
7320
|
-
const profileFileName = this.typeMapper.formatFileName(schema.identifier.name);
|
|
7321
|
-
context.filename = `profiles/${sanitizedPackage}/${profileFileName}`;
|
|
7322
|
-
if (!this.profilesByPackage.has(schema.identifier.package || "unknown")) {
|
|
7323
|
-
this.profilesByPackage.set(schema.identifier.package || "unknown", []);
|
|
7324
|
-
}
|
|
7325
|
-
this.profilesByPackage.get(schema.identifier.package || "unknown").push({
|
|
7326
|
-
filename: profileFileName,
|
|
7327
|
-
interfaceName: this.typeMapper.formatTypeName(schema.identifier.name)
|
|
7328
|
-
});
|
|
7329
|
-
}
|
|
7330
7249
|
if (schema.identifier.name === "Reference") {
|
|
7331
7250
|
return this.generateReferenceInterface(schema);
|
|
7332
7251
|
}
|
|
7333
|
-
|
|
7252
|
+
const mainInterface = this.generateTypeScriptInterface(schema);
|
|
7253
|
+
let nestedInterfaces = "";
|
|
7254
|
+
if ("nested" in schema && schema.nested && Array.isArray(schema.nested)) {
|
|
7255
|
+
const nestedInterfaceStrings = schema.nested.map((nestedType) => this.generateNestedTypeInterface(schema.identifier.name, nestedType));
|
|
7256
|
+
nestedInterfaces = nestedInterfaceStrings.join(`
|
|
7257
|
+
|
|
7258
|
+
`);
|
|
7259
|
+
}
|
|
7260
|
+
if (nestedInterfaces) {
|
|
7261
|
+
return `${mainInterface}
|
|
7262
|
+
|
|
7263
|
+
${nestedInterfaces}`;
|
|
7264
|
+
}
|
|
7265
|
+
return mainInterface;
|
|
7334
7266
|
}
|
|
7335
7267
|
filterAndSortSchemas(schemas) {
|
|
7336
7268
|
return schemas.filter((schema) => !this.shouldSkipSchema(schema));
|
|
@@ -7384,9 +7316,6 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7384
7316
|
if (schema.identifier.kind === "value-set" || schema.identifier.kind === "binding" || schema.identifier.kind === "primitive-type") {
|
|
7385
7317
|
return true;
|
|
7386
7318
|
}
|
|
7387
|
-
if (schema.identifier.kind === "profile" && !this.tsOptions.includeProfiles) {
|
|
7388
|
-
return true;
|
|
7389
|
-
}
|
|
7390
7319
|
if (schema.identifier.url?.includes("/extension/") && !this.tsOptions.includeExtensions) {
|
|
7391
7320
|
return true;
|
|
7392
7321
|
}
|
|
@@ -7396,7 +7325,7 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7396
7325
|
const baseName = this.typeMapper.formatFileName(schema.identifier.name);
|
|
7397
7326
|
return `${baseName}${this.getFileExtension()}`;
|
|
7398
7327
|
}
|
|
7399
|
-
extractImportsFromContent(content,
|
|
7328
|
+
extractImportsFromContent(content, _schema) {
|
|
7400
7329
|
const imports = new Map;
|
|
7401
7330
|
const importRegex = /import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"]([^'"]+)['"];?/g;
|
|
7402
7331
|
let match;
|
|
@@ -7423,97 +7352,9 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7423
7352
|
exports.add(this.typeMapper.formatTypeName(schema.identifier.name));
|
|
7424
7353
|
return exports;
|
|
7425
7354
|
}
|
|
7426
|
-
async generateMainIndexFile(results) {
|
|
7427
|
-
const exportGroups = this.groupExportsByCategory(results);
|
|
7428
|
-
const content = this.generateMainIndexContent(exportGroups);
|
|
7429
|
-
return {
|
|
7430
|
-
path: this.fileManager.getRelativeImportPath("", "index.ts"),
|
|
7431
|
-
filename: "index.ts",
|
|
7432
|
-
content,
|
|
7433
|
-
exports: [],
|
|
7434
|
-
size: Buffer.byteLength(content, "utf-8"),
|
|
7435
|
-
timestamp: new Date
|
|
7436
|
-
};
|
|
7437
|
-
}
|
|
7438
|
-
async generateProfileIndexFiles() {
|
|
7439
|
-
const indexFiles = [];
|
|
7440
|
-
for (const [packageName, profiles] of this.profilesByPackage) {
|
|
7441
|
-
const sanitizedPackage = this.sanitizePackageName(packageName);
|
|
7442
|
-
const filename = `profiles/${sanitizedPackage}/index.ts`;
|
|
7443
|
-
const content = this.generateProfileIndexContent(packageName, profiles);
|
|
7444
|
-
indexFiles.push({
|
|
7445
|
-
path: filename,
|
|
7446
|
-
filename,
|
|
7447
|
-
content,
|
|
7448
|
-
exports: profiles.map((p) => p.interfaceName),
|
|
7449
|
-
size: Buffer.byteLength(content, "utf-8"),
|
|
7450
|
-
timestamp: new Date
|
|
7451
|
-
});
|
|
7452
|
-
}
|
|
7453
|
-
return indexFiles;
|
|
7454
|
-
}
|
|
7455
|
-
formatDescription(description) {
|
|
7456
|
-
if (!description)
|
|
7457
|
-
return "";
|
|
7458
|
-
return description.replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/"/g, "\\\"");
|
|
7459
|
-
}
|
|
7460
|
-
groupExportsByCategory(results) {
|
|
7461
|
-
const groups = {
|
|
7462
|
-
Resources: [],
|
|
7463
|
-
"Complex Types": [],
|
|
7464
|
-
Profiles: [],
|
|
7465
|
-
Extensions: []
|
|
7466
|
-
};
|
|
7467
|
-
for (const result of results) {
|
|
7468
|
-
if (result.filename.includes("profile")) {
|
|
7469
|
-
groups["Profiles"].push(...result.exports || []);
|
|
7470
|
-
} else if (result.filename.includes("extension")) {
|
|
7471
|
-
groups["Extensions"].push(...result.exports || []);
|
|
7472
|
-
} else if (this.isResourceType(result)) {
|
|
7473
|
-
groups["Resources"].push(...result.exports || []);
|
|
7474
|
-
} else {
|
|
7475
|
-
groups["Complex Types"].push(...result.exports || []);
|
|
7476
|
-
}
|
|
7477
|
-
}
|
|
7478
|
-
return Object.fromEntries(Object.entries(groups).filter(([, exports]) => exports.length > 0));
|
|
7479
|
-
}
|
|
7480
|
-
isResourceType(result) {
|
|
7481
|
-
return (result.exports || []).some((exp) => exp.endsWith("Resource") || ["Patient", "Observation", "Practitioner"].includes(exp));
|
|
7482
|
-
}
|
|
7483
7355
|
sanitizePackageName(packageName) {
|
|
7484
7356
|
return packageName.replace(/[^a-zA-Z0-9-_.]/g, "-");
|
|
7485
7357
|
}
|
|
7486
|
-
generateMainIndexContent(exportGroups) {
|
|
7487
|
-
const lines = [];
|
|
7488
|
-
lines.push("// Auto-generated TypeScript FHIR types");
|
|
7489
|
-
lines.push("// Generated by @atomic-ehr/codegen");
|
|
7490
|
-
lines.push("");
|
|
7491
|
-
for (const [category, exports] of Object.entries(exportGroups)) {
|
|
7492
|
-
if (exports.length === 0)
|
|
7493
|
-
continue;
|
|
7494
|
-
lines.push(`// ${category}`);
|
|
7495
|
-
for (const exportName of exports.sort()) {
|
|
7496
|
-
const fileName = this.typeMapper.formatFileName(exportName);
|
|
7497
|
-
lines.push(`export type { ${exportName} } from './${fileName}';`);
|
|
7498
|
-
}
|
|
7499
|
-
lines.push("");
|
|
7500
|
-
}
|
|
7501
|
-
lines.push("// Utilities");
|
|
7502
|
-
lines.push("export type { ResourceType, TypedReference } from './utilities';");
|
|
7503
|
-
return lines.join(`
|
|
7504
|
-
`);
|
|
7505
|
-
}
|
|
7506
|
-
generateProfileIndexContent(packageName, profiles) {
|
|
7507
|
-
const lines = [];
|
|
7508
|
-
lines.push(`// ${packageName} FHIR Profiles`);
|
|
7509
|
-
lines.push("// Generated by @atomic-ehr/codegen");
|
|
7510
|
-
lines.push("");
|
|
7511
|
-
for (const profile of profiles.sort((a, b) => a.interfaceName.localeCompare(b.interfaceName))) {
|
|
7512
|
-
lines.push(`export type { ${profile.interfaceName} } from './${profile.filename}';`);
|
|
7513
|
-
}
|
|
7514
|
-
return lines.join(`
|
|
7515
|
-
`);
|
|
7516
|
-
}
|
|
7517
7358
|
generateReferenceInterface(schema) {
|
|
7518
7359
|
const lines = [];
|
|
7519
7360
|
const imports = new Set;
|
|
@@ -7570,6 +7411,16 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7570
7411
|
importDeps.forEach((imp) => imports.add(imp));
|
|
7571
7412
|
}
|
|
7572
7413
|
}
|
|
7414
|
+
if ("nested" in schema && schema.nested && Array.isArray(schema.nested)) {
|
|
7415
|
+
for (const nestedType of schema.nested) {
|
|
7416
|
+
if (nestedType.fields) {
|
|
7417
|
+
for (const [, field] of Object.entries(nestedType.fields)) {
|
|
7418
|
+
const importDeps = this.collectFieldImports(field);
|
|
7419
|
+
importDeps.forEach((imp) => imports.add(imp));
|
|
7420
|
+
}
|
|
7421
|
+
}
|
|
7422
|
+
}
|
|
7423
|
+
}
|
|
7573
7424
|
if (imports.size > 0) {
|
|
7574
7425
|
const sortedImports = Array.from(imports).sort();
|
|
7575
7426
|
for (const importName of sortedImports) {
|
|
@@ -7607,6 +7458,9 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7607
7458
|
collectFieldImports(field) {
|
|
7608
7459
|
const imports = [];
|
|
7609
7460
|
if ("type" in field && field.type) {
|
|
7461
|
+
if (field.type.kind === "nested") {
|
|
7462
|
+
return imports;
|
|
7463
|
+
}
|
|
7610
7464
|
const languageType = this.typeMapper.mapType(field.type);
|
|
7611
7465
|
if (!languageType.isPrimitive && languageType.name !== "any") {
|
|
7612
7466
|
const builtInTypes = [
|
|
@@ -7641,6 +7495,33 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7641
7495
|
}
|
|
7642
7496
|
return [...new Set(resourceTypes)];
|
|
7643
7497
|
}
|
|
7498
|
+
generateNestedTypeInterface(parentTypeName, nestedType) {
|
|
7499
|
+
const lines = [];
|
|
7500
|
+
const nestedTypeName = this.typeMapper.formatTypeName(`${parentTypeName}${this.capitalizeFirst(nestedType.identifier.name)}`);
|
|
7501
|
+
if (this.tsOptions.includeDocuments && nestedType.description) {
|
|
7502
|
+
lines.push("/**");
|
|
7503
|
+
lines.push(` * ${nestedType.description}`);
|
|
7504
|
+
if (nestedType.identifier.url) {
|
|
7505
|
+
lines.push(` * @see ${nestedType.identifier.url}`);
|
|
7506
|
+
}
|
|
7507
|
+
lines.push(" */");
|
|
7508
|
+
}
|
|
7509
|
+
lines.push(`export interface ${nestedTypeName} {`);
|
|
7510
|
+
if (nestedType.fields) {
|
|
7511
|
+
for (const [fieldName, field] of Object.entries(nestedType.fields)) {
|
|
7512
|
+
const fieldLine = this.generateFieldLine(fieldName, field);
|
|
7513
|
+
if (fieldLine) {
|
|
7514
|
+
lines.push(` ${fieldLine}`);
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
lines.push("}");
|
|
7519
|
+
return lines.join(`
|
|
7520
|
+
`);
|
|
7521
|
+
}
|
|
7522
|
+
capitalizeFirst(str) {
|
|
7523
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
7524
|
+
}
|
|
7644
7525
|
generateFieldLine(fieldName, field) {
|
|
7645
7526
|
let typeString = "any";
|
|
7646
7527
|
let required = false;
|
|
@@ -7648,7 +7529,16 @@ class TypeScriptGenerator extends BaseGenerator {
|
|
|
7648
7529
|
if ("type" in field && field.type) {
|
|
7649
7530
|
const languageType = this.typeMapper.mapType(field.type);
|
|
7650
7531
|
typeString = languageType.name;
|
|
7651
|
-
if (
|
|
7532
|
+
if (field.type.kind === "nested") {
|
|
7533
|
+
const urlParts = field.type.url?.split("#") || [];
|
|
7534
|
+
if (urlParts.length === 2) {
|
|
7535
|
+
const parentName = urlParts[0].split("/").pop() || "";
|
|
7536
|
+
const nestedName = field.type.name;
|
|
7537
|
+
typeString = this.typeMapper.formatTypeName(`${parentName}${this.capitalizeFirst(nestedName)}`);
|
|
7538
|
+
} else {
|
|
7539
|
+
typeString = this.typeMapper.formatTypeName(field.type.name);
|
|
7540
|
+
}
|
|
7541
|
+
} else if (typeString === "Reference" && field.reference && Array.isArray(field.reference)) {
|
|
7652
7542
|
const referenceTypes = this.extractReferenceTypes(field.reference);
|
|
7653
7543
|
if (referenceTypes.length > 0) {
|
|
7654
7544
|
referenceTypes.forEach((type) => this.resourceTypes.add(type));
|
|
@@ -8124,7 +8014,6 @@ var DEFAULT_CONFIG = {
|
|
|
8124
8014
|
treeshake: [],
|
|
8125
8015
|
singleFile: false,
|
|
8126
8016
|
profiles: {
|
|
8127
|
-
packages: [],
|
|
8128
8017
|
autoDetect: true
|
|
8129
8018
|
}
|
|
8130
8019
|
},
|
|
@@ -8533,25 +8422,6 @@ class ConfigValidator {
|
|
|
8533
8422
|
});
|
|
8534
8423
|
} else {
|
|
8535
8424
|
const profiles = cfg.profiles;
|
|
8536
|
-
if (profiles.packages !== undefined) {
|
|
8537
|
-
if (!Array.isArray(profiles.packages)) {
|
|
8538
|
-
errors.push({
|
|
8539
|
-
path: "typeSchema.profiles.packages",
|
|
8540
|
-
message: "packages must be an array",
|
|
8541
|
-
value: profiles.packages
|
|
8542
|
-
});
|
|
8543
|
-
} else {
|
|
8544
|
-
profiles.packages.forEach((pkg, index) => {
|
|
8545
|
-
if (typeof pkg !== "string") {
|
|
8546
|
-
errors.push({
|
|
8547
|
-
path: `typeSchema.profiles.packages[${index}]`,
|
|
8548
|
-
message: "package name must be a string",
|
|
8549
|
-
value: pkg
|
|
8550
|
-
});
|
|
8551
|
-
}
|
|
8552
|
-
});
|
|
8553
|
-
}
|
|
8554
|
-
}
|
|
8555
8425
|
if (profiles.autoDetect !== undefined && typeof profiles.autoDetect !== "boolean") {
|
|
8556
8426
|
errors.push({
|
|
8557
8427
|
path: "typeSchema.profiles.autoDetect",
|
|
@@ -8638,5 +8508,8 @@ function isConfig(obj) {
|
|
|
8638
8508
|
const result = validator.validate(obj);
|
|
8639
8509
|
return result.valid;
|
|
8640
8510
|
}
|
|
8511
|
+
function defineConfig(config) {
|
|
8512
|
+
return config;
|
|
8513
|
+
}
|
|
8641
8514
|
|
|
8642
|
-
export { __toESM, __commonJS, __require, TypeSchemaCache, require_picocolors, success, error, warn, info, step, configure, createLogger, header, complete, list, TypeSchemaGenerator, TypeSchemaParser, RestClientGenerator, TypeScriptGenerator, APIBuilder, createAPI, createAPIFromConfig, generateTypesFromPackage, generateTypesFromFiles, DEFAULT_CONFIG, CONFIG_FILE_NAMES, ConfigValidator, ConfigLoader, configLoader, loadConfig, isConfig };
|
|
8515
|
+
export { __toESM, __commonJS, __require, TypeSchemaCache, require_picocolors, success, error, warn, info, step, configure, createLogger, header, complete, list, TypeSchemaGenerator, TypeSchemaParser, RestClientGenerator, TypeScriptGenerator, APIBuilder, createAPI, createAPIFromConfig, generateTypesFromPackage, generateTypesFromFiles, DEFAULT_CONFIG, CONFIG_FILE_NAMES, ConfigValidator, ConfigLoader, configLoader, loadConfig, isConfig, defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -12,16 +12,18 @@ import {
|
|
|
12
12
|
configLoader,
|
|
13
13
|
createAPI,
|
|
14
14
|
createAPIFromConfig,
|
|
15
|
+
defineConfig,
|
|
15
16
|
generateTypesFromFiles,
|
|
16
17
|
generateTypesFromPackage,
|
|
17
18
|
isConfig,
|
|
18
19
|
loadConfig
|
|
19
|
-
} from "./index-
|
|
20
|
+
} from "./index-fgcebdva.js";
|
|
20
21
|
export {
|
|
21
22
|
loadConfig,
|
|
22
23
|
isConfig,
|
|
23
24
|
generateTypesFromPackage,
|
|
24
25
|
generateTypesFromFiles,
|
|
26
|
+
defineConfig,
|
|
25
27
|
createAPIFromConfig,
|
|
26
28
|
createAPI,
|
|
27
29
|
configLoader,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Caching system for TypeSchema documents with both in-memory and persistent file-based storage.
|
|
5
5
|
*/
|
|
6
6
|
import type { TypeSchemaConfig } from "../config";
|
|
7
|
-
import type { TypeSchema, TypeSchemaIdentifier } from "./types";
|
|
7
|
+
import type { TypeSchema, TypeSchemaIdentifier } from "./type-schema.types";
|
|
8
8
|
/**
|
|
9
9
|
* TypeSchema Cache with optional persistent storage
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/typeschema/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/typeschema/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MA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C1C,MAAM,CAAC,EAAE,gBAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CAI1B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,UAAU,EAAE,oBAAoB,GAC9B,UAAU,GAAG,IAAI,CAEnB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAElE"}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
|
|
7
7
|
import type { FHIRSchema, FHIRSchemaElement } from "@atomic-ehr/fhirschema";
|
|
8
|
-
import type {
|
|
8
|
+
import type { TypeSchema, TypeSchemaField } from "../type-schema.types";
|
|
9
|
+
import type { PackageInfo } from "../types";
|
|
9
10
|
/**
|
|
10
11
|
* Transform elements into fields
|
|
11
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../src/typeschema/core/transformer.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../src/typeschema/core/transformer.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,KAAK,EACX,UAAU,EACV,eAAe,EAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAY5C;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC3C,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAC5C,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAiC1C;AAqOD;;;GAGG;AACH,wBAAsB,mBAAmB,CACxC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAC5C,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC,CAmMvB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAC5C,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC,CASvB"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type FHIRSchema } from "@atomic-ehr/fhirschema";
|
|
8
8
|
import type { TypeSchemaConfig } from "../config";
|
|
9
|
-
import type {
|
|
9
|
+
import type { TypeSchema } from "./type-schema.types";
|
|
10
|
+
import type { PackageInfo, TypeschemaGeneratorOptions } from "./types";
|
|
10
11
|
/**
|
|
11
12
|
* TypeSchema Generator class
|
|
12
13
|
*
|
|
@@ -55,10 +56,6 @@ export declare class TypeSchemaGenerator {
|
|
|
55
56
|
* Extract resource name from FHIR URL
|
|
56
57
|
*/
|
|
57
58
|
private extractResourceNameFromUrl;
|
|
58
|
-
/**
|
|
59
|
-
* Extract dependency names from a TypeSchema
|
|
60
|
-
*/
|
|
61
|
-
private extractDependencies;
|
|
62
59
|
}
|
|
63
60
|
/**
|
|
64
61
|
* Convenience function to generate TypeSchema from a package
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/typeschema/generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACN,KAAK,UAAU,EAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAKlD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/typeschema/generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACN,KAAK,UAAU,EAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAKlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEvE;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,KAAK,CAAgC;IAC7C,OAAO,CAAC,WAAW,CAAC,CAAmB;IACvC,OAAO,CAAC,MAAM,CAAgB;gBAG7B,OAAO,GAAE,0BAA+B,EACxC,WAAW,CAAC,EAAE,gBAAgB;IAkB/B;;OAEG;YACW,eAAe;IAO7B;;OAEG;IACG,mBAAmB,CACxB,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,UAAU,EAAE,CAAC;IAmGxB;;OAEG;IACG,kBAAkB,CACvB,UAAU,EAAE,UAAU,EACtB,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC;IAMxB;;OAEG;IACG,mBAAmB,CACxB,WAAW,EAAE,UAAU,EAAE,EACzB,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC;IA8DxB,OAAO,CAAC,gBAAgB;YAqDV,eAAe;YAIf,iBAAiB;YAMjB,gBAAgB;YAIhB,kBAAkB;IAMhC;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAuG3C;;;OAGG;IACH,OAAO,CAAC,oDAAoD;IAqD5D;;OAEG;IACH,OAAO,CAAC,0BAA0B;CAIlC;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CAClD,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,0BAA+B,GACtC,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CAClD,WAAW,EAAE,UAAU,EAAE,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,OAAO,GAAE,0BAA+B,GACtC,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CACjD,UAAU,EAAE,UAAU,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,OAAO,GAAE,0BAA+B,GACtC,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB"}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* - Reading TypeSchema documents
|
|
10
10
|
* - Validating TypeSchema documents
|
|
11
11
|
*/
|
|
12
|
-
import type { TypeSchema
|
|
12
|
+
import type { TypeSchema } from "./type-schema.types";
|
|
13
|
+
import type { TypeschemaParserOptions } from "./types";
|
|
13
14
|
export { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
|
|
14
15
|
export type { FHIRSchema, FHIRSchemaElement } from "@atomic-ehr/fhirschema";
|
|
15
16
|
export { cacheSchema, clearGlobalCache, getCachedSchema, getGlobalCache, initializeGlobalCache, isCached, TypeSchemaCache, } from "./cache";
|
|
@@ -20,9 +21,9 @@ export { buildNestedTypes, collectNestedElements, extractNestedDependencies, } f
|
|
|
20
21
|
export { transformFHIRSchema, transformFHIRSchemas, } from "./core/transformer";
|
|
21
22
|
export { generateTypeSchemaFromPackage, generateTypeSchemaFromSchema, generateTypeSchemaFromSchemas, TypeSchemaGenerator, } from "./generator";
|
|
22
23
|
export { parseTypeSchemaFromFile, parseTypeSchemaFromFiles, parseTypeSchemaFromString, TypeSchemaParser, } from "./parser";
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export * from "./type-schema.types";
|
|
25
|
+
export type { PackageInfo, TypeschemaGeneratorOptions, TypeschemaParserOptions, } from "./types";
|
|
26
|
+
export { isTypeSchemaBinding, isTypeSchemaForResourceComplexTypeLogical, isTypeSchemaValueSet, } from "./utils";
|
|
26
27
|
export { transformValueSet } from "./value-set/processor";
|
|
27
28
|
/**
|
|
28
29
|
* TypeSchema Core API class
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typeschema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typeschema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,eAAe,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACN,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,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AAO,CAAC,UAAU,EAAE,CAAC;IAYxB;;OAEG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAQjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,GACtD,aAAa,CAEf;AAED;;GAEG;AACH,wBAAsB,iCAAiC,CACtD,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CACjD,UAAU,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/typeschema/parser.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/typeschema/parser.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,OAAO,CAAoC;gBAEvC,OAAO,GAAE,uBAA4B;IASjD;;OAEG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAU5D;;OAEG;IACG,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC;IAkBxB;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC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