@skmtc/core 0.0.692 → 0.0.694
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 +8 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +12 -8
- package/esm/dsl/Definition.d.ts +3 -1
- package/esm/dsl/Definition.d.ts.map +1 -1
- package/esm/dsl/Definition.js +9 -2
- 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 +3 -2
- package/esm/dsl/model/ModelDriver.d.ts +3 -1
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +10 -2
- package/esm/dsl/model/toModelBase.d.ts +1 -1
- package/esm/dsl/operation/OperationBase.d.ts +7 -6
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.js +14 -10
- package/esm/dsl/operation/OperationDriver.d.ts +3 -1
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +10 -2
- package/esm/dsl/operation/toOperationBase.d.ts +6 -5
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +8 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +12 -8
- package/script/dsl/Definition.d.ts +3 -1
- package/script/dsl/Definition.d.ts.map +1 -1
- package/script/dsl/Definition.js +9 -2
- 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 +3 -2
- package/script/dsl/model/ModelDriver.d.ts +3 -1
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +10 -2
- package/script/dsl/model/toModelBase.d.ts +1 -1
- package/script/dsl/operation/OperationBase.d.ts +7 -6
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.js +14 -10
- package/script/dsl/operation/OperationDriver.d.ts +3 -1
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +10 -2
- package/script/dsl/operation/toOperationBase.d.ts +6 -5
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
|
@@ -58,11 +58,13 @@ export type CreateAndRegisterDefinition<Schema extends SchemaType> = {
|
|
|
58
58
|
destinationPath: string;
|
|
59
59
|
schemaToValueFn: SchemaToValueFn;
|
|
60
60
|
rootRef?: RefName;
|
|
61
|
+
noExport?: boolean;
|
|
61
62
|
};
|
|
62
63
|
export type DefineAndRegisterArgs<V extends GeneratedValue> = {
|
|
63
64
|
identifier: Identifier;
|
|
64
65
|
value: V;
|
|
65
66
|
destinationPath: string;
|
|
67
|
+
noExport?: boolean;
|
|
66
68
|
};
|
|
67
69
|
export type GetOperationSettingsArgs = {
|
|
68
70
|
generatorId: string;
|
|
@@ -79,10 +81,12 @@ export type ToModelSettingsArgs = {
|
|
|
79
81
|
refName: RefName;
|
|
80
82
|
};
|
|
81
83
|
export type InsertOperationOptions<T extends GenerationType> = {
|
|
84
|
+
noExport?: boolean;
|
|
82
85
|
generation?: T;
|
|
83
86
|
destinationPath?: string;
|
|
84
87
|
};
|
|
85
88
|
export type InsertModelOptions<T extends GenerationType> = {
|
|
89
|
+
noExport?: boolean;
|
|
86
90
|
generation?: T;
|
|
87
91
|
destinationPath?: string;
|
|
88
92
|
};
|
|
@@ -131,13 +135,13 @@ export declare class GenerateContext {
|
|
|
131
135
|
* used to support circular references depending on generator implementation.
|
|
132
136
|
* @returns The created definition or cached definition if it already exists.
|
|
133
137
|
*/
|
|
134
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
138
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
135
139
|
/**
|
|
136
140
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
137
141
|
*
|
|
138
142
|
* @experimental
|
|
139
143
|
*/
|
|
140
|
-
defineAndRegister<V extends GeneratedValue>({ identifier, value, destinationPath }: DefineAndRegisterArgs<V>): Definition<V>;
|
|
144
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value, destinationPath, noExport }: DefineAndRegisterArgs<V>): Definition<V>;
|
|
141
145
|
/** @experimental */
|
|
142
146
|
registerJson({ destinationPath, json }: RegisterJsonArgs): void;
|
|
143
147
|
/**
|
|
@@ -166,7 +170,7 @@ export declare class GenerateContext {
|
|
|
166
170
|
* insertable's driver
|
|
167
171
|
* @mutates this.files
|
|
168
172
|
*/
|
|
169
|
-
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
173
|
+
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath, noExport }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
170
174
|
/**
|
|
171
175
|
* Insert model into the output file with path `destinationPath`.
|
|
172
176
|
*
|
|
@@ -181,7 +185,7 @@ export declare class GenerateContext {
|
|
|
181
185
|
* insertable's driver
|
|
182
186
|
* @mutates this.files
|
|
183
187
|
*/
|
|
184
|
-
insertModel<V extends GeneratedValue, T extends GenerationType, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { generation, destinationPath }?: InsertModelOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
188
|
+
insertModel<V extends GeneratedValue, T extends GenerationType, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { generation, destinationPath, noExport }?: InsertModelOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
185
189
|
/**
|
|
186
190
|
* Generate and return content settings for operation insertable and
|
|
187
191
|
* operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,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;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,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,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,KAAK,GAAG,MAAM,yCAAyC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,UAAU,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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,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,eAAO,MAAM,aAAa,GAAI,0BAA0B,iBAAiB,KAAG,WAI1E,CAAA"}
|
|
@@ -120,7 +120,7 @@ export class GenerateContext {
|
|
|
120
120
|
* used to support circular references depending on generator implementation.
|
|
121
121
|
* @returns The created definition or cached definition if it already exists.
|
|
122
122
|
*/
|
|
123
|
-
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef }) {
|
|
123
|
+
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }) {
|
|
124
124
|
const cachedDefinition = this.findDefinition({
|
|
125
125
|
name: identifier.name,
|
|
126
126
|
exportPath: destinationPath
|
|
@@ -140,7 +140,8 @@ export class GenerateContext {
|
|
|
140
140
|
return this.defineAndRegister({
|
|
141
141
|
identifier,
|
|
142
142
|
value,
|
|
143
|
-
destinationPath
|
|
143
|
+
destinationPath,
|
|
144
|
+
noExport
|
|
144
145
|
});
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
@@ -148,7 +149,7 @@ export class GenerateContext {
|
|
|
148
149
|
*
|
|
149
150
|
* @experimental
|
|
150
151
|
*/
|
|
151
|
-
defineAndRegister({ identifier, value, destinationPath }) {
|
|
152
|
+
defineAndRegister({ identifier, value, destinationPath, noExport }) {
|
|
152
153
|
// @TODO cache check is duplicatd if call comes from
|
|
153
154
|
// createAndRegisterDefinition. Look for a way to share code between
|
|
154
155
|
// these two functions
|
|
@@ -164,7 +165,8 @@ export class GenerateContext {
|
|
|
164
165
|
const definition = new Definition({
|
|
165
166
|
context: this,
|
|
166
167
|
identifier,
|
|
167
|
-
value
|
|
168
|
+
value,
|
|
169
|
+
noExport
|
|
168
170
|
});
|
|
169
171
|
this.register({
|
|
170
172
|
definitions: [definition],
|
|
@@ -241,13 +243,14 @@ export class GenerateContext {
|
|
|
241
243
|
* insertable's driver
|
|
242
244
|
* @mutates this.files
|
|
243
245
|
*/
|
|
244
|
-
insertOperation(insertable, operation, { generation, destinationPath } = {}) {
|
|
246
|
+
insertOperation(insertable, operation, { generation, destinationPath, noExport = false } = {}) {
|
|
245
247
|
const { settings, definition } = new OperationDriver({
|
|
246
248
|
context: this,
|
|
247
249
|
insertable,
|
|
248
250
|
operation,
|
|
249
251
|
generation,
|
|
250
|
-
destinationPath
|
|
252
|
+
destinationPath,
|
|
253
|
+
noExport
|
|
251
254
|
});
|
|
252
255
|
return new Inserted({ settings, definition });
|
|
253
256
|
}
|
|
@@ -265,14 +268,15 @@ export class GenerateContext {
|
|
|
265
268
|
* insertable's driver
|
|
266
269
|
* @mutates this.files
|
|
267
270
|
*/
|
|
268
|
-
insertModel(insertable, refName, { generation, destinationPath } = {}) {
|
|
271
|
+
insertModel(insertable, refName, { generation, destinationPath, noExport = false } = {}) {
|
|
269
272
|
const { settings, definition } = new ModelDriver({
|
|
270
273
|
context: this,
|
|
271
274
|
insertable,
|
|
272
275
|
refName,
|
|
273
276
|
generation,
|
|
274
277
|
destinationPath,
|
|
275
|
-
rootRef: refName
|
|
278
|
+
rootRef: refName,
|
|
279
|
+
noExport
|
|
276
280
|
});
|
|
277
281
|
return new Inserted({ settings, definition });
|
|
278
282
|
}
|
package/esm/dsl/Definition.d.ts
CHANGED
|
@@ -7,12 +7,14 @@ type ConstructorArgs<V extends GeneratedValue> = {
|
|
|
7
7
|
description?: string;
|
|
8
8
|
identifier: Identifier;
|
|
9
9
|
value: V;
|
|
10
|
+
noExport?: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare class Definition<V extends GeneratedValue = GeneratedValue> extends ContentBase {
|
|
12
13
|
identifier: Identifier;
|
|
13
14
|
description: string | undefined;
|
|
14
15
|
value: V;
|
|
15
|
-
|
|
16
|
+
noExport?: boolean;
|
|
17
|
+
constructor({ context, identifier, value, description, noExport }: ConstructorArgs<V>);
|
|
16
18
|
toString(): string;
|
|
17
19
|
}
|
|
18
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/dsl/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/dsl/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,WAAW;IACpF,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,CAAC,EAAE,OAAO,CAAA;gBAEN,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;IAS5E,QAAQ,IAAI,MAAM;CAa5B"}
|
package/esm/dsl/Definition.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ContentBase } from './ContentBase.js';
|
|
2
2
|
import { withDescription } from '../typescript/withDescription.js';
|
|
3
3
|
export class Definition extends ContentBase {
|
|
4
|
-
constructor({ context, identifier, value, description }) {
|
|
4
|
+
constructor({ context, identifier, value, description, noExport }) {
|
|
5
5
|
super({ context, generatorKey: value.generatorKey });
|
|
6
6
|
Object.defineProperty(this, "identifier", {
|
|
7
7
|
enumerable: true,
|
|
@@ -21,16 +21,23 @@ export class Definition extends ContentBase {
|
|
|
21
21
|
writable: true,
|
|
22
22
|
value: void 0
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(this, "noExport", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
24
30
|
this.value = value;
|
|
25
31
|
this.identifier = identifier;
|
|
26
32
|
this.description = description;
|
|
33
|
+
this.noExport = noExport;
|
|
27
34
|
}
|
|
28
35
|
toString() {
|
|
29
36
|
const identifier = this.identifier.typeName
|
|
30
37
|
? `${this.identifier.name}: ${this.identifier.typeName}`
|
|
31
38
|
: this.identifier.name;
|
|
32
39
|
// @TODO move syntax to typescript package to enable language agnostic use
|
|
33
|
-
return withDescription(
|
|
40
|
+
return withDescription(`${this.noExport ? '' : 'export '}${this.identifier.entityType} ${identifier} = ${this.value};\n`, {
|
|
34
41
|
description: this.description
|
|
35
42
|
});
|
|
36
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
1
|
+
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
3
3
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
4
4
|
import type { RefName } from '../../types/RefName.js';
|
|
@@ -17,7 +17,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
17
17
|
refName: RefName;
|
|
18
18
|
generatorKey: GeneratorKey;
|
|
19
19
|
constructor({ context, settings, generatorKey, refName }: ModelBaseArgs<EnrichmentType>);
|
|
20
|
-
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
20
|
+
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
21
21
|
register(args: BaseRegisterArgs): void;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=ModelBase.d.ts.map
|
|
@@ -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":"A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,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -24,10 +24,11 @@ export class ModelBase extends ContentBase {
|
|
|
24
24
|
this.refName = refName;
|
|
25
25
|
this.settings = settings;
|
|
26
26
|
}
|
|
27
|
-
insertModel(insertable, refName) {
|
|
27
|
+
insertModel(insertable, refName, options = {}) {
|
|
28
28
|
return this.context.insertModel(insertable, refName, {
|
|
29
29
|
generation: 'force',
|
|
30
|
-
destinationPath: this.settings.exportPath
|
|
30
|
+
destinationPath: this.settings.exportPath,
|
|
31
|
+
noExport: options.noExport
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
register(args) {
|
|
@@ -11,6 +11,7 @@ type CreateModelArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
11
11
|
generation?: T;
|
|
12
12
|
destinationPath?: string;
|
|
13
13
|
rootRef?: RefName;
|
|
14
|
+
noExport?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare class ModelDriver<V extends GeneratedValue, T extends GenerationType, EnrichmentType> {
|
|
16
17
|
context: GenerateContext;
|
|
@@ -20,7 +21,8 @@ export declare class ModelDriver<V extends GeneratedValue, T extends GenerationT
|
|
|
20
21
|
destinationPath?: string;
|
|
21
22
|
definition: GeneratedDefinition<V, T>;
|
|
22
23
|
rootRef?: RefName;
|
|
23
|
-
|
|
24
|
+
noExport?: boolean;
|
|
25
|
+
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }: CreateModelArgs<V, T, EnrichmentType>);
|
|
24
26
|
private apply;
|
|
25
27
|
private getDefinition;
|
|
26
28
|
private affirmDefinition;
|
|
@@ -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;AACv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AAC,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,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;gBACN,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,OAAO,CAAC,KAAK;IAuBb,OAAO,CAAC,aAAa;IA2CrB,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -2,7 +2,7 @@ import { normalize } from '../../deps/jsr.io/@std/path/1.1.1/mod.js';
|
|
|
2
2
|
import { Definition } from '../Definition.js';
|
|
3
3
|
import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
4
4
|
export class ModelDriver {
|
|
5
|
-
constructor({ context, insertable, refName, generation, destinationPath, rootRef }) {
|
|
5
|
+
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }) {
|
|
6
6
|
Object.defineProperty(this, "context", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
configurable: true,
|
|
@@ -45,11 +45,18 @@ export class ModelDriver {
|
|
|
45
45
|
writable: true,
|
|
46
46
|
value: void 0
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(this, "noExport", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: void 0
|
|
53
|
+
});
|
|
48
54
|
this.context = context;
|
|
49
55
|
this.insertable = insertable;
|
|
50
56
|
this.refName = refName;
|
|
51
57
|
this.destinationPath = destinationPath;
|
|
52
58
|
this.rootRef = rootRef;
|
|
59
|
+
this.noExport = noExport;
|
|
53
60
|
this.context.modelDepth[`${insertable.id}:${refName}`] = 0;
|
|
54
61
|
this.settings = this.context.toModelContentSettings({ refName, insertable });
|
|
55
62
|
this.definition = this.apply({ generation, destinationPath });
|
|
@@ -96,7 +103,8 @@ export class ModelDriver {
|
|
|
96
103
|
const definition = new Definition({
|
|
97
104
|
context: this.context,
|
|
98
105
|
value,
|
|
99
|
-
identifier
|
|
106
|
+
identifier,
|
|
107
|
+
noExport: this.noExport
|
|
100
108
|
});
|
|
101
109
|
this.context.register({
|
|
102
110
|
definitions: [definition],
|
|
@@ -23,7 +23,7 @@ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModel
|
|
|
23
23
|
settings: ContentSettings<EnrichmentType>;
|
|
24
24
|
refName: RefName;
|
|
25
25
|
generatorKey: import("../../mod.js").GeneratorKey;
|
|
26
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_1>, refName: RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
26
|
+
insertModel<V extends import("../../mod.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>;
|
|
27
27
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
28
28
|
context: GenerateContext;
|
|
29
29
|
skipped: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
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, CreateAndRegisterDefinition, DefineAndRegisterArgs } from '../../context/GenerateContext.js';
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, CreateAndRegisterDefinition, DefineAndRegisterArgs, InsertOperationOptions, InsertModelOptions } from '../../context/GenerateContext.js';
|
|
5
5
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
6
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
@@ -21,20 +21,21 @@ type CreateAndRegisterCannonicalArgs<Schema extends SchemaType> = {
|
|
|
21
21
|
schema: Schema;
|
|
22
22
|
fallbackIdentifier: Identifier;
|
|
23
23
|
schemaToValueFn: SchemaToValueFn;
|
|
24
|
+
noExport?: boolean;
|
|
24
25
|
};
|
|
25
26
|
export declare class OperationBase<EnrichmentType = undefined> extends ContentBase {
|
|
26
27
|
settings: ContentSettings<EnrichmentType>;
|
|
27
28
|
operation: OasOperation;
|
|
28
29
|
generatorKey: GeneratorKey;
|
|
29
30
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
30
|
-
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation): Inserted<V, 'force', EnrichmentType>;
|
|
31
|
-
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
31
|
+
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, options?: Pick<InsertOperationOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
32
|
+
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
32
33
|
/** @experimental */
|
|
33
|
-
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
|
+
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn, noExport }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
35
|
/** @experimental */
|
|
35
|
-
defineAndRegister<V extends GeneratedValue>({ identifier, value }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value, noExport }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
37
|
/** @experimental */
|
|
37
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
38
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
38
39
|
register(args: BaseRegisterArgs): void;
|
|
39
40
|
}
|
|
40
41
|
export {};
|
|
@@ -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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MAAM,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAC1E,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IAWQ,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -24,20 +24,22 @@ export class OperationBase extends ContentBase {
|
|
|
24
24
|
this.operation = operation;
|
|
25
25
|
this.settings = settings;
|
|
26
26
|
}
|
|
27
|
-
insertOperation(insertable, operation) {
|
|
27
|
+
insertOperation(insertable, operation, options = {}) {
|
|
28
28
|
return this.context.insertOperation(insertable, operation, {
|
|
29
29
|
generation: 'force',
|
|
30
|
-
destinationPath: this.settings.exportPath
|
|
30
|
+
destinationPath: this.settings.exportPath,
|
|
31
|
+
noExport: options.noExport
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
insertModel(insertable, refName) {
|
|
34
|
+
insertModel(insertable, refName, options = {}) {
|
|
34
35
|
return this.context.insertModel(insertable, refName, {
|
|
35
36
|
generation: 'force',
|
|
36
|
-
destinationPath: this.settings.exportPath
|
|
37
|
+
destinationPath: this.settings.exportPath,
|
|
38
|
+
noExport: options.noExport
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
41
|
/** @experimental */
|
|
40
|
-
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn }) {
|
|
42
|
+
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn, noExport }) {
|
|
41
43
|
const value = schemaToValueFn({
|
|
42
44
|
context: this.context,
|
|
43
45
|
schema,
|
|
@@ -47,24 +49,26 @@ export class OperationBase extends ContentBase {
|
|
|
47
49
|
});
|
|
48
50
|
return schema.isRef()
|
|
49
51
|
? value
|
|
50
|
-
: this.defineAndRegister({ identifier: fallbackIdentifier, value }).value;
|
|
52
|
+
: this.defineAndRegister({ identifier: fallbackIdentifier, value, noExport }).value;
|
|
51
53
|
}
|
|
52
54
|
/** @experimental */
|
|
53
|
-
defineAndRegister({ identifier, value }) {
|
|
55
|
+
defineAndRegister({ identifier, value, noExport }) {
|
|
54
56
|
return this.context.defineAndRegister({
|
|
55
57
|
identifier,
|
|
56
58
|
value,
|
|
57
|
-
destinationPath: this.settings.exportPath
|
|
59
|
+
destinationPath: this.settings.exportPath,
|
|
60
|
+
noExport
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
/** @experimental */
|
|
61
|
-
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef }) {
|
|
64
|
+
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef, noExport }) {
|
|
62
65
|
return this.context.createAndRegisterDefinition({
|
|
63
66
|
schema,
|
|
64
67
|
identifier,
|
|
65
68
|
schemaToValueFn,
|
|
66
69
|
destinationPath: this.settings.exportPath,
|
|
67
|
-
rootRef: rootRef
|
|
70
|
+
rootRef: rootRef,
|
|
71
|
+
noExport
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
register(args) {
|
|
@@ -10,6 +10,7 @@ type CreateOperationArgs<V extends GeneratedValue, T extends GenerationType, Enr
|
|
|
10
10
|
operation: OasOperation;
|
|
11
11
|
generation?: T;
|
|
12
12
|
destinationPath?: string;
|
|
13
|
+
noExport?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare class OperationDriver<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined> {
|
|
15
16
|
context: GenerateContext;
|
|
@@ -18,7 +19,8 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
|
|
|
18
19
|
settings: ContentSettings<EnrichmentType>;
|
|
19
20
|
destinationPath?: string;
|
|
20
21
|
definition: GeneratedDefinition<V, T>;
|
|
21
|
-
|
|
22
|
+
noExport?: boolean;
|
|
23
|
+
constructor({ context, insertable, operation, generation, destinationPath, noExport }: CreateOperationArgs<V, T, EnrichmentType>);
|
|
22
24
|
private apply;
|
|
23
25
|
private getDefinition;
|
|
24
26
|
private affirmDefinition;
|
|
@@ -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,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,mBAAmB,CACtB,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc,EACxB,cAAc,GAAG,SAAS,IACxB;IACF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,SAAS,EAAE,YAAY,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;
|
|
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,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,mBAAmB,CACtB,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc,EACxB,cAAc,GAAG,SAAS,IACxB;IACF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,SAAS,EAAE,YAAY,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAYD,qBAAa,eAAe,CAC1B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc,EACxB,cAAc,GAAG,SAAS;IAE1B,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,SAAS,EAAE,YAAY,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;gBACN,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,QAAQ,EACT,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAc5C,OAAO,CAAC,KAAK;IAuBb,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -2,7 +2,7 @@ import { normalize } from '../../deps/jsr.io/@std/path/1.1.1/mod.js';
|
|
|
2
2
|
import { Definition } from '../Definition.js';
|
|
3
3
|
import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
4
4
|
export class OperationDriver {
|
|
5
|
-
constructor({ context, insertable, operation, generation, destinationPath }) {
|
|
5
|
+
constructor({ context, insertable, operation, generation, destinationPath, noExport }) {
|
|
6
6
|
Object.defineProperty(this, "context", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
configurable: true,
|
|
@@ -39,10 +39,17 @@ export class OperationDriver {
|
|
|
39
39
|
writable: true,
|
|
40
40
|
value: void 0
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(this, "noExport", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: void 0
|
|
47
|
+
});
|
|
42
48
|
this.context = context;
|
|
43
49
|
this.insertable = insertable;
|
|
44
50
|
this.operation = operation;
|
|
45
51
|
this.destinationPath = destinationPath;
|
|
52
|
+
this.noExport = noExport;
|
|
46
53
|
this.settings = this.context.toOperationContentSettings({
|
|
47
54
|
operation,
|
|
48
55
|
insertable
|
|
@@ -80,7 +87,8 @@ export class OperationDriver {
|
|
|
80
87
|
const definition = new Definition({
|
|
81
88
|
context: this.context,
|
|
82
89
|
value,
|
|
83
|
-
identifier
|
|
90
|
+
identifier,
|
|
91
|
+
noExport: this.noExport
|
|
84
92
|
});
|
|
85
93
|
this.context.register({
|
|
86
94
|
definitions: [definition],
|
|
@@ -18,15 +18,16 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
18
18
|
settings: import("../ContentSettings.js").ContentSettings<EnrichmentType>;
|
|
19
19
|
operation: OasOperation;
|
|
20
20
|
generatorKey: import("../../mod.js").GeneratorKey;
|
|
21
|
-
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
-
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: {
|
|
21
|
+
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../mod.js").InsertOperationOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
|
+
insertModel<V extends import("../../mod.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<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
+
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn, noExport }: {
|
|
24
24
|
schema: Schema;
|
|
25
25
|
fallbackIdentifier: Identifier;
|
|
26
26
|
schemaToValueFn: import("../../mod.js").SchemaToValueFn;
|
|
27
|
+
noExport?: boolean;
|
|
27
28
|
}): import("../../mod.js").TypeSystemOutput<Schema["type"]>;
|
|
28
|
-
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
29
|
-
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<import("../../mod.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
29
|
+
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
30
|
+
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<import("../../mod.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
30
31
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
31
32
|
context: GenerateContext;
|
|
32
33
|
skipped: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAA;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC;eAoBvB,uBAAuB,CAAC,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAA;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC;eAoBvB,uBAAuB,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;UAhB3C,WAAW;8BAfD,YAAY,KAAK,UAAU;8BAC3B,YAAY,KAAK,MAAM;oBAmBvB,wBAAwB,iBAAiB,KAAG,cAAc;CAqBrF,CAAA"}
|
package/package.json
CHANGED
|
@@ -58,11 +58,13 @@ export type CreateAndRegisterDefinition<Schema extends SchemaType> = {
|
|
|
58
58
|
destinationPath: string;
|
|
59
59
|
schemaToValueFn: SchemaToValueFn;
|
|
60
60
|
rootRef?: RefName;
|
|
61
|
+
noExport?: boolean;
|
|
61
62
|
};
|
|
62
63
|
export type DefineAndRegisterArgs<V extends GeneratedValue> = {
|
|
63
64
|
identifier: Identifier;
|
|
64
65
|
value: V;
|
|
65
66
|
destinationPath: string;
|
|
67
|
+
noExport?: boolean;
|
|
66
68
|
};
|
|
67
69
|
export type GetOperationSettingsArgs = {
|
|
68
70
|
generatorId: string;
|
|
@@ -79,10 +81,12 @@ export type ToModelSettingsArgs = {
|
|
|
79
81
|
refName: RefName;
|
|
80
82
|
};
|
|
81
83
|
export type InsertOperationOptions<T extends GenerationType> = {
|
|
84
|
+
noExport?: boolean;
|
|
82
85
|
generation?: T;
|
|
83
86
|
destinationPath?: string;
|
|
84
87
|
};
|
|
85
88
|
export type InsertModelOptions<T extends GenerationType> = {
|
|
89
|
+
noExport?: boolean;
|
|
86
90
|
generation?: T;
|
|
87
91
|
destinationPath?: string;
|
|
88
92
|
};
|
|
@@ -131,13 +135,13 @@ export declare class GenerateContext {
|
|
|
131
135
|
* used to support circular references depending on generator implementation.
|
|
132
136
|
* @returns The created definition or cached definition if it already exists.
|
|
133
137
|
*/
|
|
134
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
138
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
135
139
|
/**
|
|
136
140
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
137
141
|
*
|
|
138
142
|
* @experimental
|
|
139
143
|
*/
|
|
140
|
-
defineAndRegister<V extends GeneratedValue>({ identifier, value, destinationPath }: DefineAndRegisterArgs<V>): Definition<V>;
|
|
144
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value, destinationPath, noExport }: DefineAndRegisterArgs<V>): Definition<V>;
|
|
141
145
|
/** @experimental */
|
|
142
146
|
registerJson({ destinationPath, json }: RegisterJsonArgs): void;
|
|
143
147
|
/**
|
|
@@ -166,7 +170,7 @@ export declare class GenerateContext {
|
|
|
166
170
|
* insertable's driver
|
|
167
171
|
* @mutates this.files
|
|
168
172
|
*/
|
|
169
|
-
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
173
|
+
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath, noExport }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
170
174
|
/**
|
|
171
175
|
* Insert model into the output file with path `destinationPath`.
|
|
172
176
|
*
|
|
@@ -181,7 +185,7 @@ export declare class GenerateContext {
|
|
|
181
185
|
* insertable's driver
|
|
182
186
|
* @mutates this.files
|
|
183
187
|
*/
|
|
184
|
-
insertModel<V extends GeneratedValue, T extends GenerationType, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { generation, destinationPath }?: InsertModelOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
188
|
+
insertModel<V extends GeneratedValue, T extends GenerationType, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, { generation, destinationPath, noExport }?: InsertModelOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
185
189
|
/**
|
|
186
190
|
* Generate and return content settings for operation insertable and
|
|
187
191
|
* operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,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;AAE/C,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SAAS,cAAc,EAAE,cAAc,EAC5E,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,OAAO,EAAE,OAAO,EAChB,EAAE,UAAU,EAAE,eAAe,EAAE,QAAgB,EAAE,GAAE,kBAAkB,CAAC,CAAC,CAAM,GAC5E,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAcjC;;;;;;;;;OASG;IACH,0BAA0B,CAAC,CAAC,EAAE,cAAc,EAAE,EAC5C,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,eAAe,CAAC,cAAc,CAAC;IAQ/E;;;;;;;;OAQG;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,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,eAAO,MAAM,aAAa,GAAI,0BAA0B,iBAAiB,KAAG,WAI1E,CAAA"}
|
|
@@ -159,7 +159,7 @@ class GenerateContext {
|
|
|
159
159
|
* used to support circular references depending on generator implementation.
|
|
160
160
|
* @returns The created definition or cached definition if it already exists.
|
|
161
161
|
*/
|
|
162
|
-
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef }) {
|
|
162
|
+
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }) {
|
|
163
163
|
const cachedDefinition = this.findDefinition({
|
|
164
164
|
name: identifier.name,
|
|
165
165
|
exportPath: destinationPath
|
|
@@ -179,7 +179,8 @@ class GenerateContext {
|
|
|
179
179
|
return this.defineAndRegister({
|
|
180
180
|
identifier,
|
|
181
181
|
value,
|
|
182
|
-
destinationPath
|
|
182
|
+
destinationPath,
|
|
183
|
+
noExport
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
186
|
/**
|
|
@@ -187,7 +188,7 @@ class GenerateContext {
|
|
|
187
188
|
*
|
|
188
189
|
* @experimental
|
|
189
190
|
*/
|
|
190
|
-
defineAndRegister({ identifier, value, destinationPath }) {
|
|
191
|
+
defineAndRegister({ identifier, value, destinationPath, noExport }) {
|
|
191
192
|
// @TODO cache check is duplicatd if call comes from
|
|
192
193
|
// createAndRegisterDefinition. Look for a way to share code between
|
|
193
194
|
// these two functions
|
|
@@ -203,7 +204,8 @@ class GenerateContext {
|
|
|
203
204
|
const definition = new Definition_js_1.Definition({
|
|
204
205
|
context: this,
|
|
205
206
|
identifier,
|
|
206
|
-
value
|
|
207
|
+
value,
|
|
208
|
+
noExport
|
|
207
209
|
});
|
|
208
210
|
this.register({
|
|
209
211
|
definitions: [definition],
|
|
@@ -280,13 +282,14 @@ class GenerateContext {
|
|
|
280
282
|
* insertable's driver
|
|
281
283
|
* @mutates this.files
|
|
282
284
|
*/
|
|
283
|
-
insertOperation(insertable, operation, { generation, destinationPath } = {}) {
|
|
285
|
+
insertOperation(insertable, operation, { generation, destinationPath, noExport = false } = {}) {
|
|
284
286
|
const { settings, definition } = new OperationDriver_js_1.OperationDriver({
|
|
285
287
|
context: this,
|
|
286
288
|
insertable,
|
|
287
289
|
operation,
|
|
288
290
|
generation,
|
|
289
|
-
destinationPath
|
|
291
|
+
destinationPath,
|
|
292
|
+
noExport
|
|
290
293
|
});
|
|
291
294
|
return new Inserted_js_1.Inserted({ settings, definition });
|
|
292
295
|
}
|
|
@@ -304,14 +307,15 @@ class GenerateContext {
|
|
|
304
307
|
* insertable's driver
|
|
305
308
|
* @mutates this.files
|
|
306
309
|
*/
|
|
307
|
-
insertModel(insertable, refName, { generation, destinationPath } = {}) {
|
|
310
|
+
insertModel(insertable, refName, { generation, destinationPath, noExport = false } = {}) {
|
|
308
311
|
const { settings, definition } = new ModelDriver_js_1.ModelDriver({
|
|
309
312
|
context: this,
|
|
310
313
|
insertable,
|
|
311
314
|
refName,
|
|
312
315
|
generation,
|
|
313
316
|
destinationPath,
|
|
314
|
-
rootRef: refName
|
|
317
|
+
rootRef: refName,
|
|
318
|
+
noExport
|
|
315
319
|
});
|
|
316
320
|
return new Inserted_js_1.Inserted({ settings, definition });
|
|
317
321
|
}
|
|
@@ -7,12 +7,14 @@ type ConstructorArgs<V extends GeneratedValue> = {
|
|
|
7
7
|
description?: string;
|
|
8
8
|
identifier: Identifier;
|
|
9
9
|
value: V;
|
|
10
|
+
noExport?: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare class Definition<V extends GeneratedValue = GeneratedValue> extends ContentBase {
|
|
12
13
|
identifier: Identifier;
|
|
13
14
|
description: string | undefined;
|
|
14
15
|
value: V;
|
|
15
|
-
|
|
16
|
+
noExport?: boolean;
|
|
17
|
+
constructor({ context, identifier, value, description, noExport }: ConstructorArgs<V>);
|
|
16
18
|
toString(): string;
|
|
17
19
|
}
|
|
18
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/dsl/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/dsl/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,WAAW;IACpF,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,CAAC,EAAE,OAAO,CAAA;gBAEN,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;IAS5E,QAAQ,IAAI,MAAM;CAa5B"}
|
package/script/dsl/Definition.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Definition = void 0;
|
|
|
4
4
|
const ContentBase_js_1 = require("./ContentBase.js");
|
|
5
5
|
const withDescription_js_1 = require("../typescript/withDescription.js");
|
|
6
6
|
class Definition extends ContentBase_js_1.ContentBase {
|
|
7
|
-
constructor({ context, identifier, value, description }) {
|
|
7
|
+
constructor({ context, identifier, value, description, noExport }) {
|
|
8
8
|
super({ context, generatorKey: value.generatorKey });
|
|
9
9
|
Object.defineProperty(this, "identifier", {
|
|
10
10
|
enumerable: true,
|
|
@@ -24,16 +24,23 @@ class Definition extends ContentBase_js_1.ContentBase {
|
|
|
24
24
|
writable: true,
|
|
25
25
|
value: void 0
|
|
26
26
|
});
|
|
27
|
+
Object.defineProperty(this, "noExport", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
27
33
|
this.value = value;
|
|
28
34
|
this.identifier = identifier;
|
|
29
35
|
this.description = description;
|
|
36
|
+
this.noExport = noExport;
|
|
30
37
|
}
|
|
31
38
|
toString() {
|
|
32
39
|
const identifier = this.identifier.typeName
|
|
33
40
|
? `${this.identifier.name}: ${this.identifier.typeName}`
|
|
34
41
|
: this.identifier.name;
|
|
35
42
|
// @TODO move syntax to typescript package to enable language agnostic use
|
|
36
|
-
return (0, withDescription_js_1.withDescription)(
|
|
43
|
+
return (0, withDescription_js_1.withDescription)(`${this.noExport ? '' : 'export '}${this.identifier.entityType} ${identifier} = ${this.value};\n`, {
|
|
37
44
|
description: this.description
|
|
38
45
|
});
|
|
39
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
1
|
+
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
3
3
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
4
4
|
import type { RefName } from '../../types/RefName.js';
|
|
@@ -17,7 +17,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
17
17
|
refName: RefName;
|
|
18
18
|
generatorKey: GeneratorKey;
|
|
19
19
|
constructor({ context, settings, generatorKey, refName }: ModelBaseArgs<EnrichmentType>);
|
|
20
|
-
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
20
|
+
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
21
21
|
register(args: BaseRegisterArgs): void;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=ModelBase.d.ts.map
|
|
@@ -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,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EACnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,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;AAE9C,MAAM,MAAM,aAAa,CAAC,cAAc,GAAG,SAAS,IAAI;IACtD,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,YAAY,EAAE,YAAY,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,qBAAa,SAAS,CAAC,cAAc,GAAG,SAAS,CAAE,SAAQ,WAAW;IACpE,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;IAEP,YAAY,EAAE,YAAY,CAAA;gBACvB,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,cAAc,CAAC;IAQvF,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;IAQ9B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -27,10 +27,11 @@ class ModelBase extends ContentBase_js_1.ContentBase {
|
|
|
27
27
|
this.refName = refName;
|
|
28
28
|
this.settings = settings;
|
|
29
29
|
}
|
|
30
|
-
insertModel(insertable, refName) {
|
|
30
|
+
insertModel(insertable, refName, options = {}) {
|
|
31
31
|
return this.context.insertModel(insertable, refName, {
|
|
32
32
|
generation: 'force',
|
|
33
|
-
destinationPath: this.settings.exportPath
|
|
33
|
+
destinationPath: this.settings.exportPath,
|
|
34
|
+
noExport: options.noExport
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
register(args) {
|
|
@@ -11,6 +11,7 @@ type CreateModelArgs<V extends GeneratedValue, T extends GenerationType, Enrichm
|
|
|
11
11
|
generation?: T;
|
|
12
12
|
destinationPath?: string;
|
|
13
13
|
rootRef?: RefName;
|
|
14
|
+
noExport?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare class ModelDriver<V extends GeneratedValue, T extends GenerationType, EnrichmentType> {
|
|
16
17
|
context: GenerateContext;
|
|
@@ -20,7 +21,8 @@ export declare class ModelDriver<V extends GeneratedValue, T extends GenerationT
|
|
|
20
21
|
destinationPath?: string;
|
|
21
22
|
definition: GeneratedDefinition<V, T>;
|
|
22
23
|
rootRef?: RefName;
|
|
23
|
-
|
|
24
|
+
noExport?: boolean;
|
|
25
|
+
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }: CreateModelArgs<V, T, EnrichmentType>);
|
|
24
26
|
private apply;
|
|
25
27
|
private getDefinition;
|
|
26
28
|
private affirmDefinition;
|
|
@@ -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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CAAC,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;gBACN,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,OAAO,CAAC,KAAK;IAuBb,OAAO,CAAC,aAAa;IA2CrB,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -5,7 +5,7 @@ const mod_js_1 = require("../../deps/jsr.io/@std/path/1.1.1/mod.js");
|
|
|
5
5
|
const Definition_js_1 = require("../Definition.js");
|
|
6
6
|
const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
|
|
7
7
|
class ModelDriver {
|
|
8
|
-
constructor({ context, insertable, refName, generation, destinationPath, rootRef }) {
|
|
8
|
+
constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }) {
|
|
9
9
|
Object.defineProperty(this, "context", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
configurable: true,
|
|
@@ -48,11 +48,18 @@ class ModelDriver {
|
|
|
48
48
|
writable: true,
|
|
49
49
|
value: void 0
|
|
50
50
|
});
|
|
51
|
+
Object.defineProperty(this, "noExport", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: void 0
|
|
56
|
+
});
|
|
51
57
|
this.context = context;
|
|
52
58
|
this.insertable = insertable;
|
|
53
59
|
this.refName = refName;
|
|
54
60
|
this.destinationPath = destinationPath;
|
|
55
61
|
this.rootRef = rootRef;
|
|
62
|
+
this.noExport = noExport;
|
|
56
63
|
this.context.modelDepth[`${insertable.id}:${refName}`] = 0;
|
|
57
64
|
this.settings = this.context.toModelContentSettings({ refName, insertable });
|
|
58
65
|
this.definition = this.apply({ generation, destinationPath });
|
|
@@ -99,7 +106,8 @@ class ModelDriver {
|
|
|
99
106
|
const definition = new Definition_js_1.Definition({
|
|
100
107
|
context: this.context,
|
|
101
108
|
value,
|
|
102
|
-
identifier
|
|
109
|
+
identifier,
|
|
110
|
+
noExport: this.noExport
|
|
103
111
|
});
|
|
104
112
|
this.context.register({
|
|
105
113
|
definitions: [definition],
|
|
@@ -23,7 +23,7 @@ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModel
|
|
|
23
23
|
settings: ContentSettings<EnrichmentType>;
|
|
24
24
|
refName: RefName;
|
|
25
25
|
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey;
|
|
26
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_1>, refName: RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
26
|
+
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_1>, refName: RefName, options?: Pick<import("../../context/GenerateContext.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
27
27
|
register(args: import("../../context/GenerateContext.js").BaseRegisterArgs): void;
|
|
28
28
|
context: GenerateContext;
|
|
29
29
|
skipped: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
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, CreateAndRegisterDefinition, DefineAndRegisterArgs } from '../../context/GenerateContext.js';
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, CreateAndRegisterDefinition, DefineAndRegisterArgs, InsertOperationOptions, InsertModelOptions } from '../../context/GenerateContext.js';
|
|
5
5
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
6
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
@@ -21,20 +21,21 @@ type CreateAndRegisterCannonicalArgs<Schema extends SchemaType> = {
|
|
|
21
21
|
schema: Schema;
|
|
22
22
|
fallbackIdentifier: Identifier;
|
|
23
23
|
schemaToValueFn: SchemaToValueFn;
|
|
24
|
+
noExport?: boolean;
|
|
24
25
|
};
|
|
25
26
|
export declare class OperationBase<EnrichmentType = undefined> extends ContentBase {
|
|
26
27
|
settings: ContentSettings<EnrichmentType>;
|
|
27
28
|
operation: OasOperation;
|
|
28
29
|
generatorKey: GeneratorKey;
|
|
29
30
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
30
|
-
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation): Inserted<V, 'force', EnrichmentType>;
|
|
31
|
-
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
31
|
+
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, options?: Pick<InsertOperationOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
32
|
+
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
32
33
|
/** @experimental */
|
|
33
|
-
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
|
+
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn, noExport }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
35
|
/** @experimental */
|
|
35
|
-
defineAndRegister<V extends GeneratedValue>({ identifier, value }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value, noExport }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
37
|
/** @experimental */
|
|
37
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
38
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
38
39
|
register(args: BaseRegisterArgs): void;
|
|
39
40
|
}
|
|
40
41
|
export {};
|
|
@@ -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,EACf,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;A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AAC,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,oBAAoB;IACpB,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACT,EAAE,+BAA+B,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAc7E,oBAAoB;IACpB,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,oBAAoB;IACpB,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,UAAU,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACT,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAC1E,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IAWQ,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -27,20 +27,22 @@ class OperationBase extends ContentBase_js_1.ContentBase {
|
|
|
27
27
|
this.operation = operation;
|
|
28
28
|
this.settings = settings;
|
|
29
29
|
}
|
|
30
|
-
insertOperation(insertable, operation) {
|
|
30
|
+
insertOperation(insertable, operation, options = {}) {
|
|
31
31
|
return this.context.insertOperation(insertable, operation, {
|
|
32
32
|
generation: 'force',
|
|
33
|
-
destinationPath: this.settings.exportPath
|
|
33
|
+
destinationPath: this.settings.exportPath,
|
|
34
|
+
noExport: options.noExport
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
insertModel(insertable, refName) {
|
|
37
|
+
insertModel(insertable, refName, options = {}) {
|
|
37
38
|
return this.context.insertModel(insertable, refName, {
|
|
38
39
|
generation: 'force',
|
|
39
|
-
destinationPath: this.settings.exportPath
|
|
40
|
+
destinationPath: this.settings.exportPath,
|
|
41
|
+
noExport: options.noExport
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
/** @experimental */
|
|
43
|
-
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn }) {
|
|
45
|
+
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn, noExport }) {
|
|
44
46
|
const value = schemaToValueFn({
|
|
45
47
|
context: this.context,
|
|
46
48
|
schema,
|
|
@@ -50,24 +52,26 @@ class OperationBase extends ContentBase_js_1.ContentBase {
|
|
|
50
52
|
});
|
|
51
53
|
return schema.isRef()
|
|
52
54
|
? value
|
|
53
|
-
: this.defineAndRegister({ identifier: fallbackIdentifier, value }).value;
|
|
55
|
+
: this.defineAndRegister({ identifier: fallbackIdentifier, value, noExport }).value;
|
|
54
56
|
}
|
|
55
57
|
/** @experimental */
|
|
56
|
-
defineAndRegister({ identifier, value }) {
|
|
58
|
+
defineAndRegister({ identifier, value, noExport }) {
|
|
57
59
|
return this.context.defineAndRegister({
|
|
58
60
|
identifier,
|
|
59
61
|
value,
|
|
60
|
-
destinationPath: this.settings.exportPath
|
|
62
|
+
destinationPath: this.settings.exportPath,
|
|
63
|
+
noExport
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
66
|
/** @experimental */
|
|
64
|
-
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef }) {
|
|
67
|
+
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef, noExport }) {
|
|
65
68
|
return this.context.createAndRegisterDefinition({
|
|
66
69
|
schema,
|
|
67
70
|
identifier,
|
|
68
71
|
schemaToValueFn,
|
|
69
72
|
destinationPath: this.settings.exportPath,
|
|
70
|
-
rootRef: rootRef
|
|
73
|
+
rootRef: rootRef,
|
|
74
|
+
noExport
|
|
71
75
|
});
|
|
72
76
|
}
|
|
73
77
|
register(args) {
|
|
@@ -10,6 +10,7 @@ type CreateOperationArgs<V extends GeneratedValue, T extends GenerationType, Enr
|
|
|
10
10
|
operation: OasOperation;
|
|
11
11
|
generation?: T;
|
|
12
12
|
destinationPath?: string;
|
|
13
|
+
noExport?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare class OperationDriver<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined> {
|
|
15
16
|
context: GenerateContext;
|
|
@@ -18,7 +19,8 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
|
|
|
18
19
|
settings: ContentSettings<EnrichmentType>;
|
|
19
20
|
destinationPath?: string;
|
|
20
21
|
definition: GeneratedDefinition<V, T>;
|
|
21
|
-
|
|
22
|
+
noExport?: boolean;
|
|
23
|
+
constructor({ context, insertable, operation, generation, destinationPath, noExport }: CreateOperationArgs<V, T, EnrichmentType>);
|
|
22
24
|
private apply;
|
|
23
25
|
private getDefinition;
|
|
24
26
|
private affirmDefinition;
|
|
@@ -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,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC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AE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAClD,SAAS,EAAE,YAAY,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;gBACN,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,QAAQ,EACT,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAc5C,OAAO,CAAC,KAAK;IAuBb,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -5,7 +5,7 @@ const mod_js_1 = require("../../deps/jsr.io/@std/path/1.1.1/mod.js");
|
|
|
5
5
|
const Definition_js_1 = require("../Definition.js");
|
|
6
6
|
const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
|
|
7
7
|
class OperationDriver {
|
|
8
|
-
constructor({ context, insertable, operation, generation, destinationPath }) {
|
|
8
|
+
constructor({ context, insertable, operation, generation, destinationPath, noExport }) {
|
|
9
9
|
Object.defineProperty(this, "context", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
configurable: true,
|
|
@@ -42,10 +42,17 @@ class OperationDriver {
|
|
|
42
42
|
writable: true,
|
|
43
43
|
value: void 0
|
|
44
44
|
});
|
|
45
|
+
Object.defineProperty(this, "noExport", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: void 0
|
|
50
|
+
});
|
|
45
51
|
this.context = context;
|
|
46
52
|
this.insertable = insertable;
|
|
47
53
|
this.operation = operation;
|
|
48
54
|
this.destinationPath = destinationPath;
|
|
55
|
+
this.noExport = noExport;
|
|
49
56
|
this.settings = this.context.toOperationContentSettings({
|
|
50
57
|
operation,
|
|
51
58
|
insertable
|
|
@@ -83,7 +90,8 @@ class OperationDriver {
|
|
|
83
90
|
const definition = new Definition_js_1.Definition({
|
|
84
91
|
context: this.context,
|
|
85
92
|
value,
|
|
86
|
-
identifier
|
|
93
|
+
identifier,
|
|
94
|
+
noExport: this.noExport
|
|
87
95
|
});
|
|
88
96
|
this.context.register({
|
|
89
97
|
definitions: [definition],
|
|
@@ -18,15 +18,16 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
18
18
|
settings: import("../ContentSettings.js").ContentSettings<EnrichmentType>;
|
|
19
19
|
operation: OasOperation;
|
|
20
20
|
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey;
|
|
21
|
-
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
-
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: {
|
|
21
|
+
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../context/GenerateContext.js").InsertOperationOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
|
+
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName, options?: Pick<import("../../context/GenerateContext.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
+
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn, noExport }: {
|
|
24
24
|
schema: Schema;
|
|
25
25
|
fallbackIdentifier: Identifier;
|
|
26
26
|
schemaToValueFn: import("../../mod.js").SchemaToValueFn;
|
|
27
|
+
noExport?: boolean;
|
|
27
28
|
}): import("../../mod.js").TypeSystemOutput<Schema["type"]>;
|
|
28
|
-
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value }: Omit<import("../../context/GenerateContext.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
29
|
-
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<import("../../context/GenerateContext.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
29
|
+
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../context/GenerateContext.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
30
|
+
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<import("../../context/GenerateContext.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
30
31
|
register(args: import("../../context/GenerateContext.js").BaseRegisterArgs): void;
|
|
31
32
|
context: GenerateContext;
|
|
32
33
|
skipped: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;A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