@skmtc/core 0.0.337 → 0.0.339

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 (109) hide show
  1. package/esm/context/CoreContext.d.ts +2 -2
  2. package/esm/context/CoreContext.d.ts.map +1 -1
  3. package/esm/context/CoreContext.js +4 -4
  4. package/esm/context/GenerateContext.d.ts +5 -5
  5. package/esm/context/GenerateContext.d.ts.map +1 -1
  6. package/esm/context/GenerateContext.js +64 -32
  7. package/esm/context/ParseContext.d.ts +1 -1
  8. package/esm/context/ParseContext.d.ts.map +1 -1
  9. package/esm/context/ParseContext.js +11 -11
  10. package/esm/dsl/EntityType.d.ts +2 -2
  11. package/esm/dsl/EntityType.d.ts.map +1 -1
  12. package/esm/dsl/EntityType.js +1 -1
  13. package/esm/dsl/Identifier.js +2 -2
  14. package/esm/dsl/{ModelDriver.d.ts → model/ModelDriver.d.ts} +5 -5
  15. package/esm/dsl/model/ModelDriver.d.ts.map +1 -0
  16. package/esm/dsl/{ModelDriver.js → model/ModelDriver.js} +5 -5
  17. package/{script/dsl → esm/dsl/model}/ModelInsertable.d.ts +18 -12
  18. package/esm/dsl/model/ModelInsertable.d.ts.map +1 -0
  19. package/esm/dsl/operation/OperationBase.d.ts +34 -0
  20. package/esm/dsl/operation/OperationBase.d.ts.map +1 -0
  21. package/esm/dsl/{base.js → operation/OperationBase.js} +4 -35
  22. package/esm/dsl/{OperationDriver.d.ts → operation/OperationDriver.d.ts} +5 -5
  23. package/esm/dsl/operation/OperationDriver.d.ts.map +1 -0
  24. package/esm/dsl/{OperationDriver.js → operation/OperationDriver.js} +5 -5
  25. package/{script/dsl → esm/dsl/operation}/OperationInsertable.d.ts +12 -8
  26. package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -0
  27. package/esm/mod.d.ts +5 -6
  28. package/esm/mod.d.ts.map +1 -1
  29. package/esm/mod.js +5 -6
  30. package/esm/oas/components/Components.d.ts +1 -0
  31. package/esm/oas/components/Components.d.ts.map +1 -1
  32. package/esm/oas/components/Components.js +3 -0
  33. package/esm/oas/document/toDocumentFieldsV3.d.ts +2 -2
  34. package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  35. package/esm/oas/document/toDocumentFieldsV3.js +2 -2
  36. package/esm/oas/ref/Ref.d.ts +2 -2
  37. package/esm/oas/ref/Ref.d.ts.map +1 -1
  38. package/esm/oas/ref/Ref.js +8 -8
  39. package/esm/oas/ref/toRefV31.js +1 -1
  40. package/esm/server/createServer.d.ts +2 -2
  41. package/esm/server/createServer.d.ts.map +1 -1
  42. package/esm/transform/transform.d.ts +2 -2
  43. package/esm/transform/transform.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/script/context/CoreContext.d.ts +2 -2
  46. package/script/context/CoreContext.d.ts.map +1 -1
  47. package/script/context/CoreContext.js +4 -4
  48. package/script/context/GenerateContext.d.ts +5 -5
  49. package/script/context/GenerateContext.d.ts.map +1 -1
  50. package/script/context/GenerateContext.js +64 -32
  51. package/script/context/ParseContext.d.ts +1 -1
  52. package/script/context/ParseContext.d.ts.map +1 -1
  53. package/script/context/ParseContext.js +11 -11
  54. package/script/dsl/EntityType.d.ts +2 -2
  55. package/script/dsl/EntityType.d.ts.map +1 -1
  56. package/script/dsl/EntityType.js +1 -1
  57. package/script/dsl/Identifier.js +2 -2
  58. package/script/dsl/{ModelDriver.d.ts → model/ModelDriver.d.ts} +5 -5
  59. package/script/dsl/model/ModelDriver.d.ts.map +1 -0
  60. package/script/dsl/{ModelDriver.js → model/ModelDriver.js} +5 -5
  61. package/{esm/dsl → script/dsl/model}/ModelInsertable.d.ts +18 -12
  62. package/script/dsl/model/ModelInsertable.d.ts.map +1 -0
  63. package/script/dsl/operation/OperationBase.d.ts +34 -0
  64. package/script/dsl/operation/OperationBase.d.ts.map +1 -0
  65. package/script/dsl/{base.js → operation/OperationBase.js} +5 -37
  66. package/script/dsl/{OperationDriver.d.ts → operation/OperationDriver.d.ts} +5 -5
  67. package/script/dsl/operation/OperationDriver.d.ts.map +1 -0
  68. package/script/dsl/{OperationDriver.js → operation/OperationDriver.js} +5 -5
  69. package/{esm/dsl → script/dsl/operation}/OperationInsertable.d.ts +12 -8
  70. package/script/dsl/operation/OperationInsertable.d.ts.map +1 -0
  71. package/script/mod.d.ts +5 -6
  72. package/script/mod.d.ts.map +1 -1
  73. package/script/mod.js +5 -6
  74. package/script/oas/components/Components.d.ts +1 -0
  75. package/script/oas/components/Components.d.ts.map +1 -1
  76. package/script/oas/components/Components.js +3 -0
  77. package/script/oas/document/toDocumentFieldsV3.d.ts +2 -2
  78. package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  79. package/script/oas/document/toDocumentFieldsV3.js +2 -2
  80. package/script/oas/ref/Ref.d.ts +2 -2
  81. package/script/oas/ref/Ref.d.ts.map +1 -1
  82. package/script/oas/ref/Ref.js +8 -8
  83. package/script/oas/ref/toRefV31.js +1 -1
  84. package/script/server/createServer.d.ts +2 -2
  85. package/script/server/createServer.d.ts.map +1 -1
  86. package/script/transform/transform.d.ts +2 -2
  87. package/script/transform/transform.d.ts.map +1 -1
  88. package/esm/dsl/ModelDriver.d.ts.map +0 -1
  89. package/esm/dsl/ModelInsertable.d.ts.map +0 -1
  90. package/esm/dsl/OperationDriver.d.ts.map +0 -1
  91. package/esm/dsl/OperationInsertable.d.ts.map +0 -1
  92. package/esm/dsl/base.d.ts +0 -56
  93. package/esm/dsl/base.d.ts.map +0 -1
  94. package/esm/dsl/withConfig.d.ts +0 -115
  95. package/esm/dsl/withConfig.d.ts.map +0 -1
  96. package/esm/dsl/withConfig.js +0 -138
  97. package/script/dsl/ModelDriver.d.ts.map +0 -1
  98. package/script/dsl/ModelInsertable.d.ts.map +0 -1
  99. package/script/dsl/OperationDriver.d.ts.map +0 -1
  100. package/script/dsl/OperationInsertable.d.ts.map +0 -1
  101. package/script/dsl/base.d.ts +0 -56
  102. package/script/dsl/base.d.ts.map +0 -1
  103. package/script/dsl/withConfig.d.ts +0 -115
  104. package/script/dsl/withConfig.d.ts.map +0 -1
  105. package/script/dsl/withConfig.js +0 -144
  106. /package/esm/dsl/{ModelInsertable.js → model/ModelInsertable.js} +0 -0
  107. /package/esm/dsl/{OperationInsertable.js → operation/OperationInsertable.js} +0 -0
  108. /package/script/dsl/{ModelInsertable.js → model/ModelInsertable.js} +0 -0
  109. /package/script/dsl/{OperationInsertable.js → operation/OperationInsertable.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import type { PrettierConfigType } from '../types/prettierConfig.js';
2
2
  import type { OasDocument } from '../oas/document/Document.js';
3
3
  import type { ClientSettings } from '../types/Settings.js';
4
- import type { OperationGenerator } from '../dsl/OperationInsertable.js';
5
- import type { ModelGenerator } from '../dsl/ModelInsertable.js';
4
+ import type { OperationGenerator } from '../dsl/operation/OperationInsertable.js';
5
+ import type { ModelGenerator } from '../dsl/model/ModelInsertable.js';
6
6
  import type { SuccessWarningError } from '../types/Results.js';
7
7
  import * as log from '../deps/jsr.io/@std/log/0.224.7/mod.js';
8
8
  import type { GeneratorKey } from '../types/GeneratorKeys.js';
@@ -1 +1 @@
1
- {"version":3,"file":"CoreContext.d.ts","sourceRoot":"","sources":["../../src/context/CoreContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AA6B7D,K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K,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AA6B7D,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AASD,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,CAAC,CAAA;IAClE,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,qBAAa,WAAW;;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;gBAKN,EAAE,MAAM,EAAE,EAAE,eAAe;IAmCvC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAMlC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,aAAa;;;;;;IA8DtE,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAiClD,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;CAsBxD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,GAAG,CAAC,SAAS,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,UAAU,EACX,EAAE,iBAAiB,GAAG,MAAM,CAQ5B"}
@@ -48,13 +48,13 @@ export class CoreContext {
48
48
  __classPrivateFieldGet(this, _CoreContext_phase, "f").context.addGeneratorKey({ generatorKey });
49
49
  }
50
50
  };
51
- const schemaModel = this.trace('parse', () => {
51
+ const oasDocument = this.trace('parse', () => {
52
52
  __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
53
53
  return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
54
54
  });
55
55
  const files = this.trace('generate', () => {
56
56
  __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupGeneratePhase).call(this, {
57
- schemaModel,
57
+ oasDocument,
58
58
  settings,
59
59
  generatorsMap,
60
60
  callback
@@ -127,9 +127,9 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
127
127
  stackTrail: __classPrivateFieldGet(this, _CoreContext_stackTrail, "f")
128
128
  });
129
129
  return { type: 'parse', context: parseContext };
130
- }, _CoreContext_setupGeneratePhase = function _CoreContext_setupGeneratePhase({ schemaModel, settings, generatorsMap, callback }) {
130
+ }, _CoreContext_setupGeneratePhase = function _CoreContext_setupGeneratePhase({ oasDocument, settings, generatorsMap, callback }) {
131
131
  const generateContext = new GenerateContext({
132
- schemaModel,
132
+ oasDocument,
133
133
  settings,
134
134
  generatorsMap,
135
135
  logger: this.logger,
@@ -6,9 +6,9 @@ import type { OasRef } from '../oas/ref/Ref.js';
6
6
  import type { FileContents, GetFileOptions } from './types.js';
7
7
  import type { ClientSettings } from '../types/Settings.js';
8
8
  import type { Method } from '../types/Method.js';
9
- import type { OperationInsertable, OperationGenerator } from '../dsl/OperationInsertable.js';
9
+ import type { OperationInsertable, OperationGenerator } from '../dsl/operation/OperationInsertable.js';
10
10
  import type { OasOperation } from '../oas/operation/Operation.js';
11
- import type { ModelInsertable, ModelGenerator } from '../dsl/ModelInsertable.js';
11
+ import type { ModelInsertable, ModelGenerator } from '../dsl/model/ModelInsertable.js';
12
12
  import type { GenerationType, GeneratedDefintion, GeneratedValue } from '../types/GeneratedValue.js';
13
13
  import { ContentSettings } from '../dsl/ContentSettings.js';
14
14
  import type { RefName } from '../types/RefName.js';
@@ -19,7 +19,7 @@ import type { StackTrail } from './StackTrail.js';
19
19
  import type { Identifier } from '../dsl/Identifier.js';
20
20
  import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
21
21
  type ConstructorArgs = {
22
- schemaModel: OasDocument;
22
+ oasDocument: OasDocument;
23
23
  settings: ClientSettings | undefined;
24
24
  generatorsMap: Record<string, OperationGenerator | ModelGenerator>;
25
25
  logger: log.Logger;
@@ -81,12 +81,12 @@ type BuildModelSettingsArgs<V> = {
81
81
  };
82
82
  export declare class GenerateContext {
83
83
  #private;
84
- schemaModel: OasDocument;
84
+ oasDocument: OasDocument;
85
85
  settings: ClientSettings | undefined;
86
86
  logger: log.Logger;
87
87
  callback: (generatorKey: GeneratorKey) => void;
88
88
  captureCurrentResult: (result: SuccessWarningError) => void;
89
- constructor({ schemaModel, settings, logger, callback, captureCurrentResult, stackTrail }: ConstructorArgs);
89
+ constructor({ oasDocument, settings, logger, callback, captureCurrentResult, stackTrail }: ConstructorArgs);
90
90
  generate(generatorsMap: Record<string, OperationGenerator | ModelGenerator>): Map<string, FileContents>;
91
91
  trace<T>(token: string | string[], fn: () => T): T;
92
92
  getFile(filePath: string, { throwIfNotFound }?: GetFileOptions): FileContents;
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE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EAAE,MAAM,EAChB,EAAE,eAAuB,EAAE,GAAE,cAAmB,GAC/C,YAAY;IAgBf,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,UAAU,EACV,eAAe,EACf,eAAe,EAChB,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,UAAU,CACjD,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IAiCD,QAAQ,CAAC,EAAE,OAAY,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,YAAY;IAyBrE,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,EACzD,UAAU,EACV,eAAe,EACf,GAAG,IAAI,EACR,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;IA4BxC,0BAA0B,CAAC,CAAC,EAAE,EAC5B,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,eAAe;IAiB/C,sBAAsB,CAAC,CAAC,EAAE,EACxB,OAAO,EACP,UAAU,EACX,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,eAAe;IAoE9C,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY;IAgB7C,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAWpE,oDAAoD;IACpD,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
@@ -13,16 +13,16 @@ var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTr
13
13
  import { join, normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
14
14
  import { Import } from '../dsl/Import.js';
15
15
  import { Definition } from '../dsl/Definition.js';
16
- import { OperationDriver } from '../dsl/OperationDriver.js';
17
- import { ModelDriver } from '../dsl/ModelDriver.js';
16
+ import { OperationDriver } from '../dsl/operation/OperationDriver.js';
17
+ import { ModelDriver } from '../dsl/model/ModelDriver.js';
18
18
  import { ContentSettings } from '../dsl/ContentSettings.js';
19
19
  import * as Sentry from '@sentry/deno';
20
20
  import { tracer } from '../helpers/tracer.js';
21
21
  export class GenerateContext {
22
- constructor({ schemaModel, settings, logger, callback, captureCurrentResult, stackTrail }) {
22
+ constructor({ oasDocument, settings, logger, callback, captureCurrentResult, stackTrail }) {
23
23
  _GenerateContext_instances.add(this);
24
24
  _GenerateContext_files.set(this, void 0);
25
- Object.defineProperty(this, "schemaModel", {
25
+ Object.defineProperty(this, "oasDocument", {
26
26
  enumerable: true,
27
27
  configurable: true,
28
28
  writable: true,
@@ -55,7 +55,7 @@ export class GenerateContext {
55
55
  _GenerateContext_stackTrail.set(this, void 0);
56
56
  this.logger = logger;
57
57
  __classPrivateFieldSet(this, _GenerateContext_files, new Map(), "f");
58
- this.schemaModel = schemaModel;
58
+ this.oasDocument = oasDocument;
59
59
  this.settings = settings;
60
60
  this.callback = callback;
61
61
  __classPrivateFieldSet(this, _GenerateContext_stackTrail, stackTrail, "f");
@@ -66,7 +66,7 @@ export class GenerateContext {
66
66
  .filter(generator => generator.type === 'operation')
67
67
  .forEach(generator => {
68
68
  this.trace(generator.id, () => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runOperationGenerator).call(this, {
69
- schemaModel: this.schemaModel,
69
+ oasDocument: this.oasDocument,
70
70
  generator
71
71
  }));
72
72
  }));
@@ -76,7 +76,7 @@ export class GenerateContext {
76
76
  .forEach(generator => {
77
77
  this.trace(generator.id, () => {
78
78
  __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runModelGenerator).call(this, {
79
- schemaModel: this.schemaModel,
79
+ oasDocument: this.oasDocument,
80
80
  generator
81
81
  });
82
82
  });
@@ -209,7 +209,7 @@ export class GenerateContext {
209
209
  return newFile;
210
210
  }
211
211
  resolveSchemaRefOnce(refName) {
212
- const schema = this.schemaModel.components?.schemas?.[refName]?.resolveOnce();
212
+ const schema = this.oasDocument.components?.schemas?.[refName]?.resolveOnce();
213
213
  if (!schema) {
214
214
  throw new Error(`Schema not found: ${refName}`);
215
215
  }
@@ -220,33 +220,65 @@ export class GenerateContext {
220
220
  return this.getFile(exportPath).definitions.get(name);
221
221
  }
222
222
  }
223
- _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_runOperationGenerator = function _GenerateContext_runOperationGenerator({ schemaModel, generator }) {
224
- const generatorInstance = new generator(this);
225
- schemaModel.operations.forEach(operation => {
226
- // TODO If we make OasOperation generic, for example by
227
- // adding a `method` type, we could make isSupported
228
- // a type guard which could help us narrow down the
229
- // exact operation type that a generator receives.
230
- // This would allow us to remove some type checks
231
- // in the generator implementations
232
- // https://linear.app/skmtc/issue/SKM-32/generic-models-operations
233
- const { path, method } = operation;
234
- if (generator.isSupported(operation)) {
235
- this.trace([path, method], () => {
236
- generatorInstance.transformOperation(operation);
223
+ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_runOperationGenerator = function _GenerateContext_runOperationGenerator({ oasDocument, generator }) {
224
+ if (generator._class === 'OperationGenerator') {
225
+ const generatorInstance = new generator(this);
226
+ return oasDocument.operations.forEach(operation => {
227
+ // TODO If we make OasOperation generic, for example by
228
+ // adding a `method` type, we could make isSupported
229
+ // a type guard which could help us narrow down the
230
+ // exact operation type that a generator receives.
231
+ // This would allow us to remove some type checks
232
+ // in the generator implementations
233
+ // https://linear.app/skmtc/issue/SKM-32/generic-models-operations
234
+ const { path, method } = operation;
235
+ if (generator.isSupported(operation)) {
236
+ this.trace([path, method], () => {
237
+ generatorInstance.transformOperation(operation);
238
+ this.captureCurrentResult('success');
239
+ });
240
+ }
241
+ });
242
+ }
243
+ if (generator._class === 'OperationInsertable') {
244
+ return oasDocument.operations.forEach(operation => {
245
+ // TODO If we make OasOperation generic, for example by
246
+ // adding a `method` type, we could make isSupported
247
+ // a type guard which could help us narrow down the
248
+ // exact operation type that a generator receives.
249
+ // This would allow us to remove some type checks
250
+ // in the generator implementations
251
+ // https://linear.app/skmtc/issue/SKM-32/generic-models-operations
252
+ const { path, method } = operation;
253
+ if (generator.isSupported(operation)) {
254
+ this.trace([path, method], () => {
255
+ this.insert({ insertable: generator, operation });
256
+ this.captureCurrentResult('success');
257
+ });
258
+ }
259
+ });
260
+ }
261
+ throw new Error(`Unknown generator type`);
262
+ }, _GenerateContext_runModelGenerator = function _GenerateContext_runModelGenerator({ oasDocument, generator }) {
263
+ if (generator._class === 'ModelGenerator') {
264
+ const generatorInstance = new generator(this);
265
+ const refNames = oasDocument.components?.toSchemasRefNames() ?? [];
266
+ return refNames.forEach(refName => {
267
+ this.trace(refName, () => {
268
+ generatorInstance.transformModel(refName);
237
269
  this.captureCurrentResult('success');
238
270
  });
239
- }
240
- });
241
- }, _GenerateContext_runModelGenerator = function _GenerateContext_runModelGenerator({ schemaModel, generator }) {
242
- const generatorInstance = new generator(this);
243
- const refNames = Object.keys(schemaModel.components?.schemas ?? {});
244
- refNames.forEach(rn => {
245
- this.trace(rn, () => {
246
- generatorInstance.transformModel(rn);
247
- this.captureCurrentResult('success');
248
271
  });
249
- });
272
+ }
273
+ if (generator._class === 'ModelInsertable') {
274
+ const refNames = oasDocument.components?.toSchemasRefNames() ?? [];
275
+ return refNames.forEach(refName => {
276
+ this.trace(refName, () => {
277
+ this.insert({ insertable: generator, refName });
278
+ this.captureCurrentResult('success');
279
+ });
280
+ });
281
+ }
250
282
  }, _GenerateContext_toOperationBaseSettings = function _GenerateContext_toOperationBaseSettings({ generatorId, path, method }) {
251
283
  const generatorSettings = this.settings?.generators?.find(({ id }) => id === generatorId);
252
284
  const operationSettings = generatorSettings && 'operations' in generatorSettings
@@ -11,7 +11,7 @@ export declare class ParseContext {
11
11
  #private;
12
12
  schema: string;
13
13
  logger: log.Logger;
14
- documentRoot: OasDocument;
14
+ oasDocument: OasDocument;
15
15
  constructor({ schema, logger, stackTrail }: ConstructorArgs);
16
16
  parse(): OasDocument;
17
17
  trace<T>(token: string | string[], fn: () => T): T;
@@ -1 +1 @@
1
- {"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,YAAY;;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,YAAY,EAAE,WAAW,CAAA;gBAGb,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAQ3D,KAAK;IAeL,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAiBlD,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAUlD;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,2BAMzC,CAAA"}
1
+ {"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,YAAY;;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;gBAGZ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAQ3D,KAAK;IAeL,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAiBlD,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAUlD;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,2BAMzC,CAAA"}
@@ -30,7 +30,7 @@ export class ParseContext {
30
30
  writable: true,
31
31
  value: void 0
32
32
  });
33
- Object.defineProperty(this, "documentRoot", {
33
+ Object.defineProperty(this, "oasDocument", {
34
34
  enumerable: true,
35
35
  configurable: true,
36
36
  writable: true,
@@ -40,11 +40,11 @@ export class ParseContext {
40
40
  this.schema = schema;
41
41
  this.logger = logger;
42
42
  __classPrivateFieldSet(this, _ParseContext_stackTrail, stackTrail, "f");
43
- this.documentRoot = new OasDocument();
43
+ this.oasDocument = new OasDocument();
44
44
  }
45
45
  parse() {
46
- const parsedDocument = __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseSchema).call(this);
47
- return __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseDocument).call(this, parsedDocument);
46
+ const documentObject = __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseSchema).call(this);
47
+ return __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseDocument).call(this, documentObject);
48
48
  }
49
49
  trace(token, fn) {
50
50
  return tracer(__classPrivateFieldGet(this, _ParseContext_stackTrail, "f"), token, fn);
@@ -60,17 +60,17 @@ export class ParseContext {
60
60
  }
61
61
  }
62
62
  _ParseContext_stackTrail = new WeakMap(), _ParseContext_instances = new WeakSet(), _ParseContext_parseSchema = function _ParseContext_parseSchema() {
63
- const parsedDocument = Sentry.startSpan({ name: 'Parse schema to document' }, () => parseSchema(this.schema));
64
- return parsedDocument;
65
- }, _ParseContext_parseDocument = function _ParseContext_parseDocument(parsedDocument) {
66
- if (!parsedDocument.openapi.startsWith('3.0.')) {
63
+ const documentObject = Sentry.startSpan({ name: 'Parse string schema to object' }, () => parseSchema(this.schema));
64
+ return documentObject;
65
+ }, _ParseContext_parseDocument = function _ParseContext_parseDocument(documentObject) {
66
+ if (!documentObject.openapi.startsWith('3.0.')) {
67
67
  throw new Error('Only OpenAPI v3 is supported');
68
68
  }
69
- this.documentRoot.fields = toDocumentFieldsV3({
70
- document: parsedDocument,
69
+ this.oasDocument.fields = toDocumentFieldsV3({
70
+ documentObject,
71
71
  context: this
72
72
  });
73
- return this.documentRoot;
73
+ return this.oasDocument;
74
74
  };
75
75
  export const parseSchema = (schema) => {
76
76
  if (schema.trimStart().startsWith('{')) {
@@ -1,6 +1,6 @@
1
1
  export declare class EntityType {
2
- type: 'value' | 'type';
3
- constructor(type: 'value' | 'type');
2
+ type: 'variable' | 'type';
3
+ constructor(type: 'variable' | 'type');
4
4
  toString(): string;
5
5
  }
6
6
  //# sourceMappingURL=EntityType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityType.d.ts","sourceRoot":"","sources":["../../src/dsl/EntityType.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACrB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAA;gBACV,IAAI,EAAE,OAAO,GAAG,MAAM;IAIlC,QAAQ,IAAI,MAAM;CAMnB"}
1
+ {"version":3,"file":"EntityType.d.ts","sourceRoot":"","sources":["../../src/dsl/EntityType.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACrB,IAAI,EAAE,UAAU,GAAG,MAAM,CAAA;gBACb,IAAI,EAAE,UAAU,GAAG,MAAM;IAIrC,QAAQ,IAAI,MAAM;CAMnB"}
@@ -11,7 +11,7 @@ export class EntityType {
11
11
  }
12
12
  toString() {
13
13
  return match(this.type)
14
- .with('value', () => 'const')
14
+ .with('variable', () => 'const')
15
15
  .with('type', () => 'type')
16
16
  .exhaustive();
17
17
  }
@@ -29,14 +29,14 @@ export class Identifier {
29
29
  .with(P.string, name => {
30
30
  return new Identifier({
31
31
  name,
32
- entityType: new EntityType('value')
32
+ entityType: new EntityType('variable')
33
33
  });
34
34
  })
35
35
  .otherwise(({ name, tsType }) => {
36
36
  return new Identifier({
37
37
  name,
38
38
  tsType,
39
- entityType: new EntityType('value')
39
+ entityType: new EntityType('variable')
40
40
  });
41
41
  });
42
42
  }
@@ -1,9 +1,9 @@
1
1
  import type { ModelInsertable } from './ModelInsertable.js';
2
- import type { GenerateContext } from '../context/GenerateContext.js';
3
- import type { ContentSettings } from './ContentSettings.js';
4
- import type { GeneratedDefintion, GenerationType } from '../types/GeneratedValue.js';
5
- import type { GeneratedValue } from '../types/GeneratedValue.js';
6
- import type { RefName } from '../types/RefName.js';
2
+ import type { GenerateContext } from '../../context/GenerateContext.js';
3
+ import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
+ import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
+ import type { RefName } from '../../types/RefName.js';
7
7
  type CreateModelArgs<V extends GeneratedValue, T extends GenerationType> = {
8
8
  context: GenerateContext;
9
9
  insertable: ModelInsertable<V>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eA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normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
2
- import { Definition } from './Definition.js';
3
- import { Identifier } from './Identifier.js';
1
+ import { normalize } from '../../deps/jsr.io/@std/path/1.0.0/mod.js';
2
+ import { Definition } from '../Definition.js';
3
+ import { Identifier } from '../Identifier.js';
4
4
  import { match } from 'ts-pattern';
5
- import { toModelGeneratorKey } from '../types/GeneratorKeys.js';
5
+ import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
6
6
  export class ModelDriver {
7
7
  constructor({ context, insertable, refName, generation, destinationPath }) {
8
8
  Object.defineProperty(this, "context", {
@@ -94,7 +94,7 @@ export class ModelDriver {
94
94
  ? value.tsType
95
95
  : undefined;
96
96
  const identifier = match(this.insertable.entityType.type)
97
- .with('value', () => Identifier.createValue({ name, tsType }))
97
+ .with('variable', () => Identifier.createValue({ name, tsType }))
98
98
  .with('type', () => Identifier.createType(name))
99
99
  .exhaustive();
100
100
  const definition = new Definition({
@@ -1,8 +1,14 @@
1
- import type { GenerateContext } from '../context/GenerateContext.js';
2
- import type { EntityType } from './EntityType.js';
3
- import type { ContentSettings } from './ContentSettings.js';
4
- import type { BaseSettings } from '../types/Settings.js';
5
- import type { RefName } from '../types/RefName.js';
1
+ import type { GenerateContext } from '../../context/GenerateContext.js';
2
+ import type { EntityType } from '../EntityType.js';
3
+ import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { BaseSettings } from '../../types/Settings.js';
5
+ import type { RefName } from '../../types/RefName.js';
6
+ type ModelInsertableConstructorArgs = {
7
+ context: GenerateContext;
8
+ refName: RefName;
9
+ settings: ContentSettings;
10
+ destinationPath: string;
11
+ };
6
12
  export type ToModelNameArgs = {
7
13
  refName: RefName;
8
14
  baseSettings: BaseSettings;
@@ -22,21 +28,21 @@ export type ModelGenerator = {
22
28
  new (context: GenerateContext): WithTransformModel;
23
29
  id: string;
24
30
  type: 'model';
25
- pinnable?: boolean;
31
+ _class: 'ModelGenerator';
32
+ pinnable: false;
26
33
  };
27
34
  export type ModelInsertable<V> = {
28
35
  prototype: V;
29
36
  } & {
30
- new (args: {
31
- context: GenerateContext;
32
- refName: RefName;
33
- settings: ContentSettings;
34
- destinationPath: string;
35
- }): V;
37
+ new ({ context, refName, settings, destinationPath }: ModelInsertableConstructorArgs): V;
36
38
  id: string;
39
+ type: 'model';
40
+ _class: 'ModelInsertable';
37
41
  entityType: EntityType;
38
42
  toName: ({ refName, baseSettings }: ToModelNameArgs) => string;
39
43
  toExportPath: ({ refName, baseSettings }: ToModelExportPathArgs) => string;
40
44
  isSelected: ({ refName, baseSettings }: IsModelSelectedArgs) => boolean;
45
+ pinnable: false;
41
46
  } & Function;
47
+ export {};
42
48
  //# sourceMappingURL=ModelInsertable.d.ts.map
@@ -0,0 +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,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,mBAAmB,GAAG;IAChC,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,cAAc,GAAG;IAC3B,KAAK,OAAO,EAAE,eAAe,GAAG,kBAAkB,CAAA;IAClD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,gBAAgB,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAA;CAChB,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,UAAU,EAAE,UAAU,CAAA;IACtB,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,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAA;IACvE,QAAQ,EAAE,KAAK,CAAA;CAEhB,GAAG,QAAQ,CAAA"}
@@ -0,0 +1,34 @@
1
+ import type { OperationInsertable } from './OperationInsertable.js';
2
+ import type { OasOperation } from '../../oas/operation/Operation.js';
3
+ import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { GenerateContext, RegisterArgs } from '../../context/GenerateContext.js';
5
+ import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
+ import type { GeneratorKey } from '../../types/GeneratorKeys.js';
7
+ import { ValueBase } from '../ValueBase.js';
8
+ import type { Definition } from '../Definition.js';
9
+ import type { Identifier } from '../Identifier.js';
10
+ import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
11
+ export type OperationBaseArgs = {
12
+ context: GenerateContext;
13
+ settings: ContentSettings;
14
+ generatorKey: GeneratorKey;
15
+ operation: OasOperation;
16
+ };
17
+ type CreateAndRegisterDefinition<Schema extends SchemaType> = {
18
+ schema: Schema;
19
+ identifier: Identifier;
20
+ schemaToValueFn: SchemaToValueFn;
21
+ };
22
+ export declare class OperationBase extends ValueBase {
23
+ settings: ContentSettings;
24
+ operation: OasOperation;
25
+ constructor({ context, generatorKey, settings, operation }: OperationBaseArgs);
26
+ insert<V extends GeneratedValue>(insertable: OperationInsertable<V>, operation: OasOperation): {
27
+ settings: ContentSettings;
28
+ definition: Definition<V>;
29
+ };
30
+ createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
31
+ register(args: Partial<RegisterArgs>): void;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=OperationBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.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;AAC5D,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACh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Base } from '../ValueBase.js';
2
2
  import invariant from 'tiny-invariant';
3
3
  export class OperationBase extends ValueBase {
4
4
  constructor({ context, generatorKey, settings, operation }) {
@@ -18,9 +18,10 @@ export class OperationBase extends ValueBase {
18
18
  this.operation = operation;
19
19
  this.settings = settings;
20
20
  }
21
- insert(args) {
21
+ insert(insertable, operation) {
22
22
  const { settings, definition } = this.context.insert({
23
- ...args,
23
+ insertable,
24
+ operation,
24
25
  generation: 'force',
25
26
  destinationPath: this.settings.exportPath
26
27
  });
@@ -42,35 +43,3 @@ export class OperationBase extends ValueBase {
42
43
  });
43
44
  }
44
45
  }
45
- export class ModelBase extends ValueBase {
46
- constructor({ context, settings, generatorKey, refName }) {
47
- super({ context, generatorKey });
48
- Object.defineProperty(this, "settings", {
49
- enumerable: true,
50
- configurable: true,
51
- writable: true,
52
- value: void 0
53
- });
54
- Object.defineProperty(this, "refName", {
55
- enumerable: true,
56
- configurable: true,
57
- writable: true,
58
- value: void 0
59
- });
60
- this.refName = refName;
61
- this.settings = settings;
62
- }
63
- transform(args) {
64
- this.context.insert({
65
- ...args,
66
- generation: 'force',
67
- destinationPath: this.settings.exportPath
68
- });
69
- }
70
- register(args) {
71
- this.context.register({
72
- ...args,
73
- destinationPath: args.destinationPath ?? this.settings.exportPath
74
- });
75
- }
76
- }
@@ -1,9 +1,9 @@
1
1
  import type { OperationInsertable } from './OperationInsertable.js';
2
- import type { OasOperation } from '../oas/operation/Operation.js';
3
- import type { ContentSettings } from './ContentSettings.js';
4
- import type { GeneratedDefintion, GenerationType } from '../types/GeneratedValue.js';
5
- import type { GeneratedValue } from '../types/GeneratedValue.js';
6
- import type { GenerateContext } from '../context/GenerateContext.js';
2
+ import type { OasOperation } from '../../oas/operation/Operation.js';
3
+ import type { ContentSettings } from '../ContentSettings.js';
4
+ import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
5
+ import type { GeneratedValue } from '../../types/GeneratedValue.js';
6
+ import type { GenerateContext } from '../../context/GenerateContext.js';
7
7
  type CreateOperationArgs<V extends GeneratedValue, T extends GenerationType> = {
8
8
  context: GenerateContext;
9
9
  insertable: OperationInsertable<V>;
@@ -0,0 +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,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAExB,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EAChB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;IAc5B,IAAI,KAAK,IAAI,CAAC,CAQb;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,gBAAgB;CAoBzB"}
@@ -1,8 +1,8 @@
1
- import { normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
2
- import { Definition } from './Definition.js';
3
- import { Identifier } from './Identifier.js';
1
+ import { normalize } from '../../deps/jsr.io/@std/path/1.0.0/mod.js';
2
+ import { Definition } from '../Definition.js';
3
+ import { Identifier } from '../Identifier.js';
4
4
  import { match } from 'ts-pattern';
5
- import { toOperationGeneratorKey } from '../types/GeneratorKeys.js';
5
+ import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
6
6
  export class OperationDriver {
7
7
  constructor({ context, insertable, operation, generation, destinationPath }) {
8
8
  Object.defineProperty(this, "context", {
@@ -93,7 +93,7 @@ export class OperationDriver {
93
93
  ? value.tsType
94
94
  : undefined;
95
95
  const identifier = match(this.insertable.entityType.type)
96
- .with('value', () => Identifier.createValue({ name, tsType }))
96
+ .with('variable', () => Identifier.createValue({ name, tsType }))
97
97
  .with('type', () => Identifier.createType(name))
98
98
  .exhaustive();
99
99
  const definition = new Definition({