@skmtc/core 0.0.422 → 0.0.424
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 +11 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +45 -37
- package/esm/dsl/model/ModelInsertable.d.ts +0 -5
- package/esm/dsl/model/ModelInsertable.d.ts.map +1 -1
- package/esm/dsl/model/toModelInsertable.d.ts +1 -3
- package/esm/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/esm/dsl/model/toModelInsertable.js +0 -6
- package/esm/dsl/operation/OperationInsertable.d.ts +0 -11
- package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationGateway.d.ts +0 -5
- package/esm/dsl/operation/toOperationGateway.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationGateway.js +0 -12
- package/esm/dsl/operation/toOperationInsertable.d.ts +1 -3
- package/esm/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationInsertable.js +0 -6
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +11 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +45 -37
- package/script/dsl/model/ModelInsertable.d.ts +0 -5
- package/script/dsl/model/ModelInsertable.d.ts.map +1 -1
- package/script/dsl/model/toModelInsertable.d.ts +1 -3
- package/script/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/script/dsl/model/toModelInsertable.js +0 -6
- package/script/dsl/operation/OperationInsertable.d.ts +0 -11
- package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationGateway.d.ts +0 -5
- package/script/dsl/operation/toOperationGateway.d.ts.map +1 -1
- package/script/dsl/operation/toOperationGateway.js +0 -12
- package/script/dsl/operation/toOperationInsertable.d.ts +1 -3
- package/script/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationInsertable.js +0 -6
|
@@ -3,7 +3,7 @@ import { Definition } from '../dsl/Definition.js';
|
|
|
3
3
|
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
|
-
import type { ClientSettings } from '../types/Settings.js';
|
|
6
|
+
import type { BaseSettings, ClientGeneratorSettings, ClientSettings } from '../types/Settings.js';
|
|
7
7
|
import type { Method } from '../types/Method.js';
|
|
8
8
|
import type { OperationInsertable, OperationGateway } from '../dsl/operation/OperationInsertable.js';
|
|
9
9
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
@@ -174,7 +174,7 @@ export declare class GenerateContext {
|
|
|
174
174
|
* operation.
|
|
175
175
|
*
|
|
176
176
|
* Content settings are produced by passing base settings and operation
|
|
177
|
-
* through toIdentifier
|
|
177
|
+
* through toIdentifier and toExportPath static methods on the
|
|
178
178
|
* insertable.
|
|
179
179
|
* @param { operation, insertable }
|
|
180
180
|
* @returns
|
|
@@ -184,7 +184,7 @@ export declare class GenerateContext {
|
|
|
184
184
|
* Generate and return content settings for model insertable and refName.
|
|
185
185
|
*
|
|
186
186
|
* Content settings are produced by passing base settings and refName
|
|
187
|
-
* through toIdentifier
|
|
187
|
+
* through toIdentifier and toExportPath static methods on the
|
|
188
188
|
* insertable.
|
|
189
189
|
* @param { refName, insertable }
|
|
190
190
|
* @returns Content settings for model
|
|
@@ -199,6 +199,14 @@ export declare class GenerateContext {
|
|
|
199
199
|
* @returns Content settings for model
|
|
200
200
|
*/
|
|
201
201
|
toGatewayContentSetting(gateway: OperationGateway): ContentSettings;
|
|
202
|
+
/**
|
|
203
|
+
* Look up operation settings for a given generatorId, path and method.
|
|
204
|
+
* @param { generatorId, path, method }
|
|
205
|
+
* @returns Base settings for operation
|
|
206
|
+
*/
|
|
207
|
+
toOperationBaseSettings({ generatorId, path, method }: GetOperationSettingsArgs): BaseSettings;
|
|
208
|
+
toModelBaseSettings({ generatorId, refName }: GetModelSettingsArgs): BaseSettings;
|
|
209
|
+
toGeneratorSettings(generatorId: string): ClientGeneratorSettings | undefined;
|
|
202
210
|
/**
|
|
203
211
|
* Perform one lookup of schema by `refName`.
|
|
204
212
|
* @param refName
|
|
@@ -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,
|
|
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,YAAY,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK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AAC,EAAE,EAC5B,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,eAAe;IAoB/C;;;;;;;;OAQG;IACH,sBAAsB,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,eAAe;IAmC9F;;;;;;;OAOG;IACH,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe;IAcnE;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,wBAAwB,GAAG,YAAY;IAgB9F,mBAAmB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,oBAAoB,GAAG,YAAY;IAgBjF,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IA+B7E;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAUpE;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
|
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_setExportPath,
|
|
12
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_setExportPath, _GenerateContext_toGatewayBaseSettings, _GenerateContext_cleanBaseSettings, _GenerateContext_addFile;
|
|
13
13
|
import { join, normalize } from '../deps/jsr.io/@std/path/1.0.6/mod.js';
|
|
14
14
|
import { Import } from '../dsl/Import.js';
|
|
15
15
|
import { Definition } from '../dsl/Definition.js';
|
|
@@ -266,13 +266,13 @@ export class GenerateContext {
|
|
|
266
266
|
* operation.
|
|
267
267
|
*
|
|
268
268
|
* Content settings are produced by passing base settings and operation
|
|
269
|
-
* through toIdentifier
|
|
269
|
+
* through toIdentifier and toExportPath static methods on the
|
|
270
270
|
* insertable.
|
|
271
271
|
* @param { operation, insertable }
|
|
272
272
|
* @returns
|
|
273
273
|
*/
|
|
274
274
|
toOperationContentSettings({ operation, insertable }) {
|
|
275
|
-
const baseSettings =
|
|
275
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
276
276
|
generatorId: insertable.id,
|
|
277
277
|
path: operation.path,
|
|
278
278
|
method: operation.method
|
|
@@ -281,7 +281,7 @@ export class GenerateContext {
|
|
|
281
281
|
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
282
282
|
return new ContentSettings({
|
|
283
283
|
identifier: insertable.toIdentifier({ operation, baseSettings }),
|
|
284
|
-
selected:
|
|
284
|
+
selected: baseSettings.selected,
|
|
285
285
|
exportPath,
|
|
286
286
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
287
287
|
parentExportPath: baseSettings.parentExportPath
|
|
@@ -291,13 +291,13 @@ export class GenerateContext {
|
|
|
291
291
|
* Generate and return content settings for model insertable and refName.
|
|
292
292
|
*
|
|
293
293
|
* Content settings are produced by passing base settings and refName
|
|
294
|
-
* through toIdentifier
|
|
294
|
+
* through toIdentifier and toExportPath static methods on the
|
|
295
295
|
* insertable.
|
|
296
296
|
* @param { refName, insertable }
|
|
297
297
|
* @returns Content settings for model
|
|
298
298
|
*/
|
|
299
299
|
toModelContentSettings({ refName, insertable }) {
|
|
300
|
-
const baseSettings =
|
|
300
|
+
const baseSettings = this.toModelBaseSettings({
|
|
301
301
|
generatorId: insertable.id,
|
|
302
302
|
refName
|
|
303
303
|
});
|
|
@@ -305,7 +305,7 @@ export class GenerateContext {
|
|
|
305
305
|
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
306
306
|
return new ContentSettings({
|
|
307
307
|
identifier: insertable.toIdentifier({ refName, baseSettings }),
|
|
308
|
-
selected:
|
|
308
|
+
selected: baseSettings.selected,
|
|
309
309
|
exportPath,
|
|
310
310
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
311
311
|
parentExportPath: baseSettings.parentExportPath
|
|
@@ -324,12 +324,42 @@ export class GenerateContext {
|
|
|
324
324
|
const exportPath = gateway.toExportPath(baseSettings);
|
|
325
325
|
return new ContentSettings({
|
|
326
326
|
identifier: gateway.toIdentifier(baseSettings),
|
|
327
|
-
selected:
|
|
327
|
+
selected: baseSettings.selected,
|
|
328
328
|
exportPath,
|
|
329
329
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
330
330
|
parentExportPath: baseSettings.parentExportPath
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Look up operation settings for a given generatorId, path and method.
|
|
335
|
+
* @param { generatorId, path, method }
|
|
336
|
+
* @returns Base settings for operation
|
|
337
|
+
*/
|
|
338
|
+
toOperationBaseSettings({ generatorId, path, method }) {
|
|
339
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
340
|
+
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
341
|
+
? generatorSettings.operations[path]?.[method]
|
|
342
|
+
: undefined;
|
|
343
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
344
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
345
|
+
...operationSettings,
|
|
346
|
+
parentExportPath: exportPath
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
toModelBaseSettings({ generatorId, refName }) {
|
|
350
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
351
|
+
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
352
|
+
? generatorSettings.models[refName]
|
|
353
|
+
: undefined;
|
|
354
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
355
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
356
|
+
...modelSettings,
|
|
357
|
+
parentExportPath: exportPath
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
toGeneratorSettings(generatorId) {
|
|
361
|
+
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
362
|
+
}
|
|
333
363
|
/**
|
|
334
364
|
* Perform one lookup of schema by `refName`.
|
|
335
365
|
* @param refName
|
|
@@ -374,12 +404,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
374
404
|
if (!generator.isSupported(operation)) {
|
|
375
405
|
return this.captureCurrentResult('notSupported');
|
|
376
406
|
}
|
|
377
|
-
const baseSettings =
|
|
407
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
378
408
|
generatorId: generator.id,
|
|
379
409
|
path,
|
|
380
410
|
method
|
|
381
411
|
});
|
|
382
|
-
if (!
|
|
412
|
+
if (!baseSettings.selected) {
|
|
383
413
|
return this.captureCurrentResult('notSelected');
|
|
384
414
|
}
|
|
385
415
|
gatewayInstance.transformOperation(operation);
|
|
@@ -406,12 +436,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
406
436
|
if (!generator.isSupported(operation)) {
|
|
407
437
|
return this.captureCurrentResult('notSupported');
|
|
408
438
|
}
|
|
409
|
-
const baseSettings =
|
|
439
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
410
440
|
generatorId: generator.id,
|
|
411
441
|
path,
|
|
412
442
|
method
|
|
413
443
|
});
|
|
414
|
-
if (!
|
|
444
|
+
if (!baseSettings.selected) {
|
|
415
445
|
return this.captureCurrentResult('notSelected');
|
|
416
446
|
}
|
|
417
447
|
this.insertOperation({ insertable: generator, operation });
|
|
@@ -427,11 +457,11 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
427
457
|
if (!generator.isSupported()) {
|
|
428
458
|
return this.captureCurrentResult('notSupported');
|
|
429
459
|
}
|
|
430
|
-
const baseSettings =
|
|
460
|
+
const baseSettings = this.toModelBaseSettings({
|
|
431
461
|
generatorId: generator.id,
|
|
432
462
|
refName
|
|
433
463
|
});
|
|
434
|
-
if (!
|
|
464
|
+
if (!baseSettings.selected) {
|
|
435
465
|
return this.captureCurrentResult('notSelected');
|
|
436
466
|
}
|
|
437
467
|
this.insertModel({ insertable: generator, refName });
|
|
@@ -460,30 +490,8 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
460
490
|
}
|
|
461
491
|
const combinedExportPath = join(parentExportPath ?? '', generatedExportPath);
|
|
462
492
|
return combinedExportPath;
|
|
463
|
-
}, _GenerateContext_toOperationBaseSettings = function _GenerateContext_toOperationBaseSettings({ generatorId, path, method }) {
|
|
464
|
-
const generatorSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGeneratorSettings).call(this, generatorId);
|
|
465
|
-
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
466
|
-
? generatorSettings.operations[path]?.[method]
|
|
467
|
-
: undefined;
|
|
468
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
469
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
470
|
-
...operationSettings,
|
|
471
|
-
parentExportPath: exportPath
|
|
472
|
-
});
|
|
473
|
-
}, _GenerateContext_toModelBaseSettings = function _GenerateContext_toModelBaseSettings({ generatorId, refName }) {
|
|
474
|
-
const generatorSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGeneratorSettings).call(this, generatorId);
|
|
475
|
-
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
476
|
-
? generatorSettings.models[refName]
|
|
477
|
-
: undefined;
|
|
478
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
479
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
480
|
-
...modelSettings,
|
|
481
|
-
parentExportPath: exportPath
|
|
482
|
-
});
|
|
483
|
-
}, _GenerateContext_toGeneratorSettings = function _GenerateContext_toGeneratorSettings(generatorId) {
|
|
484
|
-
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
485
493
|
}, _GenerateContext_toGatewayBaseSettings = function _GenerateContext_toGatewayBaseSettings(generatorId) {
|
|
486
|
-
const generatorSettings =
|
|
494
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
487
495
|
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, generatorSettings?.baseSettings);
|
|
488
496
|
}, _GenerateContext_cleanBaseSettings = function _GenerateContext_cleanBaseSettings(baseSettings) {
|
|
489
497
|
return {
|
|
@@ -17,10 +17,6 @@ export type ToModelExportPathArgs = {
|
|
|
17
17
|
refName: RefName;
|
|
18
18
|
baseSettings: BaseSettings;
|
|
19
19
|
};
|
|
20
|
-
export type IsModelSelectedArgs = {
|
|
21
|
-
refName: RefName;
|
|
22
|
-
baseSettings: BaseSettings;
|
|
23
|
-
};
|
|
24
20
|
export type WithTransformModel = {
|
|
25
21
|
transformModel: (refName: RefName) => void;
|
|
26
22
|
};
|
|
@@ -33,7 +29,6 @@ export type ModelInsertable<V> = {
|
|
|
33
29
|
_class: 'ModelInsertable';
|
|
34
30
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
35
31
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
36
|
-
isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
37
32
|
isSupported: () => boolean;
|
|
38
33
|
pinnable: boolean;
|
|
39
34
|
} & Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,eAAe,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"ModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OA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
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ToModelExportPathArgs, ToModelIdentifierArgs } from './ModelInsertable.js';
|
|
5
5
|
import type { Identifier } from '../Identifier.js';
|
|
6
6
|
export type ModelInsertableArgs = {
|
|
7
7
|
context: GenerateContext;
|
|
@@ -12,7 +12,6 @@ export type ModelConfig = {
|
|
|
12
12
|
id: string;
|
|
13
13
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
14
14
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
15
|
-
isSelected?: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
16
15
|
};
|
|
17
16
|
export declare const toModelInsertable: (config: ModelConfig) => {
|
|
18
17
|
new (args: ModelInsertableArgs): {
|
|
@@ -29,7 +28,6 @@ export declare const toModelInsertable: (config: ModelConfig) => {
|
|
|
29
28
|
_class: "ModelInsertable";
|
|
30
29
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
31
30
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
32
|
-
isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
33
31
|
isSupported: () => boolean;
|
|
34
32
|
pinnable: boolean;
|
|
35
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"toModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,UAAU,CAAA;IAC9E,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;CAC3E,CAAA;AAED,eAAO,MAAM,iBAAiB,WAAY,WAAW;eAa/B,mBAAmB;;;;;;;;;;;;8CAjBG,qBAAqB,KAAK,UAAU;8CACpC,qBAAqB,KAAK,MAAM;;;CA4B3E,CAAA"}
|
|
@@ -48,12 +48,6 @@ export const toModelInsertable = (config) => {
|
|
|
48
48
|
writable: true,
|
|
49
49
|
value: config.toExportPath.bind(config)
|
|
50
50
|
}),
|
|
51
|
-
Object.defineProperty(_a, "isSelected", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true,
|
|
54
|
-
writable: true,
|
|
55
|
-
value: config.isSelected ?? (() => true)
|
|
56
|
-
}),
|
|
57
51
|
Object.defineProperty(_a, "isSupported", {
|
|
58
52
|
enumerable: true,
|
|
59
53
|
configurable: true,
|
|
@@ -16,14 +16,6 @@ export type ToOperationExportPathArgs = {
|
|
|
16
16
|
operation: OasOperation;
|
|
17
17
|
baseSettings: BaseSettings;
|
|
18
18
|
};
|
|
19
|
-
export type IsOperationSelectedArgs = {
|
|
20
|
-
operation: OasOperation;
|
|
21
|
-
baseSettings: BaseSettings;
|
|
22
|
-
};
|
|
23
|
-
export type IsGeneratorSelectedArgs = {
|
|
24
|
-
operation: OasOperation;
|
|
25
|
-
baseSettings: BaseSettings;
|
|
26
|
-
};
|
|
27
19
|
export type WithTransformOperation = {
|
|
28
20
|
transformOperation: (operation: OasOperation) => void;
|
|
29
21
|
};
|
|
@@ -38,8 +30,6 @@ export type OperationGateway = {
|
|
|
38
30
|
_class: 'OperationGateway';
|
|
39
31
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
40
32
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
41
|
-
isGeneratorSelected: (baseSettings: BaseSettings) => boolean;
|
|
42
|
-
isOperationSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
43
33
|
isSupported: (operation: OasOperation) => boolean;
|
|
44
34
|
pinnable: boolean;
|
|
45
35
|
};
|
|
@@ -52,7 +42,6 @@ export type OperationInsertable<V> = {
|
|
|
52
42
|
_class: 'OperationInsertable';
|
|
53
43
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
54
44
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
55
|
-
isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
56
45
|
isSupported: (operation: OasOperation) => boolean;
|
|
57
46
|
pinnable: boolean;
|
|
58
47
|
} & Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"OperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE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|
|
@@ -2,13 +2,10 @@ import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
|
2
2
|
import { type OperationGatewayArgs } from '../GatewayBase.js';
|
|
3
3
|
import type { Identifier } from '../Identifier.js';
|
|
4
4
|
import type { BaseSettings } from '../../types/Settings.js';
|
|
5
|
-
import type { IsOperationSelectedArgs } from './OperationInsertable.js';
|
|
6
5
|
export type ToOperationGatewayArgs = {
|
|
7
6
|
id: string;
|
|
8
7
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
9
8
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
10
|
-
isGeneratorSelected?: (baseSettings: BaseSettings) => boolean;
|
|
11
|
-
isOperationSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
12
9
|
isSupported?: (operation: OasOperation) => boolean;
|
|
13
10
|
};
|
|
14
11
|
export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
@@ -24,8 +21,6 @@ export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
|
24
21
|
_class: "OperationGateway";
|
|
25
22
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
26
23
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
27
|
-
isGeneratorSelected: (baseSettings: BaseSettings) => boolean;
|
|
28
|
-
isOperationSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
29
24
|
isSupported: (operation: OasOperation) => boolean;
|
|
30
25
|
pinnable: boolean;
|
|
31
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,UAAU,CAAA;IACxD,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,MAAM,CAAA;IACpD,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,sBAAsB;gCAa1B,oBAAoB;;;;;;;;;;iCAlB5B,YAAY,KAAK,UAAU;iCAC3B,YAAY,KAAK,MAAM;6BAC1B,YAAY,KAAK,OAAO;;CAsBnD,CAAA"}
|
|
@@ -41,18 +41,6 @@ export const toOperationGateway = (config) => {
|
|
|
41
41
|
writable: true,
|
|
42
42
|
value: config.toExportPath.bind(config)
|
|
43
43
|
}),
|
|
44
|
-
Object.defineProperty(_a, "isGeneratorSelected", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true,
|
|
48
|
-
value: config.isGeneratorSelected ?? (() => true)
|
|
49
|
-
}),
|
|
50
|
-
Object.defineProperty(_a, "isOperationSelected", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
configurable: true,
|
|
53
|
-
writable: true,
|
|
54
|
-
value: config.isOperationSelected ?? (() => true)
|
|
55
|
-
}),
|
|
56
44
|
Object.defineProperty(_a, "isSupported", {
|
|
57
45
|
enumerable: true,
|
|
58
46
|
configurable: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { ToOperationIdentifierArgs, ToOperationExportPathArgs
|
|
4
|
+
import type { ToOperationIdentifierArgs, ToOperationExportPathArgs } from './OperationInsertable.js';
|
|
5
5
|
import type { Identifier } from '../Identifier.js';
|
|
6
6
|
export type OperationInsertableArgs = {
|
|
7
7
|
context: GenerateContext;
|
|
@@ -12,7 +12,6 @@ export type ToOperationInsertableArgs = {
|
|
|
12
12
|
id: string;
|
|
13
13
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
14
14
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
15
|
-
isSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
16
15
|
isSupported?: (operation: OasOperation) => boolean;
|
|
17
16
|
pinnable?: boolean;
|
|
18
17
|
};
|
|
@@ -37,7 +36,6 @@ export declare const toOperationInsertable: (config: ToOperationInsertableArgs)
|
|
|
37
36
|
_class: "OperationInsertable";
|
|
38
37
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
39
38
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
40
|
-
isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
41
39
|
isSupported: (operation: OasOperation) => boolean;
|
|
42
40
|
pinnable: boolean;
|
|
43
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationInsertable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,e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 -48,12 +48,6 @@ export const toOperationInsertable = (config) => {
|
|
|
48
48
|
writable: true,
|
|
49
49
|
value: config.toExportPath.bind(config)
|
|
50
50
|
}),
|
|
51
|
-
Object.defineProperty(_a, "isSelected", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true,
|
|
54
|
-
writable: true,
|
|
55
|
-
value: config.isSelected ?? (() => true)
|
|
56
|
-
}),
|
|
57
51
|
Object.defineProperty(_a, "isSupported", {
|
|
58
52
|
enumerable: true,
|
|
59
53
|
configurable: true,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { Definition } from '../dsl/Definition.js';
|
|
|
3
3
|
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
|
-
import type { ClientSettings } from '../types/Settings.js';
|
|
6
|
+
import type { BaseSettings, ClientGeneratorSettings, ClientSettings } from '../types/Settings.js';
|
|
7
7
|
import type { Method } from '../types/Method.js';
|
|
8
8
|
import type { OperationInsertable, OperationGateway } from '../dsl/operation/OperationInsertable.js';
|
|
9
9
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
@@ -174,7 +174,7 @@ export declare class GenerateContext {
|
|
|
174
174
|
* operation.
|
|
175
175
|
*
|
|
176
176
|
* Content settings are produced by passing base settings and operation
|
|
177
|
-
* through toIdentifier
|
|
177
|
+
* through toIdentifier and toExportPath static methods on the
|
|
178
178
|
* insertable.
|
|
179
179
|
* @param { operation, insertable }
|
|
180
180
|
* @returns
|
|
@@ -184,7 +184,7 @@ export declare class GenerateContext {
|
|
|
184
184
|
* Generate and return content settings for model insertable and refName.
|
|
185
185
|
*
|
|
186
186
|
* Content settings are produced by passing base settings and refName
|
|
187
|
-
* through toIdentifier
|
|
187
|
+
* through toIdentifier and toExportPath static methods on the
|
|
188
188
|
* insertable.
|
|
189
189
|
* @param { refName, insertable }
|
|
190
190
|
* @returns Content settings for model
|
|
@@ -199,6 +199,14 @@ export declare class GenerateContext {
|
|
|
199
199
|
* @returns Content settings for model
|
|
200
200
|
*/
|
|
201
201
|
toGatewayContentSetting(gateway: OperationGateway): ContentSettings;
|
|
202
|
+
/**
|
|
203
|
+
* Look up operation settings for a given generatorId, path and method.
|
|
204
|
+
* @param { generatorId, path, method }
|
|
205
|
+
* @returns Base settings for operation
|
|
206
|
+
*/
|
|
207
|
+
toOperationBaseSettings({ generatorId, path, method }: GetOperationSettingsArgs): BaseSettings;
|
|
208
|
+
toModelBaseSettings({ generatorId, refName }: GetModelSettingsArgs): BaseSettings;
|
|
209
|
+
toGeneratorSettings(generatorId: string): ClientGeneratorSettings | undefined;
|
|
202
210
|
/**
|
|
203
211
|
* Perform one lookup of schema by `refName`.
|
|
204
212
|
* @param refName
|
|
@@ -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,
|
|
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,KAA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CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IAY7C;;;;;;;;;;;;;OAaG;IAEH,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,EAC9D,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EAChB,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IAYzC;;;;;;;;;OASG;IACH,0BAA0B,CAAC,CAAC,EAAE,EAC5B,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,eAAe;IAoB/C;;;;;;;;OAQG;IACH,sBAAsB,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,eAAe;IAmC9F;;;;;;;OAOG;IACH,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe;IAcnE;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,wBAAwB,GAAG,YAAY;IAgB9F,mBAAmB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,oBAAoB,GAAG,YAAY;IAgBjF,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IA+B7E;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAUpE;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
|
|
@@ -36,7 +36,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
|
-
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_setExportPath,
|
|
39
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_setExportPath, _GenerateContext_toGatewayBaseSettings, _GenerateContext_cleanBaseSettings, _GenerateContext_addFile;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.GenerateContext = void 0;
|
|
42
42
|
const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.6/mod.js");
|
|
@@ -295,13 +295,13 @@ class GenerateContext {
|
|
|
295
295
|
* operation.
|
|
296
296
|
*
|
|
297
297
|
* Content settings are produced by passing base settings and operation
|
|
298
|
-
* through toIdentifier
|
|
298
|
+
* through toIdentifier and toExportPath static methods on the
|
|
299
299
|
* insertable.
|
|
300
300
|
* @param { operation, insertable }
|
|
301
301
|
* @returns
|
|
302
302
|
*/
|
|
303
303
|
toOperationContentSettings({ operation, insertable }) {
|
|
304
|
-
const baseSettings =
|
|
304
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
305
305
|
generatorId: insertable.id,
|
|
306
306
|
path: operation.path,
|
|
307
307
|
method: operation.method
|
|
@@ -310,7 +310,7 @@ class GenerateContext {
|
|
|
310
310
|
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
311
311
|
return new ContentSettings_js_1.ContentSettings({
|
|
312
312
|
identifier: insertable.toIdentifier({ operation, baseSettings }),
|
|
313
|
-
selected:
|
|
313
|
+
selected: baseSettings.selected,
|
|
314
314
|
exportPath,
|
|
315
315
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
316
316
|
parentExportPath: baseSettings.parentExportPath
|
|
@@ -320,13 +320,13 @@ class GenerateContext {
|
|
|
320
320
|
* Generate and return content settings for model insertable and refName.
|
|
321
321
|
*
|
|
322
322
|
* Content settings are produced by passing base settings and refName
|
|
323
|
-
* through toIdentifier
|
|
323
|
+
* through toIdentifier and toExportPath static methods on the
|
|
324
324
|
* insertable.
|
|
325
325
|
* @param { refName, insertable }
|
|
326
326
|
* @returns Content settings for model
|
|
327
327
|
*/
|
|
328
328
|
toModelContentSettings({ refName, insertable }) {
|
|
329
|
-
const baseSettings =
|
|
329
|
+
const baseSettings = this.toModelBaseSettings({
|
|
330
330
|
generatorId: insertable.id,
|
|
331
331
|
refName
|
|
332
332
|
});
|
|
@@ -334,7 +334,7 @@ class GenerateContext {
|
|
|
334
334
|
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
335
335
|
return new ContentSettings_js_1.ContentSettings({
|
|
336
336
|
identifier: insertable.toIdentifier({ refName, baseSettings }),
|
|
337
|
-
selected:
|
|
337
|
+
selected: baseSettings.selected,
|
|
338
338
|
exportPath,
|
|
339
339
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
340
340
|
parentExportPath: baseSettings.parentExportPath
|
|
@@ -353,12 +353,42 @@ class GenerateContext {
|
|
|
353
353
|
const exportPath = gateway.toExportPath(baseSettings);
|
|
354
354
|
return new ContentSettings_js_1.ContentSettings({
|
|
355
355
|
identifier: gateway.toIdentifier(baseSettings),
|
|
356
|
-
selected:
|
|
356
|
+
selected: baseSettings.selected,
|
|
357
357
|
exportPath,
|
|
358
358
|
importFrom: baseSettings.importFrom ?? exportPath,
|
|
359
359
|
parentExportPath: baseSettings.parentExportPath
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Look up operation settings for a given generatorId, path and method.
|
|
364
|
+
* @param { generatorId, path, method }
|
|
365
|
+
* @returns Base settings for operation
|
|
366
|
+
*/
|
|
367
|
+
toOperationBaseSettings({ generatorId, path, method }) {
|
|
368
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
369
|
+
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
370
|
+
? generatorSettings.operations[path]?.[method]
|
|
371
|
+
: undefined;
|
|
372
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
373
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
374
|
+
...operationSettings,
|
|
375
|
+
parentExportPath: exportPath
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
toModelBaseSettings({ generatorId, refName }) {
|
|
379
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
380
|
+
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
381
|
+
? generatorSettings.models[refName]
|
|
382
|
+
: undefined;
|
|
383
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
384
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
385
|
+
...modelSettings,
|
|
386
|
+
parentExportPath: exportPath
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
toGeneratorSettings(generatorId) {
|
|
390
|
+
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
391
|
+
}
|
|
362
392
|
/**
|
|
363
393
|
* Perform one lookup of schema by `refName`.
|
|
364
394
|
* @param refName
|
|
@@ -404,12 +434,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
404
434
|
if (!generator.isSupported(operation)) {
|
|
405
435
|
return this.captureCurrentResult('notSupported');
|
|
406
436
|
}
|
|
407
|
-
const baseSettings =
|
|
437
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
408
438
|
generatorId: generator.id,
|
|
409
439
|
path,
|
|
410
440
|
method
|
|
411
441
|
});
|
|
412
|
-
if (!
|
|
442
|
+
if (!baseSettings.selected) {
|
|
413
443
|
return this.captureCurrentResult('notSelected');
|
|
414
444
|
}
|
|
415
445
|
gatewayInstance.transformOperation(operation);
|
|
@@ -436,12 +466,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
436
466
|
if (!generator.isSupported(operation)) {
|
|
437
467
|
return this.captureCurrentResult('notSupported');
|
|
438
468
|
}
|
|
439
|
-
const baseSettings =
|
|
469
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
440
470
|
generatorId: generator.id,
|
|
441
471
|
path,
|
|
442
472
|
method
|
|
443
473
|
});
|
|
444
|
-
if (!
|
|
474
|
+
if (!baseSettings.selected) {
|
|
445
475
|
return this.captureCurrentResult('notSelected');
|
|
446
476
|
}
|
|
447
477
|
this.insertOperation({ insertable: generator, operation });
|
|
@@ -457,11 +487,11 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
457
487
|
if (!generator.isSupported()) {
|
|
458
488
|
return this.captureCurrentResult('notSupported');
|
|
459
489
|
}
|
|
460
|
-
const baseSettings =
|
|
490
|
+
const baseSettings = this.toModelBaseSettings({
|
|
461
491
|
generatorId: generator.id,
|
|
462
492
|
refName
|
|
463
493
|
});
|
|
464
|
-
if (!
|
|
494
|
+
if (!baseSettings.selected) {
|
|
465
495
|
return this.captureCurrentResult('notSelected');
|
|
466
496
|
}
|
|
467
497
|
this.insertModel({ insertable: generator, refName });
|
|
@@ -490,30 +520,8 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
490
520
|
}
|
|
491
521
|
const combinedExportPath = (0, mod_js_1.join)(parentExportPath ?? '', generatedExportPath);
|
|
492
522
|
return combinedExportPath;
|
|
493
|
-
}, _GenerateContext_toOperationBaseSettings = function _GenerateContext_toOperationBaseSettings({ generatorId, path, method }) {
|
|
494
|
-
const generatorSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGeneratorSettings).call(this, generatorId);
|
|
495
|
-
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
496
|
-
? generatorSettings.operations[path]?.[method]
|
|
497
|
-
: undefined;
|
|
498
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
499
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
500
|
-
...operationSettings,
|
|
501
|
-
parentExportPath: exportPath
|
|
502
|
-
});
|
|
503
|
-
}, _GenerateContext_toModelBaseSettings = function _GenerateContext_toModelBaseSettings({ generatorId, refName }) {
|
|
504
|
-
const generatorSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGeneratorSettings).call(this, generatorId);
|
|
505
|
-
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
506
|
-
? generatorSettings.models[refName]
|
|
507
|
-
: undefined;
|
|
508
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
509
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
510
|
-
...modelSettings,
|
|
511
|
-
parentExportPath: exportPath
|
|
512
|
-
});
|
|
513
|
-
}, _GenerateContext_toGeneratorSettings = function _GenerateContext_toGeneratorSettings(generatorId) {
|
|
514
|
-
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
515
523
|
}, _GenerateContext_toGatewayBaseSettings = function _GenerateContext_toGatewayBaseSettings(generatorId) {
|
|
516
|
-
const generatorSettings =
|
|
524
|
+
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
517
525
|
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, generatorSettings?.baseSettings);
|
|
518
526
|
}, _GenerateContext_cleanBaseSettings = function _GenerateContext_cleanBaseSettings(baseSettings) {
|
|
519
527
|
return {
|
|
@@ -17,10 +17,6 @@ export type ToModelExportPathArgs = {
|
|
|
17
17
|
refName: RefName;
|
|
18
18
|
baseSettings: BaseSettings;
|
|
19
19
|
};
|
|
20
|
-
export type IsModelSelectedArgs = {
|
|
21
|
-
refName: RefName;
|
|
22
|
-
baseSettings: BaseSettings;
|
|
23
|
-
};
|
|
24
20
|
export type WithTransformModel = {
|
|
25
21
|
transformModel: (refName: RefName) => void;
|
|
26
22
|
};
|
|
@@ -33,7 +29,6 @@ export type ModelInsertable<V> = {
|
|
|
33
29
|
_class: 'ModelInsertable';
|
|
34
30
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
35
31
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
36
|
-
isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
37
32
|
isSupported: () => boolean;
|
|
38
33
|
pinnable: boolean;
|
|
39
34
|
} & Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,eAAe,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,YAAY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AAqB,KAAK,UAAU,CAAA;IAC9E,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAE1E,WAAW,EAAE,MAAM,OAAO,CAAA;IAE1B,QAAQ,EAAE,OAAO,CAAA;CAGlB,GAAG,QAAQ,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { RefName } from '../../types/RefName.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ToModelExportPathArgs, ToModelIdentifierArgs } from './ModelInsertable.js';
|
|
5
5
|
import type { Identifier } from '../Identifier.js';
|
|
6
6
|
export type ModelInsertableArgs = {
|
|
7
7
|
context: GenerateContext;
|
|
@@ -12,7 +12,6 @@ export type ModelConfig = {
|
|
|
12
12
|
id: string;
|
|
13
13
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
14
14
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
15
|
-
isSelected?: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
16
15
|
};
|
|
17
16
|
export declare const toModelInsertable: (config: ModelConfig) => {
|
|
18
17
|
new (args: ModelInsertableArgs): {
|
|
@@ -29,7 +28,6 @@ export declare const toModelInsertable: (config: ModelConfig) => {
|
|
|
29
28
|
_class: "ModelInsertable";
|
|
30
29
|
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
31
30
|
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
32
|
-
isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
|
|
33
31
|
isSupported: () => boolean;
|
|
34
32
|
pinnable: boolean;
|
|
35
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"toModelInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,UAAU,CAAA;IAC9E,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;CAC3E,CAAA;AAED,eAAO,MAAM,iBAAiB,WAAY,WAAW;eAa/B,mBAAmB;;;;;;;;;;;;8CAjBG,qBAAqB,KAAK,UAAU;8CACpC,qBAAqB,KAAK,MAAM;;;CA4B3E,CAAA"}
|
|
@@ -51,12 +51,6 @@ const toModelInsertable = (config) => {
|
|
|
51
51
|
writable: true,
|
|
52
52
|
value: config.toExportPath.bind(config)
|
|
53
53
|
}),
|
|
54
|
-
Object.defineProperty(_a, "isSelected", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
configurable: true,
|
|
57
|
-
writable: true,
|
|
58
|
-
value: config.isSelected ?? (() => true)
|
|
59
|
-
}),
|
|
60
54
|
Object.defineProperty(_a, "isSupported", {
|
|
61
55
|
enumerable: true,
|
|
62
56
|
configurable: true,
|
|
@@ -16,14 +16,6 @@ export type ToOperationExportPathArgs = {
|
|
|
16
16
|
operation: OasOperation;
|
|
17
17
|
baseSettings: BaseSettings;
|
|
18
18
|
};
|
|
19
|
-
export type IsOperationSelectedArgs = {
|
|
20
|
-
operation: OasOperation;
|
|
21
|
-
baseSettings: BaseSettings;
|
|
22
|
-
};
|
|
23
|
-
export type IsGeneratorSelectedArgs = {
|
|
24
|
-
operation: OasOperation;
|
|
25
|
-
baseSettings: BaseSettings;
|
|
26
|
-
};
|
|
27
19
|
export type WithTransformOperation = {
|
|
28
20
|
transformOperation: (operation: OasOperation) => void;
|
|
29
21
|
};
|
|
@@ -38,8 +30,6 @@ export type OperationGateway = {
|
|
|
38
30
|
_class: 'OperationGateway';
|
|
39
31
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
40
32
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
41
|
-
isGeneratorSelected: (baseSettings: BaseSettings) => boolean;
|
|
42
|
-
isOperationSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
43
33
|
isSupported: (operation: OasOperation) => boolean;
|
|
44
34
|
pinnable: boolean;
|
|
45
35
|
};
|
|
@@ -52,7 +42,6 @@ export type OperationInsertable<V> = {
|
|
|
52
42
|
_class: 'OperationInsertable';
|
|
53
43
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
54
44
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
55
|
-
isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
56
45
|
isSupported: (operation: OasOperation) => boolean;
|
|
57
46
|
pinnable: boolean;
|
|
58
47
|
} & Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"OperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA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E,qBAAqB,CAAA;IAC7B,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,yBAAyB,KAAK,UAAU,CAAA;IACpF,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,yBAAyB,KAAK,MAAM,CAAA;IAEhF,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAEjD,QAAQ,EAAE,OAAO,CAAA;CAGlB,GAAG,QAAQ,CAAA"}
|
|
@@ -2,13 +2,10 @@ import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
|
2
2
|
import { type OperationGatewayArgs } from '../GatewayBase.js';
|
|
3
3
|
import type { Identifier } from '../Identifier.js';
|
|
4
4
|
import type { BaseSettings } from '../../types/Settings.js';
|
|
5
|
-
import type { IsOperationSelectedArgs } from './OperationInsertable.js';
|
|
6
5
|
export type ToOperationGatewayArgs = {
|
|
7
6
|
id: string;
|
|
8
7
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
9
8
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
10
|
-
isGeneratorSelected?: (baseSettings: BaseSettings) => boolean;
|
|
11
|
-
isOperationSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
12
9
|
isSupported?: (operation: OasOperation) => boolean;
|
|
13
10
|
};
|
|
14
11
|
export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
@@ -24,8 +21,6 @@ export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
|
24
21
|
_class: "OperationGateway";
|
|
25
22
|
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
26
23
|
toExportPath: (baseSettings: BaseSettings) => string;
|
|
27
|
-
isGeneratorSelected: (baseSettings: BaseSettings) => boolean;
|
|
28
|
-
isOperationSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
29
24
|
isSupported: (operation: OasOperation) => boolean;
|
|
30
25
|
pinnable: boolean;
|
|
31
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,UAAU,CAAA;IACxD,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,MAAM,CAAA;IACpD,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,sBAAsB;gCAa1B,oBAAoB;;;;;;;;;;iCAlB5B,YAAY,KAAK,UAAU;iCAC3B,YAAY,KAAK,MAAM;6BAC1B,YAAY,KAAK,OAAO;;CAsBnD,CAAA"}
|
|
@@ -44,18 +44,6 @@ const toOperationGateway = (config) => {
|
|
|
44
44
|
writable: true,
|
|
45
45
|
value: config.toExportPath.bind(config)
|
|
46
46
|
}),
|
|
47
|
-
Object.defineProperty(_a, "isGeneratorSelected", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true,
|
|
51
|
-
value: config.isGeneratorSelected ?? (() => true)
|
|
52
|
-
}),
|
|
53
|
-
Object.defineProperty(_a, "isOperationSelected", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true,
|
|
56
|
-
writable: true,
|
|
57
|
-
value: config.isOperationSelected ?? (() => true)
|
|
58
|
-
}),
|
|
59
47
|
Object.defineProperty(_a, "isSupported", {
|
|
60
48
|
enumerable: true,
|
|
61
49
|
configurable: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { ToOperationIdentifierArgs, ToOperationExportPathArgs
|
|
4
|
+
import type { ToOperationIdentifierArgs, ToOperationExportPathArgs } from './OperationInsertable.js';
|
|
5
5
|
import type { Identifier } from '../Identifier.js';
|
|
6
6
|
export type OperationInsertableArgs = {
|
|
7
7
|
context: GenerateContext;
|
|
@@ -12,7 +12,6 @@ export type ToOperationInsertableArgs = {
|
|
|
12
12
|
id: string;
|
|
13
13
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
14
14
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
15
|
-
isSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
16
15
|
isSupported?: (operation: OasOperation) => boolean;
|
|
17
16
|
pinnable?: boolean;
|
|
18
17
|
};
|
|
@@ -37,7 +36,6 @@ export declare const toOperationInsertable: (config: ToOperationInsertableArgs)
|
|
|
37
36
|
_class: "OperationInsertable";
|
|
38
37
|
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
39
38
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
40
|
-
isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
41
39
|
isSupported: (operation: OasOperation) => boolean;
|
|
42
40
|
pinnable: boolean;
|
|
43
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationInsertable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"toOperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationInsertable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,yBAAyB,KAAK,UAAU,CAAA;IACpF,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,yBAAyB,KAAK,MAAM,CAAA;IAChF,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,yBAAyB;eAajD,uBAAuB;;;;;;;;;;;;;;;;;;gDAnBC,yBAAyB,KAAK,UAAU;gDACxC,yBAAyB,KAAK,MAAM;6BACtD,YAAY,KAAK,OAAO;;CA6BnD,CAAA"}
|
|
@@ -51,12 +51,6 @@ const toOperationInsertable = (config) => {
|
|
|
51
51
|
writable: true,
|
|
52
52
|
value: config.toExportPath.bind(config)
|
|
53
53
|
}),
|
|
54
|
-
Object.defineProperty(_a, "isSelected", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
configurable: true,
|
|
57
|
-
writable: true,
|
|
58
|
-
value: config.isSelected ?? (() => true)
|
|
59
|
-
}),
|
|
60
54
|
Object.defineProperty(_a, "isSupported", {
|
|
61
55
|
enumerable: true,
|
|
62
56
|
configurable: true,
|