@skmtc/core 0.0.463 → 0.0.465
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 +3 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +29 -62
- package/esm/dsl/ContentSettings.d.ts +1 -3
- package/esm/dsl/ContentSettings.d.ts.map +1 -1
- package/esm/dsl/ContentSettings.js +2 -10
- package/esm/dsl/File.d.ts +1 -1
- package/esm/dsl/File.d.ts.map +1 -1
- package/esm/dsl/File.js +9 -6
- package/esm/dsl/model/ModelInsertable.d.ts +2 -5
- package/esm/dsl/model/ModelInsertable.d.ts.map +1 -1
- package/esm/dsl/model/toModelInsertable.d.ts +4 -4
- package/esm/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/OperationInsertable.d.ts +4 -7
- package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationGateway.d.ts +4 -5
- package/esm/dsl/operation/toOperationGateway.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationInsertable.d.ts +4 -4
- package/esm/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/esm/types/Settings.d.ts +52 -482
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +5 -11
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +3 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +28 -61
- package/script/dsl/ContentSettings.d.ts +1 -3
- package/script/dsl/ContentSettings.d.ts.map +1 -1
- package/script/dsl/ContentSettings.js +2 -10
- package/script/dsl/File.d.ts +1 -1
- package/script/dsl/File.d.ts.map +1 -1
- package/script/dsl/File.js +9 -6
- package/script/dsl/model/ModelInsertable.d.ts +2 -5
- package/script/dsl/model/ModelInsertable.d.ts.map +1 -1
- package/script/dsl/model/toModelInsertable.d.ts +4 -4
- package/script/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/script/dsl/operation/OperationInsertable.d.ts +4 -7
- package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationGateway.d.ts +4 -5
- package/script/dsl/operation/toOperationGateway.d.ts.map +1 -1
- package/script/dsl/operation/toOperationInsertable.d.ts +4 -4
- package/script/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/script/types/Settings.d.ts +52 -482
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +6 -12
package/esm/types/Settings.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import "../_dnt.polyfills.js";
|
|
2
2
|
import { method } from './Method.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
export const baseSettings = z.object({
|
|
5
|
-
selected: z.boolean(),
|
|
6
|
-
name: z.string().optional(),
|
|
7
|
-
importFrom: z.string().optional(),
|
|
8
|
-
exportPath: z.string().optional(),
|
|
9
|
-
parentExportPath: z.string().optional()
|
|
10
|
-
});
|
|
11
4
|
export const operationsGeneratorSettings = z.object({
|
|
12
5
|
id: z.string(),
|
|
13
6
|
description: z.string().optional(),
|
|
14
|
-
operations: z.record(z.record(method,
|
|
15
|
-
|
|
7
|
+
operations: z.record(z.record(method, z.boolean())),
|
|
8
|
+
selected: z.boolean().optional()
|
|
16
9
|
});
|
|
17
10
|
export const modelsGeneratorSettings = z.object({
|
|
18
11
|
id: z.string(),
|
|
19
12
|
exportPath: z.string().optional(),
|
|
20
13
|
description: z.string().optional(),
|
|
21
|
-
models: z.record(
|
|
22
|
-
|
|
14
|
+
models: z.record(z.boolean()),
|
|
15
|
+
selected: z.boolean().optional()
|
|
23
16
|
});
|
|
24
17
|
export const clientGeneratorSettings = z.union([
|
|
25
18
|
operationsGeneratorSettings,
|
|
@@ -31,6 +24,7 @@ export const modulePackage = z.object({
|
|
|
31
24
|
});
|
|
32
25
|
export const clientSettings = z.object({
|
|
33
26
|
basePath: z.string().optional(),
|
|
27
|
+
alias: z.record(z.string(), z.string()).optional(),
|
|
34
28
|
packages: z.array(modulePackage).optional(),
|
|
35
29
|
generators: z.array(clientGeneratorSettings)
|
|
36
30
|
});
|
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 {
|
|
6
|
+
import type { 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';
|
|
@@ -208,8 +208,8 @@ export declare class GenerateContext {
|
|
|
208
208
|
* @param { generatorId, path, method }
|
|
209
209
|
* @returns Base settings for operation
|
|
210
210
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
toOperationSelected({ generatorId, path, method }: GetOperationSettingsArgs): boolean | undefined;
|
|
212
|
+
toModelSelected({ generatorId, refName }: GetModelSettingsArgs): boolean | undefined;
|
|
213
213
|
toGeneratorSettings(generatorId: string): ClientGeneratorSettings | undefined;
|
|
214
214
|
/**
|
|
215
215
|
* Perform one lookup of schema by `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,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GAAG,OAAO,GAAG,SAAS;IAQjD,eAAe,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,oBAAoB,GAAG,OAAO,GAAG,SAAS;IAQpF,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAqB7E;;;;;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_previews, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile,
|
|
39
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_previews, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_toGatewaySelected, _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");
|
|
@@ -311,19 +311,17 @@ class GenerateContext {
|
|
|
311
311
|
* @returns
|
|
312
312
|
*/
|
|
313
313
|
toOperationContentSettings({ operation, insertable }) {
|
|
314
|
-
const
|
|
314
|
+
const selected = this.toOperationSelected({
|
|
315
315
|
generatorId: insertable.id,
|
|
316
316
|
path: operation.path,
|
|
317
317
|
method: operation.method
|
|
318
318
|
});
|
|
319
|
-
const
|
|
320
|
-
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
319
|
+
const exportPath = insertable.toExportPath({ operation });
|
|
321
320
|
return new ContentSettings_js_1.ContentSettings({
|
|
322
|
-
identifier: insertable.toIdentifier({ operation
|
|
323
|
-
selected:
|
|
321
|
+
identifier: insertable.toIdentifier({ operation }),
|
|
322
|
+
selected: Boolean(selected),
|
|
324
323
|
exportPath,
|
|
325
|
-
importFrom:
|
|
326
|
-
parentExportPath: baseSettings.parentExportPath
|
|
324
|
+
importFrom: exportPath
|
|
327
325
|
});
|
|
328
326
|
}
|
|
329
327
|
/**
|
|
@@ -336,18 +334,16 @@ class GenerateContext {
|
|
|
336
334
|
* @returns Content settings for model
|
|
337
335
|
*/
|
|
338
336
|
toModelContentSettings({ refName, insertable }) {
|
|
339
|
-
const
|
|
337
|
+
const selected = this.toModelSelected({
|
|
340
338
|
generatorId: insertable.id,
|
|
341
339
|
refName
|
|
342
340
|
});
|
|
343
|
-
const
|
|
344
|
-
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
341
|
+
const exportPath = insertable.toExportPath({ refName });
|
|
345
342
|
return new ContentSettings_js_1.ContentSettings({
|
|
346
|
-
identifier: insertable.toIdentifier({ refName
|
|
347
|
-
selected:
|
|
343
|
+
identifier: insertable.toIdentifier({ refName }),
|
|
344
|
+
selected: Boolean(selected),
|
|
348
345
|
exportPath,
|
|
349
|
-
importFrom:
|
|
350
|
-
parentExportPath: baseSettings.parentExportPath
|
|
346
|
+
importFrom: exportPath
|
|
351
347
|
});
|
|
352
348
|
}
|
|
353
349
|
/**
|
|
@@ -359,14 +355,13 @@ class GenerateContext {
|
|
|
359
355
|
* @returns Content settings for model
|
|
360
356
|
*/
|
|
361
357
|
toGatewayContentSetting(gateway) {
|
|
362
|
-
const
|
|
363
|
-
const exportPath = gateway.toExportPath(
|
|
358
|
+
const selected = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGatewaySelected).call(this, gateway.id);
|
|
359
|
+
const exportPath = gateway.toExportPath();
|
|
364
360
|
return new ContentSettings_js_1.ContentSettings({
|
|
365
|
-
identifier: gateway.toIdentifier(
|
|
366
|
-
selected:
|
|
361
|
+
identifier: gateway.toIdentifier(),
|
|
362
|
+
selected: Boolean(selected),
|
|
367
363
|
exportPath,
|
|
368
|
-
importFrom:
|
|
369
|
-
parentExportPath: baseSettings.parentExportPath
|
|
364
|
+
importFrom: exportPath
|
|
370
365
|
});
|
|
371
366
|
}
|
|
372
367
|
/**
|
|
@@ -374,27 +369,17 @@ class GenerateContext {
|
|
|
374
369
|
* @param { generatorId, path, method }
|
|
375
370
|
* @returns Base settings for operation
|
|
376
371
|
*/
|
|
377
|
-
|
|
372
|
+
toOperationSelected({ generatorId, path, method }) {
|
|
378
373
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
379
|
-
|
|
374
|
+
return generatorSettings && 'operations' in generatorSettings
|
|
380
375
|
? generatorSettings.operations[path]?.[method]
|
|
381
376
|
: undefined;
|
|
382
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
383
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
384
|
-
...operationSettings,
|
|
385
|
-
parentExportPath: exportPath
|
|
386
|
-
});
|
|
387
377
|
}
|
|
388
|
-
|
|
378
|
+
toModelSelected({ generatorId, refName }) {
|
|
389
379
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
390
|
-
|
|
380
|
+
return generatorSettings && 'models' in generatorSettings
|
|
391
381
|
? generatorSettings.models[refName]
|
|
392
382
|
: undefined;
|
|
393
|
-
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
394
|
-
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
395
|
-
...modelSettings,
|
|
396
|
-
parentExportPath: exportPath
|
|
397
|
-
});
|
|
398
383
|
}
|
|
399
384
|
toGeneratorSettings(generatorId) {
|
|
400
385
|
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
@@ -444,12 +429,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
444
429
|
if (!generator.isSupported(operation)) {
|
|
445
430
|
return this.captureCurrentResult('notSupported');
|
|
446
431
|
}
|
|
447
|
-
const
|
|
432
|
+
const operationSelected = this.toOperationSelected({
|
|
448
433
|
generatorId: generator.id,
|
|
449
434
|
path,
|
|
450
435
|
method
|
|
451
436
|
});
|
|
452
|
-
if (!
|
|
437
|
+
if (!operationSelected) {
|
|
453
438
|
return this.captureCurrentResult('notSelected');
|
|
454
439
|
}
|
|
455
440
|
gatewayInstance.transformOperation(operation);
|
|
@@ -476,12 +461,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
476
461
|
if (!generator.isSupported(operation)) {
|
|
477
462
|
return this.captureCurrentResult('notSupported');
|
|
478
463
|
}
|
|
479
|
-
const
|
|
464
|
+
const operationSelected = this.toOperationSelected({
|
|
480
465
|
generatorId: generator.id,
|
|
481
466
|
path,
|
|
482
467
|
method
|
|
483
468
|
});
|
|
484
|
-
if (!
|
|
469
|
+
if (!operationSelected) {
|
|
485
470
|
return this.captureCurrentResult('notSelected');
|
|
486
471
|
}
|
|
487
472
|
this.insertOperation({ insertable: generator, operation });
|
|
@@ -497,11 +482,11 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
497
482
|
if (!generator.isSupported()) {
|
|
498
483
|
return this.captureCurrentResult('notSupported');
|
|
499
484
|
}
|
|
500
|
-
const
|
|
485
|
+
const selected = this.toModelSelected({
|
|
501
486
|
generatorId: generator.id,
|
|
502
487
|
refName
|
|
503
488
|
});
|
|
504
|
-
if (!
|
|
489
|
+
if (!selected) {
|
|
505
490
|
return this.captureCurrentResult('notSelected');
|
|
506
491
|
}
|
|
507
492
|
this.insertModel({ insertable: generator, refName });
|
|
@@ -520,27 +505,9 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
520
505
|
}
|
|
521
506
|
}
|
|
522
507
|
return currentFile;
|
|
523
|
-
},
|
|
524
|
-
const { parentExportPath, exportPath } = baseSettings;
|
|
525
|
-
if (exportPath) {
|
|
526
|
-
return (0, mod_js_1.join)(parentExportPath ?? '', exportPath);
|
|
527
|
-
}
|
|
528
|
-
if (generatedExportPath.startsWith('@/')) {
|
|
529
|
-
return generatedExportPath;
|
|
530
|
-
}
|
|
531
|
-
const combinedExportPath = (0, mod_js_1.join)(parentExportPath ?? '', generatedExportPath);
|
|
532
|
-
return combinedExportPath;
|
|
533
|
-
}, _GenerateContext_toGatewayBaseSettings = function _GenerateContext_toGatewayBaseSettings(generatorId) {
|
|
508
|
+
}, _GenerateContext_toGatewaySelected = function _GenerateContext_toGatewaySelected(generatorId) {
|
|
534
509
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
535
|
-
return
|
|
536
|
-
}, _GenerateContext_cleanBaseSettings = function _GenerateContext_cleanBaseSettings(baseSettings) {
|
|
537
|
-
return {
|
|
538
|
-
exportPath: baseSettings?.exportPath,
|
|
539
|
-
selected: Boolean(baseSettings?.selected),
|
|
540
|
-
name: baseSettings?.name,
|
|
541
|
-
importFrom: baseSettings?.importFrom,
|
|
542
|
-
parentExportPath: baseSettings?.parentExportPath
|
|
543
|
-
};
|
|
510
|
+
return generatorSettings?.selected;
|
|
544
511
|
}, _GenerateContext_addFile = function _GenerateContext_addFile(normalisedPath) {
|
|
545
512
|
if (__classPrivateFieldGet(this, _GenerateContext_files, "f").has(normalisedPath)) {
|
|
546
513
|
throw new Error(`File already exists: ${normalisedPath}`);
|
|
@@ -8,15 +8,13 @@ type CreateArgs = {
|
|
|
8
8
|
selected: boolean;
|
|
9
9
|
exportPath: string;
|
|
10
10
|
importFrom: string;
|
|
11
|
-
parentExportPath: string | undefined;
|
|
12
11
|
};
|
|
13
12
|
export declare class ContentSettings {
|
|
14
13
|
identifier: Identifier;
|
|
15
14
|
selected: boolean;
|
|
16
15
|
exportPath: string;
|
|
17
16
|
importFrom: string;
|
|
18
|
-
|
|
19
|
-
constructor({ identifier, selected, exportPath, importFrom, parentExportPath }: CreateArgs);
|
|
17
|
+
constructor({ identifier, selected, exportPath, importFrom }: CreateArgs);
|
|
20
18
|
static empty({ identifier, exportPath }: EmptyArgs): ContentSettings;
|
|
21
19
|
}
|
|
22
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSettings.d.ts","sourceRoot":"","sources":["../../src/dsl/ContentSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"ContentSettings.d.ts","sourceRoot":"","sources":["../../src/dsl/ContentSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,qBAAa,eAAe;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;gBAEN,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,UAAU;IAOxE,MAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,GAAG,eAAe;CAQrE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContentSettings = void 0;
|
|
4
4
|
class ContentSettings {
|
|
5
|
-
constructor({ identifier, selected, exportPath, importFrom
|
|
5
|
+
constructor({ identifier, selected, exportPath, importFrom }) {
|
|
6
6
|
Object.defineProperty(this, "identifier", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
configurable: true,
|
|
@@ -27,25 +27,17 @@ class ContentSettings {
|
|
|
27
27
|
writable: true,
|
|
28
28
|
value: void 0
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(this, "parentExportPath", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true,
|
|
34
|
-
value: void 0
|
|
35
|
-
});
|
|
36
30
|
this.identifier = identifier;
|
|
37
31
|
this.selected = selected;
|
|
38
32
|
this.exportPath = exportPath;
|
|
39
33
|
this.importFrom = importFrom;
|
|
40
|
-
this.parentExportPath = parentExportPath;
|
|
41
34
|
}
|
|
42
35
|
static empty({ identifier, exportPath }) {
|
|
43
36
|
return new ContentSettings({
|
|
44
37
|
selected: true,
|
|
45
38
|
identifier,
|
|
46
39
|
exportPath,
|
|
47
|
-
importFrom: exportPath
|
|
48
|
-
parentExportPath: undefined
|
|
40
|
+
importFrom: exportPath
|
|
49
41
|
});
|
|
50
42
|
}
|
|
51
43
|
}
|
package/script/dsl/File.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class File {
|
|
|
11
11
|
reExports: Map<string, Record<string, Set<string>>>;
|
|
12
12
|
imports: Map<string, Set<string>>;
|
|
13
13
|
definitions: Map<string, Definition>;
|
|
14
|
-
|
|
14
|
+
settings: ClientSettings | undefined;
|
|
15
15
|
constructor({ path, settings }: FileArgs);
|
|
16
16
|
get generatorKeys(): Set<GeneratorKey>;
|
|
17
17
|
toString(): string;
|
package/script/dsl/File.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/dsl/File.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC,CAAA;AAED,qBAAa,IAAI;;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEpC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/dsl/File.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC,CAAA;AAED,qBAAa,IAAI;;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEpC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;gBAExB,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ;IASxC,IAAI,aAAa,sBAEhB;IAED,QAAQ;CAyCT;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,mBAAmB,8CAI7B,uBAAuB,WAYzB,CAAA"}
|
package/script/dsl/File.js
CHANGED
|
@@ -41,7 +41,7 @@ class File {
|
|
|
41
41
|
value: void 0
|
|
42
42
|
});
|
|
43
43
|
_File_generatorKeys.set(this, void 0);
|
|
44
|
-
Object.defineProperty(this, "
|
|
44
|
+
Object.defineProperty(this, "settings", {
|
|
45
45
|
enumerable: true,
|
|
46
46
|
configurable: true,
|
|
47
47
|
writable: true,
|
|
@@ -52,7 +52,7 @@ class File {
|
|
|
52
52
|
this.imports = new Map();
|
|
53
53
|
this.definitions = new Map();
|
|
54
54
|
__classPrivateFieldSet(this, _File_generatorKeys, new Set(), "f");
|
|
55
|
-
this.
|
|
55
|
+
this.settings = settings;
|
|
56
56
|
}
|
|
57
57
|
get generatorKeys() {
|
|
58
58
|
return __classPrivateFieldGet(this, _File_generatorKeys, "f");
|
|
@@ -62,7 +62,7 @@ class File {
|
|
|
62
62
|
const updatedModuleName = (0, exports.normaliseModuleName)({
|
|
63
63
|
destinationPath: this.path,
|
|
64
64
|
exportPath: module,
|
|
65
|
-
packages: this.packages
|
|
65
|
+
packages: this.settings?.packages
|
|
66
66
|
});
|
|
67
67
|
return Object.entries(entityTypes).map(([entityType, names]) => {
|
|
68
68
|
const prefix = entityType === 'type' ? 'type' : '';
|
|
@@ -70,14 +70,17 @@ class File {
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
const imports = Array.from(this.imports.entries()).map(([module, importItems]) => {
|
|
73
|
-
const updatedModuleName = this.packages
|
|
73
|
+
const updatedModuleName = this.settings?.packages
|
|
74
74
|
? (0, exports.normaliseModuleName)({
|
|
75
75
|
destinationPath: this.path,
|
|
76
76
|
exportPath: module,
|
|
77
|
-
packages: this.packages
|
|
77
|
+
packages: this.settings?.packages
|
|
78
78
|
})
|
|
79
79
|
: module;
|
|
80
|
-
|
|
80
|
+
const aliasedModuleName = Object.entries(this.settings?.alias ?? {}).reduce((acc, [pattern, replacement]) => {
|
|
81
|
+
return acc.startsWith(pattern) ? acc.replace(pattern, replacement) : acc;
|
|
82
|
+
}, updatedModuleName);
|
|
83
|
+
return new Import_js_1.Import({ module: aliasedModuleName, importNames: Array.from(importItems) });
|
|
81
84
|
});
|
|
82
85
|
const definitions = Array.from(this.definitions.values());
|
|
83
86
|
return [reExports, imports, definitions]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
3
|
-
import type { BaseSettings } from '../../types/Settings.js';
|
|
4
3
|
import type { RefName } from '../../types/RefName.js';
|
|
5
4
|
import type { Identifier } from '../Identifier.js';
|
|
6
5
|
type ModelInsertableConstructorArgs = {
|
|
@@ -11,11 +10,9 @@ type ModelInsertableConstructorArgs = {
|
|
|
11
10
|
};
|
|
12
11
|
export type ToModelIdentifierArgs = {
|
|
13
12
|
refName: RefName;
|
|
14
|
-
baseSettings: BaseSettings;
|
|
15
13
|
};
|
|
16
14
|
export type ToModelExportPathArgs = {
|
|
17
15
|
refName: RefName;
|
|
18
|
-
baseSettings: BaseSettings;
|
|
19
16
|
};
|
|
20
17
|
export type WithTransformModel = {
|
|
21
18
|
transformModel: (refName: RefName) => void;
|
|
@@ -27,8 +24,8 @@ export type ModelInsertable<V> = {
|
|
|
27
24
|
id: string;
|
|
28
25
|
type: 'model';
|
|
29
26
|
_class: 'ModelInsertable';
|
|
30
|
-
toIdentifier: ({ refName
|
|
31
|
-
toExportPath: ({ refName
|
|
27
|
+
toIdentifier: ({ refName }: ToModelIdentifierArgs) => Identifier;
|
|
28
|
+
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
32
29
|
isSupported: () => boolean;
|
|
33
30
|
pinnable: boolean;
|
|
34
31
|
} & 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,
|
|
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,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;CACjB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAAG;IAClD,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,8BAA8B,GAAG,CAAC,CAAA;IACxF,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;IAEzB,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,qBAAqB,KAAK,UAAU,CAAA;IAChE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAE5D,WAAW,EAAE,MAAM,OAAO,CAAA;IAE1B,QAAQ,EAAE,OAAO,CAAA;CAGlB,GAAG,QAAQ,CAAA"}
|
|
@@ -10,8 +10,8 @@ export type ModelInsertableArgs = {
|
|
|
10
10
|
};
|
|
11
11
|
export type ModelConfig = {
|
|
12
12
|
id: string;
|
|
13
|
-
toIdentifier: ({ refName
|
|
14
|
-
toExportPath: ({ refName
|
|
13
|
+
toIdentifier: ({ refName }: ToModelIdentifierArgs) => Identifier;
|
|
14
|
+
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
15
15
|
};
|
|
16
16
|
export declare const toModelInsertable: (config: ModelConfig) => {
|
|
17
17
|
new (args: ModelInsertableArgs): {
|
|
@@ -26,8 +26,8 @@ export declare const toModelInsertable: (config: ModelConfig) => {
|
|
|
26
26
|
id: string;
|
|
27
27
|
type: "model";
|
|
28
28
|
_class: "ModelInsertable";
|
|
29
|
-
toIdentifier: ({ refName
|
|
30
|
-
toExportPath: ({ refName
|
|
29
|
+
toIdentifier: ({ refName }: ToModelIdentifierArgs) => Identifier;
|
|
30
|
+
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
31
31
|
isSupported: () => boolean;
|
|
32
32
|
pinnable: boolean;
|
|
33
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,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,
|
|
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,EAAE,qBAAqB,KAAK,UAAU,CAAA;IAChE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;CAC7D,CAAA;AAED,eAAO,MAAM,iBAAiB,WAAY,WAAW;eAa/B,mBAAmB;;;;;;;;;;;;gCAjBX,qBAAqB,KAAK,UAAU;gCACpC,qBAAqB,KAAK,MAAM;;;CA4B7D,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
2
2
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
3
|
-
import type { BaseSettings } from '../../types/Settings.js';
|
|
4
3
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
5
4
|
import type { Identifier } from '../Identifier.js';
|
|
6
5
|
type OperationInsertableConstructorArgs = {
|
|
@@ -10,11 +9,9 @@ type OperationInsertableConstructorArgs = {
|
|
|
10
9
|
};
|
|
11
10
|
export type ToOperationIdentifierArgs = {
|
|
12
11
|
operation: OasOperation;
|
|
13
|
-
baseSettings: BaseSettings;
|
|
14
12
|
};
|
|
15
13
|
export type ToOperationExportPathArgs = {
|
|
16
14
|
operation: OasOperation;
|
|
17
|
-
baseSettings: BaseSettings;
|
|
18
15
|
};
|
|
19
16
|
export type WithTransformOperation = {
|
|
20
17
|
transformOperation: (operation: OasOperation) => void;
|
|
@@ -28,8 +25,8 @@ export type OperationGateway = {
|
|
|
28
25
|
id: string;
|
|
29
26
|
type: 'operation';
|
|
30
27
|
_class: 'OperationGateway';
|
|
31
|
-
toIdentifier: (
|
|
32
|
-
toExportPath: (
|
|
28
|
+
toIdentifier: () => Identifier;
|
|
29
|
+
toExportPath: () => string;
|
|
33
30
|
isSupported: (operation: OasOperation) => boolean;
|
|
34
31
|
pinnable: boolean;
|
|
35
32
|
};
|
|
@@ -40,8 +37,8 @@ export type OperationInsertable<V> = {
|
|
|
40
37
|
id: string;
|
|
41
38
|
type: 'operation';
|
|
42
39
|
_class: 'OperationInsertable';
|
|
43
|
-
toIdentifier: ({ operation
|
|
44
|
-
toExportPath: ({ operation
|
|
40
|
+
toIdentifier: ({ operation }: ToOperationIdentifierArgs) => Identifier;
|
|
41
|
+
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
45
42
|
isSupported: (operation: OasOperation) => boolean;
|
|
46
43
|
pinnable: boolean;
|
|
47
44
|
} & 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,
|
|
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,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CA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AA;IAElE,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAEjD,QAAQ,EAAE,OAAO,CAAA;CAGlB,GAAG,QAAQ,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
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
|
-
import type { BaseSettings } from '../../types/Settings.js';
|
|
5
4
|
export type ToOperationGatewayArgs = {
|
|
6
5
|
id: string;
|
|
7
|
-
toIdentifier: (
|
|
8
|
-
toExportPath: (
|
|
6
|
+
toIdentifier: () => Identifier;
|
|
7
|
+
toExportPath: () => string;
|
|
9
8
|
isSupported?: (operation: OasOperation) => boolean;
|
|
10
9
|
};
|
|
11
10
|
export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
@@ -19,8 +18,8 @@ export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
|
19
18
|
id: string;
|
|
20
19
|
type: "operation";
|
|
21
20
|
_class: "OperationGateway";
|
|
22
|
-
toIdentifier: (
|
|
23
|
-
toExportPath: (
|
|
21
|
+
toIdentifier: () => Identifier;
|
|
22
|
+
toExportPath: () => string;
|
|
24
23
|
isSupported: (operation: OasOperation) => boolean;
|
|
25
24
|
pinnable: boolean;
|
|
26
25
|
};
|
|
@@ -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;
|
|
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;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,UAAU,CAAA;IAC9B,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,sBAAsB;gCAa1B,oBAAoB;;;;;;;;;;wBAlBrC,UAAU;wBACV,MAAM;6BACA,YAAY,KAAK,OAAO;;CAsBnD,CAAA"}
|
|
@@ -10,8 +10,8 @@ export type OperationInsertableArgs = {
|
|
|
10
10
|
};
|
|
11
11
|
export type ToOperationInsertableArgs = {
|
|
12
12
|
id: string;
|
|
13
|
-
toIdentifier: ({ operation
|
|
14
|
-
toExportPath: ({ operation
|
|
13
|
+
toIdentifier: ({ operation }: ToOperationIdentifierArgs) => Identifier;
|
|
14
|
+
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
15
15
|
isSupported?: (operation: OasOperation) => boolean;
|
|
16
16
|
pinnable?: boolean;
|
|
17
17
|
};
|
|
@@ -34,8 +34,8 @@ export declare const toOperationInsertable: (config: ToOperationInsertableArgs)
|
|
|
34
34
|
id: string;
|
|
35
35
|
type: "operation";
|
|
36
36
|
_class: "OperationInsertable";
|
|
37
|
-
toIdentifier: ({ operation
|
|
38
|
-
toExportPath: ({ operation
|
|
37
|
+
toIdentifier: ({ operation }: ToOperationIdentifierArgs) => Identifier;
|
|
38
|
+
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
39
39
|
isSupported: (operation: OasOperation) => boolean;
|
|
40
40
|
pinnable: boolean;
|
|
41
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,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,
|
|
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,EAAE,yBAAyB,KAAK,UAAU,CAAA;IACtE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,yBAAyB,KAAK,MAAM,CAAA;IAClE,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;;;;;;;;;;;;;;;;;;kCAnBb,yBAAyB,KAAK,UAAU;kCACxC,yBAAyB,KAAK,MAAM;6BACxC,YAAY,KAAK,OAAO;;CA6BnD,CAAA"}
|