@skmtc/core 0.0.465 → 0.0.466
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 +62 -29
- package/esm/dsl/ContentSettings.d.ts +3 -1
- package/esm/dsl/ContentSettings.d.ts.map +1 -1
- package/esm/dsl/ContentSettings.js +10 -2
- package/esm/dsl/File.d.ts +1 -1
- package/esm/dsl/File.d.ts.map +1 -1
- package/esm/dsl/File.js +6 -9
- package/esm/dsl/model/ModelInsertable.d.ts +5 -2
- 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 +7 -4
- package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationGateway.d.ts +5 -4
- 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 +482 -52
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +11 -5
- 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 +61 -28
- package/script/dsl/ContentSettings.d.ts +3 -1
- package/script/dsl/ContentSettings.d.ts.map +1 -1
- package/script/dsl/ContentSettings.js +10 -2
- package/script/dsl/File.d.ts +1 -1
- package/script/dsl/File.d.ts.map +1 -1
- package/script/dsl/File.js +6 -9
- package/script/dsl/model/ModelInsertable.d.ts +5 -2
- 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 +7 -4
- package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationGateway.d.ts +5 -4
- 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 +482 -52
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +12 -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 { ClientGeneratorSettings, 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';
|
|
@@ -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
|
+
toOperationBaseSettings({ generatorId, path, method }: GetOperationSettingsArgs): BaseSettings;
|
|
212
|
+
toModelBaseSettings({ generatorId, refName }: GetModelSettingsArgs): BaseSettings;
|
|
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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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,8 +9,8 @@ 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_previews, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile,
|
|
13
|
-
import { normalize } from '../deps/jsr.io/@std/path/1.0.6/mod.js';
|
|
12
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_previews, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_getFile, _GenerateContext_setExportPath, _GenerateContext_toGatewayBaseSettings, _GenerateContext_cleanBaseSettings, _GenerateContext_addFile;
|
|
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';
|
|
16
16
|
import { OperationDriver } from '../dsl/operation/OperationDriver.js';
|
|
@@ -282,17 +282,19 @@ export class GenerateContext {
|
|
|
282
282
|
* @returns
|
|
283
283
|
*/
|
|
284
284
|
toOperationContentSettings({ operation, insertable }) {
|
|
285
|
-
const
|
|
285
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
286
286
|
generatorId: insertable.id,
|
|
287
287
|
path: operation.path,
|
|
288
288
|
method: operation.method
|
|
289
289
|
});
|
|
290
|
-
const
|
|
290
|
+
const generatedExportPath = insertable.toExportPath({ operation, baseSettings });
|
|
291
|
+
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
291
292
|
return new ContentSettings({
|
|
292
|
-
identifier: insertable.toIdentifier({ operation }),
|
|
293
|
-
selected:
|
|
293
|
+
identifier: insertable.toIdentifier({ operation, baseSettings }),
|
|
294
|
+
selected: baseSettings.selected,
|
|
294
295
|
exportPath,
|
|
295
|
-
importFrom: exportPath
|
|
296
|
+
importFrom: baseSettings.importFrom ?? exportPath,
|
|
297
|
+
parentExportPath: baseSettings.parentExportPath
|
|
296
298
|
});
|
|
297
299
|
}
|
|
298
300
|
/**
|
|
@@ -305,16 +307,18 @@ export class GenerateContext {
|
|
|
305
307
|
* @returns Content settings for model
|
|
306
308
|
*/
|
|
307
309
|
toModelContentSettings({ refName, insertable }) {
|
|
308
|
-
const
|
|
310
|
+
const baseSettings = this.toModelBaseSettings({
|
|
309
311
|
generatorId: insertable.id,
|
|
310
312
|
refName
|
|
311
313
|
});
|
|
312
|
-
const
|
|
314
|
+
const generatedExportPath = insertable.toExportPath({ refName, baseSettings });
|
|
315
|
+
const exportPath = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_setExportPath).call(this, { generatedExportPath, baseSettings });
|
|
313
316
|
return new ContentSettings({
|
|
314
|
-
identifier: insertable.toIdentifier({ refName }),
|
|
315
|
-
selected:
|
|
317
|
+
identifier: insertable.toIdentifier({ refName, baseSettings }),
|
|
318
|
+
selected: baseSettings.selected,
|
|
316
319
|
exportPath,
|
|
317
|
-
importFrom: exportPath
|
|
320
|
+
importFrom: baseSettings.importFrom ?? exportPath,
|
|
321
|
+
parentExportPath: baseSettings.parentExportPath
|
|
318
322
|
});
|
|
319
323
|
}
|
|
320
324
|
/**
|
|
@@ -326,13 +330,14 @@ export class GenerateContext {
|
|
|
326
330
|
* @returns Content settings for model
|
|
327
331
|
*/
|
|
328
332
|
toGatewayContentSetting(gateway) {
|
|
329
|
-
const
|
|
330
|
-
const exportPath = gateway.toExportPath();
|
|
333
|
+
const baseSettings = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGatewayBaseSettings).call(this, gateway.id);
|
|
334
|
+
const exportPath = gateway.toExportPath(baseSettings);
|
|
331
335
|
return new ContentSettings({
|
|
332
|
-
identifier: gateway.toIdentifier(),
|
|
333
|
-
selected:
|
|
336
|
+
identifier: gateway.toIdentifier(baseSettings),
|
|
337
|
+
selected: baseSettings.selected,
|
|
334
338
|
exportPath,
|
|
335
|
-
importFrom: exportPath
|
|
339
|
+
importFrom: baseSettings.importFrom ?? exportPath,
|
|
340
|
+
parentExportPath: baseSettings.parentExportPath
|
|
336
341
|
});
|
|
337
342
|
}
|
|
338
343
|
/**
|
|
@@ -340,17 +345,27 @@ export class GenerateContext {
|
|
|
340
345
|
* @param { generatorId, path, method }
|
|
341
346
|
* @returns Base settings for operation
|
|
342
347
|
*/
|
|
343
|
-
|
|
348
|
+
toOperationBaseSettings({ generatorId, path, method }) {
|
|
344
349
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
345
|
-
|
|
350
|
+
const operationSettings = generatorSettings && 'operations' in generatorSettings
|
|
346
351
|
? generatorSettings.operations[path]?.[method]
|
|
347
352
|
: undefined;
|
|
353
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
354
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
355
|
+
...operationSettings,
|
|
356
|
+
parentExportPath: exportPath
|
|
357
|
+
});
|
|
348
358
|
}
|
|
349
|
-
|
|
359
|
+
toModelBaseSettings({ generatorId, refName }) {
|
|
350
360
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
351
|
-
|
|
361
|
+
const modelSettings = generatorSettings && 'models' in generatorSettings
|
|
352
362
|
? generatorSettings.models[refName]
|
|
353
363
|
: undefined;
|
|
364
|
+
const { exportPath } = generatorSettings?.baseSettings ?? {};
|
|
365
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, {
|
|
366
|
+
...modelSettings,
|
|
367
|
+
parentExportPath: exportPath
|
|
368
|
+
});
|
|
354
369
|
}
|
|
355
370
|
toGeneratorSettings(generatorId) {
|
|
356
371
|
return this.settings?.generators?.find(({ id }) => id === generatorId);
|
|
@@ -399,12 +414,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
399
414
|
if (!generator.isSupported(operation)) {
|
|
400
415
|
return this.captureCurrentResult('notSupported');
|
|
401
416
|
}
|
|
402
|
-
const
|
|
417
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
403
418
|
generatorId: generator.id,
|
|
404
419
|
path,
|
|
405
420
|
method
|
|
406
421
|
});
|
|
407
|
-
if (!
|
|
422
|
+
if (!baseSettings.selected) {
|
|
408
423
|
return this.captureCurrentResult('notSelected');
|
|
409
424
|
}
|
|
410
425
|
gatewayInstance.transformOperation(operation);
|
|
@@ -431,12 +446,12 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
431
446
|
if (!generator.isSupported(operation)) {
|
|
432
447
|
return this.captureCurrentResult('notSupported');
|
|
433
448
|
}
|
|
434
|
-
const
|
|
449
|
+
const baseSettings = this.toOperationBaseSettings({
|
|
435
450
|
generatorId: generator.id,
|
|
436
451
|
path,
|
|
437
452
|
method
|
|
438
453
|
});
|
|
439
|
-
if (!
|
|
454
|
+
if (!baseSettings.selected) {
|
|
440
455
|
return this.captureCurrentResult('notSelected');
|
|
441
456
|
}
|
|
442
457
|
this.insertOperation({ insertable: generator, operation });
|
|
@@ -452,11 +467,11 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
452
467
|
if (!generator.isSupported()) {
|
|
453
468
|
return this.captureCurrentResult('notSupported');
|
|
454
469
|
}
|
|
455
|
-
const
|
|
470
|
+
const baseSettings = this.toModelBaseSettings({
|
|
456
471
|
generatorId: generator.id,
|
|
457
472
|
refName
|
|
458
473
|
});
|
|
459
|
-
if (!selected) {
|
|
474
|
+
if (!baseSettings.selected) {
|
|
460
475
|
return this.captureCurrentResult('notSelected');
|
|
461
476
|
}
|
|
462
477
|
this.insertModel({ insertable: generator, refName });
|
|
@@ -475,9 +490,27 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
|
|
|
475
490
|
}
|
|
476
491
|
}
|
|
477
492
|
return currentFile;
|
|
478
|
-
},
|
|
493
|
+
}, _GenerateContext_setExportPath = function _GenerateContext_setExportPath({ generatedExportPath, baseSettings }) {
|
|
494
|
+
const { parentExportPath, exportPath } = baseSettings;
|
|
495
|
+
if (exportPath) {
|
|
496
|
+
return join(parentExportPath ?? '', exportPath);
|
|
497
|
+
}
|
|
498
|
+
if (generatedExportPath.startsWith('@/')) {
|
|
499
|
+
return generatedExportPath;
|
|
500
|
+
}
|
|
501
|
+
const combinedExportPath = join(parentExportPath ?? '', generatedExportPath);
|
|
502
|
+
return combinedExportPath;
|
|
503
|
+
}, _GenerateContext_toGatewayBaseSettings = function _GenerateContext_toGatewayBaseSettings(generatorId) {
|
|
479
504
|
const generatorSettings = this.toGeneratorSettings(generatorId);
|
|
480
|
-
return generatorSettings?.
|
|
505
|
+
return __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_cleanBaseSettings).call(this, generatorSettings?.baseSettings);
|
|
506
|
+
}, _GenerateContext_cleanBaseSettings = function _GenerateContext_cleanBaseSettings(baseSettings) {
|
|
507
|
+
return {
|
|
508
|
+
exportPath: baseSettings?.exportPath,
|
|
509
|
+
selected: Boolean(baseSettings?.selected),
|
|
510
|
+
name: baseSettings?.name,
|
|
511
|
+
importFrom: baseSettings?.importFrom,
|
|
512
|
+
parentExportPath: baseSettings?.parentExportPath
|
|
513
|
+
};
|
|
481
514
|
}, _GenerateContext_addFile = function _GenerateContext_addFile(normalisedPath) {
|
|
482
515
|
if (__classPrivateFieldGet(this, _GenerateContext_files, "f").has(normalisedPath)) {
|
|
483
516
|
throw new Error(`File already exists: ${normalisedPath}`);
|
|
@@ -8,13 +8,15 @@ type CreateArgs = {
|
|
|
8
8
|
selected: boolean;
|
|
9
9
|
exportPath: string;
|
|
10
10
|
importFrom: string;
|
|
11
|
+
parentExportPath: string | undefined;
|
|
11
12
|
};
|
|
12
13
|
export declare class ContentSettings {
|
|
13
14
|
identifier: Identifier;
|
|
14
15
|
selected: boolean;
|
|
15
16
|
exportPath: string;
|
|
16
17
|
importFrom: string;
|
|
17
|
-
|
|
18
|
+
parentExportPath: string | undefined;
|
|
19
|
+
constructor({ identifier, selected, exportPath, importFrom, parentExportPath }: CreateArgs);
|
|
18
20
|
static empty({ identifier, exportPath }: EmptyArgs): ContentSettings;
|
|
19
21
|
}
|
|
20
22
|
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;IAClB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC,CAAA;AAED,qBAAa,eAAe;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;gBAExB,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE,UAAU;IAQ1F,MAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,GAAG,eAAe;CASrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class ContentSettings {
|
|
2
|
-
constructor({ identifier, selected, exportPath, importFrom }) {
|
|
2
|
+
constructor({ identifier, selected, exportPath, importFrom, parentExportPath }) {
|
|
3
3
|
Object.defineProperty(this, "identifier", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
configurable: true,
|
|
@@ -24,17 +24,25 @@ export class ContentSettings {
|
|
|
24
24
|
writable: true,
|
|
25
25
|
value: void 0
|
|
26
26
|
});
|
|
27
|
+
Object.defineProperty(this, "parentExportPath", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
27
33
|
this.identifier = identifier;
|
|
28
34
|
this.selected = selected;
|
|
29
35
|
this.exportPath = exportPath;
|
|
30
36
|
this.importFrom = importFrom;
|
|
37
|
+
this.parentExportPath = parentExportPath;
|
|
31
38
|
}
|
|
32
39
|
static empty({ identifier, exportPath }) {
|
|
33
40
|
return new ContentSettings({
|
|
34
41
|
selected: true,
|
|
35
42
|
identifier,
|
|
36
43
|
exportPath,
|
|
37
|
-
importFrom: exportPath
|
|
44
|
+
importFrom: exportPath,
|
|
45
|
+
parentExportPath: undefined
|
|
38
46
|
});
|
|
39
47
|
}
|
|
40
48
|
}
|
package/esm/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
|
+
packages: ModulePackage[] | undefined;
|
|
15
15
|
constructor({ path, settings }: FileArgs);
|
|
16
16
|
get generatorKeys(): Set<GeneratorKey>;
|
|
17
17
|
toString(): string;
|
package/esm/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,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,QAAQ;CAkCT;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/esm/dsl/File.js
CHANGED
|
@@ -38,7 +38,7 @@ export class File {
|
|
|
38
38
|
value: void 0
|
|
39
39
|
});
|
|
40
40
|
_File_generatorKeys.set(this, void 0);
|
|
41
|
-
Object.defineProperty(this, "
|
|
41
|
+
Object.defineProperty(this, "packages", {
|
|
42
42
|
enumerable: true,
|
|
43
43
|
configurable: true,
|
|
44
44
|
writable: true,
|
|
@@ -49,7 +49,7 @@ export class File {
|
|
|
49
49
|
this.imports = new Map();
|
|
50
50
|
this.definitions = new Map();
|
|
51
51
|
__classPrivateFieldSet(this, _File_generatorKeys, new Set(), "f");
|
|
52
|
-
this.
|
|
52
|
+
this.packages = settings?.packages;
|
|
53
53
|
}
|
|
54
54
|
get generatorKeys() {
|
|
55
55
|
return __classPrivateFieldGet(this, _File_generatorKeys, "f");
|
|
@@ -59,7 +59,7 @@ export class File {
|
|
|
59
59
|
const updatedModuleName = normaliseModuleName({
|
|
60
60
|
destinationPath: this.path,
|
|
61
61
|
exportPath: module,
|
|
62
|
-
packages: this.
|
|
62
|
+
packages: this.packages
|
|
63
63
|
});
|
|
64
64
|
return Object.entries(entityTypes).map(([entityType, names]) => {
|
|
65
65
|
const prefix = entityType === 'type' ? 'type' : '';
|
|
@@ -67,17 +67,14 @@ export class File {
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
const imports = Array.from(this.imports.entries()).map(([module, importItems]) => {
|
|
70
|
-
const updatedModuleName = this.
|
|
70
|
+
const updatedModuleName = this.packages
|
|
71
71
|
? normaliseModuleName({
|
|
72
72
|
destinationPath: this.path,
|
|
73
73
|
exportPath: module,
|
|
74
|
-
packages: this.
|
|
74
|
+
packages: this.packages
|
|
75
75
|
})
|
|
76
76
|
: module;
|
|
77
|
-
|
|
78
|
-
return acc.startsWith(pattern) ? acc.replace(pattern, replacement) : acc;
|
|
79
|
-
}, updatedModuleName);
|
|
80
|
-
return new Import({ module: aliasedModuleName, importNames: Array.from(importItems) });
|
|
77
|
+
return new Import({ module: updatedModuleName, importNames: Array.from(importItems) });
|
|
81
78
|
});
|
|
82
79
|
const definitions = Array.from(this.definitions.values());
|
|
83
80
|
return [reExports, imports, definitions]
|
|
@@ -1,5 +1,6 @@
|
|
|
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';
|
|
3
4
|
import type { RefName } from '../../types/RefName.js';
|
|
4
5
|
import type { Identifier } from '../Identifier.js';
|
|
5
6
|
type ModelInsertableConstructorArgs = {
|
|
@@ -10,9 +11,11 @@ type ModelInsertableConstructorArgs = {
|
|
|
10
11
|
};
|
|
11
12
|
export type ToModelIdentifierArgs = {
|
|
12
13
|
refName: RefName;
|
|
14
|
+
baseSettings: BaseSettings;
|
|
13
15
|
};
|
|
14
16
|
export type ToModelExportPathArgs = {
|
|
15
17
|
refName: RefName;
|
|
18
|
+
baseSettings: BaseSettings;
|
|
16
19
|
};
|
|
17
20
|
export type WithTransformModel = {
|
|
18
21
|
transformModel: (refName: RefName) => void;
|
|
@@ -24,8 +27,8 @@ export type ModelInsertable<V> = {
|
|
|
24
27
|
id: string;
|
|
25
28
|
type: 'model';
|
|
26
29
|
_class: 'ModelInsertable';
|
|
27
|
-
toIdentifier: ({ refName }: ToModelIdentifierArgs) => Identifier;
|
|
28
|
-
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
30
|
+
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
31
|
+
toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
|
|
29
32
|
isSupported: () => boolean;
|
|
30
33
|
pinnable: boolean;
|
|
31
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,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;
|
|
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,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,YAAY,EAAE,EAAE,qBAAqB,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"}
|
|
@@ -10,8 +10,8 @@ export type ModelInsertableArgs = {
|
|
|
10
10
|
};
|
|
11
11
|
export type ModelConfig = {
|
|
12
12
|
id: string;
|
|
13
|
-
toIdentifier: ({ refName }: ToModelIdentifierArgs) => Identifier;
|
|
14
|
-
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
13
|
+
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
14
|
+
toExportPath: ({ refName, baseSettings }: 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 }: ToModelIdentifierArgs) => Identifier;
|
|
30
|
-
toExportPath: ({ refName }: ToModelExportPathArgs) => string;
|
|
29
|
+
toIdentifier: ({ refName, baseSettings }: ToModelIdentifierArgs) => Identifier;
|
|
30
|
+
toExportPath: ({ refName, baseSettings }: 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,EAAE,qBAAqB,KAAK,UAAU,CAAA;
|
|
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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
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';
|
|
3
4
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
4
5
|
import type { Identifier } from '../Identifier.js';
|
|
5
6
|
type OperationInsertableConstructorArgs = {
|
|
@@ -9,9 +10,11 @@ type OperationInsertableConstructorArgs = {
|
|
|
9
10
|
};
|
|
10
11
|
export type ToOperationIdentifierArgs = {
|
|
11
12
|
operation: OasOperation;
|
|
13
|
+
baseSettings: BaseSettings;
|
|
12
14
|
};
|
|
13
15
|
export type ToOperationExportPathArgs = {
|
|
14
16
|
operation: OasOperation;
|
|
17
|
+
baseSettings: BaseSettings;
|
|
15
18
|
};
|
|
16
19
|
export type WithTransformOperation = {
|
|
17
20
|
transformOperation: (operation: OasOperation) => void;
|
|
@@ -25,8 +28,8 @@ export type OperationGateway = {
|
|
|
25
28
|
id: string;
|
|
26
29
|
type: 'operation';
|
|
27
30
|
_class: 'OperationGateway';
|
|
28
|
-
toIdentifier: () => Identifier;
|
|
29
|
-
toExportPath: () => string;
|
|
31
|
+
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
32
|
+
toExportPath: (baseSettings: BaseSettings) => string;
|
|
30
33
|
isSupported: (operation: OasOperation) => boolean;
|
|
31
34
|
pinnable: boolean;
|
|
32
35
|
};
|
|
@@ -37,8 +40,8 @@ export type OperationInsertable<V> = {
|
|
|
37
40
|
id: string;
|
|
38
41
|
type: 'operation';
|
|
39
42
|
_class: 'OperationInsertable';
|
|
40
|
-
toIdentifier: ({ operation }: ToOperationIdentifierArgs) => Identifier;
|
|
41
|
-
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
43
|
+
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
44
|
+
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
42
45
|
isSupported: (operation: OasOperation) => boolean;
|
|
43
46
|
pinnable: boolean;
|
|
44
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,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,kCAAkC,GAAG;IACxC,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AA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,kBAAkB,CAAA;IAE1B,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,UAAU,CAAA;IACxD,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,MAAM,CAAA;IAEpD,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAEjD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAAG;IACtD,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kCAAkC,GAAG,CAAC,CAAA;IAC7E,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,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"}
|
|
@@ -1,10 +1,11 @@
|
|
|
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';
|
|
4
5
|
export type ToOperationGatewayArgs = {
|
|
5
6
|
id: string;
|
|
6
|
-
toIdentifier: () => Identifier;
|
|
7
|
-
toExportPath: () => string;
|
|
7
|
+
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
8
|
+
toExportPath: (baseSettings: BaseSettings) => string;
|
|
8
9
|
isSupported?: (operation: OasOperation) => boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
@@ -18,8 +19,8 @@ export declare const toOperationGateway: (config: ToOperationGatewayArgs) => {
|
|
|
18
19
|
id: string;
|
|
19
20
|
type: "operation";
|
|
20
21
|
_class: "OperationGateway";
|
|
21
|
-
toIdentifier: () => Identifier;
|
|
22
|
-
toExportPath: () => string;
|
|
22
|
+
toIdentifier: (baseSettings: BaseSettings) => Identifier;
|
|
23
|
+
toExportPath: (baseSettings: BaseSettings) => string;
|
|
23
24
|
isSupported: (operation: OasOperation) => boolean;
|
|
24
25
|
pinnable: boolean;
|
|
25
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;
|
|
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"}
|
|
@@ -10,8 +10,8 @@ export type OperationInsertableArgs = {
|
|
|
10
10
|
};
|
|
11
11
|
export type ToOperationInsertableArgs = {
|
|
12
12
|
id: string;
|
|
13
|
-
toIdentifier: ({ operation }: ToOperationIdentifierArgs) => Identifier;
|
|
14
|
-
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
13
|
+
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
14
|
+
toExportPath: ({ operation, baseSettings }: 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 }: ToOperationIdentifierArgs) => Identifier;
|
|
38
|
-
toExportPath: ({ operation }: ToOperationExportPathArgs) => string;
|
|
37
|
+
toIdentifier: ({ operation, baseSettings }: ToOperationIdentifierArgs) => Identifier;
|
|
38
|
+
toExportPath: ({ operation, baseSettings }: 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,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