@skmtc/core 0.0.799 → 0.0.802
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/esm/context/CoreContext.d.ts +0 -3
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +12 -17
- package/esm/context/GenerateContext.d.ts +35 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +21 -1
- package/esm/context/ParseContext.d.ts +64 -3
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +61 -0
- package/esm/context/RenderContext.d.ts +151 -2
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +185 -11
- package/esm/context/ResultsHandler.d.ts +10 -3
- package/esm/context/ResultsHandler.d.ts.map +1 -1
- package/esm/context/types.d.ts +30 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.d.ts +1 -1
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts +62 -0
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +63 -1
- package/esm/dsl/model/toModelBase.d.ts +66 -0
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.js +46 -0
- package/esm/dsl/model/toModelEntry.d.ts +63 -0
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.js +63 -0
- package/esm/dsl/model/types.d.ts +51 -4
- package/esm/dsl/model/types.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.d.ts +3 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.d.ts +48 -0
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +49 -1
- package/esm/dsl/operation/types.d.ts +61 -3
- package/esm/dsl/operation/types.d.ts.map +1 -1
- package/esm/helpers/isEmpty.d.ts +1 -1
- package/esm/helpers/isEmpty.d.ts.map +1 -1
- package/esm/helpers/tracer.d.ts +1 -1
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +1 -1
- package/esm/mod.d.ts +51 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +51 -0
- package/esm/oas/array/array-types.d.ts +20 -11
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +10 -0
- package/esm/oas/array/toArray.d.ts +111 -0
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +115 -3
- package/esm/oas/boolean/boolean-types.d.ts +1 -7
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/components/components-types.d.ts +19 -0
- package/esm/oas/components/components-types.d.ts.map +1 -0
- package/esm/oas/components/components-types.js +21 -0
- package/esm/oas/contact/contact-types.d.ts +9 -0
- package/esm/oas/contact/contact-types.d.ts.map +1 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/esm/oas/discriminator/discriminator-types.d.ts +1 -5
- package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/esm/oas/document/document-types.d.ts +16 -0
- package/esm/oas/document/document-types.d.ts.map +1 -0
- package/esm/oas/document/document-types.js +18 -0
- package/esm/oas/example/example-types.d.ts +1 -6
- package/esm/oas/example/example-types.d.ts.map +1 -1
- package/esm/oas/header/header-types.d.ts +50 -0
- package/esm/oas/header/header-types.d.ts.map +1 -0
- package/esm/oas/header/header-types.js +30 -0
- package/esm/oas/info/info-types.d.ts +14 -0
- package/esm/oas/info/info-types.d.ts.map +1 -0
- package/esm/oas/info/info-types.js +13 -0
- package/esm/oas/integer/integer-types.d.ts +3 -17
- package/esm/oas/integer/integer-types.d.ts.map +1 -1
- package/esm/oas/license/license-types.d.ts +9 -0
- package/esm/oas/license/license-types.d.ts.map +1 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/mediaType/mediaType-types.d.ts +1 -11
- package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/esm/oas/number/number-types.d.ts +2 -16
- package/esm/oas/number/number-types.d.ts.map +1 -1
- package/esm/oas/operation/Operation.d.ts +47 -2
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +43 -0
- package/esm/oas/operation/operation-types.d.ts +22 -0
- package/esm/oas/operation/operation-types.d.ts.map +1 -0
- package/esm/oas/operation/operation-types.js +35 -0
- package/esm/oas/parameter/parameter-types.d.ts +3 -58
- package/esm/oas/parameter/parameter-types.d.ts.map +1 -1
- package/esm/oas/pathItem/pathItem-types.d.ts +12 -0
- package/esm/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/esm/oas/pathItem/pathItem-types.js +12 -0
- package/esm/oas/ref/Ref.d.ts +49 -2
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +28 -0
- package/esm/oas/requestBody/requestBody-types.d.ts +10 -0
- package/esm/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/esm/oas/requestBody/requestBody-types.js +9 -0
- package/esm/oas/response/response-types.d.ts +12 -0
- package/esm/oas/response/response-types.d.ts.map +1 -0
- package/esm/oas/response/response-types.js +11 -0
- package/esm/oas/schema/toSchemasV3.js +2 -2
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/string/string-types.d.ts +2 -29
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/toString.d.ts +125 -1
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +119 -0
- package/esm/oas/tag/tag-types.d.ts +8 -0
- package/esm/oas/tag/tag-types.d.ts.map +1 -0
- package/esm/oas/tag/tag-types.js +8 -0
- package/esm/oas/union/union-types.d.ts +1 -12
- package/esm/oas/union/union-types.d.ts.map +1 -1
- package/esm/oas/unknown/unknown-types.d.ts +1 -7
- package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
- package/esm/types/Preview.d.ts +37 -0
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +37 -0
- package/esm/types/Settings.d.ts +35 -0
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +27 -0
- package/esm/typescript/FunctionParameter.d.ts +4 -4
- package/esm/typescript/FunctionParameter.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +104 -5
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +75 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +0 -3
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +12 -17
- package/script/context/GenerateContext.d.ts +35 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +21 -1
- package/script/context/ParseContext.d.ts +64 -3
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +61 -0
- package/script/context/RenderContext.d.ts +151 -2
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +185 -11
- package/script/context/ResultsHandler.d.ts +10 -3
- package/script/context/ResultsHandler.d.ts.map +1 -1
- package/script/context/types.d.ts +30 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.d.ts +1 -1
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts +62 -0
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +63 -1
- package/script/dsl/model/toModelBase.d.ts +66 -0
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.js +46 -0
- package/script/dsl/model/toModelEntry.d.ts +63 -0
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.js +63 -0
- package/script/dsl/model/types.d.ts +51 -4
- package/script/dsl/model/types.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.d.ts +3 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.d.ts +48 -0
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +49 -1
- package/script/dsl/operation/types.d.ts +61 -3
- package/script/dsl/operation/types.d.ts.map +1 -1
- package/script/helpers/isEmpty.d.ts +1 -1
- package/script/helpers/isEmpty.d.ts.map +1 -1
- package/script/helpers/tracer.d.ts +1 -1
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +1 -1
- package/script/mod.d.ts +51 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +51 -0
- package/script/oas/array/array-types.d.ts +20 -11
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +11 -1
- package/script/oas/array/toArray.d.ts +111 -0
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +114 -2
- package/script/oas/boolean/boolean-types.d.ts +1 -7
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/components/components-types.d.ts +19 -0
- package/script/oas/components/components-types.d.ts.map +1 -0
- package/script/oas/components/components-types.js +57 -0
- package/script/oas/contact/contact-types.d.ts +9 -0
- package/script/oas/contact/contact-types.d.ts.map +1 -0
- package/script/oas/contact/contact-types.js +43 -0
- package/script/oas/discriminator/discriminator-types.d.ts +1 -5
- package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/script/oas/document/document-types.d.ts +16 -0
- package/script/oas/document/document-types.d.ts.map +1 -0
- package/script/oas/document/document-types.js +54 -0
- package/script/oas/example/example-types.d.ts +1 -6
- package/script/oas/example/example-types.d.ts.map +1 -1
- package/script/oas/header/header-types.d.ts +50 -0
- package/script/oas/header/header-types.d.ts.map +1 -0
- package/script/oas/header/header-types.js +66 -0
- package/script/oas/info/info-types.d.ts +14 -0
- package/script/oas/info/info-types.d.ts.map +1 -0
- package/script/oas/info/info-types.js +49 -0
- package/script/oas/integer/integer-types.d.ts +3 -17
- package/script/oas/integer/integer-types.d.ts.map +1 -1
- package/script/oas/license/license-types.d.ts +9 -0
- package/script/oas/license/license-types.d.ts.map +1 -0
- package/script/oas/license/license-types.js +43 -0
- package/script/oas/mediaType/mediaType-types.d.ts +1 -11
- package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/script/oas/number/number-types.d.ts +2 -16
- package/script/oas/number/number-types.d.ts.map +1 -1
- package/script/oas/operation/Operation.d.ts +47 -2
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +43 -0
- package/script/oas/operation/operation-types.d.ts +22 -0
- package/script/oas/operation/operation-types.d.ts.map +1 -0
- package/script/oas/operation/operation-types.js +71 -0
- package/script/oas/parameter/parameter-types.d.ts +3 -58
- package/script/oas/parameter/parameter-types.d.ts.map +1 -1
- package/script/oas/pathItem/pathItem-types.d.ts +12 -0
- package/script/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/script/oas/pathItem/pathItem-types.js +48 -0
- package/script/oas/ref/Ref.d.ts +49 -2
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +28 -0
- package/script/oas/requestBody/requestBody-types.d.ts +10 -0
- package/script/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/script/oas/requestBody/requestBody-types.js +45 -0
- package/script/oas/response/response-types.d.ts +12 -0
- package/script/oas/response/response-types.d.ts.map +1 -0
- package/script/oas/response/response-types.js +47 -0
- package/script/oas/schema/toSchemasV3.js +2 -2
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/string/string-types.d.ts +2 -29
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/toString.d.ts +125 -1
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +119 -0
- package/script/oas/tag/tag-types.d.ts +8 -0
- package/script/oas/tag/tag-types.d.ts.map +1 -0
- package/script/oas/tag/tag-types.js +44 -0
- package/script/oas/union/union-types.d.ts +1 -12
- package/script/oas/union/union-types.d.ts.map +1 -1
- package/script/oas/unknown/unknown-types.d.ts +1 -7
- package/script/oas/unknown/unknown-types.d.ts.map +1 -1
- package/script/types/Preview.d.ts +37 -0
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +37 -0
- package/script/types/Settings.d.ts +35 -0
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +27 -0
- package/script/typescript/FunctionParameter.d.ts +4 -4
- package/script/typescript/FunctionParameter.d.ts.map +1 -1
- package/script/typescript/List.d.ts +104 -5
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +75 -0
|
@@ -13,18 +13,80 @@ type CreateModelArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
13
13
|
rootRef?: RefName;
|
|
14
14
|
noExport?: boolean;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Driver class responsible for managing model generation lifecycle.
|
|
18
|
+
*
|
|
19
|
+
* @template V - The generated value type
|
|
20
|
+
* @template T - The generation type
|
|
21
|
+
* @template EnrichmentType - Optional enrichment type
|
|
22
|
+
*/
|
|
16
23
|
export declare class ModelDriver<V extends GeneratedValue, T extends GenerationType, EnrichmentType> {
|
|
24
|
+
/** The generation context */
|
|
17
25
|
context: GenerateContext;
|
|
26
|
+
/** The insertable model configuration */
|
|
18
27
|
insertable: ModelInsertable<V, EnrichmentType>;
|
|
28
|
+
/** Reference name for the model */
|
|
19
29
|
refName: RefName;
|
|
30
|
+
/** Content settings for the model */
|
|
20
31
|
settings: ContentSettings<EnrichmentType>;
|
|
32
|
+
/** Optional destination path for the generated file */
|
|
21
33
|
destinationPath?: string;
|
|
34
|
+
/** The generated definition */
|
|
22
35
|
definition: GeneratedDefinition<V, T>;
|
|
36
|
+
/** Optional root reference name */
|
|
23
37
|
rootRef?: RefName;
|
|
38
|
+
/** Whether to skip export declaration */
|
|
24
39
|
noExport?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new ModelDriver instance.
|
|
42
|
+
*
|
|
43
|
+
* @param args - Constructor arguments
|
|
44
|
+
* @param args.context - Generation context
|
|
45
|
+
* @param args.insertable - Model insertable configuration
|
|
46
|
+
* @param args.refName - Reference name for the model
|
|
47
|
+
* @param args.generation - Optional generation type
|
|
48
|
+
* @param args.destinationPath - Optional destination path
|
|
49
|
+
* @param args.rootRef - Optional root reference name
|
|
50
|
+
* @param args.noExport - Whether to skip export declaration
|
|
51
|
+
*/
|
|
25
52
|
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }: CreateModelArgs<V, T, EnrichmentType>);
|
|
53
|
+
/**
|
|
54
|
+
* Applies generation configuration to create the model definition.
|
|
55
|
+
*
|
|
56
|
+
* This method handles the core generation logic, including identifier resolution,
|
|
57
|
+
* export path management, and import registration for cross-file dependencies.
|
|
58
|
+
*
|
|
59
|
+
* @template T - The generation type
|
|
60
|
+
* @param args - Apply configuration arguments
|
|
61
|
+
* @param args.generation - Optional generation type (unused currently)
|
|
62
|
+
* @param args.destinationPath - Optional destination path for imports
|
|
63
|
+
* @returns Generated definition for the model
|
|
64
|
+
*/
|
|
26
65
|
private apply;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves or creates a definition for the model.
|
|
68
|
+
*
|
|
69
|
+
* This method first checks for cached definitions to avoid duplicate generation,
|
|
70
|
+
* then creates a new definition if none exists. It handles the complete model
|
|
71
|
+
* transformation process including schema resolution and value generation.
|
|
72
|
+
*
|
|
73
|
+
* @param args - Definition retrieval arguments
|
|
74
|
+
* @param args.identifier - The identifier for the definition
|
|
75
|
+
* @param args.exportPath - The export path for the definition
|
|
76
|
+
* @returns Model definition instance
|
|
77
|
+
*/
|
|
27
78
|
private getDefinition;
|
|
79
|
+
/**
|
|
80
|
+
* Type guard to verify a definition matches the expected generated value type.
|
|
81
|
+
*
|
|
82
|
+
* This method performs type narrowing to ensure a cached definition is compatible
|
|
83
|
+
* with the current generation requirements, including export path validation.
|
|
84
|
+
*
|
|
85
|
+
* @template V - The expected generated value type
|
|
86
|
+
* @param definition - The definition to verify (may be undefined)
|
|
87
|
+
* @param exportPath - Expected export path for validation
|
|
88
|
+
* @returns True if definition matches expected type and constraints
|
|
89
|
+
*/
|
|
28
90
|
private affirmDefinition;
|
|
29
91
|
}
|
|
30
92
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAGrD,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc,IAAI;IACzF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAYD,qBAAa,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc;IACzF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,QA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C,CAAA;IAC9C,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,qCAAqC;IACrC,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+BAA+B;IAC/B,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrC,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;OAWG;gBACS,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACT,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAgBxC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,KAAK;IAuBb;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;IA2CrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -1,50 +1,77 @@
|
|
|
1
1
|
import { normalize } from '../../deps/jsr.io/@std/path/1.1.2/normalize.js';
|
|
2
2
|
import { Definition } from '../Definition.js';
|
|
3
3
|
import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
4
|
+
/**
|
|
5
|
+
* Driver class responsible for managing model generation lifecycle.
|
|
6
|
+
*
|
|
7
|
+
* @template V - The generated value type
|
|
8
|
+
* @template T - The generation type
|
|
9
|
+
* @template EnrichmentType - Optional enrichment type
|
|
10
|
+
*/
|
|
4
11
|
export class ModelDriver {
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new ModelDriver instance.
|
|
14
|
+
*
|
|
15
|
+
* @param args - Constructor arguments
|
|
16
|
+
* @param args.context - Generation context
|
|
17
|
+
* @param args.insertable - Model insertable configuration
|
|
18
|
+
* @param args.refName - Reference name for the model
|
|
19
|
+
* @param args.generation - Optional generation type
|
|
20
|
+
* @param args.destinationPath - Optional destination path
|
|
21
|
+
* @param args.rootRef - Optional root reference name
|
|
22
|
+
* @param args.noExport - Whether to skip export declaration
|
|
23
|
+
*/
|
|
5
24
|
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }) {
|
|
25
|
+
/** The generation context */
|
|
6
26
|
Object.defineProperty(this, "context", {
|
|
7
27
|
enumerable: true,
|
|
8
28
|
configurable: true,
|
|
9
29
|
writable: true,
|
|
10
30
|
value: void 0
|
|
11
31
|
});
|
|
32
|
+
/** The insertable model configuration */
|
|
12
33
|
Object.defineProperty(this, "insertable", {
|
|
13
34
|
enumerable: true,
|
|
14
35
|
configurable: true,
|
|
15
36
|
writable: true,
|
|
16
37
|
value: void 0
|
|
17
38
|
});
|
|
39
|
+
/** Reference name for the model */
|
|
18
40
|
Object.defineProperty(this, "refName", {
|
|
19
41
|
enumerable: true,
|
|
20
42
|
configurable: true,
|
|
21
43
|
writable: true,
|
|
22
44
|
value: void 0
|
|
23
45
|
});
|
|
46
|
+
/** Content settings for the model */
|
|
24
47
|
Object.defineProperty(this, "settings", {
|
|
25
48
|
enumerable: true,
|
|
26
49
|
configurable: true,
|
|
27
50
|
writable: true,
|
|
28
51
|
value: void 0
|
|
29
52
|
});
|
|
53
|
+
/** Optional destination path for the generated file */
|
|
30
54
|
Object.defineProperty(this, "destinationPath", {
|
|
31
55
|
enumerable: true,
|
|
32
56
|
configurable: true,
|
|
33
57
|
writable: true,
|
|
34
58
|
value: void 0
|
|
35
59
|
});
|
|
60
|
+
/** The generated definition */
|
|
36
61
|
Object.defineProperty(this, "definition", {
|
|
37
62
|
enumerable: true,
|
|
38
63
|
configurable: true,
|
|
39
64
|
writable: true,
|
|
40
65
|
value: void 0
|
|
41
66
|
});
|
|
67
|
+
/** Optional root reference name */
|
|
42
68
|
Object.defineProperty(this, "rootRef", {
|
|
43
69
|
enumerable: true,
|
|
44
70
|
configurable: true,
|
|
45
71
|
writable: true,
|
|
46
72
|
value: void 0
|
|
47
73
|
});
|
|
74
|
+
/** Whether to skip export declaration */
|
|
48
75
|
Object.defineProperty(this, "noExport", {
|
|
49
76
|
enumerable: true,
|
|
50
77
|
configurable: true,
|
|
@@ -62,7 +89,19 @@ export class ModelDriver {
|
|
|
62
89
|
this.definition = this.apply({ generation, destinationPath });
|
|
63
90
|
this.context.modelDepth[`${insertable.id}:${refName}`] = 0;
|
|
64
91
|
}
|
|
65
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Applies generation configuration to create the model definition.
|
|
94
|
+
*
|
|
95
|
+
* This method handles the core generation logic, including identifier resolution,
|
|
96
|
+
* export path management, and import registration for cross-file dependencies.
|
|
97
|
+
*
|
|
98
|
+
* @template T - The generation type
|
|
99
|
+
* @param args - Apply configuration arguments
|
|
100
|
+
* @param args.generation - Optional generation type (unused currently)
|
|
101
|
+
* @param args.destinationPath - Optional destination path for imports
|
|
102
|
+
* @returns Generated definition for the model
|
|
103
|
+
*/
|
|
104
|
+
apply({ generation: _generation, destinationPath } = {}) {
|
|
66
105
|
const { identifier, exportPath } = this.settings;
|
|
67
106
|
// Everything is selected (for now)
|
|
68
107
|
// if (/*!selected && */ generation !== 'force') {
|
|
@@ -77,6 +116,18 @@ export class ModelDriver {
|
|
|
77
116
|
}
|
|
78
117
|
return definition;
|
|
79
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Retrieves or creates a definition for the model.
|
|
121
|
+
*
|
|
122
|
+
* This method first checks for cached definitions to avoid duplicate generation,
|
|
123
|
+
* then creates a new definition if none exists. It handles the complete model
|
|
124
|
+
* transformation process including schema resolution and value generation.
|
|
125
|
+
*
|
|
126
|
+
* @param args - Definition retrieval arguments
|
|
127
|
+
* @param args.identifier - The identifier for the definition
|
|
128
|
+
* @param args.exportPath - The export path for the definition
|
|
129
|
+
* @returns Model definition instance
|
|
130
|
+
*/
|
|
80
131
|
getDefinition({ identifier, exportPath }) {
|
|
81
132
|
const cachedDefinition = this.context.findDefinition({
|
|
82
133
|
name: identifier.name,
|
|
@@ -112,6 +163,17 @@ export class ModelDriver {
|
|
|
112
163
|
});
|
|
113
164
|
return definition;
|
|
114
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Type guard to verify a definition matches the expected generated value type.
|
|
168
|
+
*
|
|
169
|
+
* This method performs type narrowing to ensure a cached definition is compatible
|
|
170
|
+
* with the current generation requirements, including export path validation.
|
|
171
|
+
*
|
|
172
|
+
* @template V - The expected generated value type
|
|
173
|
+
* @param definition - The definition to verify (may be undefined)
|
|
174
|
+
* @param exportPath - Expected export path for validation
|
|
175
|
+
* @returns True if definition matches expected type and constraints
|
|
176
|
+
*/
|
|
115
177
|
affirmDefinition(definition, exportPath) {
|
|
116
178
|
if (!definition) {
|
|
117
179
|
return false;
|
|
@@ -4,16 +4,82 @@ import type { ContentSettings } from '../ContentSettings.js';
|
|
|
4
4
|
import { ModelBase } from './ModelBase.js';
|
|
5
5
|
import type { Identifier } from '../Identifier.js';
|
|
6
6
|
import * as v from 'valibot';
|
|
7
|
+
/**
|
|
8
|
+
* Arguments for creating a model insertable instance.
|
|
9
|
+
*
|
|
10
|
+
* @template EnrichmentType - Type of enrichments to apply to the model
|
|
11
|
+
*/
|
|
7
12
|
export type ModelInsertableArgs<EnrichmentType = undefined> = {
|
|
13
|
+
/** The generation context providing access to OAS objects and utilities */
|
|
8
14
|
context: GenerateContext;
|
|
15
|
+
/** Content settings for customizing model generation behavior */
|
|
9
16
|
settings: ContentSettings<EnrichmentType>;
|
|
17
|
+
/** Reference name identifying the model schema */
|
|
10
18
|
refName: RefName;
|
|
11
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for creating a base model class.
|
|
22
|
+
*
|
|
23
|
+
* Defines the structure and behavior for model generators, including
|
|
24
|
+
* identifier generation, export path resolution, and enrichment schemas.
|
|
25
|
+
*
|
|
26
|
+
* @template EnrichmentType - Type of enrichments to apply to generated models
|
|
27
|
+
*/
|
|
12
28
|
export type BaseModelConfig<EnrichmentType = undefined> = {
|
|
29
|
+
/** Unique identifier for the model generator */
|
|
13
30
|
id: string;
|
|
31
|
+
/** Function to generate identifiers from reference names */
|
|
14
32
|
toIdentifier: (refName: RefName) => Identifier;
|
|
33
|
+
/** Function to generate export paths from reference names */
|
|
15
34
|
toExportPath: (refName: RefName) => string;
|
|
35
|
+
/** Optional function to provide enrichment validation schema */
|
|
16
36
|
toEnrichmentSchema?: () => v.BaseSchema<EnrichmentType, EnrichmentType, v.BaseIssue<unknown>>;
|
|
17
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Creates a base model class constructor for generating type-safe model artifacts.
|
|
40
|
+
*
|
|
41
|
+
* This factory function creates a specialized ModelBase class that implements
|
|
42
|
+
* the provided configuration for identifier generation, export paths, and
|
|
43
|
+
* enrichment handling. The resulting class can be instantiated to generate
|
|
44
|
+
* model artifacts from OpenAPI schemas.
|
|
45
|
+
*
|
|
46
|
+
* @template EnrichmentType - Type of enrichments to apply to generated models
|
|
47
|
+
* @param config - Configuration defining the model generation behavior
|
|
48
|
+
* @returns Constructor function for creating model instances
|
|
49
|
+
*
|
|
50
|
+
* @example Creating a TypeScript interface generator
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { toModelBase } from '@skmtc/core';
|
|
53
|
+
*
|
|
54
|
+
* const TypeScriptModelBase = toModelBase({
|
|
55
|
+
* id: 'typescript-interfaces',
|
|
56
|
+
* toIdentifier: (refName) => new Identifier(pascalCase(refName)),
|
|
57
|
+
* toExportPath: (refName) => `./models/${kebabCase(refName)}.ts`,
|
|
58
|
+
* toEnrichmentSchema: () => v.object({
|
|
59
|
+
* includeValidation: v.optional(v.boolean()),
|
|
60
|
+
* readonly: v.optional(v.boolean())
|
|
61
|
+
* })
|
|
62
|
+
* });
|
|
63
|
+
*
|
|
64
|
+
* class TypeScriptModelGenerator extends TypeScriptModelBase {
|
|
65
|
+
* generate() {
|
|
66
|
+
* const enrichments = this.enrichments;
|
|
67
|
+
* const interface = generateInterface(this.schema, {
|
|
68
|
+
* readonly: enrichments?.readonly ?? false
|
|
69
|
+
* });
|
|
70
|
+
* this.register({ file: this.createFile(interface) });
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example Creating a validation schema generator
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const ValidationModelBase = toModelBase({
|
|
78
|
+
* id: 'zod-schemas',
|
|
79
|
+
* toIdentifier: (refName) => new Identifier(`${pascalCase(refName)}Schema`),
|
|
80
|
+
* toExportPath: (refName) => `./schemas/${kebabCase(refName)}.schema.ts`
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
18
84
|
export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModelConfig<EnrichmentType>) => new (args: ModelInsertableArgs<EnrichmentType>) => ModelBase<EnrichmentType>;
|
|
19
85
|
//# sourceMappingURL=toModelBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAOD,MAAM,MAAM,eAAe,CAAC,cAAc,GAAG,SAAS,IA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AAM,CAAA;IACV,4DAA4D;IAC5D,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,UAAU,CAAA;IAC9C,6DAA6D;IAC7D,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC1C,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,GAAI,cAAc,GAAG,SAAS,EACpD,QAAQ,eAAe,CAAC,cAAc,CAAC,KACtC,KAAK,IAAI,EAAE,mBAAmB,CAAC,cAAc,CAAC,KAAK,SAAS,CAAC,cAAc,CA0B7E,CAAA"}
|
|
@@ -2,6 +2,52 @@ import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
|
2
2
|
import { ModelBase } from './ModelBase.js';
|
|
3
3
|
import * as v from 'valibot';
|
|
4
4
|
import { get } from 'lodash-es';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a base model class constructor for generating type-safe model artifacts.
|
|
7
|
+
*
|
|
8
|
+
* This factory function creates a specialized ModelBase class that implements
|
|
9
|
+
* the provided configuration for identifier generation, export paths, and
|
|
10
|
+
* enrichment handling. The resulting class can be instantiated to generate
|
|
11
|
+
* model artifacts from OpenAPI schemas.
|
|
12
|
+
*
|
|
13
|
+
* @template EnrichmentType - Type of enrichments to apply to generated models
|
|
14
|
+
* @param config - Configuration defining the model generation behavior
|
|
15
|
+
* @returns Constructor function for creating model instances
|
|
16
|
+
*
|
|
17
|
+
* @example Creating a TypeScript interface generator
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { toModelBase } from '@skmtc/core';
|
|
20
|
+
*
|
|
21
|
+
* const TypeScriptModelBase = toModelBase({
|
|
22
|
+
* id: 'typescript-interfaces',
|
|
23
|
+
* toIdentifier: (refName) => new Identifier(pascalCase(refName)),
|
|
24
|
+
* toExportPath: (refName) => `./models/${kebabCase(refName)}.ts`,
|
|
25
|
+
* toEnrichmentSchema: () => v.object({
|
|
26
|
+
* includeValidation: v.optional(v.boolean()),
|
|
27
|
+
* readonly: v.optional(v.boolean())
|
|
28
|
+
* })
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* class TypeScriptModelGenerator extends TypeScriptModelBase {
|
|
32
|
+
* generate() {
|
|
33
|
+
* const enrichments = this.enrichments;
|
|
34
|
+
* const interface = generateInterface(this.schema, {
|
|
35
|
+
* readonly: enrichments?.readonly ?? false
|
|
36
|
+
* });
|
|
37
|
+
* this.register({ file: this.createFile(interface) });
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Creating a validation schema generator
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const ValidationModelBase = toModelBase({
|
|
45
|
+
* id: 'zod-schemas',
|
|
46
|
+
* toIdentifier: (refName) => new Identifier(`${pascalCase(refName)}Schema`),
|
|
47
|
+
* toExportPath: (refName) => `./schemas/${kebabCase(refName)}.schema.ts`
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
5
51
|
export const toModelBase = (config) => {
|
|
6
52
|
var _a;
|
|
7
53
|
return _a = class extends ModelBase {
|
|
@@ -11,6 +11,69 @@ type ToModelEntryArgs<EnrichmentType = undefined, Acc = void> = {
|
|
|
11
11
|
toMappingModule?: ({ context, refName }: ToModelMappingArgs) => MappingModule;
|
|
12
12
|
toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(refName: RefName) => EnrichmentRequest<RequestedEnrichment> | undefined;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Creates a model transformation entry for the SKMTC pipeline.
|
|
16
|
+
*
|
|
17
|
+
* This function creates a standardized model entry that defines how to transform
|
|
18
|
+
* OpenAPI schema objects into model artifacts. Model entries are used by the
|
|
19
|
+
* generation pipeline to process schemas and create output files.
|
|
20
|
+
*
|
|
21
|
+
* The resulting entry includes transformation logic, preview generation,
|
|
22
|
+
* mapping generation, enrichment handling, and schema validation.
|
|
23
|
+
*
|
|
24
|
+
* @template EnrichmentType - Type of enrichments that can be applied to models
|
|
25
|
+
* @template Acc - Accumulator type for the transformation process
|
|
26
|
+
* @param args - Configuration for the model entry
|
|
27
|
+
* @param args.id - Unique identifier for this model entry
|
|
28
|
+
* @param args.transform - Function to transform schemas into artifacts
|
|
29
|
+
* @param args.toPreviewModule - Optional function to generate preview modules
|
|
30
|
+
* @param args.toMappingModule - Optional function to generate mapping modules
|
|
31
|
+
* @param args.toEnrichmentSchema - Optional function to provide enrichment validation
|
|
32
|
+
* @param args.toEnrichmentRequest - Optional function to request enrichments
|
|
33
|
+
* @returns Model entry object for use in the generation pipeline
|
|
34
|
+
*
|
|
35
|
+
* @example Basic model entry
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import { toModelEntry } from '@skmtc/core';
|
|
38
|
+
*
|
|
39
|
+
* const typeScriptModelEntry = toModelEntry({
|
|
40
|
+
* id: 'typescript-models',
|
|
41
|
+
* transform: ({ context, refName, acc }) => {
|
|
42
|
+
* const schema = context.getSchemaByRefName(refName);
|
|
43
|
+
* const tsInterface = generateTypeScriptInterface(schema);
|
|
44
|
+
* return { ...acc, [refName]: tsInterface };
|
|
45
|
+
* },
|
|
46
|
+
* toPreviewModule: ({ context, refName }) => ({
|
|
47
|
+
* group: 'forms',
|
|
48
|
+
* title: `${refName} Model`,
|
|
49
|
+
* description: 'Generated TypeScript interface'
|
|
50
|
+
* })
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example Model entry with enrichments
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const validationModelEntry = toModelEntry({
|
|
57
|
+
* id: 'validation-schemas',
|
|
58
|
+
* transform: ({ context, refName, acc }) => {
|
|
59
|
+
* const enrichments = context.getEnrichments(refName);
|
|
60
|
+
* const schema = context.getSchemaByRefName(refName);
|
|
61
|
+
* const validationSchema = generateValidationSchema(schema, {
|
|
62
|
+
* strict: enrichments?.strict ?? false
|
|
63
|
+
* });
|
|
64
|
+
* return { ...acc, [refName]: validationSchema };
|
|
65
|
+
* },
|
|
66
|
+
* toEnrichmentSchema: () => v.object({
|
|
67
|
+
* strict: v.optional(v.boolean()),
|
|
68
|
+
* nullable: v.optional(v.boolean())
|
|
69
|
+
* }),
|
|
70
|
+
* toEnrichmentRequest: (refName) => ({
|
|
71
|
+
* path: `models.${refName}`,
|
|
72
|
+
* schema: enrichmentSchema
|
|
73
|
+
* })
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
14
77
|
export declare const toModelEntry: <EnrichmentType = undefined, Acc = void>({ id, transform, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest }: ToModelEntryArgs<EnrichmentType, Acc>) => {
|
|
15
78
|
id: string;
|
|
16
79
|
type: "model";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelEntry.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAClG,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE1E,KAAK,gBAAgB,CAAC,cAAc,GAAG,SAAS,EAAE,GAAG,GAAG,IAAI,IAAI;IAC9D,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,CAAC,EAAE,OAAO,E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AE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,kBAAkB,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;IACvE,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,wBAAwB,KAAK,aAAa,CAAC;IACpF,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB,KAAK,aAAa,CAAC;IAC9E,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAC3D,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,OAAO,EAAE,OAAO,KACb,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;CAWzD,CAAA"}
|
|
@@ -1,3 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a model transformation entry for the SKMTC pipeline.
|
|
3
|
+
*
|
|
4
|
+
* This function creates a standardized model entry that defines how to transform
|
|
5
|
+
* OpenAPI schema objects into model artifacts. Model entries are used by the
|
|
6
|
+
* generation pipeline to process schemas and create output files.
|
|
7
|
+
*
|
|
8
|
+
* The resulting entry includes transformation logic, preview generation,
|
|
9
|
+
* mapping generation, enrichment handling, and schema validation.
|
|
10
|
+
*
|
|
11
|
+
* @template EnrichmentType - Type of enrichments that can be applied to models
|
|
12
|
+
* @template Acc - Accumulator type for the transformation process
|
|
13
|
+
* @param args - Configuration for the model entry
|
|
14
|
+
* @param args.id - Unique identifier for this model entry
|
|
15
|
+
* @param args.transform - Function to transform schemas into artifacts
|
|
16
|
+
* @param args.toPreviewModule - Optional function to generate preview modules
|
|
17
|
+
* @param args.toMappingModule - Optional function to generate mapping modules
|
|
18
|
+
* @param args.toEnrichmentSchema - Optional function to provide enrichment validation
|
|
19
|
+
* @param args.toEnrichmentRequest - Optional function to request enrichments
|
|
20
|
+
* @returns Model entry object for use in the generation pipeline
|
|
21
|
+
*
|
|
22
|
+
* @example Basic model entry
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { toModelEntry } from '@skmtc/core';
|
|
25
|
+
*
|
|
26
|
+
* const typeScriptModelEntry = toModelEntry({
|
|
27
|
+
* id: 'typescript-models',
|
|
28
|
+
* transform: ({ context, refName, acc }) => {
|
|
29
|
+
* const schema = context.getSchemaByRefName(refName);
|
|
30
|
+
* const tsInterface = generateTypeScriptInterface(schema);
|
|
31
|
+
* return { ...acc, [refName]: tsInterface };
|
|
32
|
+
* },
|
|
33
|
+
* toPreviewModule: ({ context, refName }) => ({
|
|
34
|
+
* group: 'forms',
|
|
35
|
+
* title: `${refName} Model`,
|
|
36
|
+
* description: 'Generated TypeScript interface'
|
|
37
|
+
* })
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Model entry with enrichments
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const validationModelEntry = toModelEntry({
|
|
44
|
+
* id: 'validation-schemas',
|
|
45
|
+
* transform: ({ context, refName, acc }) => {
|
|
46
|
+
* const enrichments = context.getEnrichments(refName);
|
|
47
|
+
* const schema = context.getSchemaByRefName(refName);
|
|
48
|
+
* const validationSchema = generateValidationSchema(schema, {
|
|
49
|
+
* strict: enrichments?.strict ?? false
|
|
50
|
+
* });
|
|
51
|
+
* return { ...acc, [refName]: validationSchema };
|
|
52
|
+
* },
|
|
53
|
+
* toEnrichmentSchema: () => v.object({
|
|
54
|
+
* strict: v.optional(v.boolean()),
|
|
55
|
+
* nullable: v.optional(v.boolean())
|
|
56
|
+
* }),
|
|
57
|
+
* toEnrichmentRequest: (refName) => ({
|
|
58
|
+
* path: `models.${refName}`,
|
|
59
|
+
* schema: enrichmentSchema
|
|
60
|
+
* })
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
1
64
|
export const toModelEntry = ({ id, transform, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest }) => {
|
|
2
65
|
return {
|
|
3
66
|
id,
|
package/esm/dsl/model/types.d.ts
CHANGED
|
@@ -6,33 +6,73 @@ import type { EnrichmentRequest } from '../../types/EnrichmentRequest.js';
|
|
|
6
6
|
import type * as v from 'valibot';
|
|
7
7
|
import type { MappingModule, PreviewModule } from '../../types/Preview.js';
|
|
8
8
|
import type { SchemaToValueFn } from '../../types/TypeSystem.js';
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Constructor arguments for model insertable instances.
|
|
11
|
+
*
|
|
12
|
+
* @template EnrichmentType - Optional enrichment data type for additional metadata
|
|
13
|
+
*/
|
|
14
|
+
export type ModelInsertableConstructorArgs<EnrichmentType = undefined> = {
|
|
10
15
|
context: GenerateContext;
|
|
11
16
|
refName: RefName;
|
|
12
17
|
settings: ContentSettings<EnrichmentType>;
|
|
13
18
|
destinationPath: string;
|
|
14
19
|
rootRef?: RefName;
|
|
15
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Interface for objects that provide model transformation capabilities.
|
|
23
|
+
*
|
|
24
|
+
* Used by generator configurations to transform model definitions
|
|
25
|
+
* during the code generation process.
|
|
26
|
+
*/
|
|
16
27
|
export type WithTransformModel = {
|
|
17
28
|
transformModel: (refName: RefName) => void;
|
|
18
29
|
};
|
|
19
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Arguments for generating enrichment data for models.
|
|
32
|
+
*/
|
|
33
|
+
export type ModelToEnrichmentsArgs = {
|
|
20
34
|
refName: RefName;
|
|
21
35
|
context: GenerateContext;
|
|
22
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Arguments passed to model transformation functions.
|
|
39
|
+
*
|
|
40
|
+
* @template Acc - Accumulator type for collecting transformation results
|
|
41
|
+
*/
|
|
23
42
|
export type TransformModelArgs<Acc> = {
|
|
24
43
|
context: GenerateContext;
|
|
25
44
|
refName: RefName;
|
|
26
45
|
acc: Acc | undefined;
|
|
27
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Arguments for generating model preview modules.
|
|
49
|
+
*
|
|
50
|
+
* Preview modules provide quick insights into generated models
|
|
51
|
+
* without full code generation.
|
|
52
|
+
*/
|
|
28
53
|
export type ToModelPreviewModuleArgs = {
|
|
29
54
|
context: GenerateContext;
|
|
30
55
|
refName: RefName;
|
|
31
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Arguments for generating model mapping information.
|
|
59
|
+
*
|
|
60
|
+
* Mappings track relationships between OAS schemas and generated models,
|
|
61
|
+
* enabling cross-references and dependency analysis.
|
|
62
|
+
*/
|
|
32
63
|
export type ToModelMappingArgs = {
|
|
33
64
|
context: GenerateContext;
|
|
34
65
|
refName: RefName;
|
|
35
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Configuration object for insertable model generators.
|
|
69
|
+
*
|
|
70
|
+
* Defines the contract for model generator classes that can be inserted
|
|
71
|
+
* into the generation context to produce type-safe model definitions.
|
|
72
|
+
*
|
|
73
|
+
* @template V - Generated value type produced by the model generator
|
|
74
|
+
* @template EnrichmentType - Optional enrichment data type for additional metadata
|
|
75
|
+
*/
|
|
36
76
|
export type ModelInsertable<V, EnrichmentType = undefined> = {
|
|
37
77
|
prototype: V;
|
|
38
78
|
} & {
|
|
@@ -41,10 +81,18 @@ export type ModelInsertable<V, EnrichmentType = undefined> = {
|
|
|
41
81
|
type: 'model';
|
|
42
82
|
toIdentifier: (refName: RefName) => Identifier;
|
|
43
83
|
toExportPath: (refName: RefName) => string;
|
|
44
|
-
toEnrichments: ({ refName, context }:
|
|
84
|
+
toEnrichments: ({ refName, context }: ModelToEnrichmentsArgs) => EnrichmentType;
|
|
45
85
|
schemaToValueFn: SchemaToValueFn;
|
|
46
86
|
createIdentifier: (name: string) => Identifier;
|
|
47
87
|
} & Function;
|
|
88
|
+
/**
|
|
89
|
+
* Configuration object for model generators.
|
|
90
|
+
*
|
|
91
|
+
* Defines the behavior and capabilities of model generators including
|
|
92
|
+
* transformation logic, preview generation, and enrichment handling.
|
|
93
|
+
*
|
|
94
|
+
* @template EnrichmentType - Optional enrichment data type for additional metadata
|
|
95
|
+
*/
|
|
48
96
|
export type ModelConfig<EnrichmentType = undefined> = {
|
|
49
97
|
id: string;
|
|
50
98
|
type: 'model';
|
|
@@ -54,5 +102,4 @@ export type ModelConfig<EnrichmentType = undefined> = {
|
|
|
54
102
|
toEnrichmentSchema?: () => v.BaseSchema<EnrichmentType, EnrichmentType, v.BaseIssue<unknown>>;
|
|
55
103
|
toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(refName: RefName) => EnrichmentRequest<RequestedEnrichment> | undefined;
|
|
56
104
|
};
|
|
57
|
-
export {};
|
|
58
105
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAu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,OAAO,CAAC,CAAC,CAAA;IAC7F,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,OAAO,EAAE,OAAO,KACb,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;CACxD,CAAA"}
|
|
@@ -9,9 +9,9 @@ import type { Definition } from '../Definition.js';
|
|
|
9
9
|
import type { Inserted } from '../Inserted.js';
|
|
10
10
|
import type { ModelInsertable } from '../model/types.js';
|
|
11
11
|
import type { RefName } from '../../types/RefName.js';
|
|
12
|
-
import { OasSchema } from '../../oas/schema/Schema.js';
|
|
13
|
-
import { OasRef } from '../../oas/ref/Ref.js';
|
|
14
|
-
import { OasVoid } from '../../oas/void/Void.js';
|
|
12
|
+
import type { OasSchema } from '../../oas/schema/Schema.js';
|
|
13
|
+
import type { OasRef } from '../../oas/ref/Ref.js';
|
|
14
|
+
import type { OasVoid } from '../../oas/void/Void.js';
|
|
15
15
|
/**
|
|
16
16
|
* Constructor arguments for {@link OperationBase}.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA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