@skmtc/core 0.0.355 → 0.0.357

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.
Files changed (47) hide show
  1. package/esm/context/GenerateContext.js +2 -2
  2. package/esm/dsl/ContentSettings.d.ts +6 -5
  3. package/esm/dsl/ContentSettings.d.ts.map +1 -1
  4. package/esm/dsl/ContentSettings.js +5 -5
  5. package/esm/dsl/Identifier.d.ts +2 -2
  6. package/esm/dsl/Identifier.d.ts.map +1 -1
  7. package/esm/dsl/Identifier.js +1 -1
  8. package/esm/dsl/model/ModelDriver.d.ts +2 -1
  9. package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
  10. package/esm/dsl/model/ModelDriver.js +10 -20
  11. package/esm/dsl/model/ModelInsertable.d.ts +2 -3
  12. package/esm/dsl/model/ModelInsertable.d.ts.map +1 -1
  13. package/esm/dsl/model/toModelBase.d.ts +3 -5
  14. package/esm/dsl/model/toModelBase.d.ts.map +1 -1
  15. package/esm/dsl/model/toModelBase.js +2 -9
  16. package/esm/dsl/operation/OperationDriver.d.ts +2 -1
  17. package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
  18. package/esm/dsl/operation/OperationDriver.js +10 -17
  19. package/esm/dsl/operation/OperationInsertable.d.ts +2 -3
  20. package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
  21. package/esm/dsl/operation/toOperationBase.d.ts +4 -6
  22. package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
  23. package/esm/dsl/operation/toOperationBase.js +2 -9
  24. package/package.json +1 -1
  25. package/script/context/GenerateContext.js +2 -2
  26. package/script/dsl/ContentSettings.d.ts +6 -5
  27. package/script/dsl/ContentSettings.d.ts.map +1 -1
  28. package/script/dsl/ContentSettings.js +5 -5
  29. package/script/dsl/Identifier.d.ts +2 -2
  30. package/script/dsl/Identifier.d.ts.map +1 -1
  31. package/script/dsl/Identifier.js +1 -1
  32. package/script/dsl/model/ModelDriver.d.ts +2 -1
  33. package/script/dsl/model/ModelDriver.d.ts.map +1 -1
  34. package/script/dsl/model/ModelDriver.js +10 -20
  35. package/script/dsl/model/ModelInsertable.d.ts +2 -3
  36. package/script/dsl/model/ModelInsertable.d.ts.map +1 -1
  37. package/script/dsl/model/toModelBase.d.ts +3 -5
  38. package/script/dsl/model/toModelBase.d.ts.map +1 -1
  39. package/script/dsl/model/toModelBase.js +2 -9
  40. package/script/dsl/operation/OperationDriver.d.ts +2 -1
  41. package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
  42. package/script/dsl/operation/OperationDriver.js +10 -17
  43. package/script/dsl/operation/OperationInsertable.d.ts +2 -3
  44. package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
  45. package/script/dsl/operation/toOperationBase.d.ts +4 -6
  46. package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
  47. package/script/dsl/operation/toOperationBase.js +2 -9
@@ -177,7 +177,7 @@ export class GenerateContext {
177
177
  });
178
178
  const e = insertable.toExportPath({ operation, baseSettings });
