@skmtc/core 0.0.314 → 0.0.316

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 (91) hide show
  1. package/esm/context/CoreContext.d.ts +0 -2
  2. package/esm/context/CoreContext.d.ts.map +1 -1
  3. package/esm/context/CoreContext.js +6 -15
  4. package/esm/context/GenerateContext.d.ts +3 -5
  5. package/esm/context/GenerateContext.d.ts.map +1 -1
  6. package/esm/context/GenerateContext.js +22 -32
  7. package/esm/context/ParseContext.d.ts +4 -5
  8. package/esm/context/ParseContext.d.ts.map +1 -1
  9. package/esm/context/ParseContext.js +15 -17
  10. package/esm/context/RenderContext.d.ts +4 -5
  11. package/esm/context/RenderContext.d.ts.map +1 -1
  12. package/esm/context/RenderContext.js +17 -16
  13. package/esm/helpers/tracer.d.ts +2 -6
  14. package/esm/helpers/tracer.d.ts.map +1 -1
  15. package/esm/helpers/tracer.js +3 -3
  16. package/esm/oas/array/toArray.d.ts.map +1 -1
  17. package/esm/oas/array/toArray.js +1 -2
  18. package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
  19. package/esm/oas/components/toComponentsV3.js +5 -6
  20. package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  21. package/esm/oas/document/toDocumentFieldsV3.js +4 -5
  22. package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
  23. package/esm/oas/example/toExamplesV3.js +3 -4
  24. package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
  25. package/esm/oas/header/toHeadersV3.js +3 -4
  26. package/esm/oas/intersection/toIntersection.d.ts.map +1 -1
  27. package/esm/oas/intersection/toIntersection.js +2 -3
  28. package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
  29. package/esm/oas/mediaType/toMediaTypeItemV3.js +3 -4
  30. package/esm/oas/object/toObject.d.ts.map +1 -1
  31. package/esm/oas/object/toObject.js +2 -3
  32. package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
  33. package/esm/oas/operation/toOperationsV3.js +5 -6
  34. package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
  35. package/esm/oas/parameter/toParameterV3.js +7 -8
  36. package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
  37. package/esm/oas/pathItem/toPathItemV3.js +1 -2
  38. package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
  39. package/esm/oas/requestBody/toRequestBodiesV3.js +2 -3
  40. package/esm/oas/response/toResponseV3.d.ts.map +1 -1
  41. package/esm/oas/response/toResponseV3.js +3 -4
  42. package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
  43. package/esm/oas/schema/toSchemasV3.js +3 -4
  44. package/esm/oas/union/toUnion.d.ts.map +1 -1
  45. package/esm/oas/union/toUnion.js +2 -3
  46. package/package.json +1 -1
  47. package/script/context/CoreContext.d.ts +0 -2
  48. package/script/context/CoreContext.d.ts.map +1 -1
  49. package/script/context/CoreContext.js +6 -15
  50. package/script/context/GenerateContext.d.ts +3 -5
  51. package/script/context/GenerateContext.d.ts.map +1 -1
  52. package/script/context/GenerateContext.js +22 -32
  53. package/script/context/ParseContext.d.ts +4 -5
  54. package/script/context/ParseContext.d.ts.map +1 -1
  55. package/script/context/ParseContext.js +15 -17
  56. package/script/context/RenderContext.d.ts +4 -5
  57. package/script/context/RenderContext.d.ts.map +1 -1
  58. package/script/context/RenderContext.js +17 -16
  59. package/script/helpers/tracer.d.ts +2 -6
  60. package/script/helpers/tracer.d.ts.map +1 -1
  61. package/script/helpers/tracer.js +3 -3
  62. package/script/oas/array/toArray.d.ts.map +1 -1
  63. package/script/oas/array/toArray.js +1 -2
  64. package/script/oas/components/toComponentsV3.d.ts.map +1 -1
  65. package/script/oas/components/toComponentsV3.js +5 -6
  66. package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  67. package/script/oas/document/toDocumentFieldsV3.js +4 -5
  68. package/script/oas/example/toExamplesV3.d.ts.map +1 -1
  69. package/script/oas/example/toExamplesV3.js +3 -4
  70. package/script/oas/header/toHeadersV3.d.ts.map +1 -1
  71. package/script/oas/header/toHeadersV3.js +3 -4
  72. package/script/oas/intersection/toIntersection.d.ts.map +1 -1
  73. package/script/oas/intersection/toIntersection.js +2 -3
  74. package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
  75. package/script/oas/mediaType/toMediaTypeItemV3.js +3 -4
  76. package/script/oas/object/toObject.d.ts.map +1 -1
  77. package/script/oas/object/toObject.js +2 -3
  78. package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
  79. package/script/oas/operation/toOperationsV3.js +5 -6
  80. package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
  81. package/script/oas/parameter/toParameterV3.js +7 -8
  82. package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
  83. package/script/oas/pathItem/toPathItemV3.js +1 -2
  84. package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
  85. package/script/oas/requestBody/toRequestBodiesV3.js +2 -3
  86. package/script/oas/response/toResponseV3.d.ts.map +1 -1
  87. package/script/oas/response/toResponseV3.js +3 -4
  88. package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
  89. package/script/oas/schema/toSchemasV3.js +3 -4
  90. package/script/oas/union/toUnion.d.ts.map +1 -1
  91. package/script/oas/union/toUnion.js +2 -3
