@skmtc/core 0.0.314 → 0.0.317
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/context/CoreContext.d.ts +0 -2
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +9 -16
- package/esm/context/GenerateContext.d.ts +3 -5
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +22 -32
- package/esm/context/ParseContext.d.ts +4 -5
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +15 -17
- package/esm/context/RenderContext.d.ts +10 -5
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +46 -30
- package/esm/helpers/tracer.d.ts +2 -6
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +3 -3
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +1 -2
- package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
- package/esm/oas/components/toComponentsV3.js +5 -6
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.js +4 -5
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +3 -4
- package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
- package/esm/oas/header/toHeadersV3.js +3 -4
- package/esm/oas/intersection/toIntersection.d.ts.map +1 -1
- package/esm/oas/intersection/toIntersection.js +2 -3
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.js +3 -4
- package/esm/oas/object/toObject.d.ts.map +1 -1
- package/esm/oas/object/toObject.js +2 -3
- package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/esm/oas/operation/toOperationsV3.js +5 -6
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +7 -8
- package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/esm/oas/pathItem/toPathItemV3.js +1 -2
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +2 -3
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +3 -4
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +3 -4
- package/esm/oas/union/toUnion.d.ts.map +1 -1
- package/esm/oas/union/toUnion.js +2 -3
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +0 -2
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +9 -16
- package/script/context/GenerateContext.d.ts +3 -5
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +22 -32
- package/script/context/ParseContext.d.ts +4 -5
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +15 -17
- package/script/context/RenderContext.d.ts +10 -5
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +46 -30
- package/script/helpers/tracer.d.ts +2 -6
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +3 -3
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +1 -2
- package/script/oas/components/toComponentsV3.d.ts.map +1 -1
- package/script/oas/components/toComponentsV3.js +5 -6
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.js +4 -5
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +3 -4
- package/script/oas/header/toHeadersV3.d.ts.map +1 -1
- package/script/oas/header/toHeadersV3.js +3 -4
- package/script/oas/intersection/toIntersection.d.ts.map +1 -1
- package/script/oas/intersection/toIntersection.js +2 -3
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/script/oas/mediaType/toMediaTypeItemV3.js +3 -4
- package/script/oas/object/toObject.d.ts.map +1 -1
- package/script/oas/object/toObject.js +2 -3
- package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/script/oas/operation/toOperationsV3.js +5 -6
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +7 -8
- package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/script/oas/pathItem/toPathItemV3.js +1 -2
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +2 -3
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +3 -4
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +3 -4
- package/script/oas/union/toUnion.d.ts.map +1 -1
- 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,
|
|
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
|
-
|
|
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;
|
|
85
|
+
__classPrivateFieldSet(this, _GenerateContext_stackTrail, stackTrail, "f");
|
|
95
86
|
this.captureCurrentResult = captureCurrentResult;
|
|
96
|
-
this.appendToStackTrail = appendToStackTrail;
|
|
97
|
-
this.removeFromStackTrail = removeFromStackTrail;
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
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,
|
|
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
|
-
|
|
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,28 @@ 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 { SuccessWarningError } from '../types/Manifest.js';
|
|
6
|
+
import type { StackTrail } from './StackTrail.js';
|
|
7
|
+
import type * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
|
|
5
8
|
type ConstructorArgs = {
|
|
6
9
|
files: Map<string, FileContents>;
|
|
7
10
|
prettier?: PrettierConfigType;
|
|
8
11
|
basePath: string | undefined;
|
|
9
12
|
pinnableGenerators: string[];
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
stackTrail: StackTrail;
|
|
14
|
+
logger: log.Logger;
|
|
15
|
+
captureCurrentResult: (result: SuccessWarningError) => void;
|
|
12
16
|
};
|
|
13
17
|
export declare class RenderContext {
|
|
18
|
+
#private;
|
|
14
19
|
files: Map<string, FileContents>;
|
|
15
20
|
private prettier?;
|
|
16
21
|
basePath: string | undefined;
|
|
17
22
|
currentDestinationPath: string | 'PRE_RENDER' | 'POST_RENDER';
|
|
18
23
|
pinnableGenerators: string[];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
constructor({ files, prettier, basePath, pinnableGenerators,
|
|
24
|
+
logger: log.Logger;
|
|
25
|
+
captureCurrentResult: (result: SuccessWarningError) => void;
|
|
26
|
+
constructor({ files, prettier, basePath, pinnableGenerators, logger, stackTrail, captureCurrentResult }: ConstructorArgs);
|
|
22
27
|
render(): Omit<RenderResult, 'results'>;
|
|
23
28
|
private collate;
|
|
24
29
|
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;
|
|
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;AAEpD,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAElE,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,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,oBAAoB,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;CAC5D,CAAA;AAYD,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;IAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAElB,oBAAoB,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;gBAC/C,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,oBAAoB,EACrB,EAAE,eAAe;IAWlB,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,
|
|
49
|
+
constructor({ files, prettier, basePath, pinnableGenerators, logger, stackTrail, captureCurrentResult }) {
|
|
38
50
|
Object.defineProperty(this, "files", {
|
|
39
51
|
enumerable: true,
|
|
40
52
|
configurable: true,
|
|
@@ -65,13 +77,14 @@ class RenderContext {
|
|
|
65
77
|
writable: true,
|
|
66
78
|
value: void 0
|
|
67
79
|
});
|
|
68
|
-
Object.defineProperty(this, "
|
|
80
|
+
Object.defineProperty(this, "logger", {
|
|
69
81
|
enumerable: true,
|
|
70
82
|
configurable: true,
|
|
71
83
|
writable: true,
|
|
72
84
|
value: void 0
|
|
73
85
|
});
|
|
74
|
-
|
|
86
|
+
_RenderContext_stackTrail.set(this, void 0);
|
|
87
|
+
Object.defineProperty(this, "captureCurrentResult", {
|
|
75
88
|
enumerable: true,
|
|
76
89
|
configurable: true,
|
|
77
90
|
writable: true,
|
|
@@ -82,8 +95,9 @@ class RenderContext {
|
|
|
82
95
|
this.prettier = prettier;
|
|
83
96
|
this.basePath = basePath;
|
|
84
97
|
this.pinnableGenerators = pinnableGenerators;
|
|
85
|
-
this.
|
|
86
|
-
this
|
|
98
|
+
this.logger = logger;
|
|
99
|
+
__classPrivateFieldSet(this, _RenderContext_stackTrail, stackTrail, "f");
|
|
100
|
+
this.captureCurrentResult = captureCurrentResult;
|
|
87
101
|
}
|
|
88
102
|
render() {
|
|
89
103
|
return Sentry.startSpan({ name: 'Render artifacts' }, () => {
|
|
@@ -106,43 +120,43 @@ class RenderContext {
|
|
|
106
120
|
}
|
|
107
121
|
collate() {
|
|
108
122
|
const fileEntries = Array.from(this.files.entries());
|
|
109
|
-
const fileObjects = fileEntries
|
|
110
|
-
|
|
123
|
+
const fileObjects = fileEntries
|
|
124
|
+
.map(([destinationPath, file]) => {
|
|
125
|
+
return (0, tracer_js_1.tracer)(__classPrivateFieldGet(this, _RenderContext_stackTrail, "f"), destinationPath, () => {
|
|
111
126
|
// Set the current destination path to be used by
|
|
112
127
|
// addGeneratorKey method to apply generator keys
|
|
113
128
|
// to Correct file
|
|
114
129
|
// @TODO: Could this be combined with the tracer call above?
|
|
115
130
|
this.currentDestinationPath = destinationPath;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
131
|
+
try {
|
|
132
|
+
const renderedFile = renderFile({
|
|
133
|
+
file,
|
|
134
|
+
destinationPath,
|
|
135
|
+
basePath: this.basePath,
|
|
136
|
+
prettier: this.prettier
|
|
137
|
+
});
|
|
138
|
+
this.captureCurrentResult('success');
|
|
139
|
+
return renderedFile;
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
this.logger.error(error);
|
|
143
|
+
this.captureCurrentResult('error');
|
|
144
|
+
Sentry.captureException(error);
|
|
145
|
+
}
|
|
122
146
|
});
|
|
123
|
-
})
|
|
147
|
+
})
|
|
148
|
+
.filter(fileObject => fileObject !== undefined);
|
|
124
149
|
this.currentDestinationPath = 'POST_RENDER';
|
|
125
|
-
|
|
126
|
-
for (const fileObject of fileObjects) {
|
|
127
|
-
resolvedFileObjects.push({
|
|
128
|
-
...fileObject,
|
|
129
|
-
hash: 'ADD LATER'
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return resolvedFileObjects.reduce((acc, fileObject) => ({
|
|
150
|
+
return fileObjects.reduce((acc, { content, path, ...fileMeta }) => ({
|
|
133
151
|
...acc,
|
|
134
152
|
artifacts: {
|
|
135
153
|
...acc.artifacts,
|
|
136
|
-
[
|
|
154
|
+
[path]: content
|
|
137
155
|
},
|
|
138
156
|
files: {
|
|
139
157
|
...acc.files,
|
|
140
|
-
[
|
|
141
|
-
|
|
142
|
-
numberOfLines: fileObject.numberOfLines,
|
|
143
|
-
numberOfCharacters: fileObject.numberOfCharacters,
|
|
144
|
-
hash: fileObject.hash,
|
|
145
|
-
generatorKeys: fileObject.generatorKeys
|
|
158
|
+
[path]: {
|
|
159
|
+
...fileMeta
|
|
146
160
|
}
|
|
147
161
|
}
|
|
148
162
|
}), {
|
|
@@ -168,6 +182,7 @@ class RenderContext {
|
|
|
168
182
|
}
|
|
169
183
|
}
|
|
170
184
|
exports.RenderContext = RenderContext;
|
|
185
|
+
_RenderContext_stackTrail = new WeakMap();
|
|
171
186
|
const renderFile = ({ file, destinationPath, basePath }) => {
|
|
172
187
|
const imports = Array.from(file.imports.entries()).map(([module, importItems]) => new Import_js_1.Import({ module, importNames: Array.from(importItems) }));
|
|
173
188
|
const definitions = Array.from(file.definitions.values());
|
|
@@ -181,7 +196,8 @@ const renderFile = ({ file, destinationPath, basePath }) => {
|
|
|
181
196
|
destinationPath,
|
|
182
197
|
numberOfLines: content.split('\n').length,
|
|
183
198
|
numberOfCharacters: content.length,
|
|
184
|
-
generatorKeys: Array.from(file.generatorKeys).filter(Boolean)
|
|
199
|
+
generatorKeys: Array.from(file.generatorKeys).filter(Boolean),
|
|
200
|
+
hash: 'PLACEHOLDER'
|
|
185
201
|
};
|
|
186
202
|
};
|
|
187
203
|
const generatePinnable = ({ pinnableGenerators, files }) => {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
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,
|
|
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"}
|
package/script/helpers/tracer.js
CHANGED
|
@@ -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 = (
|
|
5
|
-
|
|
4
|
+
const tracer = (stackTrail, token, fn) => {
|
|
5
|
+
stackTrail.append(token);
|
|
6
6
|
const result = fn();
|
|
7
|
-
|
|
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;
|
|
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:
|
|
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;
|
|
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:
|
|
20
|
-
responses:
|
|
21
|
-
parameters:
|
|
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:
|
|
32
|
-
headers:
|
|
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;
|
|
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:
|
|
15
|
-
operations:
|
|
16
|
-
components:
|
|
17
|
-
tags:
|
|
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;
|
|
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;AAE3C,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,iBAAiB,gBAE3B,qBAAqB,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,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]:
|
|
22
|
+
[exampleKey]: context.trace('example', () => (0, exports.toExampleSimpleV3)({ example }))
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
if (examples) {
|
|
27
|
-
|
|
26
|
+
context.trace('examples', () => {
|
|
28
27
|
return Object.fromEntries(Object.entries(examples).map(([key, value]) => {
|
|
29
28
|
return [
|
|
30
29
|
key,
|
|
31
|
-
|
|
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;
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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;
|
|
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"}
|