@skmtc/core 0.0.931 → 0.0.933
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/GenerateContext.d.ts +5 -210
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +0 -52
- package/esm/context/RenderContext.d.ts +1 -1
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/types.d.ts +179 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/ContentBase.d.ts +2 -2
- package/esm/dsl/ContentBase.d.ts.map +1 -1
- package/esm/dsl/ContentSettings.d.ts +1 -1
- package/esm/dsl/ContentSettings.js +1 -1
- package/esm/dsl/Definition.d.ts +1 -1
- package/esm/dsl/Definition.d.ts.map +1 -1
- package/esm/{types → dsl}/GeneratedValue.d.ts +2 -2
- package/esm/dsl/GeneratedValue.d.ts.map +1 -0
- package/esm/dsl/GeneratedValueList.d.ts +1 -1
- package/esm/dsl/GeneratedValueList.d.ts.map +1 -1
- package/{script/types → esm/dsl}/GeneratorKeys.d.ts +3 -3
- package/esm/dsl/GeneratorKeys.d.ts.map +1 -0
- package/esm/{types → dsl}/GeneratorKeys.js +2 -4
- package/esm/dsl/Inserted.d.ts +1 -84
- package/esm/dsl/Inserted.d.ts.map +1 -1
- package/esm/dsl/Inserted.js +0 -83
- package/esm/dsl/JsonFile.d.ts +0 -80
- package/esm/dsl/JsonFile.d.ts.map +1 -1
- package/esm/dsl/JsonFile.js +0 -80
- package/esm/dsl/Stringable.d.ts +0 -67
- package/esm/dsl/Stringable.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.d.ts +4 -3
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts +2 -2
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +1 -1
- package/esm/dsl/model/toModelBase.d.ts +3 -3
- package/esm/dsl/model/toModelBase.js +1 -1
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.d.ts +4 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.d.ts +2 -2
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +1 -1
- package/esm/dsl/operation/toOperationBase.d.ts +5 -5
- package/esm/dsl/operation/toOperationBase.js +1 -1
- package/esm/mod.d.ts +2 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -2
- package/esm/types/CustomValue.d.ts +1 -1
- package/esm/types/CustomValue.d.ts.map +1 -1
- package/esm/types/TypeSystem.d.ts +1 -1
- package/esm/types/TypeSystem.d.ts.map +1 -1
- package/esm/typescript/ReactRouterPathParams.d.ts +1 -1
- package/esm/typescript/ReactRouterPathParams.d.ts.map +1 -1
- package/package.json +3 -3
- package/script/context/GenerateContext.d.ts +5 -210
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +0 -52
- package/script/context/RenderContext.d.ts +1 -1
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/types.d.ts +179 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/ContentBase.d.ts +2 -2
- package/script/dsl/ContentBase.d.ts.map +1 -1
- package/script/dsl/ContentSettings.d.ts +1 -1
- package/script/dsl/ContentSettings.js +1 -1
- package/script/dsl/Definition.d.ts +1 -1
- package/script/dsl/Definition.d.ts.map +1 -1
- package/script/{types → dsl}/GeneratedValue.d.ts +2 -2
- package/script/dsl/GeneratedValue.d.ts.map +1 -0
- package/script/dsl/GeneratedValueList.d.ts +1 -1
- package/script/dsl/GeneratedValueList.d.ts.map +1 -1
- package/{esm/types → script/dsl}/GeneratorKeys.d.ts +3 -3
- package/script/dsl/GeneratorKeys.d.ts.map +1 -0
- package/script/{types → dsl}/GeneratorKeys.js +2 -4
- package/script/dsl/Inserted.d.ts +1 -84
- package/script/dsl/Inserted.d.ts.map +1 -1
- package/script/dsl/Inserted.js +0 -83
- package/script/dsl/JsonFile.d.ts +0 -80
- package/script/dsl/JsonFile.d.ts.map +1 -1
- package/script/dsl/JsonFile.js +0 -80
- package/script/dsl/Stringable.d.ts +0 -67
- package/script/dsl/Stringable.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.d.ts +4 -3
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts +2 -2
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +1 -1
- package/script/dsl/model/toModelBase.d.ts +3 -3
- package/script/dsl/model/toModelBase.js +1 -1
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.d.ts +4 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.d.ts +2 -2
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +1 -1
- package/script/dsl/operation/toOperationBase.d.ts +5 -5
- package/script/dsl/operation/toOperationBase.js +1 -1
- package/script/mod.d.ts +2 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -2
- package/script/types/CustomValue.d.ts +1 -1
- package/script/types/CustomValue.d.ts.map +1 -1
- package/script/types/TypeSystem.d.ts +1 -1
- package/script/types/TypeSystem.d.ts.map +1 -1
- package/script/typescript/ReactRouterPathParams.d.ts +1 -1
- package/script/typescript/ReactRouterPathParams.d.ts.map +1 -1
- package/esm/types/GeneratedValue.d.ts.map +0 -1
- package/esm/types/GeneratorKeys.d.ts.map +0 -1
- package/script/types/GeneratedValue.d.ts.map +0 -1
- package/script/types/GeneratorKeys.d.ts.map +0 -1
- /package/esm/{types → dsl}/GeneratedValue.js +0 -0
- /package/script/{types → dsl}/GeneratedValue.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Definition } from '
|
|
2
|
-
import type { Stringable } from '
|
|
1
|
+
import type { Definition } from './Definition.js';
|
|
2
|
+
import type { Stringable } from './Stringable.js';
|
|
3
3
|
import type { GeneratorKey } from './GeneratorKeys.js';
|
|
4
4
|
/**
|
|
5
5
|
* 'force' - will generate content even it is not selected.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratedValue.d.ts","sourceRoot":"","sources":["../../src/dsl/GeneratedValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;GASG;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc,IACtB,CAAC,SAAS,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratedValueList.d.ts","sourceRoot":"","sources":["../../src/dsl/GeneratedValueList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GeneratedValueList.d.ts","sourceRoot":"","sources":["../../src/dsl/GeneratedValueList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AACH,qBAAa,kBAAkB;IAC7B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IAEjB,yCAAyC;IACzC,OAAO,CAAC,KAAK,CAAuB;IAEpC;;;;;;;;;;;;;;;;OAgBG;gBACS,SAAS,EAAE,MAAM;IAI7B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAI9B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,IAAI,MAAM;CAMnB"}
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
* @module GeneratorKeys
|
|
64
64
|
*/
|
|
65
65
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
66
|
-
import type { Brand } from '
|
|
67
|
-
import type { RefName } from '
|
|
68
|
-
import { type Method } from '
|
|
66
|
+
import type { Brand } from '../types/Brand.js';
|
|
67
|
+
import type { RefName } from '../types/RefName.js';
|
|
68
|
+
import { type Method } from '../types/Method.js';
|
|
69
69
|
/**
|
|
70
70
|
* Template literal type for operation generator keys before branding.
|
|
71
71
|
* Format: `generatorId|path|method` (e.g., 'api-client|/users|get')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorKeys.d.ts","sourceRoot":"","sources":["../../src/dsl/GeneratorKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,oBAAoB,CAAA;AAE1D;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAA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;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,gBAAgB,GAAI,cAAc,YAAY,KAAG,kBAY7D,CAAA"}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
*
|
|
63
63
|
* @module GeneratorKeys
|
|
64
64
|
*/
|
|
65
|
-
import { isMethod } from '
|
|
65
|
+
import { isMethod } from '../types/Method.js';
|
|
66
66
|
/**
|
|
67
67
|
* Creates an operation generator key from generator ID and operation details.
|
|
68
68
|
*
|
|
@@ -178,9 +178,7 @@ export const toGeneratorOnlyKey = ({ generatorId }) => {
|
|
|
178
178
|
* ```
|
|
179
179
|
*/
|
|
180
180
|
export const isGeneratorKey = (arg) => {
|
|
181
|
-
return
|
|
182
|
-
isOperationGeneratorKey(arg) ||
|
|
183
|
-
isGeneratorOnlyKey(arg));
|
|
181
|
+
return isModelGeneratorKey(arg) || isOperationGeneratorKey(arg) || isGeneratorOnlyKey(arg);
|
|
184
182
|
};
|
|
185
183
|
/**
|
|
186
184
|
* Type guard to check if a value is a valid OperationGeneratorKey.
|
package/esm/dsl/Inserted.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeneratedDefinition, GeneratedValue, GenerationType } from '
|
|
1
|
+
import type { GeneratedDefinition, GeneratedValue, GenerationType } from './GeneratedValue.js';
|
|
2
2
|
import type { ContentSettings } from './ContentSettings.js';
|
|
3
3
|
import type { Identifier } from './Identifier.js';
|
|
4
4
|
/**
|
|
@@ -65,89 +65,6 @@ type ConstructorArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
65
65
|
* }
|
|
66
66
|
* }
|
|
67
67
|
* ```
|
|
68
|
-
*
|
|
69
|
-
* @example Working with lazy generation
|
|
70
|
-
* ```typescript
|
|
71
|
-
* class ConditionalGenerator extends ModelBase {
|
|
72
|
-
* generate(): Definition {
|
|
73
|
-
* // Insert with lazy generation (may not generate if already exists)
|
|
74
|
-
* const optionalModel = this.insertModel(
|
|
75
|
-
* new OptionalModelGenerator({ ... }),
|
|
76
|
-
* 'OptionalModel',
|
|
77
|
-
* { generation: 'lazy' }
|
|
78
|
-
* ); // Returns Inserted<OptionalValue, 'lazy', EnrichmentType>
|
|
79
|
-
*
|
|
80
|
-
* // Value might be undefined with lazy generation
|
|
81
|
-
* const value = optionalModel.toValue(); // OptionalValue | undefined
|
|
82
|
-
*
|
|
83
|
-
* if (value) {
|
|
84
|
-
* // Use the generated value
|
|
85
|
-
* return this.createDefinitionWith(value);
|
|
86
|
-
* } else {
|
|
87
|
-
* // Handle case where generation was skipped
|
|
88
|
-
* return this.createFallbackDefinition();
|
|
89
|
-
* }
|
|
90
|
-
* }
|
|
91
|
-
* }
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* @example Accessing insertion metadata
|
|
95
|
-
* ```typescript
|
|
96
|
-
* class MetadataAwareGenerator extends OperationBase {
|
|
97
|
-
* generate(): Definition {
|
|
98
|
-
* const requestModel = this.insertModel(
|
|
99
|
-
* new RequestModelGenerator({ ... }),
|
|
100
|
-
* 'CreateUserRequest'
|
|
101
|
-
* );
|
|
102
|
-
*
|
|
103
|
-
* // Access various metadata
|
|
104
|
-
* const modelName = requestModel.toName(); // 'CreateUserRequest'
|
|
105
|
-
* const identifier = requestModel.toIdentifier(); // Full Identifier object
|
|
106
|
-
* const exportPath = requestModel.toExportPath(); // './src/api/types.ts'
|
|
107
|
-
* const enrichments = requestModel.settings.enrichments; // Custom data
|
|
108
|
-
*
|
|
109
|
-
* console.log(`Generated ${modelName} in ${exportPath}`);
|
|
110
|
-
*
|
|
111
|
-
* return new Definition({
|
|
112
|
-
* identifier: Identifier.createVariable(this.operation.operationId!),
|
|
113
|
-
* value: {
|
|
114
|
-
* generatorKey: this.generatorKey,
|
|
115
|
-
* content: `async function createUser(data: ${modelName}) { ... }`
|
|
116
|
-
* }
|
|
117
|
-
* });
|
|
118
|
-
* }
|
|
119
|
-
* }
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* @example With enrichment data
|
|
123
|
-
* ```typescript
|
|
124
|
-
* type ValidationEnrichment = {
|
|
125
|
-
* validators: string[];
|
|
126
|
-
* required: boolean;
|
|
127
|
-
* };
|
|
128
|
-
*
|
|
129
|
-
* class EnrichedGenerator extends ModelBase<ValidationEnrichment> {
|
|
130
|
-
* generate(): Definition {
|
|
131
|
-
* const validatedModel = this.insertModel(
|
|
132
|
-
* new ValidatedModelGenerator({ ... }),
|
|
133
|
-
* 'ValidatedUser'
|
|
134
|
-
* ); // Returns Inserted<ModelValue, 'force', ValidationEnrichment>
|
|
135
|
-
*
|
|
136
|
-
* // Access enrichment data
|
|
137
|
-
* const enrichment = validatedModel.settings.enrichments;
|
|
138
|
-
* const validators = enrichment?.validators ?? [];
|
|
139
|
-
* const isRequired = enrichment?.required ?? false;
|
|
140
|
-
*
|
|
141
|
-
* return new Definition({
|
|
142
|
-
* identifier: Identifier.createType(this.refName),
|
|
143
|
-
* value: {
|
|
144
|
-
* generatorKey: this.generatorKey,
|
|
145
|
-
* content: this.generateWithValidation(validatedModel.toValue(), validators)
|
|
146
|
-
* }
|
|
147
|
-
* });
|
|
148
|
-
* }
|
|
149
|
-
* }
|
|
150
|
-
* ```
|
|
151
68
|
*/
|
|
152
69
|
export declare class Inserted<V extends GeneratedValue, T extends GenerationType, EnrichmentType> {
|
|
153
70
|
/** Content settings including identifier and export path */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inserted.d.ts","sourceRoot":"","sources":["../../src/dsl/Inserted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Inserted.d.ts","sourceRoot":"","sources":["../../src/dsl/Inserted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;GAMG;AACH,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc,IAAI;IACzF,4DAA4D;IAC5D,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,8CAA8C;IAC9C,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CACtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc;IACtF,4DAA4D;IAC5D,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IAEzC,8CAA8C;IAC9C,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAErC;;;;;;OAMG;gBACS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAK3E;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,IAAI,MAAM;IAIhB;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,IAAI,UAAU;IAI1B;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,IAAI,MAAM;IAItB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,OAAO,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS;CAGjD"}
|
package/esm/dsl/Inserted.js
CHANGED
|
@@ -49,89 +49,6 @@
|
|
|
49
49
|
* }
|
|
50
50
|
* }
|
|
51
51
|
* ```
|
|
52
|
-
*
|
|
53
|
-
* @example Working with lazy generation
|
|
54
|
-
* ```typescript
|
|
55
|
-
* class ConditionalGenerator extends ModelBase {
|
|
56
|
-
* generate(): Definition {
|
|
57
|
-
* // Insert with lazy generation (may not generate if already exists)
|
|
58
|
-
* const optionalModel = this.insertModel(
|
|
59
|
-
* new OptionalModelGenerator({ ... }),
|
|
60
|
-
* 'OptionalModel',
|
|
61
|
-
* { generation: 'lazy' }
|
|
62
|
-
* ); // Returns Inserted<OptionalValue, 'lazy', EnrichmentType>
|
|
63
|
-
*
|
|
64
|
-
* // Value might be undefined with lazy generation
|
|
65
|
-
* const value = optionalModel.toValue(); // OptionalValue | undefined
|
|
66
|
-
*
|
|
67
|
-
* if (value) {
|
|
68
|
-
* // Use the generated value
|
|
69
|
-
* return this.createDefinitionWith(value);
|
|
70
|
-
* } else {
|
|
71
|
-
* // Handle case where generation was skipped
|
|
72
|
-
* return this.createFallbackDefinition();
|
|
73
|
-
* }
|
|
74
|
-
* }
|
|
75
|
-
* }
|
|
76
|
-
* ```
|
|
77
|
-
*
|
|
78
|
-
* @example Accessing insertion metadata
|
|
79
|
-
* ```typescript
|
|
80
|
-
* class MetadataAwareGenerator extends OperationBase {
|
|
81
|
-
* generate(): Definition {
|
|
82
|
-
* const requestModel = this.insertModel(
|
|
83
|
-
* new RequestModelGenerator({ ... }),
|
|
84
|
-
* 'CreateUserRequest'
|
|
85
|
-
* );
|
|
86
|
-
*
|
|
87
|
-
* // Access various metadata
|
|
88
|
-
* const modelName = requestModel.toName(); // 'CreateUserRequest'
|
|
89
|
-
* const identifier = requestModel.toIdentifier(); // Full Identifier object
|
|
90
|
-
* const exportPath = requestModel.toExportPath(); // './src/api/types.ts'
|
|
91
|
-
* const enrichments = requestModel.settings.enrichments; // Custom data
|
|
92
|
-
*
|
|
93
|
-
* console.log(`Generated ${modelName} in ${exportPath}`);
|
|
94
|
-
*
|
|
95
|
-
* return new Definition({
|
|
96
|
-
* identifier: Identifier.createVariable(this.operation.operationId!),
|
|
97
|
-
* value: {
|
|
98
|
-
* generatorKey: this.generatorKey,
|
|
99
|
-
* content: `async function createUser(data: ${modelName}) { ... }`
|
|
100
|
-
* }
|
|
101
|
-
* });
|
|
102
|
-
* }
|
|
103
|
-
* }
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* @example With enrichment data
|
|
107
|
-
* ```typescript
|
|
108
|
-
* type ValidationEnrichment = {
|
|
109
|
-
* validators: string[];
|
|
110
|
-
* required: boolean;
|
|
111
|
-
* };
|
|
112
|
-
*
|
|
113
|
-
* class EnrichedGenerator extends ModelBase<ValidationEnrichment> {
|
|
114
|
-
* generate(): Definition {
|
|
115
|
-
* const validatedModel = this.insertModel(
|
|
116
|
-
* new ValidatedModelGenerator({ ... }),
|
|
117
|
-
* 'ValidatedUser'
|
|
118
|
-
* ); // Returns Inserted<ModelValue, 'force', ValidationEnrichment>
|
|
119
|
-
*
|
|
120
|
-
* // Access enrichment data
|
|
121
|
-
* const enrichment = validatedModel.settings.enrichments;
|
|
122
|
-
* const validators = enrichment?.validators ?? [];
|
|
123
|
-
* const isRequired = enrichment?.required ?? false;
|
|
124
|
-
*
|
|
125
|
-
* return new Definition({
|
|
126
|
-
* identifier: Identifier.createType(this.refName),
|
|
127
|
-
* value: {
|
|
128
|
-
* generatorKey: this.generatorKey,
|
|
129
|
-
* content: this.generateWithValidation(validatedModel.toValue(), validators)
|
|
130
|
-
* }
|
|
131
|
-
* });
|
|
132
|
-
* }
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
135
52
|
*/
|
|
136
53
|
export class Inserted {
|
|
137
54
|
/**
|
package/esm/dsl/JsonFile.d.ts
CHANGED
|
@@ -38,86 +38,6 @@ type JsonFileArgs = {
|
|
|
38
38
|
* }
|
|
39
39
|
* });
|
|
40
40
|
*
|
|
41
|
-
* const jsonContent = packageJson.toString();
|
|
42
|
-
* console.log(jsonContent);
|
|
43
|
-
* // {
|
|
44
|
-
* // "name": "my-api-client",
|
|
45
|
-
* // "version": "1.0.0",
|
|
46
|
-
* // "type": "module",
|
|
47
|
-
* // "main": "./index.js",
|
|
48
|
-
* // "dependencies": {
|
|
49
|
-
* // "axios": "^1.0.0"
|
|
50
|
-
* // }
|
|
51
|
-
* // }
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* @example Configuration file generation
|
|
55
|
-
* ```typescript
|
|
56
|
-
* const configFile = new JsonFile({
|
|
57
|
-
* path: './src/config/api.json',
|
|
58
|
-
* content: {
|
|
59
|
-
* baseUrl: 'https://api.example.com',
|
|
60
|
-
* timeout: 5000,
|
|
61
|
-
* retryAttempts: 3,
|
|
62
|
-
* endpoints: {
|
|
63
|
-
* users: '/users',
|
|
64
|
-
* products: '/products',
|
|
65
|
-
* orders: '/orders'
|
|
66
|
-
* }
|
|
67
|
-
* }
|
|
68
|
-
* });
|
|
69
|
-
*
|
|
70
|
-
* // Write to file system
|
|
71
|
-
* await Deno.writeTextFile(configFile.path, configFile.toString());
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @example OpenAPI specification output
|
|
75
|
-
* ```typescript
|
|
76
|
-
* const openApiFile = new JsonFile({
|
|
77
|
-
* path: './dist/openapi.json',
|
|
78
|
-
* content: {
|
|
79
|
-
* openapi: '3.0.0',
|
|
80
|
-
* info: {
|
|
81
|
-
* title: 'My API',
|
|
82
|
-
* version: '1.0.0'
|
|
83
|
-
* },
|
|
84
|
-
* paths: {
|
|
85
|
-
* '/users': {
|
|
86
|
-
* get: {
|
|
87
|
-
* summary: 'List users',
|
|
88
|
-
* responses: {
|
|
89
|
-
* '200': {
|
|
90
|
-
* description: 'Success'
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* });
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* @example Using with generator registration
|
|
101
|
-
* ```typescript
|
|
102
|
-
* class MyGenerator extends ContentBase {
|
|
103
|
-
* generate() {
|
|
104
|
-
* const manifestFile = new JsonFile({
|
|
105
|
-
* path: './generated/manifest.json',
|
|
106
|
-
* content: {
|
|
107
|
-
* generatedAt: new Date().toISOString(),
|
|
108
|
-
* version: '1.0.0',
|
|
109
|
-
* files: [
|
|
110
|
-
* './models/User.ts',
|
|
111
|
-
* './models/Product.ts'
|
|
112
|
-
* ]
|
|
113
|
-
* }
|
|
114
|
-
* });
|
|
115
|
-
*
|
|
116
|
-
* // Register with the generation context
|
|
117
|
-
* this.register({ jsonFile: manifestFile });
|
|
118
|
-
* }
|
|
119
|
-
* }
|
|
120
|
-
* ```
|
|
121
41
|
*/
|
|
122
42
|
export declare class JsonFile {
|
|
123
43
|
/** The file type, always 'json' for JSON files */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonFile.d.ts","sourceRoot":"","sources":["../../src/dsl/JsonFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,KAAK,YAAY,GAAG;IAClB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"JsonFile.d.ts","sourceRoot":"","sources":["../../src/dsl/JsonFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,KAAK,YAAY,GAAG;IAClB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,QAAQ;IACnB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAS;IAEzB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IAEZ,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;gBACS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY;IAK3C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,IAAI,MAAM;CAGnB"}
|
package/esm/dsl/JsonFile.js
CHANGED
|
@@ -29,86 +29,6 @@
|
|
|
29
29
|
* }
|
|
30
30
|
* });
|
|
31
31
|
*
|
|
32
|
-
* const jsonContent = packageJson.toString();
|
|
33
|
-
* console.log(jsonContent);
|
|
34
|
-
* // {
|
|
35
|
-
* // "name": "my-api-client",
|
|
36
|
-
* // "version": "1.0.0",
|
|
37
|
-
* // "type": "module",
|
|
38
|
-
* // "main": "./index.js",
|
|
39
|
-
* // "dependencies": {
|
|
40
|
-
* // "axios": "^1.0.0"
|
|
41
|
-
* // }
|
|
42
|
-
* // }
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @example Configuration file generation
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const configFile = new JsonFile({
|
|
48
|
-
* path: './src/config/api.json',
|
|
49
|
-
* content: {
|
|
50
|
-
* baseUrl: 'https://api.example.com',
|
|
51
|
-
* timeout: 5000,
|
|
52
|
-
* retryAttempts: 3,
|
|
53
|
-
* endpoints: {
|
|
54
|
-
* users: '/users',
|
|
55
|
-
* products: '/products',
|
|
56
|
-
* orders: '/orders'
|
|
57
|
-
* }
|
|
58
|
-
* }
|
|
59
|
-
* });
|
|
60
|
-
*
|
|
61
|
-
* // Write to file system
|
|
62
|
-
* await Deno.writeTextFile(configFile.path, configFile.toString());
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* @example OpenAPI specification output
|
|
66
|
-
* ```typescript
|
|
67
|
-
* const openApiFile = new JsonFile({
|
|
68
|
-
* path: './dist/openapi.json',
|
|
69
|
-
* content: {
|
|
70
|
-
* openapi: '3.0.0',
|
|
71
|
-
* info: {
|
|
72
|
-
* title: 'My API',
|
|
73
|
-
* version: '1.0.0'
|
|
74
|
-
* },
|
|
75
|
-
* paths: {
|
|
76
|
-
* '/users': {
|
|
77
|
-
* get: {
|
|
78
|
-
* summary: 'List users',
|
|
79
|
-
* responses: {
|
|
80
|
-
* '200': {
|
|
81
|
-
* description: 'Success'
|
|
82
|
-
* }
|
|
83
|
-
* }
|
|
84
|
-
* }
|
|
85
|
-
* }
|
|
86
|
-
* }
|
|
87
|
-
* }
|
|
88
|
-
* });
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* @example Using with generator registration
|
|
92
|
-
* ```typescript
|
|
93
|
-
* class MyGenerator extends ContentBase {
|
|
94
|
-
* generate() {
|
|
95
|
-
* const manifestFile = new JsonFile({
|
|
96
|
-
* path: './generated/manifest.json',
|
|
97
|
-
* content: {
|
|
98
|
-
* generatedAt: new Date().toISOString(),
|
|
99
|
-
* version: '1.0.0',
|
|
100
|
-
* files: [
|
|
101
|
-
* './models/User.ts',
|
|
102
|
-
* './models/Product.ts'
|
|
103
|
-
* ]
|
|
104
|
-
* }
|
|
105
|
-
* });
|
|
106
|
-
*
|
|
107
|
-
* // Register with the generation context
|
|
108
|
-
* this.register({ jsonFile: manifestFile });
|
|
109
|
-
* }
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
32
|
*/
|
|
113
33
|
export class JsonFile {
|
|
114
34
|
/**
|
package/esm/dsl/Stringable.d.ts
CHANGED
|
@@ -5,73 +5,6 @@
|
|
|
5
5
|
* system to ensure that objects can be converted to strings for code generation.
|
|
6
6
|
* This interface matches JavaScript's built-in `toString()` contract and is used
|
|
7
7
|
* extensively by the {@link List} class and other string-building utilities.
|
|
8
|
-
*
|
|
9
|
-
* ## Usage in SKMTC
|
|
10
|
-
*
|
|
11
|
-
* This type is used as a constraint in generic classes and functions that need
|
|
12
|
-
* to output string representations. It allows for type-safe string building
|
|
13
|
-
* while accommodating both primitive types and custom objects.
|
|
14
|
-
*
|
|
15
|
-
* @example Built-in types are stringable
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import type { Stringable } from '@skmtc/core';
|
|
18
|
-
*
|
|
19
|
-
* // All these types implement Stringable
|
|
20
|
-
* const str: Stringable = 'hello'; // string
|
|
21
|
-
* const num: Stringable = 42; // number
|
|
22
|
-
* const bool: Stringable = true; // boolean
|
|
23
|
-
* const obj: Stringable = { toString: () => 'custom' }; // custom object
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example Custom classes implementing Stringable
|
|
27
|
-
* ```typescript
|
|
28
|
-
* class CodeBlock implements Stringable {
|
|
29
|
-
* constructor(private code: string) {}
|
|
30
|
-
*
|
|
31
|
-
* toString(): string {
|
|
32
|
-
* return `{\n ${this.code}\n}`;
|
|
33
|
-
* }
|
|
34
|
-
* }
|
|
35
|
-
*
|
|
36
|
-
* const block = new CodeBlock('console.log("hello");');
|
|
37
|
-
* console.log(block.toString());
|
|
38
|
-
* // {
|
|
39
|
-
* // console.log("hello");
|
|
40
|
-
* // }
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example Using with List class
|
|
44
|
-
* ```typescript
|
|
45
|
-
* import { List } from '@skmtc/core';
|
|
46
|
-
*
|
|
47
|
-
* // List accepts any Stringable items
|
|
48
|
-
* const stringables: Stringable[] = [
|
|
49
|
-
* 'string literal',
|
|
50
|
-
* 42,
|
|
51
|
-
* true,
|
|
52
|
-
* { toString: () => 'custom object' },
|
|
53
|
-
* new CodeBlock('return value;')
|
|
54
|
-
* ];
|
|
55
|
-
*
|
|
56
|
-
* const list = new List(stringables);
|
|
57
|
-
* console.log(list.toString());
|
|
58
|
-
* // string literal, 42, true, custom object, {
|
|
59
|
-
* // return value;
|
|
60
|
-
* // }
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* @example Type constraints in generics
|
|
64
|
-
* ```typescript
|
|
65
|
-
* function joinWithCommas<T extends Stringable>(items: T[]): string {
|
|
66
|
-
* return items.map(item => item.toString()).join(', ');
|
|
67
|
-
* }
|
|
68
|
-
*
|
|
69
|
-
* const result = joinWithCommas([1, 2, 3]); // "1, 2, 3"
|
|
70
|
-
* const identifiers = joinWithCommas([
|
|
71
|
-
* Identifier.createVariable('user'),
|
|
72
|
-
* Identifier.createType('User')
|
|
73
|
-
* ]); // "user, User"
|
|
74
|
-
* ```
|
|
75
8
|
*/
|
|
76
9
|
export type Stringable = {
|
|
77
10
|
/** Converts the object to its string representation */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stringable.d.ts","sourceRoot":"","sources":["../../src/dsl/Stringable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Stringable.d.ts","sourceRoot":"","sources":["../../src/dsl/Stringable.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,MAAM,CAAA;CACvB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { BaseRegisterArgs, GenerateContext
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
2
|
+
import type { InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } from '../../context/types.js';
|
|
3
|
+
import type { GeneratedValue } from '../GeneratedValue.js';
|
|
4
|
+
import type { GeneratorKey } from '../GeneratorKeys.js';
|
|
4
5
|
import type { RefName } from '../../types/RefName.js';
|
|
5
6
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
6
7
|
import type { ModelInsertable } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACzF,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC5B,MA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qBG;gBACS,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,cAAc,CAAC;IAQvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,GAAG,SAAS,EAC9D,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC;IAQvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,qBAAqB,CACnB,CAAC,SAAS,cAAc,EACxB,MAAM,SAAS,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,EACrD,cAAc,GAAG,SAAS,EAE1B,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,EACpF,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACM,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ModelInsertable } from './types.js';
|
|
2
2
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { GeneratedDefinition, GenerationType } from '
|
|
5
|
-
import type { GeneratedValue } from '
|
|
4
|
+
import type { GeneratedDefinition, GenerationType } from '../GeneratedValue.js';
|
|
5
|
+
import type { GeneratedValue } from '../GeneratedValue.js';
|
|
6
6
|
import type { RefName } from '../../types/RefName.js';
|
|
7
7
|
type CreateModelArgs<V extends GeneratedValue, T extends GenerationType, EnrichmentType> = {
|
|
8
8
|
context: GenerateContext;
|
|
@@ -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
|
|
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,sBAAsB,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,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;;;;;;GAMG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc;IACzF,6BAA6B;IAC7B,OAAO,EAAE,eAAe,CAAA;IACxB,yCAAyC;IACzC,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,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,6 +1,6 @@
|
|
|
1
1
|
import { normalize } from '../../deps/jsr.io/@std/path/1.1.2/normalize.js';
|
|
2
2
|
import { Definition } from '../Definition.js';
|
|
3
|
-
import { toModelGeneratorKey } from '
|
|
3
|
+
import { toModelGeneratorKey } from '../GeneratorKeys.js';
|
|
4
4
|
/**
|
|
5
5
|
* Driver class responsible for managing model generation lifecycle.
|
|
6
6
|
*
|
|
@@ -88,9 +88,9 @@ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModel
|
|
|
88
88
|
new (args: ModelInsertableArgs<EnrichmentType>): {
|
|
89
89
|
settings: ContentSettings<EnrichmentType>;
|
|
90
90
|
refName: RefName;
|
|
91
|
-
generatorKey: import("
|
|
92
|
-
insertModel<V extends import("
|
|
93
|
-
insertNormalizedModel<V extends import("
|
|
91
|
+
generatorKey: import("../GeneratorKeys.js").GeneratorKey;
|
|
92
|
+
insertModel<V extends import("../GeneratedValue.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_1>, refName: RefName, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
93
|
+
insertNormalizedModel<V extends import("../GeneratedValue.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
94
94
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
95
95
|
context: GenerateContext;
|
|
96
96
|
skipped: boolean;
|
|
@@ -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,EAA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,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,wBAAwB,KAAK,aAAa,CAAA;IACnF,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB,KAAK,aAAa,CAAA;IAC7E,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1D,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,OAAO,EAAE,OAAO,KACb,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;CAWxD,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { OperationInsertable } from './types.js';
|
|
2
2
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { BaseRegisterArgs, GenerateContext
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
5
|
+
import type { DefineAndRegisterArgs, InsertOperationOptions, InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } from '../../context/types.js';
|
|
6
|
+
import type { GeneratedValue } from '../GeneratedValue.js';
|
|
7
|
+
import type { GeneratorKey } from '../GeneratorKeys.js';
|
|
7
8
|
import { ContentBase } from '../ContentBase.js';
|
|
8
9
|
import type { Definition } from '../Definition.js';
|
|
9
10
|
import type { Inserted } from '../Inserted.js';
|
|
@@ -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,CA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