@@ -33,7 +33,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
33
33
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
34
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
35
  };
36
- var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_generateModel, _GenerateContext_generateOperation;
36
+ var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_stackTrail, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_generateModel, _GenerateContext_generateOperation;
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.GenerateContext = void 0;
39
39
  const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
@@ -41,8 +41,9 @@ const Import_js_1 = require("../dsl/Import.js");
41
41
  const OperationDriver_js_1 = require("../dsl/OperationDriver.js");
42
42
  const ModelDriver_js_1 = require("../dsl/ModelDriver.js");
43
43
  const Sentry = __importStar(require("@sentry/deno"));
44
+ const tracer_js_1 = require("../helpers/tracer.js");
44
45
  class GenerateContext {
45
- constructor({ schemaModel, settings, logger, callback, captureCurrentResult, appendToStackTrail, removeFromStackTrail }) {
46
+ constructor({ schemaModel, settings, logger, callback, captureCurrentResult, stackTrail }) {
46
47
  _GenerateContext_instances.add(this);
47
48
  _GenerateContext_files.set(this, void 0);
48
49
  Object.defineProperty(this, "schemaModel", {
@@ -75,45 +76,34 @@ class GenerateContext {
75
76
  writable: true,
76
77
  value: void 0
77
78
  });
78
- Object.defineProperty(this, "appendToStackTrail", {
79
- enumerable: true,
80
- configurable: true,
81
- writable: true,
82
- value: void 0
83
- });
84
- Object.defineProperty(this, "removeFromStackTrail", {
85
- enumerable: true,
86
- configurable: true,
87
- writable: true,
88
- value: void 0
89
- });
79
+ _GenerateContext_stackTrail.set(this, void 0);
90
80
  this.logger = logger;
91
81
  __classPrivateFieldSet(this, _GenerateContext_files, new Map(), "f");
92
82
  this.schemaModel = schemaModel;
93
83
  this.settings = settings;
94
84
  this.callback = callback;
95
85
  this.captureCurrentResult = captureCurrentResult;
96
- this.appendToStackTrail = appendToStackTrail;
97
- this.removeFromStackTrail = removeFromStackTrail;
86
+ __classPrivateFieldSet(this, _GenerateContext_stackTrail, stackTrail, "f");
98
87
  }
99
88
  generate(generatorsMap) {
100
89
  Sentry.startSpan({ name: 'Generate operations' }, () => Object.values(generatorsMap)
101
90
  .filter(generator => generator.type === 'operation')
102
91
  .forEach(generator => {
103
- this.appendToStackTrail(generator.id);
104
- __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runOperationGenerator).call(this, {
92
+ (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), generator.id, () => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runOperationGenerator).call(this, {
105
93
  schemaModel: this.schemaModel,
106
94
  generator
107
- });
108
- this.removeFromStackTrail(generator.id);
95
+ }));
109
96
  }));
110
97
  Sentry.startSpan({ name: 'Generate models' }, () => {
111
98
  Object.values(generatorsMap)
112
99
  .filter(generator => generator.type === 'model')
113
100
  .forEach(generator => {
114
- this.appendToStackTrail(generator.id);
115
- __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runModelGenerator).call(this, { schemaModel: this.schemaModel, generator });
116
- this.removeFromStackTrail(generator.id);
101
+ (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), generator.id, () => {
102
+ __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runModelGenerator).call(this, {
103
+ schemaModel: this.schemaModel,
104
+ generator
105
+ });
106
+ });
117
107
  });
118
108
  });
119
109
  return __classPrivateFieldGet(this, _GenerateContext_files, "f");
@@ -230,7 +220,7 @@ class GenerateContext {
230
220
  }
231
221
  }
232
222
  exports.GenerateContext = GenerateContext;
