@skmtc/core 0.0.945 → 0.0.947
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 +4 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +2 -5
- package/esm/context/generateTypes.d.ts +5 -10
- package/esm/context/generateTypes.d.ts.map +1 -1
- package/esm/dsl/GeneratedValue.d.ts +2 -18
- package/esm/dsl/GeneratedValue.d.ts.map +1 -1
- package/esm/dsl/Inserted.d.ts +13 -33
- package/esm/dsl/Inserted.d.ts.map +1 -1
- package/esm/dsl/Inserted.js +7 -26
- package/esm/dsl/model/ModelBase.d.ts +2 -2
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.js +0 -1
- package/esm/dsl/model/ModelDriver.d.ts +5 -9
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +3 -10
- package/esm/dsl/model/toModelBase.d.ts +2 -2
- package/esm/dsl/operation/OperationBase.d.ts +3 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.js +0 -2
- package/esm/dsl/operation/OperationDriver.d.ts +5 -7
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +3 -8
- package/esm/dsl/operation/toOperationBase.d.ts +3 -3
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +4 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +2 -5
- package/script/context/generateTypes.d.ts +5 -10
- package/script/context/generateTypes.d.ts.map +1 -1
- package/script/dsl/GeneratedValue.d.ts +2 -18
- package/script/dsl/GeneratedValue.d.ts.map +1 -1
- package/script/dsl/Inserted.d.ts +13 -33
- package/script/dsl/Inserted.d.ts.map +1 -1
- package/script/dsl/Inserted.js +7 -26
- package/script/dsl/model/ModelBase.d.ts +2 -2
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.js +0 -1
- package/script/dsl/model/ModelDriver.d.ts +5 -9
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +3 -10
- package/script/dsl/model/toModelBase.d.ts +2 -2
- package/script/dsl/operation/OperationBase.d.ts +3 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.js +0 -2
- package/script/dsl/operation/OperationDriver.d.ts +5 -7
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +3 -8
- package/script/dsl/operation/toOperationBase.d.ts +3 -3
|
@@ -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,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,E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M,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,EAAE,UAAU,CAAM,GACjD,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,EAC1C,UAAU,EACV,KAAK,EACL,QAAQ,EACT,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IASpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACM,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -192,7 +192,6 @@ export class OperationBase extends ContentBase {
|
|
|
192
192
|
*/
|
|
193
193
|
insertOperation(insertable, operation, options = {}) {
|
|
194
194
|
return this.context.insertOperation(insertable, operation, {
|
|
195
|
-
generation: 'force',
|
|
196
195
|
destinationPath: this.settings.exportPath,
|
|
197
196
|
noExport: options.noExport
|
|
198
197
|
});
|
|
@@ -240,7 +239,6 @@ export class OperationBase extends ContentBase {
|
|
|
240
239
|
*/
|
|
241
240
|
insertModel(insertable, refName, options = {}) {
|
|
242
241
|
return this.context.insertModel(insertable, refName, {
|
|
243
|
-
generation: 'force',
|
|
244
242
|
destinationPath: this.settings.exportPath,
|
|
245
243
|
noExport: options.noExport
|
|
246
244
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
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 { GeneratedDefinition
|
|
4
|
+
import type { GeneratedDefinition } from '../GeneratedValue.js';
|
|
5
5
|
import type { GeneratedValue } from '../GeneratedValue.js';
|
|
6
6
|
import type { GenerateContextType } from '../../context/generateTypes.js';
|
|
7
|
-
type CreateOperationArgs<V extends GeneratedValue,
|
|
7
|
+
type CreateOperationArgs<V extends GeneratedValue, EnrichmentType = undefined> = {
|
|
8
8
|
context: GenerateContextType;
|
|
9
9
|
insertable: OperationInsertable<V, EnrichmentType>;
|
|
10
10
|
operation: OasOperation;
|
|
11
|
-
generation?: T;
|
|
12
11
|
destinationPath?: string;
|
|
13
12
|
noExport?: boolean;
|
|
14
13
|
};
|
|
@@ -42,7 +41,7 @@ type CreateOperationArgs<V extends GeneratedValue, T extends GenerationType, Enr
|
|
|
42
41
|
* }
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
|
-
export declare class OperationDriver<V extends GeneratedValue,
|
|
44
|
+
export declare class OperationDriver<V extends GeneratedValue, EnrichmentType = undefined> {
|
|
46
45
|
/** The generation context providing access to OAS objects and utilities */
|
|
47
46
|
context: GenerateContextType;
|
|
48
47
|
/** The insertable object that provides generation configuration */
|
|
@@ -54,7 +53,7 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
|
|
|
54
53
|
/** Optional custom destination path for generated files */
|
|
55
54
|
destinationPath?: string;
|
|
56
55
|
/** The generated definition containing the transformed operation */
|
|
57
|
-
definition: GeneratedDefinition<V
|
|
56
|
+
definition: GeneratedDefinition<V>;
|
|
58
57
|
/** Whether to exclude this operation from exports */
|
|
59
58
|
noExport?: boolean;
|
|
60
59
|
/**
|
|
@@ -64,11 +63,10 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
|
|
|
64
63
|
* @param args.context - Generation context
|
|
65
64
|
* @param args.insertable - Insertable providing generation configuration
|
|
66
65
|
* @param args.operation - OpenAPI operation to process
|
|
67
|
-
* @param args.generation - Optional generation type
|
|
68
66
|
* @param args.destinationPath - Optional custom destination path
|
|
69
67
|
* @param args.noExport - Whether to exclude from exports
|
|
70
68
|
*/
|
|
71
|
-
constructor({ context, insertable, operation,
|
|
69
|
+
constructor({ context, insertable, operation, destinationPath, noExport }: CreateOperationArgs<V, EnrichmentType>);
|
|
72
70
|
/**
|
|
73
71
|
* Applies generation configuration to create the operation definition.
|
|
74
72
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationDriver.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;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationDriver.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;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAEzE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,GAAG,SAAS,IAAI;IAC/E,OAAO,EAAE,mBAAmB,CAAA;IAC5B,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,SAAS,EAAE,YAAY,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,GAAG,SAAS;IAC/E,2EAA2E;IAC3E,OAAO,EAAE,mBAAmB,CAAA;IAC5B,mEAAmE;IACnE,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,mDAAmD;IACnD,SAAS,EAAE,YAAY,CAAA;IACvB,2DAA2D;IAC3D,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oEAAoE;IACpE,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;OASG;gBACS,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,eAAe,EACf,QAAQ,EACT,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC;IAczC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,KAAK;IAeb;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;IA+BrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -39,11 +39,10 @@ export class OperationDriver {
|
|
|
39
39
|
* @param args.context - Generation context
|
|
40
40
|
* @param args.insertable - Insertable providing generation configuration
|
|
41
41
|
* @param args.operation - OpenAPI operation to process
|
|
42
|
-
* @param args.generation - Optional generation type
|
|
43
42
|
* @param args.destinationPath - Optional custom destination path
|
|
44
43
|
* @param args.noExport - Whether to exclude from exports
|
|
45
44
|
*/
|
|
46
|
-
constructor({ context, insertable, operation,
|
|
45
|
+
constructor({ context, insertable, operation, destinationPath, noExport }) {
|
|
47
46
|
/** The generation context providing access to OAS objects and utilities */
|
|
48
47
|
Object.defineProperty(this, "context", {
|
|
49
48
|
enumerable: true,
|
|
@@ -102,7 +101,7 @@ export class OperationDriver {
|
|
|
102
101
|
operation,
|
|
103
102
|
insertable
|
|
104
103
|
});
|
|
105
|
-
this.definition = this.apply({
|
|
104
|
+
this.definition = this.apply({ destinationPath });
|
|
106
105
|
}
|
|
107
106
|
/**
|
|
108
107
|
* Applies generation configuration to create the operation definition.
|
|
@@ -117,12 +116,8 @@ export class OperationDriver {
|
|
|
117
116
|
* @param args.destinationPath - Optional destination path for imports
|
|
118
117
|
* @returns Generated definition for the operation
|
|
119
118
|
*/
|
|
120
|
-
apply({
|
|
119
|
+
apply({ destinationPath } = {}) {
|
|
121
120
|
const { identifier, exportPath } = this.settings;
|
|
122
|
-
// Everything is selected (for now)
|
|
123
|
-
// if (/*!selected && */ generation !== 'force') {
|
|
124
|
-
// return undefined as GeneratedDefinition<V, T>
|
|
125
|
-
// }
|
|
126
121
|
const definition = this.getDefinition({ identifier, exportPath });
|
|
127
122
|
if (destinationPath && normalize(exportPath) !== normalize(destinationPath)) {
|
|
128
123
|
this.context.register({
|
|
@@ -76,9 +76,9 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
76
76
|
settings: import("../ContentSettings.js").ContentSettings<EnrichmentType>;
|
|
77
77
|
operation: OasOperation;
|
|
78
78
|
generatorKey: import("../GeneratorKeys.js").GeneratorKey;
|
|
79
|
-
insertOperation<V extends import("../GeneratedValue.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../mod.js").InsertOperationOptions
|
|
80
|
-
insertModel<V extends import("../GeneratedValue.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName, options?: Pick<import("../../mod.js").InsertModelOptions
|
|
81
|
-
insertNormalizedModel<V extends import("../GeneratedValue.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions
|
|
79
|
+
insertOperation<V extends import("../GeneratedValue.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../mod.js").InsertOperationOptions, "noExport">): import("../Inserted.js").Inserted<V, EnrichmentType_1>;
|
|
80
|
+
insertModel<V extends import("../GeneratedValue.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName, options?: Pick<import("../../mod.js").InsertModelOptions, "noExport">): import("../Inserted.js").Inserted<V, EnrichmentType_2>;
|
|
81
|
+
insertNormalizedModel<V extends import("../GeneratedValue.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
82
82
|
defineAndRegister<V extends import("../GeneratedValue.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
83
83
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
84
84
|
context: GenerateContextType;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import type { Method } from '../types/Method.js';
|
|
|
8
8
|
import type { OperationInsertable } from '../dsl/operation/types.js';
|
|
9
9
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
10
10
|
import type { ModelInsertable } from '../dsl/model/types.js';
|
|
11
|
-
import type {
|
|
11
|
+
import type { GeneratedValue } from '../dsl/GeneratedValue.js';
|
|
12
12
|
import { ContentSettings } from '../dsl/ContentSettings.js';
|
|
13
13
|
import type { RefName } from '../types/RefName.js';
|
|
14
14
|
import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
@@ -112,7 +112,7 @@ export type ToModelSettingsArgs = {
|
|
|
112
112
|
* @template T - The generation type
|
|
113
113
|
* @template EnrichmentType - The enrichment data type
|
|
114
114
|
*/
|
|
115
|
-
export type InsertReturn<V extends GeneratedValue,
|
|
115
|
+
export type InsertReturn<V extends GeneratedValue, EnrichmentType> = Inserted<V, EnrichmentType>;
|
|
116
116
|
/**
|
|
117
117
|
* The generation context for the second phase of the SKMTC transformation pipeline.
|
|
118
118
|
*
|
|
@@ -219,7 +219,7 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
219
219
|
* insertable's driver
|
|
220
220
|
* @mutates this.files
|
|
221
221
|
*/
|
|
222
|
-
insertOperation<V extends GeneratedValue,
|
|
222
|
+
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { destinationPath, noExport }?: InsertOperationOptions): Inserted<V, EnrichmentType>;
|
|
223
223
|
/**
|
|
224
224
|
* Inserts a normalized model definition into the generation context.
|
|
225
225
|
*
|
|
@@ -243,7 +243,7 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
243
243
|
* insertable's driver
|
|
244
244
|
* @mutates this.files
|
|
245
245
|
*/
|
|
246
|
-
insertModel<V extends GeneratedValue,
|
|
246
|
+
insertModel<V extends GeneratedValue, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { destinationPath, noExport }?: InsertModelOptions): Inserted<V, EnrichmentType>;
|
|
247
247
|
/**
|
|
248
248
|
* Generate and return content settings for operation insertable and
|
|
249
249
|
* operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EAEd,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,sBAAsB,CAAA;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAmB,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGzE,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAA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AQG;IACH,sBAAsB,CAAC,CAAC,EAAE,cAAc,EAAE,EACxC,OAAO,EACP,UAAU,EACX,EAAE,sBAAsB,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,eAAe,CAAC,cAAc,CAAC;IAuB9E;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAYzF;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAOvE;AAED,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,YAAY,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,4BAG/B,qBAAqB,KAAG,eAKzB,CAAA;AAEF,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,0BAA0B,iBAAiB,KAAG,WAI1E,CAAA"}
|
|
@@ -259,12 +259,11 @@ class GenerateContext {
|
|
|
259
259
|
* insertable's driver
|
|
260
260
|
* @mutates this.files
|
|
261
261
|
*/
|
|
262
|
-
insertOperation(insertable, operation, {
|
|
262
|
+
insertOperation(insertable, operation, { destinationPath, noExport = false } = {}) {
|
|
263
263
|
const { settings, definition } = new OperationDriver_js_1.OperationDriver({
|
|
264
264
|
context: this,
|
|
265
265
|
insertable,
|
|
266
266
|
operation,
|
|
267
|
-
generation,
|
|
268
267
|
destinationPath,
|
|
269
268
|
noExport
|
|
270
269
|
});
|
|
@@ -281,7 +280,6 @@ class GenerateContext {
|
|
|
281
280
|
insertNormalisedModel(insertable, { schema, fallbackName, destinationPath }, { noExport = false } = {}) {
|
|
282
281
|
if (schema.isRef()) {
|
|
283
282
|
const { definition } = this.insertModel(insertable, schema.toRefName(), {
|
|
284
|
-
generation: 'force',
|
|
285
283
|
destinationPath,
|
|
286
284
|
noExport
|
|
287
285
|
});
|
|
@@ -326,12 +324,11 @@ class GenerateContext {
|
|
|
326
324
|
* insertable's driver
|
|
327
325
|
* @mutates this.files
|
|
328
326
|
*/
|
|
329
|
-
insertModel(insertable, refName, {
|
|
327
|
+
insertModel(insertable, refName, { destinationPath, noExport = false } = {}) {
|
|
330
328
|
const { settings, definition } = new ModelDriver_js_1.ModelDriver({
|
|
331
329
|
context: this,
|
|
332
330
|
insertable,
|
|
333
331
|
refName,
|
|
334
|
-
generation,
|
|
335
332
|
destinationPath,
|
|
336
333
|
rootRef: refName,
|
|
337
334
|
noExport
|
|
@@ -3,7 +3,7 @@ import type { Mapping, Preview } from '../types/Preview.js';
|
|
|
3
3
|
import type { ResultsItem } from '../types/Results.js';
|
|
4
4
|
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
5
5
|
import type { JsonFile } from '../dsl/JsonFile.js';
|
|
6
|
-
import type { GeneratedValue
|
|
6
|
+
import type { GeneratedValue } from '../dsl/GeneratedValue.js';
|
|
7
7
|
import type { Definition } from '../dsl/Definition.js';
|
|
8
8
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
9
9
|
import type { OperationInsertable } from '../dsl/operation/types.js';
|
|
@@ -28,11 +28,9 @@ import type { StackTrail } from './StackTrail.js';
|
|
|
28
28
|
*
|
|
29
29
|
* @template T - The generation type extending GenerationType
|
|
30
30
|
*/
|
|
31
|
-
export type InsertOperationOptions
|
|
31
|
+
export type InsertOperationOptions = {
|
|
32
32
|
/** Whether to exclude this operation from exports */
|
|
33
33
|
noExport?: boolean;
|
|
34
|
-
/** The type of generation to apply */
|
|
35
|
-
generation?: T;
|
|
36
34
|
/** Custom destination path for the operation */
|
|
37
35
|
destinationPath?: string;
|
|
38
36
|
};
|
|
@@ -166,13 +164,10 @@ export type InsertNormalisedModelArgs<Schema extends OasSchema | OasRef<'schema'
|
|
|
166
164
|
* Configures how a model should be processed and included in
|
|
167
165
|
* the generated code output.
|
|
168
166
|
*
|
|
169
|
-
* @template T - The generation type extending GenerationType
|
|
170
167
|
*/
|
|
171
|
-
export type InsertModelOptions
|
|
168
|
+
export type InsertModelOptions = {
|
|
172
169
|
/** Whether to exclude this model from exports */
|
|
173
170
|
noExport?: boolean;
|
|
174
|
-
/** The type of generation to apply */
|
|
175
|
-
generation?: T;
|
|
176
171
|
/** Custom destination path for the model */
|
|
177
172
|
destinationPath?: string;
|
|
178
173
|
};
|
|
@@ -233,9 +228,9 @@ export type GenerateContextType = {
|
|
|
233
228
|
defineAndRegister: <V extends GeneratedValue>({ identifier, value, destinationPath, noExport }: DefineAndRegisterArgs<V>) => Definition<V>;
|
|
234
229
|
registerJson: ({ destinationPath, json }: RegisterJsonArgs) => void;
|
|
235
230
|
register: ({ imports, definitions, destinationPath, reExports }: RegisterArgs) => void;
|
|
236
|
-
insertOperation: <V extends GeneratedValue,
|
|
231
|
+
insertOperation: <V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { destinationPath, noExport }: InsertOperationOptions) => Inserted<V, EnrichmentType>;
|
|
237
232
|
insertNormalisedModel: <V extends GeneratedValue, Schema extends OasSchema | OasRef<'schema'> | OasVoid, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName, destinationPath }: InsertNormalisedModelArgs<Schema>, { noExport }: InsertNormalisedModelOptions) => InsertNormalisedModelReturn<V, Schema>;
|
|
238
|
-
insertModel: <V extends GeneratedValue,
|
|
233
|
+
insertModel: <V extends GeneratedValue, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { destinationPath, noExport }: InsertModelOptions) => Inserted<V, EnrichmentType>;
|
|
239
234
|
toOperationContentSettings: <V, EnrichmentType>({ operation, insertable }: ToOperationSettingsArgs<V, EnrichmentType>) => ContentSettings<EnrichmentType>;
|
|
240
235
|
toModelContentSettings: <V, EnrichmentType>({ refName, insertable }: BuildModelSettingsArgs<V, EnrichmentType>) => ContentSettings<EnrichmentType>;
|
|
241
236
|
resolveSchemaRefOnce: (refName: RefName, generatorId: string) => OasSchema | OasRef<'schema'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/context/generateTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/context/generateTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAA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,MAAM,CAAC,CAAA;IAC3C,WAAW,EAAE,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,EACpD,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,OAAO,EAAE,OAAO,EAChB,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,kBAAkB,KAC9C,QAAQ,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAChC,0BAA0B,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,EAC9C,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,KAAK,eAAe,CAAC,cAAc,CAAC,CAAA;IACjF,sBAAsB,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,EAC1C,OAAO,EACP,UAAU,EACX,EAAE,sBAAsB,CAAC,CAAC,EAAE,cAAc,CAAC,KAAK,eAAe,CAAC,cAAc,CAAC,CAAA;IAChF,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC7F,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,KAAK,UAAU,GAAG,SAAS,CAAA;CAC3E,CAAA"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import type { Definition } from './Definition.js';
|
|
2
2
|
import type { Stringable } from './Stringable.js';
|
|
3
3
|
import type { GeneratorKey } from './GeneratorKeys.js';
|
|
4
|
-
/**
|
|
5
|
-
* 'force' - will generate content even it is not selected.
|
|
6
|
-
* Use this option when generating code via a dependency.
|
|
7
|
-
* For example, when you are generating a form and it needs
|
|
8
|
-
* an accompanying API client as well. You should use 'force'
|
|
9
|
-
* when generating the API client to ensure it is generated
|
|
10
|
-
* event the API client itself is not selected.
|
|
11
|
-
*
|
|
12
|
-
* 'regular' - will generate content only if it is selected.
|
|
13
|
-
*/
|
|
14
|
-
export type GenerationType = 'force' | 'regular';
|
|
15
4
|
/**
|
|
16
5
|
* Represents a value that can be generated by the SKMTC pipeline.
|
|
17
6
|
*
|
|
@@ -23,14 +12,9 @@ export type GeneratedValue = Stringable & {
|
|
|
23
12
|
generatorKey?: GeneratorKey;
|
|
24
13
|
};
|
|
25
14
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* When generation type is 'force', always returns a Definition.
|
|
29
|
-
* When generation type is 'regular', returns Definition or undefined
|
|
30
|
-
* based on whether the content is selected for generation.
|
|
15
|
+
* Type for generated definitions.
|
|
31
16
|
*
|
|
32
17
|
* @template V - The generated value type extending GeneratedValue
|
|
33
|
-
* @template T - The generation type ('force' or 'regular')
|
|
34
18
|
*/
|
|
35
|
-
export type GeneratedDefinition<V extends GeneratedValue
|
|
19
|
+
export type GeneratedDefinition<V extends GeneratedValue> = Definition<V>;
|
|
36
20
|
//# sourceMappingURL=GeneratedValue.d.ts.map
|
|
@@ -1 +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
|
|
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;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA"}
|
package/script/dsl/Inserted.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import type { GeneratedDefinition, GeneratedValue
|
|
1
|
+
import type { GeneratedDefinition, GeneratedValue } from './GeneratedValue.js';
|
|
2
2
|
import type { ContentSettings } from './ContentSettings.js';
|
|
3
3
|
import type { Identifier } from './Identifier.js';
|
|
4
4
|
/**
|
|
5
5
|
* Constructor arguments for {@link Inserted}.
|
|
6
6
|
*
|
|
7
7
|
* @template V - The type of generated value
|
|
8
|
-
* @template T - The generation type ('force' or 'lazy')
|
|
9
8
|
* @template EnrichmentType - Optional enrichment data type
|
|
10
9
|
*/
|
|
11
|
-
type ConstructorArgs<V extends GeneratedValue,
|
|
10
|
+
type ConstructorArgs<V extends GeneratedValue, EnrichmentType> = {
|
|
12
11
|
/** Content settings including identifier and export path */
|
|
13
12
|
settings: ContentSettings<EnrichmentType>;
|
|
14
13
|
/** The generated definition with its value */
|
|
15
|
-
definition: GeneratedDefinition<V
|
|
14
|
+
definition: GeneratedDefinition<V>;
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* Represents a successfully inserted generator artifact in the SKMTC DSL system.
|
|
@@ -29,13 +28,11 @@ type ConstructorArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
29
28
|
* ## Key Features
|
|
30
29
|
*
|
|
31
30
|
* - **Type Safety**: Generic parameters preserve exact types from generators
|
|
32
|
-
* - **Generation Modes**: Handles both 'force' and 'lazy' generation strategies
|
|
33
31
|
* - **Metadata Access**: Provides access to identifiers, export paths, and settings
|
|
34
32
|
* - **Value Extraction**: Type-safe value extraction with proper optionality
|
|
35
33
|
* - **Enrichment Support**: Full support for custom enrichment data types
|
|
36
34
|
*
|
|
37
35
|
* @template V - The type of generated value (preserves generator output type)
|
|
38
|
-
* @template T - The generation type ('force' ensures non-null, 'lazy' allows undefined)
|
|
39
36
|
* @template EnrichmentType - Optional type for custom enrichment data
|
|
40
37
|
*
|
|
41
38
|
* @example Basic usage with forced generation
|
|
@@ -48,7 +45,7 @@ type ConstructorArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
48
45
|
* const userModel = this.insertModel(
|
|
49
46
|
* new UserModelGenerator({ ... }),
|
|
50
47
|
* 'User'
|
|
51
|
-
* ); // Returns Inserted<UserModelValue,
|
|
48
|
+
* ); // Returns Inserted<UserModelValue, EnrichmentType>
|
|
52
49
|
*
|
|
53
50
|
* // Access the generated value (guaranteed to be present)
|
|
54
51
|
* const userTypeName = userModel.toValue(); // UserModelValue (not undefined)
|
|
@@ -66,11 +63,11 @@ type ConstructorArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
66
63
|
* }
|
|
67
64
|
* ```
|
|
68
65
|
*/
|
|
69
|
-
export declare class Inserted<V extends GeneratedValue,
|
|
66
|
+
export declare class Inserted<V extends GeneratedValue, EnrichmentType> {
|
|
70
67
|
/** Content settings including identifier and export path */
|
|
71
68
|
settings: ContentSettings<EnrichmentType>;
|
|
72
69
|
/** The generated definition with its value */
|
|
73
|
-
definition: GeneratedDefinition<V
|
|
70
|
+
definition: GeneratedDefinition<V>;
|
|
74
71
|
/**
|
|
75
72
|
* Creates a new Inserted instance.
|
|
76
73
|
*
|
|
@@ -78,7 +75,7 @@ export declare class Inserted<V extends GeneratedValue, T extends GenerationType
|
|
|
78
75
|
* @param args.settings - Content settings with identifier and export path
|
|
79
76
|
* @param args.definition - The generated definition containing the value
|
|
80
77
|
*/
|
|
81
|
-
constructor({ settings, definition }: ConstructorArgs<V,
|
|
78
|
+
constructor({ settings, definition }: ConstructorArgs<V, EnrichmentType>);
|
|
82
79
|
/**
|
|
83
80
|
* Gets the name of the inserted artifact.
|
|
84
81
|
*
|
|
@@ -140,36 +137,19 @@ export declare class Inserted<V extends GeneratedValue, T extends GenerationType
|
|
|
140
137
|
* Gets the generated value from the inserted artifact.
|
|
141
138
|
*
|
|
142
139
|
* This method returns the actual generated content with proper type safety
|
|
143
|
-
* based on the generation mode. For 'force' generation, the value is guaranteed
|
|
144
|
-
* to be present. For 'lazy' generation, the value might be undefined if
|
|
145
|
-
* generation was skipped.
|
|
146
140
|
*
|
|
147
|
-
* @returns The generated value
|
|
141
|
+
* @returns The generated value
|
|
148
142
|
*
|
|
149
|
-
* @example
|
|
143
|
+
* @example
|
|
150
144
|
* ```typescript
|
|
151
|
-
* const userModel = this.insertModel(generator, 'User');
|
|
152
|
-
* const value = userModel.toValue(); // UserModelValue
|
|
145
|
+
* const userModel = this.insertModel(generator, 'User');
|
|
146
|
+
* const value = userModel.toValue(); // UserModelValue
|
|
153
147
|
*
|
|
154
|
-
* //
|
|
148
|
+
* // Use the generated value
|
|
155
149
|
* const code = `type OrderUser = ${value};`;
|
|
156
150
|
* ```
|
|
157
|
-
*
|
|
158
|
-
* @example Lazy generation (optional value)
|
|
159
|
-
* ```typescript
|
|
160
|
-
* const optionalModel = this.insertModel(generator, 'Optional', { generation: 'lazy' });
|
|
161
|
-
* const value = optionalModel.toValue(); // OptionalValue | undefined
|
|
162
|
-
*
|
|
163
|
-
* if (value) {
|
|
164
|
-
* // Use the generated value
|
|
165
|
-
* const code = `type Optional = ${value};`;
|
|
166
|
-
* } else {
|
|
167
|
-
* // Handle missing value (generation was skipped)
|
|
168
|
-
* const code = 'type Optional = any; // Fallback';
|
|
169
|
-
* }
|
|
170
|
-
* ```
|
|
171
151
|
*/
|
|
172
|
-
toValue():
|
|
152
|
+
toValue(): V;
|
|
173
153
|
}
|
|
174
154
|
export {};
|
|
175
155
|
//# sourceMappingURL=Inserted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inserted.d.ts","sourceRoot":"","sources":["../../src/dsl/Inserted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"Inserted.d.ts","sourceRoot":"","sources":["../../src/dsl/Inserted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;GAKG;AACH,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,IAAI;IAC/D,4DAA4D;IAC5D,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,8CAA8C;IAC9C,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CACnC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc;IAC5D,4DAA4D;IAC5D,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IAEzC,8CAA8C;IAC9C,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAElC;;;;;;OAMG;gBACS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC;IAKxE;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,IAAI,MAAM;IAIhB;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,IAAI,UAAU;IAI1B;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,IAAI,MAAM;IAItB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,IAAI,CAAC;CAGb"}
|
package/script/dsl/Inserted.js
CHANGED
|
@@ -16,13 +16,11 @@ exports.Inserted = void 0;
|
|
|
16
16
|
* ## Key Features
|
|
17
17
|
*
|
|
18
18
|
* - **Type Safety**: Generic parameters preserve exact types from generators
|
|
19
|
-
* - **Generation Modes**: Handles both 'force' and 'lazy' generation strategies
|
|
20
19
|
* - **Metadata Access**: Provides access to identifiers, export paths, and settings
|
|
21
20
|
* - **Value Extraction**: Type-safe value extraction with proper optionality
|
|
22
21
|
* - **Enrichment Support**: Full support for custom enrichment data types
|
|
23
22
|
*
|
|
24
23
|
* @template V - The type of generated value (preserves generator output type)
|
|
25
|
-
* @template T - The generation type ('force' ensures non-null, 'lazy' allows undefined)
|
|
26
24
|
* @template EnrichmentType - Optional type for custom enrichment data
|
|
27
25
|
*
|
|
28
26
|
* @example Basic usage with forced generation
|
|
@@ -35,7 +33,7 @@ exports.Inserted = void 0;
|
|
|
35
33
|
* const userModel = this.insertModel(
|
|
36
34
|
* new UserModelGenerator({ ... }),
|
|
37
35
|
* 'User'
|
|
38
|
-
* ); // Returns Inserted<UserModelValue,
|
|
36
|
+
* ); // Returns Inserted<UserModelValue, EnrichmentType>
|
|
39
37
|
*
|
|
40
38
|
* // Access the generated value (guaranteed to be present)
|
|
41
39
|
* const userTypeName = userModel.toValue(); // UserModelValue (not undefined)
|
|
@@ -146,37 +144,20 @@ class Inserted {
|
|
|
146
144
|
* Gets the generated value from the inserted artifact.
|
|
147
145
|
*
|
|
148
146
|
* This method returns the actual generated content with proper type safety
|
|
149
|
-
* based on the generation mode. For 'force' generation, the value is guaranteed
|
|
150
|
-
* to be present. For 'lazy' generation, the value might be undefined if
|
|
151
|
-
* generation was skipped.
|
|
152
147
|
*
|
|
153
|
-
* @returns The generated value
|
|
148
|
+
* @returns The generated value
|
|
154
149
|
*
|
|
155
|
-
* @example
|
|
150
|
+
* @example
|
|
156
151
|
* ```typescript
|
|
157
|
-
* const userModel = this.insertModel(generator, 'User');
|
|
158
|
-
* const value = userModel.toValue(); // UserModelValue
|
|
152
|
+
* const userModel = this.insertModel(generator, 'User');
|
|
153
|
+
* const value = userModel.toValue(); // UserModelValue
|
|
159
154
|
*
|
|
160
|
-
* //
|
|
155
|
+
* // Use the generated value
|
|
161
156
|
* const code = `type OrderUser = ${value};`;
|
|
162
157
|
* ```
|
|
163
|
-
*
|
|
164
|
-
* @example Lazy generation (optional value)
|
|
165
|
-
* ```typescript
|
|
166
|
-
* const optionalModel = this.insertModel(generator, 'Optional', { generation: 'lazy' });
|
|
167
|
-
* const value = optionalModel.toValue(); // OptionalValue | undefined
|
|
168
|
-
*
|
|
169
|
-
* if (value) {
|
|
170
|
-
* // Use the generated value
|
|
171
|
-
* const code = `type Optional = ${value};`;
|
|
172
|
-
* } else {
|
|
173
|
-
* // Handle missing value (generation was skipped)
|
|
174
|
-
* const code = 'type Optional = any; // Fallback';
|
|
175
|
-
* }
|
|
176
|
-
* ```
|
|
177
158
|
*/
|
|
178
159
|
toValue() {
|
|
179
|
-
return this.definition
|
|
160
|
+
return this.definition.value;
|
|
180
161
|
}
|
|
181
162
|
}
|
|
182
163
|
exports.Inserted = Inserted;
|
|
@@ -180,7 +180,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
180
180
|
* }
|
|
181
181
|
* ```
|
|
182
182
|
*/
|
|
183
|
-
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions
|
|
183
|
+
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions, 'noExport'>): Inserted<V, EnrichmentType>;
|
|
184
184
|
/**
|
|
185
185
|
* Inserts a related model with automatic schema normalization and reference resolution.
|
|
186
186
|
*
|
|
@@ -238,7 +238,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
238
238
|
* );
|
|
239
239
|
* ```
|
|
240
240
|
*/
|
|
241
|
-
insertNormalizedModel<V extends GeneratedValue, Schema extends OasSchema | OasRef<'schema'> | OasVoid, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs<Schema>, 'destinationPath'>, options?: Pick<InsertModelOptions
|
|
241
|
+
insertNormalizedModel<V extends GeneratedValue, Schema extends OasSchema | OasRef<'schema'> | OasVoid, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs<Schema>, 'destinationPath'>, options?: Pick<InsertModelOptions, 'noExport'>): InsertNormalisedModelReturn<V, Schema>;
|
|
242
242
|
/**
|
|
243
243
|
* Registers a file-level artifact with the generation context.
|
|
244
244
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,cAAc,GAAG,SAAS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,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,EAAE,UAAU,CAAM,GACjD,QAAQ,CAAC,CAAC,EAAE,cAAc,CAAC;IAO9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,UAAU,CAAM,GACjD,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACM,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -179,7 +179,6 @@ class ModelBase extends ContentBase_js_1.ContentBase {
|
|
|
179
179
|
*/
|
|
180
180
|
insertModel(insertable, refName, options = {}) {
|
|
181
181
|
return this.context.insertModel(insertable, refName, {
|
|
182
|
-
generation: 'force',
|
|
183
182
|
destinationPath: this.settings.exportPath,
|
|
184
183
|
noExport: options.noExport
|
|
185
184
|
});
|