179
179
  return new ContentSettings({
180
- name: insertable.toName({ operation, baseSettings }),
180
+ identifier: insertable.toIdentifier({ operation, baseSettings }),
181
181
  selected: insertable.isSelected({ operation, baseSettings }),
182
182
  exportPath: e,
183
183
  importFrom: baseSettings.importFrom ?? e
@@ -190,7 +190,7 @@ export class GenerateContext {
190
190
  });
191
191
  const e = insertable.toExportPath({ refName, baseSettings });
192
192
  return new ContentSettings({
193
- name: insertable.toName({ refName, baseSettings }),
193
+ identifier: insertable.toIdentifier({ refName, baseSettings }),
194
194
  selected: insertable.isSelected({ refName, baseSettings }),
195
195
  exportPath: e,
196
196
  importFrom: baseSettings.importFrom ?? e
@@ -1,20 +1,21 @@
1
+ import type { Identifier } from './Identifier.js';
1
2
  type EmptyArgs = {
2
3
  exportPath: string;
3
- name: string;
4
+ identifier: Identifier;
4
5
  };
5
6
  type CreateArgs = {
6
- name: string;
7
+ identifier: Identifier;
7
8
  selected: boolean;
8
9
  exportPath: string;
9
10
  importFrom: string;
10
11
  };
11
12
  export declare class ContentSettings {
12
- name: string;
13
+ identifier: Identifier;
13
14
  selected: boolean;
14
15
  exportPath: string;
15
16
  importFrom: string;
16
- constructor({ name, selected, exportPath, importFrom }: CreateArgs);
17
- static empty({ name, exportPath }: EmptyArgs): ContentSettings;
17
+ constructor({ identifier, selected, exportPath, importFrom }: CreateArgs);
18
+ static empty({ identifier, exportPath }: EmptyArgs): ContentSettings;
18
19
  }
19
20
  export {};
20
21
  //# sourceMappingURL=ContentSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSettings.d.ts","sourceRoot":"","sources":["../../src/dsl/ContentSettings.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,qBAAa,eAAe;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;gBAEN,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,UAAU;IAOlE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,SAAS,GAAG,eAAe;CAQ/D"}
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"}
@@ -1,6 +1,6 @@
1
1
  export class ContentSettings {
2
- constructor({ name, selected, exportPath, importFrom }) {
3
- Object.defineProperty(this, "name", {
2
+ constructor({ identifier, selected, exportPath, importFrom }) {
3
+ Object.defineProperty(this, "identifier", {
4
4
  enumerable: true,
5
5
  configurable: true,
6
6
  writable: true,
@@ -24,15 +24,15 @@ export class ContentSettings {
24
24
  writable: true,
25
25
  value: void 0
26
26
  });
27
- this.name = name;
27
+ this.identifier = identifier;
28
28
  this.selected = selected;
29
29
  this.exportPath = exportPath;
30
30
  this.importFrom = importFrom;
31
31
  }
32
- static empty({ name, exportPath }) {
32
+ static empty({ identifier, exportPath }) {
33
33
  return new ContentSettings({
34
34
  selected: true,
35
- name,
35
+ identifier,
36
36
  exportPath,
37
37
  importFrom: exportPath
38
38
  });
@@ -1,5 +1,5 @@
1
1
  import { EntityType } from './EntityType.js';
2
- type CreateValueArgs = string | {
2
+ type CreateVariableArgs = string | {
3
3
  name: string;
4
4
  tsType?: string;
5
5
  };
@@ -13,7 +13,7 @@ export declare class Identifier {
13
13
  entityType: EntityType;
14
14
  tsType?: string;
15
15
  constructor({ name, tsType, entityType }: ConstructorArgs);
16
- static createValue(args: CreateValueArgs): Identifier;
16
+ static createVariable(args: CreateVariableArgs): Identifier;
17
17
  static createType(name: string): Identifier;
18
18
  toString(): string;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,eAAe,GAChB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU;IAiBrD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
1
+ {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,kBAAkB,GACnB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,UAAU;IAiB3D,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
@@ -24,7 +24,7 @@ export class Identifier {
24
24
  this.tsType = tsType;
25
25
  this.entityType = entityType;
26
26
  }
27
- static createValue(args) {
27
+ static createVariable(args) {
28
28
  return match(args)
29
29
  .with(P.string, name => {
30
30
  return new Identifier({
@@ -1,6 +1,7 @@
1
1
  import type { ModelInsertable } from './ModelInsertable.js';
2
2
  import type { GenerateContext } from '../../context/GenerateContext.js';
3
3
  import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { Identifier } from '../Identifier.js';
4
5
  import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
6
  import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
7
  import type { RefName } from '../../types/RefName.js';
@@ -20,7 +21,7 @@ export declare class ModelDriver<V extends GeneratedValue, T extends GenerationT
20
21
  definition: GeneratedDefintion<V, T>;
21
22
  constructor({ context, insertable, refName, generation, destinationPath }: CreateModelArgs<V, T>);
22
23
  get value(): V;
23
- get name(): string;
24
+ get identifier(): Identifier;
24
25
  get exportPath(): string;
25
26
  private apply;
26
27
  private getDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAK5D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,E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2
  import { Definition } from '../Definition.js';
3
- import { Identifier } from '../Identifier.js';
4
- import { match } from 'ts-pattern';
5
3
  import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
6
4
  export class ModelDriver {
7
5
  constructor({ context, insertable, refName, generation, destinationPath }) {
@@ -54,29 +52,32 @@ export class ModelDriver {
54
52
  }
55
53
  return this.definition.value;
56
54
  }
57
- get name() {
58
- return this.settings.name;
55
+ get identifier() {
56
+ return this.settings.identifier;
59
57
  }
60
58
  get exportPath() {
61
59
  return this.settings.exportPath;
62
60
  }
63
61
  apply({ generation, destinationPath } = {}) {
64
- const { name, exportPath, selected, importFrom } = this.settings;
62
+ const { identifier, exportPath, selected, importFrom } = this.settings;
65
63
  if (!selected && generation !== 'force') {
66
64
  return undefined;
67
65
  }
68
- const definition = this.getDefinition({ name, exportPath });
66
+ const definition = this.getDefinition({ identifier, exportPath });
69
67
  if (destinationPath &&
70
68
  normalize(exportPath) !== normalize(destinationPath)) {
71
69
  this.context.register({
72
- imports: { [importFrom]: [name] },
70
+ imports: { [importFrom]: [identifier.name] },
73
71
  destinationPath
74
72
  });
75
73
  }
76
74
  return definition;
77
75
  }
78
- getDefinition({ name, exportPath }) {
79
- const cachedDefinition = this.context.findDefinition({ name, exportPath });
76
+ getDefinition({ identifier, exportPath }) {
77
+ const cachedDefinition = this.context.findDefinition({
78
+ name: identifier.name,
79
+ exportPath
80
+ });
80
81
  if (this.affirmDefinition(cachedDefinition, exportPath)) {
81
82
  return cachedDefinition;
82
83
  }
@@ -86,17 +87,6 @@ export class ModelDriver {
86
87
  settings: this.settings,
87
88
  destinationPath: this.settings.exportPath
88
89
  });
89
- // @TODO This feels hacky and there is probably a better way to do this
90
- const tsType = value &&
91
- typeof value === 'object' &&
92
- 'tsType' in value &&
93
- typeof value.tsType === 'string'
94
- ? value.tsType
95
- : undefined;
96
- const identifier = match(this.insertable.entityType.type)
97
- .with('variable', () => Identifier.createValue({ name, tsType }))
98
- .with('type', () => Identifier.createType(name))
99
- .exhaustive();
100
90
  const definition = new Definition({
101
91
  context: this.context,
102
92
  value,
@@ -1,8 +1,8 @@
1
1
  import type { GenerateContext } from '../../context/GenerateContext.js';
2
- import type { EntityType } from '../EntityType.js';
3
2
  import type { ContentSettings } from '../ContentSettings.js';
4
3
  import type { BaseSettings } from '../../types/Settings.js';
5
4
  import type { RefName } from '../../types/RefName.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  type ModelInsertableConstructorArgs = {
7
7
  context: GenerateContext;
8
8
  refName: RefName;
@@ -39,8 +39,7 @@ export type ModelInsertable<V> = {
39
39
  id: string;
40
40
  type: 'model';
41
41
  _class: 'ModelInsertable';
42
- entityType: EntityType;
43
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
42
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
44
43
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
45
44
  isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
46
45
  pinnable: boolean;
@@ -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,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,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;AAErD,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,eAAe,GAAG;IAC5B,OAAO,EAAE,OAAO,C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A;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAAG;IAClD,KAAK,EACH,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EAChB,EAAE,8BAA8B,GAAG,CAAC,CAAA;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;IACzB,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,KAAK,UAAU,CAAA;IACxE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAC1E,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAA;IACvE,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,OAAO,CAAA;CAE3B,GAAG,QAAQ,CAAA"}
@@ -1,8 +1,8 @@
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 { EntityType } from '../EntityType.js';
5
4
  import type { IsModelSelectedArgs, ToModelExportPathArgs, ToModelNameArgs } from './ModelInsertable.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  export type ModelInsertableArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -10,8 +10,7 @@ export type ModelInsertableArgs = {
10
10
  };
11
11
  export type ModelConfig = {
12
12
  id: string;
13
- entityType?: EntityType;
14
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
13
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
15
14
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
16
15
  isSelected?: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
17
16
  };
@@ -29,8 +28,7 @@ export declare const toModelBase: (config: ModelConfig) => {
29
28
  id: string;
30
29
  type: "model";
31
30
  _class: "ModelInsertable";
32
- entityType: EntityType;
33
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
31
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
34
32
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
35
33
  isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
36
34
  isSupported: () => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.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,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAG7B,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,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,KAAK,MAAM,CAAA;IAC9D,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAA;CACzE,CAAA;AAED,eAAO,MAAM,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,CAAA"}
@@ -3,7 +3,6 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
3
3
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
4
4
  };
5
5
  import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
6
- import { EntityType } from '../EntityType.js';
7
6
  import { GatewayBase } from '../GeneratorBase.js';
8
7
  import { ModelBase } from './ModelBase.js';
9
8
  export const toModelBase = (config) => {
@@ -38,17 +37,11 @@ export const toModelBase = (config) => {
38
37
  writable: true,
39
38
  value: 'ModelInsertable'
40
39
  }),
41
- Object.defineProperty(_a, "entityType", {
40
+ Object.defineProperty(_a, "toIdentifier", {
42
41
  enumerable: true,
43
42
  configurable: true,
44
43
  writable: true,
45
- value: config.entityType ?? new EntityType('variable')
46
- }),
47
- Object.defineProperty(_a, "toName", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: config.toName.bind(config)
44
+ value: config.toIdentifier.bind(config)
52
45
  }),
53
46
  Object.defineProperty(_a, "toExportPath", {
54
47
  enumerable: true,
@@ -1,6 +1,7 @@
1
1
  import type { OperationInsertable } from './OperationInsertable.js';
2
2
  import type { OasOperation } from '../../oas/operation/Operation.js';
3
3
  import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { Identifier } from '../Identifier.js';
4
5
  import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
6
  import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
7
  import type { GenerateContext } from '../../context/GenerateContext.js';
@@ -20,7 +21,7 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
20
21
  definition: GeneratedDefintion<V, T>;
21
22
  constructor({ context, insertable, operation, generation, destinationPath }: CreateOperationArgs<V, T>);
22
23
  get value(): V;
23
- get name(): string;
24
+ get identifier(): Identifier;
24
25
  get exportPath(): string;
25
26
  private apply;
26
27
  private getDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"OperationDriver.d.ts","sourceRoot":"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C,EAAE,CAAC,CAAC;IAc5B,IAAI,KAAK,IAAI,CAAC,CAQb;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,gBAAgB;CAqBzB"}
@@ -1,7 +1,5 @@
1
1
  import { normalize } from '../../deps/jsr.io/@std/path/1.0.0/mod.js';
2
2
  import { Definition } from '../Definition.js';
3
- import { Identifier } from '../Identifier.js';
4
- import { match } from 'ts-pattern';
5
3
  import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
6
4
  export class OperationDriver {
7
5
  constructor({ context, insertable, operation, generation, destinationPath }) {
@@ -57,29 +55,32 @@ export class OperationDriver {
57
55
  }
58
56
  return this.definition.value;
59
57
  }
60
- get name() {
61
- return this.settings.name;
58
+ get identifier() {
59
+ return this.settings.identifier;
62
60
  }
63
61
  get exportPath() {
64
62
  return this.settings.exportPath;
65
63
  }
66
64
  apply({ generation, destinationPath } = {}) {
67
- const { name, exportPath, selected, importFrom } = this.settings;
65
+ const { identifier, exportPath, selected, importFrom } = this.settings;
68
66
  if (!selected && generation !== 'force') {
69
67
  return undefined;
70
68
  }
71
- const definition = this.getDefinition({ name, exportPath });
69
+ const definition = this.getDefinition({ identifier, exportPath });
72
70
  if (destinationPath &&
73
71
  normalize(exportPath) !== normalize(destinationPath)) {
74
72
  this.context.register({
75
- imports: { [importFrom]: [name] },
73
+ imports: { [importFrom]: [identifier.name] },
76
74
  destinationPath
77
75
  });
78
76
  }
79
77
  return definition;
80
78
  }
81
- getDefinition({ name, exportPath }) {
82
- const cachedDefinition = this.context.findDefinition({ name, exportPath });
79
+ getDefinition({ identifier, exportPath }) {
80
+ const cachedDefinition = this.context.findDefinition({
81
+ name: identifier.name,
82
+ exportPath
83
+ });
83
84
  if (this.affirmDefinition(cachedDefinition, exportPath)) {
84
85
  return cachedDefinition;
85
86
  }
@@ -88,14 +89,6 @@ export class OperationDriver {
88
89
  operation: this.operation,
89
90
  settings: this.settings
90
91
  });
91
- // @TODO This feels hacky and there is probably a better way to do this
92
- const tsType = 'tsType' in value && typeof value.tsType === 'string'
93
- ? value.tsType
94
- : undefined;
95
- const identifier = match(this.insertable.entityType.type)
96
- .with('variable', () => Identifier.createValue({ name, tsType }))
97
- .with('type', () => Identifier.createType(name))
98
- .exhaustive();
99
92
  const definition = new Definition({
100
93
  context: this.context,
101
94
  value,
@@ -1,8 +1,8 @@
1
1
  import type { OasOperation } from '../../oas/operation/Operation.js';
2
2
  import type { ContentSettings } from '../ContentSettings.js';
3
3
  import type { BaseSettings } from '../../types/Settings.js';
4
- import type { EntityType } from '../EntityType.js';
5
4
  import type { GenerateContext } from '../../context/GenerateContext.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  type OperationInsertableConstructorArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -38,8 +38,7 @@ export type OperationInsertable<V> = {
38
38
  id: string;
39
39
  type: 'operation';
40
40
  _class: 'OperationInsertable';
41
- entityType: EntityType;
42
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
41
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
43
42
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
44
43
  isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
45
44
  pinnable: boolean;
@@ -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,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,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AA;CACtD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,OAAO,EAAE,eAAe,GAAG,sBAAsB,CAAA;IACtD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CAClD,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,mBAAmB,KAAK,UAAU,CAAA;IAC9E,YAAY,EAAE,CAAC,EACb,SAAS,EACT,YAAY,EACb,EAAE,yBAAyB,KAAK,MAAM,CAAA;IACvC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC7E,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CAElD,GAAG,QAAQ,CAAA"}
@@ -1,8 +1,8 @@
1
- import { EntityType } from '../EntityType.js';
2
1
  import type { GenerateContext } from '../../context/GenerateContext.js';
3
2
  import type { OasOperation } from '../../oas/operation/Operation.js';
4
3
  import type { ContentSettings } from '../ContentSettings.js';
5
4
  import type { ToOperationNameArgs, ToOperationExportPathArgs, IsOperationSelectedArgs } from './OperationInsertable.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  export type OperationInsertableArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -10,8 +10,7 @@ export type OperationInsertableArgs = {
10
10
  };
11
11
  export type OperationConfig = {
12
12
  id: string;
13
- entityType?: EntityType;
14
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
13
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
15
14
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
16
15
  isSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
17
16
  isSupported?: (operation: OasOperation) => boolean;
@@ -29,7 +28,7 @@ export declare const toOperationBase: (config: OperationConfig) => {
29
28
  };
30
29
  createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn }: {
31
30
  schema: Schema;
32
- identifier: import("../Identifier.js").Identifier;
31
+ identifier: Identifier;
33
32
  schemaToValueFn: import("../../mod.js").SchemaToValueFn;
34
33
  }): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
35
34
  register(args: Partial<import("../../context/GenerateContext.js").RegisterArgs>): void;
@@ -39,8 +38,7 @@ export declare const toOperationBase: (config: OperationConfig) => {
39
38
  id: string;
40
39
  type: "operation";
41
40
  _class: "OperationInsertable";
42
- entityType: EntityType;
43
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
41
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
44
42
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
45
43
  isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
46
44
  isSupported: (operation: OasOperation) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KA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AE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AAGjC,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,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,UAAU,CAAA;IAC9E,YAAY,EAAE,CAAC,EACb,SAAS,EACT,YAAY,EACb,EAAE,yBAAyB,KAAK,MAAM,CAAA;IACvC,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC9E,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,eAAe,WAAY,eAAe;;mBAWjC,uBAAuB;;;;;;;;;;;;;;;;;;;;oDArBC,mBAAmB,KAAK,UAAU;oDAI3E,yBAAyB,KAAK,MAAM;kDACI,uBAAuB,KAAK,OAAO;iCACpD,YAAY,KAAK,OAAO;;;;sBAiC3B,eAAe;;;;;;iCAjCZ,YAAY,KAAK,OAAO;;;CAuCnD,CAAA"}
@@ -2,7 +2,6 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
2
2
  if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
3
3
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
4
4
  };
5
- import { EntityType } from '../EntityType.js';
6
5
  import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
7
6
  import { OperationBase } from './OperationBase.js';
8
7
  import { GatewayBase } from '../GeneratorBase.js';
@@ -38,17 +37,11 @@ export const toOperationBase = (config) => {
38
37
  writable: true,
39
38
  value: 'OperationInsertable'
40
39
  }),
41
- Object.defineProperty(_a, "entityType", {
40
+ Object.defineProperty(_a, "toIdentifier", {
42
41
  enumerable: true,
43
42
  configurable: true,
44
43
  writable: true,
45
- value: config.entityType ?? new EntityType('variable')
46
- }),
47
- Object.defineProperty(_a, "toName", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: config.toName.bind(config)
44
+ value: config.toIdentifier.bind(config)
52
45
  }),
53
46
  Object.defineProperty(_a, "toExportPath", {
54
47
  enumerable: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.0.355",
3
+ "version": "0.0.357",
4
4
  "main": "./script/mod.js",
5
5
  "module": "./esm/mod.js",
6
6
  "exports": {
@@ -203,7 +203,7 @@ class GenerateContext {
203
203
  });
204
204
  const e = insertable.toExportPath({ operation, baseSettings });
205
205
  return new ContentSettings_js_1.ContentSettings({
206
- name: insertable.toName({ operation, baseSettings }),
206
+ identifier: insertable.toIdentifier({ operation, baseSettings }),
207
207
  selected: insertable.isSelected({ operation, baseSettings }),
208
208
  exportPath: e,
209
209
  importFrom: baseSettings.importFrom ?? e
@@ -216,7 +216,7 @@ class GenerateContext {
216
216
  });
217
217
  const e = insertable.toExportPath({ refName, baseSettings });
218
218
  return new ContentSettings_js_1.ContentSettings({
219
- name: insertable.toName({ refName, baseSettings }),
219
+ identifier: insertable.toIdentifier({ refName, baseSettings }),
220
220
  selected: insertable.isSelected({ refName, baseSettings }),
221
221
  exportPath: e,
222
222
  importFrom: baseSettings.importFrom ?? e
@@ -1,20 +1,21 @@
1
+ import type { Identifier } from './Identifier.js';
1
2
  type EmptyArgs = {
2
3
  exportPath: string;
3
- name: string;
4
+ identifier: Identifier;
4
5
  };
5
6
  type CreateArgs = {
6
- name: string;
7
+ identifier: Identifier;
7
8
  selected: boolean;
8
9
  exportPath: string;
9
10
  importFrom: string;
10
11
  };
11
12
  export declare class ContentSettings {
12
- name: string;
13
+ identifier: Identifier;
13
14
  selected: boolean;
14
15
  exportPath: string;
15
16
  importFrom: string;
16
- constructor({ name, selected, exportPath, importFrom }: CreateArgs);
17
- static empty({ name, exportPath }: EmptyArgs): ContentSettings;
17
+ constructor({ identifier, selected, exportPath, importFrom }: CreateArgs);
18
+ static empty({ identifier, exportPath }: EmptyArgs): ContentSettings;
18
19
  }
19
20
  export {};
20
21
  //# sourceMappingURL=ContentSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSettings.d.ts","sourceRoot":"","sources":["../../src/dsl/ContentSettings.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,qBAAa,eAAe;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;gBAEN,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,UAAU;IAOlE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,SAAS,GAAG,eAAe;CAQ/D"}
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,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ContentSettings = void 0;
4
4
  class ContentSettings {
5
- constructor({ name, selected, exportPath, importFrom }) {
6
- Object.defineProperty(this, "name", {
5
+ constructor({ identifier, selected, exportPath, importFrom }) {
6
+ Object.defineProperty(this, "identifier", {
7
7
  enumerable: true,
8
8
  configurable: true,
9
9
  writable: true,
@@ -27,15 +27,15 @@ class ContentSettings {
27
27
  writable: true,
28
28
  value: void 0
29
29
  });
30
- this.name = name;
30
+ this.identifier = identifier;
31
31
  this.selected = selected;
32
32
  this.exportPath = exportPath;
33
33
  this.importFrom = importFrom;
34
34
  }
35
- static empty({ name, exportPath }) {
35
+ static empty({ identifier, exportPath }) {
36
36
  return new ContentSettings({
37
37
  selected: true,
38
- name,
38
+ identifier,
39
39
  exportPath,
40
40
  importFrom: exportPath
41
41
  });
@@ -1,5 +1,5 @@
1
1
  import { EntityType } from './EntityType.js';
2
- type CreateValueArgs = string | {
2
+ type CreateVariableArgs = string | {
3
3
  name: string;
4
4
  tsType?: string;
5
5
  };
@@ -13,7 +13,7 @@ export declare class Identifier {
13
13
  entityType: EntityType;
14
14
  tsType?: string;
15
15
  constructor({ name, tsType, entityType }: ConstructorArgs);
16
- static createValue(args: CreateValueArgs): Identifier;
16
+ static createVariable(args: CreateVariableArgs): Identifier;
17
17
  static createType(name: string): Identifier;
18
18
  toString(): string;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,eAAe,GAChB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU;IAiBrD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
1
+ {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,kBAAkB,GACnB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,UAAU;IAiB3D,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
@@ -27,7 +27,7 @@ class Identifier {
27
27
  this.tsType = tsType;
28
28
  this.entityType = entityType;
29
29
  }
30
- static createValue(args) {
30
+ static createVariable(args) {
31
31
  return (0, ts_pattern_1.match)(args)
32
32
  .with(ts_pattern_1.P.string, name => {
33
33
  return new Identifier({
@@ -1,6 +1,7 @@
1
1
  import type { ModelInsertable } from './ModelInsertable.js';
2
2
  import type { GenerateContext } from '../../context/GenerateContext.js';
3
3
  import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { Identifier } from '../Identifier.js';
4
5
  import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
6
  import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
7
  import type { RefName } from '../../types/RefName.js';
@@ -20,7 +21,7 @@ export declare class ModelDriver<V extends GeneratedValue, T extends GenerationT
20
21
  definition: GeneratedDefintion<V, T>;
21
22
  constructor({ context, insertable, refName, generation, destinationPath }: CreateModelArgs<V, T>);
22
23
  get value(): V;
23
- get name(): string;
24
+ get identifier(): Identifier;
24
25
  get exportPath(): string;
25
26
  private apply;
26
27
  private getDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelDriver.ts"],"names":[],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AI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,gBAAgB;CAqBzB"}
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModelDriver = void 0;
4
4
  const mod_js_1 = require("../../deps/jsr.io/@std/path/1.0.0/mod.js");
5
5
  const Definition_js_1 = require("../Definition.js");
6
- const Identifier_js_1 = require("../Identifier.js");
7
- const ts_pattern_1 = require("ts-pattern");
8
6
  const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
9
7
  class ModelDriver {
10
8
  constructor({ context, insertable, refName, generation, destinationPath }) {
@@ -57,29 +55,32 @@ class ModelDriver {
57
55
  }
58
56
  return this.definition.value;
59
57
  }
60
- get name() {
61
- return this.settings.name;
58
+ get identifier() {
59
+ return this.settings.identifier;
62
60
  }
63
61
  get exportPath() {
64
62
  return this.settings.exportPath;
65
63
  }
66
64
  apply({ generation, destinationPath } = {}) {
67
- const { name, exportPath, selected, importFrom } = this.settings;
65
+ const { identifier, exportPath, selected, importFrom } = this.settings;
68
66
  if (!selected && generation !== 'force') {
69
67
  return undefined;
70
68
  }
71
- const definition = this.getDefinition({ name, exportPath });
69
+ const definition = this.getDefinition({ identifier, exportPath });
72
70
  if (destinationPath &&
73
71
  (0, mod_js_1.normalize)(exportPath) !== (0, mod_js_1.normalize)(destinationPath)) {
74
72
  this.context.register({
75
- imports: { [importFrom]: [name] },
73
+ imports: { [importFrom]: [identifier.name] },
76
74
  destinationPath
77
75
  });
78
76
  }
79
77
  return definition;
80
78
  }
81
- getDefinition({ name, exportPath }) {
82
- const cachedDefinition = this.context.findDefinition({ name, exportPath });
79
+ getDefinition({ identifier, exportPath }) {
80
+ const cachedDefinition = this.context.findDefinition({
81
+ name: identifier.name,
82
+ exportPath
83
+ });
83
84
  if (this.affirmDefinition(cachedDefinition, exportPath)) {
84
85
  return cachedDefinition;
85
86
  }
@@ -89,17 +90,6 @@ class ModelDriver {
89
90
  settings: this.settings,
90
91
  destinationPath: this.settings.exportPath
91
92
  });
92
- // @TODO This feels hacky and there is probably a better way to do this
93
- const tsType = value &&
94
- typeof value === 'object' &&
95
- 'tsType' in value &&
96
- typeof value.tsType === 'string'
97
- ? value.tsType
98
- : undefined;
99
- const identifier = (0, ts_pattern_1.match)(this.insertable.entityType.type)
100
- .with('variable', () => Identifier_js_1.Identifier.createValue({ name, tsType }))
101
- .with('type', () => Identifier_js_1.Identifier.createType(name))
102
- .exhaustive();
103
93
  const definition = new Definition_js_1.Definition({
104
94
  context: this.context,
105
95
  value,
@@ -1,8 +1,8 @@
1
1
  import type { GenerateContext } from '../../context/GenerateContext.js';
2
- import type { EntityType } from '../EntityType.js';
3
2
  import type { ContentSettings } from '../ContentSettings.js';
4
3
  import type { BaseSettings } from '../../types/Settings.js';
5
4
  import type { RefName } from '../../types/RefName.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  type ModelInsertableConstructorArgs = {
7
7
  context: GenerateContext;
8
8
  refName: RefName;
@@ -39,8 +39,7 @@ export type ModelInsertable<V> = {
39
39
  id: string;
40
40
  type: 'model';
41
41
  _class: 'ModelInsertable';
42
- entityType: EntityType;
43
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
42
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
44
43
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
45
44
  isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
46
45
  pinnable: boolean;
@@ -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,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,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AAA;CAC3B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,OAAO,EAAE,eAAe,GAAG,kBAAkB,CAAA;IAClD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,OAAO,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAAG;IAClD,KAAK,EACH,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EAChB,EAAE,8BAA8B,GAAG,CAAC,CAAA;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;IACzB,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,KAAK,UAAU,CAAA;IACxE,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAC1E,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAA;IACvE,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,OAAO,CAAA;CAE3B,GAAG,QAAQ,CAAA"}
@@ -1,8 +1,8 @@
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 { EntityType } from '../EntityType.js';
5
4
  import type { IsModelSelectedArgs, ToModelExportPathArgs, ToModelNameArgs } from './ModelInsertable.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  export type ModelInsertableArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -10,8 +10,7 @@ export type ModelInsertableArgs = {
10
10
  };
11
11
  export type ModelConfig = {
12
12
  id: string;
13
- entityType?: EntityType;
14
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
13
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
15
14
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
16
15
  isSelected?: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
17
16
  };
@@ -29,8 +28,7 @@ export declare const toModelBase: (config: ModelConfig) => {
29
28
  id: string;
30
29
  type: "model";
31
30
  _class: "ModelInsertable";
32
- entityType: EntityType;
33
- toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
31
+ toIdentifier: ({ refName, baseSettings }: ToModelNameArgs) => Identifier;
34
32
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
35
33
  isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
36
34
  isSupported: () => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.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,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAG7B,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,WA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AY,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,qBAAqB,KAAK,MAAM,CAAA;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAA;CACzE,CAAA;AAED,eAAO,MAAM,WAAW,WAAY,WAAW;;mBAWzB,mBAAmB;;;;;;;;;;;;kDAhBG,eAAe,KAAK,UAAU;kDAC9B,qBAAqB,KAAK,MAAM;gDACjC,mBAAmB,KAAK,OAAO;;;;;sBAgCjD,eAAe;;;;;;;;;CAMvC,CAAA"}
@@ -6,7 +6,6 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.toModelBase = void 0;
8
8
  const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
9
- const EntityType_js_1 = require("../EntityType.js");
10
9
  const GeneratorBase_js_1 = require("../GeneratorBase.js");
11
10
  const ModelBase_js_1 = require("./ModelBase.js");
12
11
  const toModelBase = (config) => {
@@ -41,17 +40,11 @@ const toModelBase = (config) => {
41
40
  writable: true,
42
41
  value: 'ModelInsertable'
43
42
  }),
44
- Object.defineProperty(_a, "entityType", {
43
+ Object.defineProperty(_a, "toIdentifier", {
45
44
  enumerable: true,
46
45
  configurable: true,
47
46
  writable: true,
48
- value: config.entityType ?? new EntityType_js_1.EntityType('variable')
49
- }),
50
- Object.defineProperty(_a, "toName", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: config.toName.bind(config)
47
+ value: config.toIdentifier.bind(config)
55
48
  }),
56
49
  Object.defineProperty(_a, "toExportPath", {
57
50
  enumerable: true,
@@ -1,6 +1,7 @@
1
1
  import type { OperationInsertable } from './OperationInsertable.js';
2
2
  import type { OasOperation } from '../../oas/operation/Operation.js';
3
3
  import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { Identifier } from '../Identifier.js';
4
5
  import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
6
  import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
7
  import type { GenerateContext } from '../../context/GenerateContext.js';
@@ -20,7 +21,7 @@ export declare class OperationDriver<V extends GeneratedValue, T extends Generat
20
21
  definition: GeneratedDefintion<V, T>;
21
22
  constructor({ context, insertable, operation, generation, destinationPath }: CreateOperationArgs<V, T>);
22
23
  get value(): V;
23
- get name(): string;
24
+ get identifier(): Identifier;
24
25
  get exportPath(): string;
25
26
  private apply;
26
27
  private getDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,IAAI;IAC7E,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAYD,qBAAa,eAAe,CAC1B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc;IAExB,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,C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e,CAC1B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc;IAExB,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAExB,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EAChB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;IAc5B,IAAI,KAAK,IAAI,CAAC,CAQb;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,gBAAgB;CAqBzB"}
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OperationDriver = void 0;
4
4
  const mod_js_1 = require("../../deps/jsr.io/@std/path/1.0.0/mod.js");
5
5
  const Definition_js_1 = require("../Definition.js");
6
- const Identifier_js_1 = require("../Identifier.js");
7
- const ts_pattern_1 = require("ts-pattern");
8
6
  const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
9
7
  class OperationDriver {
10
8
  constructor({ context, insertable, operation, generation, destinationPath }) {
@@ -60,29 +58,32 @@ class OperationDriver {
60
58
  }
61
59
  return this.definition.value;
62
60
  }
63
- get name() {
64
- return this.settings.name;
61
+ get identifier() {
62
+ return this.settings.identifier;
65
63
  }
66
64
  get exportPath() {
67
65
  return this.settings.exportPath;
68
66
  }
69
67
  apply({ generation, destinationPath } = {}) {
70
- const { name, exportPath, selected, importFrom } = this.settings;
68
+ const { identifier, exportPath, selected, importFrom } = this.settings;
71
69
  if (!selected && generation !== 'force') {
72
70
  return undefined;
73
71
  }
74
- const definition = this.getDefinition({ name, exportPath });
72
+ const definition = this.getDefinition({ identifier, exportPath });
75
73
  if (destinationPath &&
76
74
  (0, mod_js_1.normalize)(exportPath) !== (0, mod_js_1.normalize)(destinationPath)) {
77
75
  this.context.register({
78
- imports: { [importFrom]: [name] },
76
+ imports: { [importFrom]: [identifier.name] },
79
77
  destinationPath
80
78
  });
81
79
  }
82
80
  return definition;
83
81
  }
84
- getDefinition({ name, exportPath }) {
85
- const cachedDefinition = this.context.findDefinition({ name, exportPath });
82
+ getDefinition({ identifier, exportPath }) {
83
+ const cachedDefinition = this.context.findDefinition({
84
+ name: identifier.name,
85
+ exportPath
86
+ });
86
87
  if (this.affirmDefinition(cachedDefinition, exportPath)) {
87
88
  return cachedDefinition;
88
89
  }
@@ -91,14 +92,6 @@ class OperationDriver {
91
92
  operation: this.operation,
92
93
  settings: this.settings
93
94
  });
94
- // @TODO This feels hacky and there is probably a better way to do this
95
- const tsType = 'tsType' in value && typeof value.tsType === 'string'
96
- ? value.tsType
97
- : undefined;
98
- const identifier = (0, ts_pattern_1.match)(this.insertable.entityType.type)
99
- .with('variable', () => Identifier_js_1.Identifier.createValue({ name, tsType }))
100
- .with('type', () => Identifier_js_1.Identifier.createType(name))
101
- .exhaustive();
102
95
  const definition = new Definition_js_1.Definition({
103
96
  context: this.context,
104
97
  value,
@@ -1,8 +1,8 @@
1
1
  import type { OasOperation } from '../../oas/operation/Operation.js';
2
2
  import type { ContentSettings } from '../ContentSettings.js';
3
3
  import type { BaseSettings } from '../../types/Settings.js';
4
- import type { EntityType } from '../EntityType.js';
5
4
  import type { GenerateContext } from '../../context/GenerateContext.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  type OperationInsertableConstructorArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -38,8 +38,7 @@ export type OperationInsertable<V> = {
38
38
  id: string;
39
39
  type: 'operation';
40
40
  _class: 'OperationInsertable';
41
- entityType: EntityType;
42
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
41
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
43
42
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
44
43
  isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
45
44
  pinnable: boolean;
@@ -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,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,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,uBAAuB,GAAG;IACpC,SAAS,EAAE,YAAY,CAAA;IACvB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,kBAAkB,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,IAAI,CAAA;CACtD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,OAAO,EAAE,eAAe,GAAG,sBAAsB,CAAA;IACtD,EAAE,EAAE,M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E,yBAAyB,KAAK,MAAM,CAAA;IACvC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC7E,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CAElD,GAAG,QAAQ,CAAA"}
@@ -1,8 +1,8 @@
1
- import { EntityType } from '../EntityType.js';
2
1
  import type { GenerateContext } from '../../context/GenerateContext.js';
3
2
  import type { OasOperation } from '../../oas/operation/Operation.js';
4
3
  import type { ContentSettings } from '../ContentSettings.js';
5
4
  import type { ToOperationNameArgs, ToOperationExportPathArgs, IsOperationSelectedArgs } from './OperationInsertable.js';
5
+ import type { Identifier } from '../Identifier.js';
6
6
  export type OperationInsertableArgs = {
7
7
  context: GenerateContext;
8
8
  settings: ContentSettings;
@@ -10,8 +10,7 @@ export type OperationInsertableArgs = {
10
10
  };
11
11
  export type OperationConfig = {
12
12
  id: string;
13
- entityType?: EntityType;
14
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
13
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
15
14
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
16
15
  isSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
17
16
  isSupported?: (operation: OasOperation) => boolean;
@@ -29,7 +28,7 @@ export declare const toOperationBase: (config: OperationConfig) => {
29
28
  };
30
29
  createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn }: {
31
30
  schema: Schema;
32
- identifier: import("../Identifier.js").Identifier;
31
+ identifier: Identifier;
33
32
  schemaToValueFn: import("../../mod.js").SchemaToValueFn;
34
33
  }): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
35
34
  register(args: Partial<import("../../context/GenerateContext.js").RegisterArgs>): void;
@@ -39,8 +38,7 @@ export declare const toOperationBase: (config: OperationConfig) => {
39
38
  id: string;
40
39
  type: "operation";
41
40
  _class: "OperationInsertable";
42
- entityType: EntityType;
43
- toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
41
+ toIdentifier: ({ operation, baseSettings }: ToOperationNameArgs) => Identifier;
44
42
  toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
45
43
  isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
46
44
  isSupported: (operation: OasOperation) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,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,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,MAAM,CAAA;IACpE,YAAY,EAAE,CAAC,EACb,SAAS,EACT,YAAY,EACb,EAAE,yBAAyB,KAAK,MAAM,CAAA;IACvC,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC9E,WAAW,CAAC,EAA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EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,eAAe,WAAY,eAAe;;mBAWjC,uBAAuB;;;;;;;;;;;;;;;;;;;;oDArBC,mBAAmB,KAAK,UAAU;oDAI3E,yBAAyB,KAAK,MAAM;kDACI,uBAAuB,KAAK,OAAO;iCACpD,YAAY,KAAK,OAAO;;;;sBAiC3B,eAAe;;;;;;iCAjCZ,YAAY,KAAK,OAAO;;;CAuCnD,CAAA"}
@@ -5,7 +5,6 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.toOperationBase = void 0;
8
- const EntityType_js_1 = require("../EntityType.js");
9
8
  const GeneratorKeys_js_1 = require("../../types/GeneratorKeys.js");
10
9
  const OperationBase_js_1 = require("./OperationBase.js");
11
10
  const GeneratorBase_js_1 = require("../GeneratorBase.js");
@@ -41,17 +40,11 @@ const toOperationBase = (config) => {
41
40
  writable: true,
42
41
  value: 'OperationInsertable'
43
42
  }),
44
- Object.defineProperty(_a, "entityType", {
43
+ Object.defineProperty(_a, "toIdentifier", {
45
44
  enumerable: true,
46
45
  configurable: true,
47
46
  writable: true,
48
- value: config.entityType ?? new EntityType_js_1.EntityType('variable')
49
- }),
50
- Object.defineProperty(_a, "toName", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: config.toName.bind(config)
47
+ value: config.toIdentifier.bind(config)
55
48
  }),
56
49
  Object.defineProperty(_a, "toExportPath", {
57
50
  enumerable: true,