233
- _GenerateContext_files = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_runOperationGenerator = function _GenerateContext_runOperationGenerator({ schemaModel, generator }) {
223
+ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_runOperationGenerator = function _GenerateContext_runOperationGenerator({ schemaModel, generator }) {
234
224
  const generatorInstance = new generator(this);
235
225
  schemaModel.operations.forEach(operation => {
236
226
  // TODO If we make OasOperation generic, for example by
@@ -242,21 +232,21 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_instances = new WeakSet
242
232
  // https://linear.app/skmtc/issue/SKM-32/generic-models-operations
243
233
  const { path, method } = operation;
244
234
  if (generator.isSupported(operation)) {
245
- this.appendToStackTrail([path, method]);
246
- __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateOperation).call(this, { operation, generatorInstance });
247
- this.removeFromStackTrail([path, method]);
235
+ (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), [path, method], () => {
236
+ __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateOperation).call(this, { operation, generatorInstance });
237
+ });
248
238
  }
249
239
  });
250
240
  }, _GenerateContext_runModelGenerator = function _GenerateContext_runModelGenerator({ schemaModel, generator }) {
251
241
  const generatorInstance = new generator(this);
252
242
  const refNames = Object.keys(schemaModel.components?.schemas ?? {});
253
243
  refNames.forEach(rn => {
254
- this.appendToStackTrail(rn);
255
- __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateModel).call(this, {
256
- refName: rn,
257
- generatorInstance
244
+ (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), rn, () => {
245
+ __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateModel).call(this, {
246
+ refName: rn,
247
+ generatorInstance
248
+ });
258
249
  });
259
- this.removeFromStackTrail(rn);
260
250
  });
