@skmtc/core 0.0.702 → 0.0.704
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/context/GenerateContext.d.ts +5 -22
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +19 -45
- package/esm/dsl/model/ModelBase.d.ts +5 -3
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.d.ts +1 -1
- package/esm/dsl/operation/OperationBase.d.ts +5 -5
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.js +0 -11
- package/esm/dsl/operation/toOperationBase.d.ts +1 -2
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +5 -22
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +19 -45
- package/script/dsl/model/ModelBase.d.ts +5 -3
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.d.ts +1 -1
- package/script/dsl/operation/OperationBase.d.ts +5 -5
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.js +0 -11
- package/script/dsl/operation/toOperationBase.d.ts +1 -2
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
|
@@ -15,7 +15,7 @@ import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
|
15
15
|
import type { ResultType } from '../types/Results.js';
|
|
16
16
|
import type { StackTrail } from './StackTrail.js';
|
|
17
17
|
import type { Identifier } from '../dsl/Identifier.js';
|
|
18
|
-
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
|
|
18
|
+
import type { SchemaToNonRef, SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
|
|
19
19
|
import { Inserted } from '../dsl/Inserted.js';
|
|
20
20
|
import { File } from '../dsl/File.js';
|
|
21
21
|
import { JsonFile } from '../dsl/JsonFile.js';
|
|
@@ -86,14 +86,15 @@ export type InsertOperationOptions<T extends GenerationType> = {
|
|
|
86
86
|
generation?: T;
|
|
87
87
|
destinationPath?: string;
|
|
88
88
|
};
|
|
89
|
-
export type InsertNormalisedModelArgs = {
|
|
89
|
+
export type InsertNormalisedModelArgs<Schema extends OasSchema | OasRef<'schema'> | OasVoid> = {
|
|
90
90
|
fallbackName: string;
|
|
91
|
-
schema:
|
|
91
|
+
schema: Schema;
|
|
92
92
|
destinationPath: string;
|
|
93
93
|
};
|
|
94
94
|
export type InsertNormalisedModelOptions = {
|
|
95
95
|
noExport?: boolean;
|
|
96
96
|
};
|
|
97
|
+
export type InsertNormalisedModelReturn<V extends GeneratedValue, Schema extends OasSchema | OasRef<'schema'> | OasVoid> = Schema extends OasRef<'schema'> ? Definition<V> : Definition<TypeSystemOutput<SchemaToNonRef<Schema>['type']>>;
|
|
97
98
|
export type InsertModelOptions<T extends GenerationType> = {
|
|
98
99
|
noExport?: boolean;
|
|
99
100
|
generation?: T;
|
|
@@ -127,24 +128,6 @@ export declare class GenerateContext {
|
|
|
127
128
|
*/
|
|
128
129
|
toArtifacts(): GenerateResult;
|
|
129
130
|
trace<T>(token: string | string[], fn: () => T): T;
|
|
130
|
-
/**
|
|
131
|
-
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
132
|
-
* with the given `identifier` at `destinationPath`.
|
|
133
|
-
*
|
|
134
|
-
* If a definition with the same name already exists, it will be returned
|
|
135
|
-
* instead of creating a new one.
|
|
136
|
-
*
|
|
137
|
-
* @experimental
|
|
138
|
-
*
|
|
139
|
-
* @param schema - The schema to create the definition for.
|
|
140
|
-
* @param identifier - The identifier for the definition.
|
|
141
|
-
* @param destinationPath - The path to the file where the definition will be registered.
|
|
142
|
-
* @param schemaToValueFn - A function that converts the schema to a value.
|
|
143
|
-
* @param rootRef - If the definition identifier is a ref, provide it here. It can be
|
|
144
|
-
* used to support circular references depending on generator implementation.
|
|
145
|
-
* @returns The created definition or cached definition if it already exists.
|
|
146
|
-
*/
|
|
147
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
148
131
|
/**
|
|
149
132
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
150
133
|
*
|
|
@@ -180,7 +163,7 @@ export declare class GenerateContext {
|
|
|
180
163
|
* @mutates this.files
|
|
181
164
|
*/
|
|
182
165
|
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath, noExport }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
183
|
-
insertNormalisedModel<V extends GeneratedValue, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName, destinationPath }: InsertNormalisedModelArgs
|
|
166
|
+
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>;
|
|
184
167
|
/**
|
|
185
168
|
* Insert model into the output file with path `destinationPath`.
|
|
186
169
|
*
|
|
@@ -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,E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O,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,0BAA0B,iBAAiB,KAAG,WAI1E,CAAA"}
|
|
@@ -103,47 +103,6 @@ export class GenerateContext {
|
|
|
103
103
|
trace(token, fn) {
|
|
104
104
|
return tracer(this.stackTrail, token, fn, this.logger);
|
|
105
105
|
}
|
|
106
|
-
/**
|
|
107
|
-
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
108
|
-
* with the given `identifier` at `destinationPath`.
|
|
109
|
-
*
|
|
110
|
-
* If a definition with the same name already exists, it will be returned
|
|
111
|
-
* instead of creating a new one.
|
|
112
|
-
*
|
|
113
|
-
* @experimental
|
|
114
|
-
*
|
|
115
|
-
* @param schema - The schema to create the definition for.
|
|
116
|
-
* @param identifier - The identifier for the definition.
|
|
117
|
-
* @param destinationPath - The path to the file where the definition will be registered.
|
|
118
|
-
* @param schemaToValueFn - A function that converts the schema to a value.
|
|
119
|
-
* @param rootRef - If the definition identifier is a ref, provide it here. It can be
|
|
120
|
-
* used to support circular references depending on generator implementation.
|
|
121
|
-
* @returns The created definition or cached definition if it already exists.
|
|
122
|
-
*/
|
|
123
|
-
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }) {
|
|
124
|
-
const cachedDefinition = this.findDefinition({
|
|
125
|
-
name: identifier.name,
|
|
126
|
-
exportPath: destinationPath
|
|
127
|
-
});
|
|
128
|
-
// @TODO add check to make sure retrieved definition
|
|
129
|
-
// used same generator and same schema #SKM-47
|
|
130
|
-
if (cachedDefinition) {
|
|
131
|
-
return cachedDefinition;
|
|
132
|
-
}
|
|
133
|
-
const value = schemaToValueFn({
|
|
134
|
-
context: this,
|
|
135
|
-
schema,
|
|
136
|
-
destinationPath,
|
|
137
|
-
rootRef,
|
|
138
|
-
required: true
|
|
139
|
-
});
|
|
140
|
-
return this.defineAndRegister({
|
|
141
|
-
identifier,
|
|
142
|
-
value,
|
|
143
|
-
destinationPath,
|
|
144
|
-
noExport
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
106
|
/**
|
|
148
107
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
149
108
|
*
|
|
@@ -261,16 +220,31 @@ export class GenerateContext {
|
|
|
261
220
|
destinationPath,
|
|
262
221
|
noExport
|
|
263
222
|
});
|
|
223
|
+
// @TODO Using mapped types would help avoid generics casting
|
|
264
224
|
return definition;
|
|
265
225
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
226
|
+
const cachedDefinition = this.findDefinition({
|
|
227
|
+
name: fallbackName,
|
|
228
|
+
exportPath: destinationPath
|
|
229
|
+
});
|
|
230
|
+
// @TODO add check to make sure retrieved definition
|
|
231
|
+
// used same generator and same schema #SKM-47
|
|
232
|
+
if (cachedDefinition) {
|
|
233
|
+
return cachedDefinition;
|
|
234
|
+
}
|
|
235
|
+
const value = insertable.schemaToValueFn({
|
|
236
|
+
context: this,
|
|
268
237
|
schema,
|
|
269
|
-
|
|
238
|
+
destinationPath,
|
|
239
|
+
required: true
|
|
240
|
+
});
|
|
241
|
+
const definition = this.defineAndRegister({
|
|
242
|
+
identifier: insertable.createIdentifier(fallbackName),
|
|
243
|
+
value,
|
|
270
244
|
destinationPath,
|
|
271
245
|
noExport
|
|
272
246
|
});
|
|
273
|
-
// @TODO
|
|
247
|
+
// @TODO Using mapped types would help avoid generics casting
|
|
274
248
|
return definition;
|
|
275
249
|
}
|
|
276
250
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions, InsertNormalisedModelArgs } from '../../context/GenerateContext.js';
|
|
1
|
+
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } 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';
|
|
@@ -6,7 +6,9 @@ import type { ContentSettings } from '../ContentSettings.js';
|
|
|
6
6
|
import type { ModelInsertable } from './types.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
8
8
|
import type { Inserted } from '../Inserted.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { OasSchema } from '../../oas/schema/Schema.js';
|
|
10
|
+
import type { OasRef } from '../../oas/ref/Ref.js';
|
|
11
|
+
import { OasVoid } from '../../oas/void/Void.js';
|
|
10
12
|
export type ModelBaseArgs<EnrichmentType = undefined> = {
|
|
11
13
|
context: GenerateContext;
|
|
12
14
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -19,7 +21,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
19
21
|
generatorKey: GeneratorKey;
|
|
20
22
|
constructor({ context, settings, generatorKey, refName }: ModelBaseArgs<EnrichmentType>);
|
|
21
23
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
22
|
-
insertNormalizedModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs
|
|
24
|
+
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<'force'>, 'noExport'>): InsertNormalisedModelReturn<V, Schema>;
|
|
23
25
|
register(args: BaseRegisterArgs): void;
|
|
24
26
|
}
|
|
25
27
|
//# 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,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,yBAAyB,
|
|
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,EAClB,yBAAyB,EACzB,2BAA2B,EAC5B,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;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhD,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;IAQvC,qBAAqB,CACnB,CAAC,SAAS,cAAc,EACxB,MAAM,SAAS,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,EACrD,cAAc,GAAG,SAAS,EAE1B,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,EACpF,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYhC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -24,7 +24,7 @@ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModel
|
|
|
24
24
|
refName: RefName;
|
|
25
25
|
generatorKey: import("../../mod.js").GeneratorKey;
|
|
26
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
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs
|
|
27
|
+
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
28
28
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
29
29
|
context: GenerateContext;
|
|
30
30
|
skipped: boolean;
|
|
@@ -1,15 +1,17 @@
|
|
|
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,
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, DefineAndRegisterArgs, InsertOperationOptions, InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } 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';
|
|
8
8
|
import type { Definition } from '../Definition.js';
|
|
9
|
-
import type { SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
|
|
10
9
|
import type { Inserted } from '../Inserted.js';
|
|
11
10
|
import type { ModelInsertable } from '../model/types.js';
|
|
12
11
|
import type { RefName } from '../../types/RefName.js';
|
|
12
|
+
import { OasSchema } from '../../oas/schema/Schema.js';
|
|
13
|
+
import { OasRef } from '../../oas/ref/Ref.js';
|
|
14
|
+
import { OasVoid } from '../../oas/void/Void.js';
|
|
13
15
|
export type OperationBaseArgs<EnrichmentType = undefined> = {
|
|
14
16
|
context: GenerateContext;
|
|
15
17
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -23,11 +25,9 @@ export declare class OperationBase<EnrichmentType = undefined> extends ContentBa
|
|
|
23
25
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
24
26
|
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, options?: Pick<InsertOperationOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
25
27
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
26
|
-
insertNormalizedModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs
|
|
28
|
+
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<'force'>, 'noExport'>): InsertNormalisedModelReturn<V, Schema>;
|
|
27
29
|
/** @experimental */
|
|
28
30
|
defineAndRegister<V extends GeneratedValue>({ identifier, value, noExport }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
29
|
-
/** @experimental */
|
|
30
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
31
31
|
register(args: BaseRegisterArgs): void;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=OperationBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC5B,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;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,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G,SAAS,EAE1B,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,EACpF,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYzC,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;IAS3D,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -54,17 +54,6 @@ export class OperationBase extends ContentBase {
|
|
|
54
54
|
noExport
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
/** @experimental */
|
|
58
|
-
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef, noExport }) {
|
|
59
|
-
return this.context.createAndRegisterDefinition({
|
|
60
|
-
schema,
|
|
61
|
-
identifier,
|
|
62
|
-
schemaToValueFn,
|
|
63
|
-
destinationPath: this.settings.exportPath,
|
|
64
|
-
rootRef: rootRef,
|
|
65
|
-
noExport
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
57
|
register(args) {
|
|
69
58
|
this.context.register({
|
|
70
59
|
...args,
|
|
@@ -20,9 +20,8 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
20
20
|
generatorKey: import("../../mod.js").GeneratorKey;
|
|
21
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
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
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs
|
|
23
|
+
insertNormalizedModel<V extends import("../../mod.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<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
24
24
|
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
25
|
-
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"]>>;
|
|
26
25
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
27
26
|
context: GenerateContext;
|
|
28
27
|
skipped: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAA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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
|
@@ -15,7 +15,7 @@ import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
|
15
15
|
import type { ResultType } from '../types/Results.js';
|
|
16
16
|
import type { StackTrail } from './StackTrail.js';
|
|
17
17
|
import type { Identifier } from '../dsl/Identifier.js';
|
|
18
|
-
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
|
|
18
|
+
import type { SchemaToNonRef, SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
|
|
19
19
|
import { Inserted } from '../dsl/Inserted.js';
|
|
20
20
|
import { File } from '../dsl/File.js';
|
|
21
21
|
import { JsonFile } from '../dsl/JsonFile.js';
|
|
@@ -86,14 +86,15 @@ export type InsertOperationOptions<T extends GenerationType> = {
|
|
|
86
86
|
generation?: T;
|
|
87
87
|
destinationPath?: string;
|
|
88
88
|
};
|
|
89
|
-
export type InsertNormalisedModelArgs = {
|
|
89
|
+
export type InsertNormalisedModelArgs<Schema extends OasSchema | OasRef<'schema'> | OasVoid> = {
|
|
90
90
|
fallbackName: string;
|
|
91
|
-
schema:
|
|
91
|
+
schema: Schema;
|
|
92
92
|
destinationPath: string;
|
|
93
93
|
};
|
|
94
94
|
export type InsertNormalisedModelOptions = {
|
|
95
95
|
noExport?: boolean;
|
|
96
96
|
};
|
|
97
|
+
export type InsertNormalisedModelReturn<V extends GeneratedValue, Schema extends OasSchema | OasRef<'schema'> | OasVoid> = Schema extends OasRef<'schema'> ? Definition<V> : Definition<TypeSystemOutput<SchemaToNonRef<Schema>['type']>>;
|
|
97
98
|
export type InsertModelOptions<T extends GenerationType> = {
|
|
98
99
|
noExport?: boolean;
|
|
99
100
|
generation?: T;
|
|
@@ -127,24 +128,6 @@ export declare class GenerateContext {
|
|
|
127
128
|
*/
|
|
128
129
|
toArtifacts(): GenerateResult;
|
|
129
130
|
trace<T>(token: string | string[], fn: () => T): T;
|
|
130
|
-
/**
|
|
131
|
-
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
132
|
-
* with the given `identifier` at `destinationPath`.
|
|
133
|
-
*
|
|
134
|
-
* If a definition with the same name already exists, it will be returned
|
|
135
|
-
* instead of creating a new one.
|
|
136
|
-
*
|
|
137
|
-
* @experimental
|
|
138
|
-
*
|
|
139
|
-
* @param schema - The schema to create the definition for.
|
|
140
|
-
* @param identifier - The identifier for the definition.
|
|
141
|
-
* @param destinationPath - The path to the file where the definition will be registered.
|
|
142
|
-
* @param schemaToValueFn - A function that converts the schema to a value.
|
|
143
|
-
* @param rootRef - If the definition identifier is a ref, provide it here. It can be
|
|
144
|
-
* used to support circular references depending on generator implementation.
|
|
145
|
-
* @returns The created definition or cached definition if it already exists.
|
|
146
|
-
*/
|
|
147
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
148
131
|
/**
|
|
149
132
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
150
133
|
*
|
|
@@ -180,7 +163,7 @@ export declare class GenerateContext {
|
|
|
180
163
|
* @mutates this.files
|
|
181
164
|
*/
|
|
182
165
|
insertOperation<V extends GeneratedValue, T extends GenerationType, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, { generation, destinationPath, noExport }?: InsertOperationOptions<T>): Inserted<V, T, EnrichmentType>;
|
|
183
|
-
insertNormalisedModel<V extends GeneratedValue, EnrichmentType>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName, destinationPath }: InsertNormalisedModelArgs
|
|
166
|
+
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>;
|
|
184
167
|
/**
|
|
185
168
|
* Insert model into the output file with path `destinationPath`.
|
|
186
169
|
*
|
|
@@ -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,EAAm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
|
trace(token, fn) {
|
|
143
143
|
return (0, tracer_js_1.tracer)(this.stackTrail, token, fn, this.logger);
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
147
|
-
* with the given `identifier` at `destinationPath`.
|
|
148
|
-
*
|
|
149
|
-
* If a definition with the same name already exists, it will be returned
|
|
150
|
-
* instead of creating a new one.
|
|
151
|
-
*
|
|
152
|
-
* @experimental
|
|
153
|
-
*
|
|
154
|
-
* @param schema - The schema to create the definition for.
|
|
155
|
-
* @param identifier - The identifier for the definition.
|
|
156
|
-
* @param destinationPath - The path to the file where the definition will be registered.
|
|
157
|
-
* @param schemaToValueFn - A function that converts the schema to a value.
|
|
158
|
-
* @param rootRef - If the definition identifier is a ref, provide it here. It can be
|
|
159
|
-
* used to support circular references depending on generator implementation.
|
|
160
|
-
* @returns The created definition or cached definition if it already exists.
|
|
161
|
-
*/
|
|
162
|
-
createAndRegisterDefinition({ schema, identifier, destinationPath, schemaToValueFn, rootRef, noExport }) {
|
|
163
|
-
const cachedDefinition = this.findDefinition({
|
|
164
|
-
name: identifier.name,
|
|
165
|
-
exportPath: destinationPath
|
|
166
|
-
});
|
|
167
|
-
// @TODO add check to make sure retrieved definition
|
|
168
|
-
// used same generator and same schema #SKM-47
|
|
169
|
-
if (cachedDefinition) {
|
|
170
|
-
return cachedDefinition;
|
|
171
|
-
}
|
|
172
|
-
const value = schemaToValueFn({
|
|
173
|
-
context: this,
|
|
174
|
-
schema,
|
|
175
|
-
destinationPath,
|
|
176
|
-
rootRef,
|
|
177
|
-
required: true
|
|
178
|
-
});
|
|
179
|
-
return this.defineAndRegister({
|
|
180
|
-
identifier,
|
|
181
|
-
value,
|
|
182
|
-
destinationPath,
|
|
183
|
-
noExport
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
145
|
/**
|
|
187
146
|
* Create and register a definition with the given `identifier` at `destinationPath`.
|
|
188
147
|
*
|
|
@@ -300,16 +259,31 @@ class GenerateContext {
|
|
|
300
259
|
destinationPath,
|
|
301
260
|
noExport
|
|
302
261
|
});
|
|
262
|
+
// @TODO Using mapped types would help avoid generics casting
|
|
303
263
|
return definition;
|
|
304
264
|
}
|
|
305
|
-
const
|
|
306
|
-
|
|
265
|
+
const cachedDefinition = this.findDefinition({
|
|
266
|
+
name: fallbackName,
|
|
267
|
+
exportPath: destinationPath
|
|
268
|
+
});
|
|
269
|
+
// @TODO add check to make sure retrieved definition
|
|
270
|
+
// used same generator and same schema #SKM-47
|
|
271
|
+
if (cachedDefinition) {
|
|
272
|
+
return cachedDefinition;
|
|
273
|
+
}
|
|
274
|
+
const value = insertable.schemaToValueFn({
|
|
275
|
+
context: this,
|
|
307
276
|
schema,
|
|
308
|
-
|
|
277
|
+
destinationPath,
|
|
278
|
+
required: true
|
|
279
|
+
});
|
|
280
|
+
const definition = this.defineAndRegister({
|
|
281
|
+
identifier: insertable.createIdentifier(fallbackName),
|
|
282
|
+
value,
|
|
309
283
|
destinationPath,
|
|
310
284
|
noExport
|
|
311
285
|
});
|
|
312
|
-
// @TODO
|
|
286
|
+
// @TODO Using mapped types would help avoid generics casting
|
|
313
287
|
return definition;
|
|
314
288
|
}
|
|
315
289
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions, InsertNormalisedModelArgs } from '../../context/GenerateContext.js';
|
|
1
|
+
import type { BaseRegisterArgs, GenerateContext, InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } 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';
|
|
@@ -6,7 +6,9 @@ import type { ContentSettings } from '../ContentSettings.js';
|
|
|
6
6
|
import type { ModelInsertable } from './types.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
8
8
|
import type { Inserted } from '../Inserted.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { OasSchema } from '../../oas/schema/Schema.js';
|
|
10
|
+
import type { OasRef } from '../../oas/ref/Ref.js';
|
|
11
|
+
import { OasVoid } from '../../oas/void/Void.js';
|
|
10
12
|
export type ModelBaseArgs<EnrichmentType = undefined> = {
|
|
11
13
|
context: GenerateContext;
|
|
12
14
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -19,7 +21,7 @@ export declare class ModelBase<EnrichmentType = undefined> extends ContentBase {
|
|
|
19
21
|
generatorKey: GeneratorKey;
|
|
20
22
|
constructor({ context, settings, generatorKey, refName }: ModelBaseArgs<EnrichmentType>);
|
|
21
23
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
22
|
-
insertNormalizedModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs
|
|
24
|
+
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<'force'>, 'noExport'>): InsertNormalisedModelReturn<V, Schema>;
|
|
23
25
|
register(args: BaseRegisterArgs): void;
|
|
24
26
|
}
|
|
25
27
|
//# 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,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ModelBase.d.ts","sourceRo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E,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,qBAAqB,CACnB,CAAC,SAAS,cAAc,EACxB,MAAM,SAAS,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,EACrD,cAAc,GAAG,SAAS,EAE1B,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,EAC9C,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,EACpF,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYhC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAMhD"}
|
|
@@ -24,7 +24,7 @@ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModel
|
|
|
24
24
|
refName: RefName;
|
|
25
25
|
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey;
|
|
26
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
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../context/GenerateContext.js").InsertNormalisedModelArgs
|
|
27
|
+
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../context/GenerateContext.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../context/GenerateContext.js").InsertModelOptions<"force">, "noExport">): import("../../context/GenerateContext.js").InsertNormalisedModelReturn<V, Schema>;
|
|
28
28
|
register(args: import("../../context/GenerateContext.js").BaseRegisterArgs): void;
|
|
29
29
|
context: GenerateContext;
|
|
30
30
|
skipped: boolean;
|
|
@@ -1,15 +1,17 @@
|
|
|
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,
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, DefineAndRegisterArgs, InsertOperationOptions, InsertModelOptions, InsertNormalisedModelArgs, InsertNormalisedModelReturn } 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';
|
|
8
8
|
import type { Definition } from '../Definition.js';
|
|
9
|
-
import type { SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
|
|
10
9
|
import type { Inserted } from '../Inserted.js';
|
|
11
10
|
import type { ModelInsertable } from '../model/types.js';
|
|
12
11
|
import type { RefName } from '../../types/RefName.js';
|
|
12
|
+
import { OasSchema } from '../../oas/schema/Schema.js';
|
|
13
|
+
import { OasRef } from '../../oas/ref/Ref.js';
|
|
14
|
+
import { OasVoid } from '../../oas/void/Void.js';
|
|
13
15
|
export type OperationBaseArgs<EnrichmentType = undefined> = {
|
|
14
16
|
context: GenerateContext;
|
|
15
17
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -23,11 +25,9 @@ export declare class OperationBase<EnrichmentType = undefined> extends ContentBa
|
|
|
23
25
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
24
26
|
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation, options?: Pick<InsertOperationOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
25
27
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName, options?: Pick<InsertModelOptions<'force'>, 'noExport'>): Inserted<V, 'force', EnrichmentType>;
|
|
26
|
-
insertNormalizedModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, { schema, fallbackName }: Omit<InsertNormalisedModelArgs
|
|
28
|
+
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<'force'>, 'noExport'>): InsertNormalisedModelReturn<V, Schema>;
|
|
27
29
|
/** @experimental */
|
|
28
30
|
defineAndRegister<V extends GeneratedValue>({ identifier, value, noExport }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
29
|
-
/** @experimental */
|
|
30
|
-
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef, noExport }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
31
31
|
register(args: BaseRegisterArgs): void;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=OperationBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC5B,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;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhD,MAAM,MAAM,iBAAiB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I,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,EACpF,OAAO,GAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAM,GAC1D,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;IAYzC,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;IAS3D,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -57,17 +57,6 @@ class OperationBase extends ContentBase_js_1.ContentBase {
|
|
|
57
57
|
noExport
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
/** @experimental */
|
|
61
|
-
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef, noExport }) {
|
|
62
|
-
return this.context.createAndRegisterDefinition({
|
|
63
|
-
schema,
|
|
64
|
-
identifier,
|
|
65
|
-
schemaToValueFn,
|
|
66
|
-
destinationPath: this.settings.exportPath,
|
|
67
|
-
rootRef: rootRef,
|
|
68
|
-
noExport
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
60
|
register(args) {
|
|
72
61
|
this.context.register({
|
|
73
62
|
...args,
|
|
@@ -20,9 +20,8 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
20
20
|
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey;
|
|
21
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
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
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../context/GenerateContext.js").InsertNormalisedModelArgs
|
|
23
|
+
insertNormalizedModel<V extends import("../../mod.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("../../context/GenerateContext.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../context/GenerateContext.js").InsertModelOptions<"force">, "noExport">): import("../../context/GenerateContext.js").InsertNormalisedModelReturn<V, Schema>;
|
|
24
24
|
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../context/GenerateContext.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
25
|
-
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"]>>;
|
|
26
25
|
register(args: import("../../context/GenerateContext.js").BaseRegisterArgs): void;
|
|
27
26
|
context: GenerateContext;
|
|
28
27
|
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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