@skmtc/core 0.0.333 → 0.0.335
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 +12 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +57 -31
- package/esm/dsl/ModelDriver.d.ts +1 -2
- package/esm/dsl/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/ModelDriver.js +2 -19
- package/esm/dsl/OperationDriver.d.ts +1 -2
- package/esm/dsl/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/OperationDriver.js +2 -20
- package/esm/dsl/ValueBase.d.ts +2 -2
- package/esm/dsl/ValueBase.d.ts.map +1 -1
- package/esm/dsl/ValueBase.js +2 -3
- package/esm/dsl/withConfig.d.ts +2 -2
- package/esm/types/CustomValue.d.ts +1 -1
- package/esm/types/CustomValue.d.ts.map +1 -1
- package/esm/types/GeneratedValue.d.ts +1 -1
- package/esm/types/GeneratedValue.d.ts.map +1 -1
- package/esm/types/TypeSystem.d.ts +1 -1
- package/esm/types/TypeSystem.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +70 -3
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +94 -6
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +12 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +57 -31
- package/script/dsl/ModelDriver.d.ts +1 -2
- package/script/dsl/ModelDriver.d.ts.map +1 -1
- package/script/dsl/ModelDriver.js +2 -19
- package/script/dsl/OperationDriver.d.ts +1 -2
- package/script/dsl/OperationDriver.d.ts.map +1 -1
- package/script/dsl/OperationDriver.js +2 -20
- package/script/dsl/ValueBase.d.ts +2 -2
- package/script/dsl/ValueBase.d.ts.map +1 -1
- package/script/dsl/ValueBase.js +2 -3
- package/script/dsl/withConfig.d.ts +2 -2
- package/script/types/CustomValue.d.ts +1 -1
- package/script/types/CustomValue.d.ts.map +1 -1
- package/script/types/GeneratedValue.d.ts +1 -1
- package/script/types/GeneratedValue.d.ts.map +1 -1
- package/script/types/TypeSystem.d.ts +1 -1
- package/script/types/TypeSystem.d.ts.map +1 -1
- package/script/typescript/List.d.ts +70 -3
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +94 -6
package/esm/typescript/List.js
CHANGED
|
@@ -29,28 +29,74 @@ export class List {
|
|
|
29
29
|
.with('square', () => `[${joined}]`)
|
|
30
30
|
.with('curly', () => `{${joined}}`)
|
|
31
31
|
.with('round', () => `(${joined})`)
|
|
32
|
+
.with('angle', () => `<${joined}>`)
|
|
32
33
|
.with('none', () => joined)
|
|
33
34
|
.exhaustive();
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Create an empty List that will render as an empty string ''
|
|
39
|
+
* @returns List
|
|
40
|
+
*/
|
|
36
41
|
Object.defineProperty(List, "toEmpty", {
|
|
37
42
|
enumerable: true,
|
|
38
43
|
configurable: true,
|
|
39
44
|
writable: true,
|
|
40
45
|
value: () => new List([], { bookends: 'none' })
|
|
41
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* Create a List with a single value that will render as `value`
|
|
49
|
+
* @param value
|
|
50
|
+
* @returns List
|
|
51
|
+
*/
|
|
42
52
|
Object.defineProperty(List, "toSingle", {
|
|
43
53
|
enumerable: true,
|
|
44
54
|
configurable: true,
|
|
45
55
|
writable: true,
|
|
46
|
-
value: (value) =>
|
|
56
|
+
value: (value) => {
|
|
57
|
+
return new List([value], { bookends: 'none' });
|
|
58
|
+
}
|
|
47
59
|
});
|
|
48
|
-
|
|
60
|
+
/**
|
|
61
|
+
* If condition is true, return a List with a single value that will render as `value`.
|
|
62
|
+
* Otherwise, return an empty List that will render as an empty string ''.
|
|
63
|
+
*
|
|
64
|
+
* Useful for conditional rendering. For example, rendering a function arg object when
|
|
65
|
+
* it has at least one property.
|
|
66
|
+
* @param value
|
|
67
|
+
* @param condition
|
|
68
|
+
* @returns List
|
|
69
|
+
*/
|
|
70
|
+
Object.defineProperty(List, "toConditional", {
|
|
49
71
|
enumerable: true,
|
|
50
72
|
configurable: true,
|
|
51
73
|
writable: true,
|
|
52
|
-
value: (value, condition) =>
|
|
74
|
+
value: (value, condition) => {
|
|
75
|
+
return new List([condition ? value : undefined], { bookends: 'none' });
|
|
76
|
+
}
|
|
53
77
|
});
|
|
78
|
+
/**
|
|
79
|
+
* Create a record with Stringable values. KeyValue pairs will be joined with `: ` as separator
|
|
80
|
+
* and the resulting List will be wrapped with `{}`
|
|
81
|
+
* @param record
|
|
82
|
+
* @returns `record` with `Stringable` values
|
|
83
|
+
*/
|
|
84
|
+
Object.defineProperty(List, "toRecord", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: (record) => {
|
|
89
|
+
const entries = Object.entries(record).map(([key, value]) => {
|
|
90
|
+
return List.toKeyValue(key, value);
|
|
91
|
+
});
|
|
92
|
+
return List.toObject(entries);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Create a record with `undefined` or empty array or List values filtered out.
|
|
97
|
+
* @param record
|
|
98
|
+
* @returns `record` with `undefined` values filtered out
|
|
99
|
+
*/
|
|
54
100
|
Object.defineProperty(List, "toFilteredRecord", {
|
|
55
101
|
enumerable: true,
|
|
56
102
|
configurable: true,
|
|
@@ -62,24 +108,52 @@ Object.defineProperty(List, "toFilteredRecord", {
|
|
|
62
108
|
return List.toObject(entries);
|
|
63
109
|
}
|
|
64
110
|
});
|
|
111
|
+
/**
|
|
112
|
+
* Join `key` and `value` using `: ` as separator
|
|
113
|
+
* @param key
|
|
114
|
+
* @param value
|
|
115
|
+
* @returns `key` and `value` joined with `: ` as separator
|
|
116
|
+
*/
|
|
65
117
|
Object.defineProperty(List, "toKeyValue", {
|
|
66
118
|
enumerable: true,
|
|
67
119
|
configurable: true,
|
|
68
120
|
writable: true,
|
|
69
|
-
value: (key, value) =>
|
|
121
|
+
value: (key, value) => {
|
|
122
|
+
return new List([key, value], { separator: ': ' });
|
|
123
|
+
}
|
|
70
124
|
});
|
|
125
|
+
/**
|
|
126
|
+
* Join `key` and `value` using `.` as separator
|
|
127
|
+
* @param key
|
|
128
|
+
* @param value
|
|
129
|
+
* @returns `key` and `value` joined with `.` as separator
|
|
130
|
+
*/
|
|
71
131
|
Object.defineProperty(List, "toObjectKey", {
|
|
72
132
|
enumerable: true,
|
|
73
133
|
configurable: true,
|
|
74
134
|
writable: true,
|
|
75
|
-
value: (key, value) =>
|
|
135
|
+
value: (key, value) => {
|
|
136
|
+
return new List([key, value], { separator: '.' });
|
|
137
|
+
}
|
|
76
138
|
});
|
|
139
|
+
/**
|
|
140
|
+
* Join `values` using `, ` as separator and wrap in `{` and `}`
|
|
141
|
+
* @param values
|
|
142
|
+
* @returns `values` joined with `, ` as separator and wrapped in `{` and `}`
|
|
143
|
+
*/
|
|
77
144
|
Object.defineProperty(List, "toObject", {
|
|
78
145
|
enumerable: true,
|
|
79
146
|
configurable: true,
|
|
80
147
|
writable: true,
|
|
81
|
-
value: (values) =>
|
|
148
|
+
value: (values) => {
|
|
149
|
+
return new List(values, { bookends: 'curly' });
|
|
150
|
+
}
|
|
82
151
|
});
|
|
152
|
+
/**
|
|
153
|
+
* Create a List using the keys of a record
|
|
154
|
+
* @param record
|
|
155
|
+
* @returns List of record keys
|
|
156
|
+
*/
|
|
83
157
|
Object.defineProperty(List, "fromRecord", {
|
|
84
158
|
enumerable: true,
|
|
85
159
|
configurable: true,
|
|
@@ -88,6 +162,15 @@ Object.defineProperty(List, "fromRecord", {
|
|
|
88
162
|
return new List(Object.keys(record ?? {}));
|
|
89
163
|
}
|
|
90
164
|
});
|
|
165
|
+
/**
|
|
166
|
+
* Create a keyValue pair if `value` is not undefined and is not an empty array or List.
|
|
167
|
+
* Return `undefined` otherwise.
|
|
168
|
+
*
|
|
169
|
+
* Useful for filtering out `undefined values from a record.
|
|
170
|
+
* @param key
|
|
171
|
+
* @param value
|
|
172
|
+
* @returns `key` and `value` joined with `: ` as separator if `value` is not undefined and is not an empty array or List. `undefined` otherwise.
|
|
173
|
+
*/
|
|
91
174
|
Object.defineProperty(List, "toFilteredKeyValue", {
|
|
92
175
|
enumerable: true,
|
|
93
176
|
configurable: true,
|
|
@@ -96,6 +179,11 @@ Object.defineProperty(List, "toFilteredKeyValue", {
|
|
|
96
179
|
return List.hasValue(value) ? List.toKeyValue(key, value) : undefined;
|
|
97
180
|
}
|
|
98
181
|
});
|
|
182
|
+
/**
|
|
183
|
+
* Check if `value` is not undefined and is not an empty array or List.
|
|
184
|
+
* @param value
|
|
185
|
+
* @returns `true` if `value` is not undefined and is not an empty array or List. `false` otherwise.
|
|
186
|
+
*/
|
|
99
187
|
Object.defineProperty(List, "hasValue", {
|
|
100
188
|
enumerable: true,
|
|
101
189
|
configurable: true,
|
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@ import type { OasDocument } from '../oas/document/Document.js';
|
|
|
4
4
|
import type { OasSchema } from '../oas/schema/Schema.js';
|
|
5
5
|
import type { OasRef } from '../oas/ref/Ref.js';
|
|
6
6
|
import type { FileContents, GetFileOptions } from './types.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { ClientSettings } from '../types/Settings.js';
|
|
8
8
|
import type { Method } from '../types/Method.js';
|
|
9
9
|
import type { OperationInsertable, OperationGenerator } from '../dsl/OperationInsertable.js';
|
|
10
10
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
11
11
|
import type { ModelInsertable, ModelGenerator } from '../dsl/ModelInsertable.js';
|
|
12
12
|
import type { GenerationType, GeneratedDefintion, GeneratedValue } from '../types/GeneratedValue.js';
|
|
13
|
-
import
|
|
13
|
+
import { ContentSettings } from '../dsl/ContentSettings.js';
|
|
14
14
|
import type { RefName } from '../types/RefName.js';
|
|
15
15
|
import type * as log from '../deps/jsr.io/@std/log/0.224.7/mod.js';
|
|
16
16
|
import type { GeneratorKey } from '../types/GeneratorKeys.js';
|
|
@@ -71,6 +71,14 @@ export type InsertReturn<V extends GeneratedValue, T extends GenerationType> = {
|
|
|
71
71
|
settings: ContentSettings;
|
|
72
72
|
definition: GeneratedDefintion<V, T>;
|
|
73
73
|
};
|
|
74
|
+
type ToOperationSettingsArgs<V> = {
|
|
75
|
+
operation: OasOperation;
|
|
76
|
+
insertable: OperationInsertable<V>;
|
|
77
|
+
};
|
|
78
|
+
type BuildModelSettingsArgs<V> = {
|
|
79
|
+
refName: RefName;
|
|
80
|
+
insertable: ModelInsertable<V>;
|
|
81
|
+
};
|
|
74
82
|
export declare class GenerateContext {
|
|
75
83
|
#private;
|
|
76
84
|
schemaModel: OasDocument;
|
|
@@ -85,8 +93,8 @@ export declare class GenerateContext {
|
|
|
85
93
|
defineValue<Schema extends SchemaType>({ schema, identifier, destinationPath, schemaToValueFn }: DefineArgs<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
86
94
|
register({ imports, definitions, destinationPath }: RegisterArgs): void;
|
|
87
95
|
insert<V extends GeneratedValue, T extends GenerationType>({ generation, destinationPath, ...rest }: InsertArgs<V, T>): InsertReturn<V, T>;
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
toOperationContentSettings<V>({ operation, insertable }: ToOperationSettingsArgs<V>): ContentSettings;
|
|
97
|
+
toModelContentSettings<V>({ refName, insertable }: BuildModelSettingsArgs<V>): ContentSettings;
|
|
90
98
|
addFile(normalisedPath: string): FileContents;
|
|
91
99
|
resolveSchemaRefOnce(refName: RefName): OasSchema | OasRef<'schema'>;
|
|
92
100
|
/** Produce external instance and return its name */
|
|
@@ -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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ACxB,OAAO,EACP,UAAU,EACX,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,eAAe;IAoE9C,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY;IAgB7C,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAWpE,oDAAoD;IACpD,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
|
|
@@ -33,7 +33,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
33
33
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
34
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
35
|
};
|
|
36
|
-
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator;
|
|
36
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_toOperationBaseSettings, _GenerateContext_toModelBaseSettings;
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.GenerateContext = void 0;
|
|
39
39
|
const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
|
|
@@ -41,6 +41,7 @@ const Import_js_1 = require("../dsl/Import.js");
|
|
|
41
41
|
const Definition_js_1 = require("../dsl/Definition.js");
|
|
42
42
|
const OperationDriver_js_1 = require("../dsl/OperationDriver.js");
|
|
43
43
|
const ModelDriver_js_1 = require("../dsl/ModelDriver.js");
|
|
44
|
+
const ContentSettings_js_1 = require("../dsl/ContentSettings.js");
|
|
44
45
|
const Sentry = __importStar(require("@sentry/deno"));
|
|
45
46
|
const tracer_js_1 = require("../helpers/tracer.js");
|
|
46
47
|
class GenerateContext {
|
|
@@ -194,37 +195,32 @@ class GenerateContext {
|
|
|
194
195
|
return { settings, definition };
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
};
|
|
211
|
-
return baseSettings;
|
|
198
|
+
toOperationContentSettings({ operation, insertable }) {
|
|
199
|
+
const baseSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toOperationBaseSettings).call(this, {
|
|
200
|
+
generatorId: insertable.id,
|
|
201
|
+
path: operation.path,
|
|
202
|
+
method: operation.method
|
|
203
|
+
});
|
|
204
|
+
const e = insertable.toExportPath({ operation, baseSettings });
|
|
205
|
+
return new ContentSettings_js_1.ContentSettings({
|
|
206
|
+
name: insertable.toName({ operation, baseSettings }),
|
|
207
|
+
selected: insertable.isSelected({ operation, baseSettings }),
|
|
208
|
+
exportPath: e,
|
|
209
|
+
importFrom: baseSettings.importFrom ?? e
|
|
210
|
+
});
|
|
212
211
|
}
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
:
|
|
221
|
-
|
|
222
|
-
exportPath,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
importFrom: modelSettings?.importFrom
|
|
226
|
-
};
|
|
227
|
-
return baseSettings;
|
|
212
|
+
toModelContentSettings({ refName, insertable }) {
|
|
213
|
+
const baseSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toModelBaseSettings).call(this, {
|
|
214
|
+
generatorId: insertable.id,
|
|
215
|
+
refName
|
|
216
|
+
});
|
|
217
|
+
const e = insertable.toExportPath({ refName, baseSettings });
|
|
218
|
+
return new ContentSettings_js_1.ContentSettings({
|
|
219
|
+
name: insertable.toName({ refName, baseSettings }),
|
|
220
|
+
selected: insertable.isSelected({ refName, baseSettings }),
|
|
221
|
+
exportPath: e,
|
|
222
|
+
importFrom: baseSettings.importFrom ?? e
|
|
223
|
+
});
|
|
228
224
|
}
|
|
229
225
|
addFile(normalisedPath) {
|
|
230
226
|
if (__classPrivateFieldGet(this, _GenerateContext_files, "f").has(normalisedPath)) {
|
|
@@ -278,4 +274,34 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
278
274
|
this.captureCurrentResult('success');
|
|
279
275
|
});
|
|
280
276
|
});
|
|
277
|
+
}, _GenerateContext_toOperationBaseSettings = function _GenerateContext_toOperationBaseSettings({ generatorId, path, method }) {
|
|
278
|
+
const generatorSettings = this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
279
|
+
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
280
|
+
? generatorSettings.operations?.[path]?.[method]
|
|
281
|
+
: undefined;
|
|
282
|
+
const exportPath = operationSettings?.exportPath
|
|
283
|
+
? (0, mod_js_1.join)(generatorSettings?.exportPath ?? '', operationSettings?.exportPath)
|
|
284
|
+
: undefined;
|
|
285
|
+
const baseSettings = {
|
|
286
|
+
exportPath,
|
|
287
|
+
selected: Boolean(operationSettings?.selected),
|
|
288
|
+
name: operationSettings?.name,
|
|
289
|
+
importFrom: operationSettings?.importFrom
|
|
290
|
+
};
|
|
291
|
+
return baseSettings;
|
|
292
|
+
}, _GenerateContext_toModelBaseSettings = function _GenerateContext_toModelBaseSettings({ generatorId, refName }) {
|
|
293
|
+
const generatorSettings = this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
294
|
+
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
295
|
+
? generatorSettings?.models?.[refName]
|
|
296
|
+
: undefined;
|
|
297
|
+
const exportPath = modelSettings?.exportPath
|
|
298
|
+
? (0, mod_js_1.join)(generatorSettings?.exportPath ?? '', modelSettings?.exportPath)
|
|
299
|
+
: undefined;
|
|
300
|
+
const baseSettings = {
|
|
301
|
+
exportPath,
|
|
302
|
+
selected: Boolean(modelSettings?.selected),
|
|
303
|
+
name: modelSettings?.name,
|
|
304
|
+
importFrom: modelSettings?.importFrom
|
|
305
|
+
};
|
|
306
|
+
return baseSettings;
|
|
281
307
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModelInsertable } from './ModelInsertable.js';
|
|
2
2
|
import type { GenerateContext } from '../context/GenerateContext.js';
|
|
3
|
-
import { ContentSettings } from './ContentSettings.js';
|
|
3
|
+
import type { ContentSettings } from './ContentSettings.js';
|
|
4
4
|
import type { GeneratedDefintion, GenerationType } from '../types/GeneratedValue.js';
|
|
5
5
|
import type { GeneratedValue } from '../types/GeneratedValue.js';
|
|
6
6
|
import type { RefName } from '../types/RefName.js';
|
|
@@ -24,7 +24,6 @@ export declare class ModelDriver<V extends GeneratedValue, T extends GenerationT
|
|
|
24
24
|
get exportPath(): string;
|
|
25
25
|
private apply;
|
|
26
26
|
private getDefinition;
|
|
27
|
-
private buildModelSettings;
|
|
28
27
|
private affirmDefinition;
|
|
29
28
|
}
|
|
30
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../src/dsl/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../src/dsl/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,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ContentSettings_js_1 = require("./ContentSettings.js");
|
|
5
4
|
const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
|
|
6
5
|
const Definition_js_1 = require("./Definition.js");
|
|
7
6
|
const Identifier_js_1 = require("./Identifier.js");
|
|
@@ -49,11 +48,8 @@ class ModelDriver {
|
|
|
49
48
|
this.insertable = insertable;
|
|
50
49
|
this.refName = refName;
|
|
51
50
|
this.destinationPath = destinationPath;
|
|
52
|
-
this.settings = this.
|
|
53
|
-
this.definition = this.apply({
|
|
54
|
-
generation,
|
|
55
|
-
destinationPath
|
|
56
|
-
});
|
|
51
|
+
this.settings = this.context.toModelContentSettings({ refName, insertable });
|
|
52
|
+
this.definition = this.apply({ generation, destinationPath });
|
|
57
53
|
}
|
|
58
54
|
get value() {
|
|
59
55
|
if (!this.definition) {
|
|
@@ -115,19 +111,6 @@ class ModelDriver {
|
|
|
115
111
|
});
|
|
116
112
|
return definition;
|
|
117
113
|
}
|
|
118
|
-
buildModelSettings({ refName, insertable }) {
|
|
119
|
-
const baseSettings = this.context.getModelBaseSettings({
|
|
120
|
-
generatorId: insertable.id,
|
|
121
|
-
refName
|
|
122
|
-
});
|
|
123
|
-
const e = insertable.toExportPath({ refName, baseSettings });
|
|
124
|
-
return new ContentSettings_js_1.ContentSettings({
|
|
125
|
-
name: insertable.toName({ refName, baseSettings }),
|
|
126
|
-
selected: insertable.isSelected({ refName, baseSettings }),
|
|
127
|
-
exportPath: e,
|
|
128
|
-
importFrom: baseSettings.importFrom ?? e
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
114
|
affirmDefinition(definition) {
|
|
132
115
|
if (!definition) {
|
|
133
116
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OperationInsertable } from './OperationInsertable.js';
|
|
2
2
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
3
|
-
import { ContentSettings } from './ContentSettings.js';
|
|
3
|
+
import type { ContentSettings } from './ContentSettings.js';
|
|
4
4
|
import type { GeneratedDefintion, GenerationType } from '../types/GeneratedValue.js';
|
|
5
5
|
import type { GeneratedValue } from '../types/GeneratedValue.js';
|
|
6
6
|
import type { GenerateContext } from '../context/GenerateContext.js';
|
|
@@ -24,7 +24,6 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
|
|
|
24
24
|
get exportPath(): string;
|
|
25
25
|
private apply;
|
|
26
26
|
private getDefinition;
|
|
27
|
-
private buildOperationSettings;
|
|
28
27
|
private affirmDefinition;
|
|
29
28
|
}
|
|
30
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../src/dsl/OperationDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../src/dsl/OperationDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAI3D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,IAAI;IAC7E,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAYD,qBAAa,eAAe,CAC1B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc;IAExB,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAExB,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EAChB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;IAc5B,IAAI,KAAK,IAAI,CAAC,CAQb;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,gBAAgB;CAoBzB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OperationDriver = void 0;
|
|
4
|
-
const ContentSettings_js_1 = require("./ContentSettings.js");
|
|
5
4
|
const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
|
|
6
5
|
const Definition_js_1 = require("./Definition.js");
|
|
7
6
|
const Identifier_js_1 = require("./Identifier.js");
|
|
@@ -49,14 +48,11 @@ class OperationDriver {
|
|
|
49
48
|
this.insertable = insertable;
|
|
50
49
|
this.operation = operation;
|
|
51
50
|
this.destinationPath = destinationPath;
|
|
52
|
-
this.settings = this.
|
|
51
|
+
this.settings = this.context.toOperationContentSettings({
|
|
53
52
|
operation,
|
|
54
53
|
insertable
|
|
55
54
|
});
|
|
56
|
-
this.definition = this.apply({
|
|
57
|
-
generation,
|
|
58
|
-
destinationPath
|
|
59
|
-
});
|
|
55
|
+
this.definition = this.apply({ generation, destinationPath });
|
|
60
56
|
}
|
|
61
57
|
get value() {
|
|
62
58
|
if (!this.definition) {
|
|
@@ -114,20 +110,6 @@ class OperationDriver {
|
|
|
114
110
|
});
|
|
115
111
|
return definition;
|
|
116
112
|
}
|
|
117
|
-
buildOperationSettings({ operation, insertable }) {
|
|
118
|
-
const baseSettings = this.context.getOperationBaseSettings({
|
|
119
|
-
generatorId: insertable.id,
|
|
120
|
-
path: operation.path,
|
|
121
|
-
method: operation.method
|
|
122
|
-
});
|
|
123
|
-
const e = insertable.toExportPath({ operation, baseSettings });
|
|
124
|
-
return new ContentSettings_js_1.ContentSettings({
|
|
125
|
-
name: insertable.toName({ operation, baseSettings }),
|
|
126
|
-
selected: insertable.isSelected({ operation, baseSettings }),
|
|
127
|
-
exportPath: e,
|
|
128
|
-
importFrom: baseSettings.importFrom ?? e
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
113
|
affirmDefinition(definition) {
|
|
132
114
|
if (!definition) {
|
|
133
115
|
return false;
|
|
@@ -3,12 +3,12 @@ import type { RegisterArgs } from '../context/GenerateContext.js';
|
|
|
3
3
|
import type { GeneratorKey } from '../types/GeneratorKeys.js';
|
|
4
4
|
type ValueBaseArgs = {
|
|
5
5
|
context: GenerateContext;
|
|
6
|
-
generatorKey
|
|
6
|
+
generatorKey?: GeneratorKey;
|
|
7
7
|
};
|
|
8
8
|
export declare class ValueBase {
|
|
9
9
|
context: GenerateContext;
|
|
10
10
|
skipped: boolean;
|
|
11
|
-
generatorKey: GeneratorKey;
|
|
11
|
+
generatorKey: GeneratorKey | undefined;
|
|
12
12
|
constructor({ context, generatorKey }: ValueBaseArgs);
|
|
13
13
|
register(args: RegisterArgs): void;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueBase.d.ts","sourceRoot":"","sources":["../../src/dsl/ValueBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,eAAe,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"ValueBase.d.ts","sourceRoot":"","sources":["../../src/dsl/ValueBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,eAAe,CAAA;IACxB,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED,qBAAa,SAAS;IACpB,OAAO,EAAE,eAAe,CAAA;IACxB,OAAO,EAAE,OAAO,CAAQ;IACxB,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;gBAE1B,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,aAAa;IAOpD,QAAQ,CAAC,IAAI,EAAE,YAAY;CAG5B"}
|
package/script/dsl/ValueBase.js
CHANGED
|
@@ -35,10 +35,9 @@ const proxyHandler = {
|
|
|
35
35
|
return propertyName === 'toString'
|
|
36
36
|
? new Proxy(target[propertyName], {
|
|
37
37
|
apply: (toString, thisArg) => {
|
|
38
|
-
if (
|
|
39
|
-
|
|
38
|
+
if (target.generatorKey) {
|
|
39
|
+
target.context.callback(target.generatorKey);
|
|
40
40
|
}
|
|
41
|
-
target.context.callback(target.generatorKey);
|
|
42
41
|
return toString.apply(thisArg);
|
|
43
42
|
}
|
|
44
43
|
})
|
|
@@ -49,7 +49,7 @@ export declare const toOperationInsertable: (config: OperationConfig) => {
|
|
|
49
49
|
register(args: Partial<import("../context/GenerateContext.js").RegisterArgs>): void;
|
|
50
50
|
context: GenerateContext;
|
|
51
51
|
skipped: boolean;
|
|
52
|
-
generatorKey: import("../types/GeneratorKeys.js").GeneratorKey;
|
|
52
|
+
generatorKey: import("../types/GeneratorKeys.js").GeneratorKey | undefined;
|
|
53
53
|
};
|
|
54
54
|
id: string;
|
|
55
55
|
entityType: EntityType;
|
|
@@ -84,7 +84,7 @@ export declare const toModelInsertable: (config: ModelConfig) => {
|
|
|
84
84
|
register(args: Partial<import("../context/GenerateContext.js").RegisterArgs>): void;
|
|
85
85
|
context: GenerateContext;
|
|
86
86
|
skipped: boolean;
|
|
87
|
-
generatorKey: import("../types/GeneratorKeys.js").GeneratorKey;
|
|
87
|
+
generatorKey: import("../types/GeneratorKeys.js").GeneratorKey | undefined;
|
|
88
88
|
};
|
|
89
89
|
id: string;
|
|
90
90
|
type: "model";
|
|
@@ -5,7 +5,7 @@ import type { GeneratorKey } from './GeneratorKeys.js';
|
|
|
5
5
|
type CreateArgs = {
|
|
6
6
|
context: GenerateContext;
|
|
7
7
|
value: Stringable;
|
|
8
|
-
generatorKey
|
|
8
|
+
generatorKey?: GeneratorKey;
|
|
9
9
|
};
|
|
10
10
|
export declare class CustomValue extends ValueBase {
|
|
11
11
|
type: "custom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomValue.d.ts","sourceRoot":"","sources":["../../src/types/CustomValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,UAAU,CAAA;IACjB,YAAY,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"CustomValue.d.ts","sourceRoot":"","sources":["../../src/types/CustomValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,UAAU,CAAA;IACjB,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED,qBAAa,WAAY,SAAQ,SAAS;IACxC,IAAI,WAAoB;IACxB,KAAK,EAAE,UAAU,CAAA;gBAEL,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,UAAU;IAMxD,QAAQ,IAAI,MAAM;CAGnB;AAED,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,WAOvD,CAAA"}
|
|
@@ -13,7 +13,7 @@ import type { GeneratorKey } from './GeneratorKeys.js';
|
|
|
13
13
|
*/
|
|
14
14
|
export type GenerationType = 'force' | 'regular';
|
|
15
15
|
export type GeneratedValue = Stringable & {
|
|
16
|
-
generatorKey
|
|
16
|
+
generatorKey?: GeneratorKey;
|
|
17
17
|
};
|
|
18
18
|
export type GeneratedDefintion<V extends GeneratedValue, T extends GenerationType> = T extends 'force' ? Definition<V> : Definition<V> | undefined;
|
|
19
19
|
//# sourceMappingURL=GeneratedValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratedValue.d.ts","sourceRoot":"","sources":["../../src/types/GeneratedValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;GASG;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,YAAY,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"GeneratedValue.d.ts","sourceRoot":"","sources":["../../src/types/GeneratedValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;GASG;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc,IACtB,CAAC,SAAS,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSystem.d.ts","sourceRoot":"","sources":["../../src/types/TypeSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBA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