261
251
  }, _GenerateContext_generateModel = function _GenerateContext_generateModel({ refName, generatorInstance }) {
262
252
  try {
@@ -1,21 +1,20 @@
1
1
  import type { OpenAPIV3 } from 'openapi-types';
2
2
  import { OasDocument } from '../oas/document/Document.js';
3
3
  import type * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
4
+ import type { StackTrail } from './StackTrail.js';
4
5
  type ConstructorArgs = {
5
6
  schema: string;
6
7
  logger: log.Logger;
7
- appendToStackTrail: (token: string | string[]) => void;
8
- removeFromStackTrail: (token: string | string[]) => void;
8
+ stackTrail: StackTrail;
9
9
  };
10
10
  export declare class ParseContext {
11
11
  #private;
12
12
  schema: string;
13
13
  logger: log.Logger;
14
14
  documentRoot: OasDocument;
15
- appendToStackTrail: (token: string | string[]) => void;
16
- removeFromStackTrail: (token: string | string[]) => void;
17
- constructor({ schema, logger, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
15
+ constructor({ schema, logger, stackTrail }: ConstructorArgs);
18
16
  parse(): OasDocument;
17
+ trace<T>(token: string | string[], fn: () => T): T;
19
18
  logSkippedFields(skipped: Record<string, unknown>): void;
20
19
  }
21
20
  export declare const parseSchema: (schema: string) => OpenAPIV3.Document<{}>;
@@ -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;AAElE,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,qBAAa,YAAY;;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,YAAY,EAAE,WAAW,CAAA;IACzB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;gBAE5C,EACV,MAAM,EACN,MAAM,EACN,kBAAkB,EAClB,oBAAoB,EACrB,EAAE,eAAe;IAUlB,KAAK;IA4BL,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAWlD;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,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;CAWlD;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,2BAMzC,CAAA"}
@@ -22,20 +22,27 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
+ if (kind === "m") throw new TypeError("Private method is not writable");
27
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
28
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
+ };
25
31
  var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
26
32
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
27
33
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
28
34
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
29
35
  };
30
- var _ParseContext_instances, _ParseContext_parseSchema, _ParseContext_parseDocument;
36
+ var _ParseContext_instances, _ParseContext_stackTrail, _ParseContext_parseSchema, _ParseContext_parseDocument;
31
37
  Object.defineProperty(exports, "__esModule", { value: true });
32
38
  exports.parseSchema = exports.ParseContext = void 0;
33
39
  const Sentry = __importStar(require("@sentry/deno"));
34
40
  const mod_js_1 = require("../deps/jsr.io/@std/yaml/0.215.0/mod.js");
35
41
  const toDocumentFieldsV3_js_1 = require("../oas/document/toDocumentFieldsV3.js");
36
42
  const Document_js_1 = require("../oas/document/Document.js");
43
+ const tracer_js_1 = require("../helpers/tracer.js");
37
44
  class ParseContext {
38
- constructor({ schema, logger, appendToStackTrail, removeFromStackTrail }) {
45
+ constructor({ schema, logger, stackTrail }) {
39
46
  _ParseContext_instances.add(this);
40
47
  Object.defineProperty(this, "schema", {
41
48
  enumerable: true,
@@ -55,28 +62,19 @@ class ParseContext {
55
62
  writable: true,
56
63
  value: void 0
57
64
  });
58
- Object.defineProperty(this, "appendToStackTrail", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- Object.defineProperty(this, "removeFromStackTrail", {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: void 0
69
- });
65
+ _ParseContext_stackTrail.set(this, void 0);
70
66
  this.schema = schema;
71
67
  this.logger = logger;
68
+ __classPrivateFieldSet(this, _ParseContext_stackTrail, stackTrail, "f");
72
69
  this.documentRoot = new Document_js_1.OasDocument();
73
- this.appendToStackTrail = appendToStackTrail;
74
- this.removeFromStackTrail = removeFromStackTrail;
75
70
  }
76
71
  parse() {
77
72
  const parsedDocument = __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseSchema).call(this);
78
73
  return __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseDocument).call(this, parsedDocument);
79
74
  }
75
+ trace(token, fn) {
76
+ return (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _ParseContext_stackTrail, "f"), token, fn);
77
+ }
80
78
  logSkippedFields(skipped) {
81
79
  Object.entries(skipped).forEach(([key, value]) => {
82
80
  this.logger.warn(`Property not yet implemented. Please request from support if needed - ${JSON.stringify({
@@ -86,7 +84,7 @@ class ParseContext {
86
84
  }
87
85
  }
88
86
  exports.ParseContext = ParseContext;
89
- _ParseContext_instances = new WeakSet(), _ParseContext_parseSchema = function _ParseContext_parseSchema() {
87
+ _ParseContext_stackTrail = new WeakMap(), _ParseContext_instances = new WeakSet(), _ParseContext_parseSchema = function _ParseContext_parseSchema() {
90
88
  const parsedDocument = Sentry.startSpan({ name: 'Parse schema to document' }, () => (0, exports.parseSchema)(this.schema));
91
89
  return parsedDocument;
92
90
  }, _ParseContext_parseDocument = function _ParseContext_parseDocument(parsedDocument) {
@@ -2,23 +2,22 @@ import type { PrettierConfigType } from '../types/prettierConfig.js';
2
2
  import type { AddGeneratorKeyArgs, FileContents, RenderResult } from './types.js';
3
3
  import type { Definition } from '../dsl/Definition.js';
4
4
  import type { PickArgs } from './GenerateContext.js';
5
+ import type { StackTrail } from './StackTrail.js';
5
6
  type ConstructorArgs = {
6
7
  files: Map<string, FileContents>;
7
8
  prettier?: PrettierConfigType;
8
9
  basePath: string | undefined;
9
10
  pinnableGenerators: string[];
10
- appendToStackTrail: (token: string | string[]) => void;
11
- removeFromStackTrail: (token: string | string[]) => void;
11
+ stackTrail: StackTrail;
12
12
  };
13
13
  export declare class RenderContext {
14
+ #private;
14
15
  files: Map<string, FileContents>;
15
16
  private prettier?;
16
17
  basePath: string | undefined;
17
18
  currentDestinationPath: string | 'PRE_RENDER' | 'POST_RENDER';
18
19
  pinnableGenerators: string[];
19
- appendToStackTrail: (token: string | string[]) => void;
20
- removeFromStackTrail: (token: string | string[]) => void;
21
- constructor({ files, prettier, basePath, pinnableGenerators, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
20
+ constructor({ files, prettier, basePath, pinnableGenerators, stackTrail }: ConstructorArgs);
22
21
  render(): Omit<RenderResult, 'results'>;
23
22
  private collate;
24
23
  getFile(filePath: string): FileContents;
@@ -1 +1 @@
1
- {"version":3,"file":"RenderContext.d.ts","sourceRoot":"","sources":["../../src/context/RenderContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAGpE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEZ,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAMpD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,qBAAa,aAAa;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACh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A;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,aAAa;;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAChC,OAAO,CAAC,QAAQ,CAAC,CAAoB;IACrC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,sBAAsB,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,CAAA;IAC7D,kBAAkB,EAAE,MAAM,EAAE,CAAA;gBAEhB,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACX,EAAE,eAAe;IASlB,MAAM,IAAI,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC;IAuBvC,OAAO,CAAC,OAAO;IA0Df,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY;IAavC,eAAe,CAAC,EAAE,YAAY,EAAE,EAAE,mBAAmB;IAarD,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAG7D"}
@@ -22,9 +22,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
+ if (kind === "m") throw new TypeError("Private method is not writable");
27
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
28
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
+ };
31
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
32
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
33
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
+ };
25
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
38
  };
39
+ var _RenderContext_stackTrail;
28
40
  Object.defineProperty(exports, "__esModule", { value: true });
29
41
  exports.RenderContext = void 0;
30
42
  const Sentry = __importStar(require("@sentry/deno"));
@@ -34,7 +46,7 @@ const mod_js_1 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
34
46
  const toResolvedArtifactPath_js_1 = require("../helpers/toResolvedArtifactPath.js");
35
47
  const tracer_js_1 = require("../helpers/tracer.js");
36
48
  class RenderContext {
37
- constructor({ files, prettier, basePath, pinnableGenerators, appendToStackTrail, removeFromStackTrail }) {
49
+ constructor({ files, prettier, basePath, pinnableGenerators, stackTrail }) {
38
50
  Object.defineProperty(this, "files", {
39
51
  enumerable: true,
40
52
  configurable: true,
@@ -65,25 +77,13 @@ class RenderContext {
65
77
  writable: true,
66
78
  value: void 0
67
79
  });
68
- Object.defineProperty(this, "appendToStackTrail", {
69
- enumerable: true,
70
- configurable: true,
71
- writable: true,
72
- value: void 0
73
- });
74
- Object.defineProperty(this, "removeFromStackTrail", {
75
- enumerable: true,
76
- configurable: true,
77
- writable: true,
78
- value: void 0
79
- });
80
+ _RenderContext_stackTrail.set(this, void 0);
80
81
  this.currentDestinationPath = 'PRE_RENDER';
81
82
  this.files = files;
82
83
  this.prettier = prettier;
83
84
  this.basePath = basePath;
84
85
  this.pinnableGenerators = pinnableGenerators;
85
- this.appendToStackTrail = appendToStackTrail;
86
- this.removeFromStackTrail = removeFromStackTrail;
86
+ __classPrivateFieldSet(this, _RenderContext_stackTrail, stackTrail, "f");
87
87
  }
88
88
  render() {
89
89
  return Sentry.startSpan({ name: 'Render artifacts' }, () => {
@@ -107,7 +107,7 @@ class RenderContext {
107
107
  collate() {
108
108
  const fileEntries = Array.from(this.files.entries());
109
109
  const fileObjects = fileEntries.map(([destinationPath, file]) => {
110
- return (0, tracer_js_1.tracer)(this, destinationPath, () => {
110
+ return (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _RenderContext_stackTrail, "f"), destinationPath, () => {
111
111
  // Set the current destination path to be used by
112
112
  // addGeneratorKey method to apply generator keys
113
113
  // to Correct file
@@ -168,6 +168,7 @@ class RenderContext {
168
168
  }
169
169
  }
170
170
  exports.RenderContext = RenderContext;
171
+ _RenderContext_stackTrail = new WeakMap();
171
172
  const renderFile = ({ file, destinationPath, basePath }) => {
172
173
  const imports = Array.from(file.imports.entries()).map(([module, importItems]) => new Import_js_1.Import({ module, importNames: Array.from(importItems) }));
173
174
  const definitions = Array.from(file.definitions.values());
@@ -1,7 +1,3 @@
1
- type StackTrailHandler = {
2
- appendToStackTrail: (token: string | string[]) => void;
3
- removeFromStackTrail: (token: string | string[]) => void;
4
- };
5
- export declare const tracer: <T>(context: StackTrailHandler, token: string | string[], fn: () => T) => T;
6
- export {};
1
+ import type { StackTrail } from '../context/StackTrail.js';
2
+ export declare const tracer: <T>(stackTrail: StackTrail, token: string | string[], fn: () => T) => T;
7
3
  //# sourceMappingURL=tracer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,CAAC,WACb,iBAAiB,SACnB,MAAM,GAAG,MAAM,EAAE,MACpB,MAAM,CAAC,MASZ,CAAA"}
1
+ {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,MAAM,GAAI,CAAC,cACV,UAAU,SACf,MAAM,GAAG,MAAM,EAAE,MACpB,MAAM,CAAC,MASZ,CAAA"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tracer = void 0;
4
- const tracer = (context, token, fn) => {
5
- context.appendToStackTrail(token);
4
+ const tracer = (stackTrail, token, fn) => {
5
+ stackTrail.append(token);
6
6
  const result = fn();
7
- context.removeFromStackTrail(token);
7
+ stackTrail.remove(token);
8
8
  return result;
9
9
  };
10
10
  exports.tracer = tracer;
@@ -1 +1 @@
1
- {"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../../src/oas/array/toArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAA;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,OAAO,uBAAwB,WAAW,KAAG,QA4BzD,CAAA"}
1
+ {"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../../src/oas/array/toArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAA;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,OAAO,uBAAwB,WAAW,KAAG,QA0BzD,CAAA"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toArray = void 0;
4
4
  const Array_js_1 = require("./Array.js");
5
5
  const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
6
- const tracer_js_1 = require("../../helpers/tracer.js");
7
6
  const toArray = ({ value, context }) => {
8
7
  const { type: _type, items, title, description, nullable, uniqueItems, ...skipped } = value;
9
8
  context.logSkippedFields(skipped);
@@ -15,7 +14,7 @@ const toArray = ({ value, context }) => {
15
14
  description,
16
15
  nullable,
17
16
  uniqueItems,
18
- items: (0, tracer_js_1.tracer)(context, 'items', () => (0, toSchemasV3_js_1.toSchemaV3)({ schema: items, context }))
17
+ items: context.trace('items', () => (0, toSchemasV3_js_1.toSchemaV3)({ schema: items, context }))
19
18
  };
20
19
  return new Array_js_1.OasArray(fields);
21
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toComponentsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/components/toComponentsV3.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAA;IAClD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,aAAa,GAAG,SA0CvC,CAAA"}
1
+ {"version":3,"file":"toComponentsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/components/toComponentsV3.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAA;IAClD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,aAAa,GAAG,SA0CvC,CAAA"}
@@ -8,7 +8,6 @@ const toParameterV3_js_1 = require("../parameter/toParameterV3.js");
8
8
  const toExamplesV3_js_1 = require("../example/toExamplesV3.js");
9
9
  const toRequestBodiesV3_js_1 = require("../requestBody/toRequestBodiesV3.js");
10
10
  const Components_js_1 = require("./Components.js");
11
- const tracer_js_1 = require("../../helpers/tracer.js");
12
11
  const toComponentsV3 = ({ components, context }) => {
13
12
  if (!components) {
14
13
  return undefined;
@@ -16,9 +15,9 @@ const toComponentsV3 = ({ components, context }) => {
16
15
  const { schemas, responses, parameters, examples, requestBodies, headers, ...skipped } = components;
17
16
  context.logSkippedFields(skipped);
18
17
  const fields = {
19
- schemas: (0, tracer_js_1.tracer)(context, 'schemas', () => (0, toSchemasV3_js_1.toOptionalSchemasV3)({ schemas, context })),
20
- responses: (0, tracer_js_1.tracer)(context, 'responses', () => (0, toResponseV3_js_1.toOptionalResponsesV3)({ responses, context })),
21
- parameters: (0, tracer_js_1.tracer)(context, 'parameters', () => (0, toParameterV3_js_1.toOptionalParametersV3)({
18
+ schemas: context.trace('schemas', () => (0, toSchemasV3_js_1.toOptionalSchemasV3)({ schemas, context })),
19
+ responses: context.trace('responses', () => (0, toResponseV3_js_1.toOptionalResponsesV3)({ responses, context })),
20
+ parameters: context.trace('parameters', () => (0, toParameterV3_js_1.toOptionalParametersV3)({
22
21
  parameters,
23
22
  context
24
23
  })),
@@ -28,8 +27,8 @@ const toComponentsV3 = ({ components, context }) => {
28
27
  exampleKey: 'TEMP',
29
28
  context
30
29
  }),
31
- requestBodies: (0, tracer_js_1.tracer)(context, 'requestBodies', () => (0, toRequestBodiesV3_js_1.toRequestBodiesV3)({ requestBodies, context })),
32
- headers: (0, tracer_js_1.tracer)(context, 'headers', () => (0, toHeadersV3_js_1.toHeadersV3)({ headers, context }))
30
+ requestBodies: context.trace('requestBodies', () => (0, toRequestBodiesV3_js_1.toRequestBodiesV3)({ requestBodies, context })),
31
+ headers: context.trace('headers', () => (0, toHeadersV3_js_1.toHeadersV3)({ headers, context }))
33
32
  };
34
33
  return new Components_js_1.OasComponents(fields);
35
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,0BAG5B,gBAAgB,KAAG,cAkBrB,CAAA"}
1
+ {"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,0BAG5B,gBAAgB,KAAG,cAkBrB,CAAA"}
@@ -5,16 +5,15 @@ const toTagsV3_js_1 = require("../tag/toTagsV3.js");
5
5
  const toOperationsV3_js_1 = require("../operation/toOperationsV3.js");
6
6
  const toComponentsV3_js_1 = require("../components/toComponentsV3.js");
7
7
  const toInfoV3_js_1 = require("../info/toInfoV3.js");
8
- const tracer_js_1 = require("../../helpers/tracer.js");
9
8
  const toDocumentFieldsV3 = ({ document, context }) => {
10
9
  const { openapi, info, paths, components, tags, ...skipped } = document;
11
10
  context.logSkippedFields(skipped);
12
11
  const fields = {
13
12
  openapi,
14
- info: (0, tracer_js_1.tracer)(context, 'info', () => (0, toInfoV3_js_1.toInfoV3)({ info, context })),
15
- operations: (0, tracer_js_1.tracer)(context, 'paths', () => (0, toOperationsV3_js_1.toOperationsV3)({ paths, context })),
16
- components: (0, tracer_js_1.tracer)(context, 'components', () => (0, toComponentsV3_js_1.toComponentsV3)({ components, context })),
17
- tags: (0, tracer_js_1.tracer)(context, 'tags', () => (0, toTagsV3_js_1.toTagsV3)({ tags, context }))
13
+ info: context.trace('info', () => (0, toInfoV3_js_1.toInfoV3)({ info, context })),
14
+ operations: context.trace('paths', () => (0, toOperationsV3_js_1.toOperationsV3)({ paths, context })),
15
+ components: context.trace('components', () => (0, toComponentsV3_js_1.toComponentsV3)({ components, context })),
16
+ tags: context.trace('tags', () => (0, toTagsV3_js_1.toTagsV3)({ tags, context }))
18
17
  };
19
18
  return fields;
20
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;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AAS,CAQvD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,QAAQ,EACJ,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC,GACnE,SAAS,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,+CAKtB,gBAAgB,KACf,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAC9C,SA6BH,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAA;IAC5D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAgBjD,CAAA"}
@@ -4,7 +4,6 @@ exports.toExampleV3 = exports.toExamplesV3 = exports.toExampleSimpleV3 = void 0;
4
4
  const refFns_js_1 = require("../../helpers/refFns.js");
5
5
  const toRefV31_js_1 = require("../ref/toRefV31.js");
6
6
  const Example_js_1 = require("./Example.js");
7
- const tracer_js_1 = require("../../helpers/tracer.js");
8
7
  const toExampleSimpleV3 = ({ example }) => {
9
8
  const fields = {
10
9
  value: example,
@@ -20,15 +19,15 @@ const toExamplesV3 = ({ example, examples, exampleKey, context }) => {
20
19
  }
21
20
  if (example) {
22
21
  return {
23
- [exampleKey]: (0, tracer_js_1.tracer)(context, 'example', () => (0, exports.toExampleSimpleV3)({ example }))
22
+ [exampleKey]: context.trace('example', () => (0, exports.toExampleSimpleV3)({ example }))
24
23
  };
25
24
  }
26
25
  if (examples) {
27
- (0, tracer_js_1.tracer)(context, 'examples', () => {
26
+ context.trace('examples', () => {
28
27
  return Object.fromEntries(Object.entries(examples).map(([key, value]) => {
29
28
  return [
30
29
  key,
31
- (0, tracer_js_1.tracer)(context, key, () => (0, exports.toExampleV3)({ example: value, context }))
30
+ context.trace(key, () => (0, exports.toExampleV3)({ example: value, context }))
32
31
  ];
33
32
  }));
34
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,eAAe,GAAG;IACrB,OAAO,EACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAClE,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KACd,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAC5C,SAaH,CAAA"}
1
+ {"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,eAAe,GAAG;IACrB,OAAO,EACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAClE,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KACd,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAC5C,SAaH,CAAA"}
@@ -7,7 +7,6 @@ const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
7
7
  const refFns_js_1 = require("../../helpers/refFns.js");
8
8
  const toMediaTypeItemV3_js_1 = require("../mediaType/toMediaTypeItemV3.js");
9
9
  const Header_js_1 = require("./Header.js");
10
- const tracer_js_1 = require("../../helpers/tracer.js");
11
10
  const toHeadersV3 = ({ headers, context }) => {
12
11
  if (!headers) {
13
12
  return undefined;
@@ -15,7 +14,7 @@ const toHeadersV3 = ({ headers, context }) => {
15
14
  return Object.fromEntries(Object.entries(headers).map(([key, value]) => {
16
15
  return [
17
16
  key,
18
- (0, tracer_js_1.tracer)(context, key, () => toHeaderV3({ header: value, context }))
17
+ context.trace(key, () => toHeaderV3({ header: value, context }))
19
18
  ];
20
19
  }));
21
20
  };
@@ -30,14 +29,14 @@ const toHeaderV3 = ({ header, context }) => {
30
29
  description,
31
30
  required,
32
31
  deprecated,
33
- schema: (0, tracer_js_1.tracer)(context, 'schema', () => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, context })),
32
+ schema: context.trace('schema', () => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, context })),
34
33
  examples: (0, toExamplesV3_js_1.toExamplesV3)({
35
34
  examples,
36
35
  example,
37
36
  exampleKey: `TEMP`,
38
37
  context
39
38
  }),
40
- content: (0, tracer_js_1.tracer)(context, 'content', () => (0, toMediaTypeItemV3_js_1.toOptionalMediaTypeItemsV3)({ content, context }))
39
+ content: context.trace('content', () => (0, toMediaTypeItemV3_js_1.toOptionalMediaTypeItemsV3)({ content, context }))
41
40
  };
42
41
  return new Header_js_1.OasHeader(fields);
43
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toIntersection.d.ts","sourceRoot":"","sources":["../../../src/oas/intersection/toIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAA2B,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAK5E,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAA;IAC/D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,gCAIxB,kBAAkB,KAAG,eAkBvB,CAAA"}
1
+ {"version":3,"file":"toIntersection.d.ts","sourceRoot":"","sources":["../../../src/oas/intersection/toIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAA2B,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAI5E,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAA;IAC/D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,gCAIxB,kBAAkB,KAAG,eAkBvB,CAAA"}
@@ -4,7 +4,6 @@ exports.toIntersection = void 0;
4
4
  const Intersection_js_1 = require("./Intersection.js");
5
5
  const toDiscriminatorV3_js_1 = require("../discriminator/toDiscriminatorV3.js");
6
6
  const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
7
- const tracer_js_1 = require("../../helpers/tracer.js");
8
7
  const toIntersection = ({ value, members, context }) => {
9
8
  const { discriminator, title, description, nullable, ...skipped } = value;
10
9
  context.logSkippedFields(skipped);
@@ -12,8 +11,8 @@ const toIntersection = ({ value, members, context }) => {
12
11
  title,
13
12
  description,
14
13
  nullable,
15
- discriminator: (0, tracer_js_1.tracer)(context, 'discriminator', () => (0, toDiscriminatorV3_js_1.toDiscriminatorV3)({ discriminator, context })),
16
- members: members.map((schema, index) => (0, tracer_js_1.tracer)(context, `${index}`, () => (0, toSchemasV3_js_1.toSchemaV3)({ schema, context })))
14
+ discriminator: context.trace('discriminator', () => (0, toDiscriminatorV3_js_1.toDiscriminatorV3)({ discriminator, context })),
15
+ members: members.map((schema, index) => context.trace(`${index}`, () => (0, toSchemasV3_js_1.toSchemaV3)({ schema, context })))
17
16
  };
18
17
  return new Intersection_js_1.OasIntersection(fields);
19
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toMediaTypeItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/mediaType/toMediaTypeItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAI7C,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,SAAS,CAAC,eAAe,CAAA;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,0CAI3B,qBAAqB,KAAG,YAqB1B,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;IAClD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,yBAG5B,sBAAsB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAatD,CAAA;AAED,KAAK,8BAA8B,GAAG;IACpC,OA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exports.toMediaTypeItemsV3 = exports.toMedi
4
4
  const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
5
5
  const toExamplesV3_js_1 = require("../example/toExamplesV3.js");
6
6
  const MediaType_js_1 = require("./MediaType.js");
7
- const tracer_js_1 = require("../../helpers/tracer.js");
8
7
  const toMediaTypeItemV3 = ({ mediaTypeItem, mediaType, context }) => {
9
8
  const { schema, example, examples, ...skipped } = mediaTypeItem;
10
9
  context.logSkippedFields(skipped);
11
10
  const fields = {
12
11
  mediaType,
13
- schema: (0, tracer_js_1.tracer)(context, 'schema', () => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, context })),
14
- examples: (0, tracer_js_1.tracer)(context, 'examples', () => (0, toExamplesV3_js_1.toExamplesV3)({
12
+ schema: context.trace('schema', () => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, context })),
13
+ examples: context.trace('examples', () => (0, toExamplesV3_js_1.toExamplesV3)({
15
14
  example,
16
15
  examples,
17
16
  exampleKey: mediaType,
@@ -24,7 +23,7 @@ exports.toMediaTypeItemV3 = toMediaTypeItemV3;
24
23
  const toMediaTypeItemsV3 = ({ content, context }) => {
25
24
  return Object.fromEntries(Object.entries(content).map(([mediaType, value]) => [
26
25
  mediaType,
27
- (0, tracer_js_1.tracer)(context, mediaType, () => (0, exports.toMediaTypeItemV3)({
26
+ context.trace(mediaType, () => (0, exports.toMediaTypeItemV3)({
28
27
  mediaTypeItem: value,
29
28
  mediaType,
30
29
  context
@@ -1 +1 @@
1
- {"version":3,"file":"toObject.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAA;AAK7D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,oBAAoB,CAAA;IACrC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,QAAQ,uBAAwB,YAAY,KAAG,SA+B3D,CAAA"}
1
+ {"version":3,"file":"toObject.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAA;AAI7D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,oBAAoB,CAAA;IACrC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,QAAQ,uBAAwB,YAAY,KAAG,SA+B3D,CAAA"}