@skmtc/core 0.0.940 → 0.0.941
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 +6 -32
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +15 -60
- package/esm/context/GenerateContext.d.ts +4 -15
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +16 -35
- package/esm/context/ParseContext.d.ts +5 -9
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +11 -18
- package/esm/context/RenderContext.d.ts +6 -209
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +8 -215
- package/esm/context/ResultsHandler.d.ts +0 -67
- package/esm/context/ResultsHandler.d.ts.map +1 -1
- package/esm/context/ResultsHandler.js +2 -68
- package/esm/context/StackTrail.d.ts +2 -0
- package/esm/context/StackTrail.d.ts.map +1 -1
- package/esm/context/StackTrail.js +26 -0
- package/esm/context/generateTypes.d.ts +2 -2
- package/esm/context/generateTypes.d.ts.map +1 -1
- package/esm/context/parseTypes.d.ts +7 -2
- package/esm/context/parseTypes.d.ts.map +1 -1
- package/esm/oas/_helpers/parseEnum.d.ts +3 -1
- package/esm/oas/_helpers/parseEnum.d.ts.map +1 -1
- package/esm/oas/_helpers/parseEnum.js +2 -1
- package/esm/oas/_helpers/parseNullable.d.ts +4 -1
- package/esm/oas/_helpers/parseNullable.d.ts.map +1 -1
- package/esm/oas/_helpers/parseNullable.js +2 -1
- package/esm/oas/array/toArray.d.ts +5 -2
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +16 -9
- package/esm/oas/boolean/toBoolean.d.ts +5 -2
- package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.js +16 -8
- package/esm/oas/components/toComponentsV3.d.ts +3 -1
- package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
- package/esm/oas/components/toComponentsV3.js +9 -8
- package/esm/oas/contact/toContactV3.d.ts +2 -1
- package/esm/oas/contact/toContactV3.d.ts.map +1 -1
- package/esm/oas/contact/toContactV3.js +2 -1
- package/esm/oas/discriminator/toDiscriminatorV3.d.ts +3 -1
- package/esm/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/esm/oas/discriminator/toDiscriminatorV3.js +7 -2
- package/esm/oas/document/toDocumentFieldsV3.d.ts +3 -1
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.js +10 -9
- package/esm/oas/example/toExamplesV3.d.ts +10 -2
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +8 -7
- package/esm/oas/externalDocs/toExternalDocs.d.ts +3 -1
- package/esm/oas/externalDocs/toExternalDocs.d.ts.map +1 -1
- package/esm/oas/externalDocs/toExternalDocs.js +1 -1
- package/esm/oas/header/toHeadersV3.d.ts +3 -1
- package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
- package/esm/oas/header/toHeadersV3.js +8 -7
- package/esm/oas/info/toInfoV3.d.ts +3 -1
- package/esm/oas/info/toInfoV3.d.ts.map +1 -1
- package/esm/oas/info/toInfoV3.js +4 -3
- package/esm/oas/integer/toInteger.d.ts +5 -2
- package/esm/oas/integer/toInteger.d.ts.map +1 -1
- package/esm/oas/integer/toInteger.js +17 -9
- package/esm/oas/license/toLicenseV3.d.ts +2 -1
- package/esm/oas/license/toLicenseV3.d.ts.map +1 -1
- package/esm/oas/license/toLicenseV3.js +2 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts +10 -3
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.js +9 -8
- package/esm/oas/number/toNumber.d.ts +3 -1
- package/esm/oas/number/toNumber.d.ts.map +1 -1
- package/esm/oas/number/toNumber.js +15 -7
- package/esm/oas/object/toAdditionalPropertiesV3.d.ts +3 -1
- package/esm/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/esm/oas/object/toAdditionalPropertiesV3.js +2 -2
- package/esm/oas/object/toObject.d.ts +3 -1
- package/esm/oas/object/toObject.d.ts.map +1 -1
- package/esm/oas/object/toObject.js +15 -9
- package/esm/oas/operation/toOperationsV3.d.ts +5 -2
- package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/esm/oas/operation/toOperationsV3.js +14 -12
- package/esm/oas/parameter/toParameterV3.d.ts +7 -3
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +18 -16
- package/esm/oas/pathItem/toPathItemV3.d.ts +3 -1
- package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/esm/oas/pathItem/toPathItemV3.js +3 -3
- package/esm/oas/ref/toRefV31.d.ts +3 -1
- package/esm/oas/ref/toRefV31.d.ts.map +1 -1
- package/esm/oas/ref/toRefV31.js +3 -3
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts +5 -2
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +7 -7
- package/esm/oas/response/toResponseV3.d.ts +7 -3
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +10 -9
- package/esm/oas/schema/toSchemasV3.d.ts +9 -4
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +33 -25
- package/esm/oas/securityRequirement/toSecurityRequirement.d.ts +3 -1
- package/esm/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -1
- package/esm/oas/securityRequirement/toSecurityRequirement.js +1 -1
- package/esm/oas/securitySchemes/toSecuritySchemes.d.ts +3 -1
- package/esm/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -1
- package/esm/oas/securitySchemes/toSecuritySchemes.js +23 -8
- package/esm/oas/server/toServerV3.d.ts +7 -3
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/server/toServerV3.js +7 -7
- package/esm/oas/serverVariable/toServerVariableV3.d.ts +7 -3
- package/esm/oas/serverVariable/toServerVariableV3.d.ts.map +1 -1
- package/esm/oas/serverVariable/toServerVariableV3.js +6 -5
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
- package/esm/oas/string/toString.d.ts +6 -2
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +18 -9
- package/esm/oas/tag/toTagsV3.d.ts +5 -2
- package/esm/oas/tag/toTagsV3.d.ts.map +1 -1
- package/esm/oas/tag/toTagsV3.js +4 -3
- package/esm/oas/union/toUnion.d.ts +3 -1
- package/esm/oas/union/toUnion.d.ts.map +1 -1
- package/esm/oas/union/toUnion.js +4 -4
- package/esm/oas/unknown/toUnknown.d.ts +3 -1
- package/esm/oas/unknown/toUnknown.d.ts.map +1 -1
- package/esm/oas/unknown/toUnknown.js +2 -1
- package/esm/run/toArtifacts.d.ts +4 -1
- package/esm/run/toArtifacts.d.ts.map +1 -1
- package/esm/run/toArtifacts.js +2 -1
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +6 -32
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +15 -60
- package/script/context/GenerateContext.d.ts +4 -15
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +16 -35
- package/script/context/ParseContext.d.ts +5 -9
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +11 -18
- package/script/context/RenderContext.d.ts +6 -209
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +8 -215
- package/script/context/ResultsHandler.d.ts +0 -67
- package/script/context/ResultsHandler.d.ts.map +1 -1
- package/script/context/ResultsHandler.js +2 -68
- package/script/context/StackTrail.d.ts +2 -0
- package/script/context/StackTrail.d.ts.map +1 -1
- package/script/context/StackTrail.js +26 -0
- package/script/context/generateTypes.d.ts +2 -2
- package/script/context/generateTypes.d.ts.map +1 -1
- package/script/context/parseTypes.d.ts +7 -2
- package/script/context/parseTypes.d.ts.map +1 -1
- package/script/oas/_helpers/parseEnum.d.ts +3 -1
- package/script/oas/_helpers/parseEnum.d.ts.map +1 -1
- package/script/oas/_helpers/parseEnum.js +2 -1
- package/script/oas/_helpers/parseNullable.d.ts +4 -1
- package/script/oas/_helpers/parseNullable.d.ts.map +1 -1
- package/script/oas/_helpers/parseNullable.js +2 -1
- package/script/oas/array/toArray.d.ts +5 -2
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +16 -9
- package/script/oas/boolean/toBoolean.d.ts +5 -2
- package/script/oas/boolean/toBoolean.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.js +16 -8
- package/script/oas/components/toComponentsV3.d.ts +3 -1
- package/script/oas/components/toComponentsV3.d.ts.map +1 -1
- package/script/oas/components/toComponentsV3.js +9 -8
- package/script/oas/contact/toContactV3.d.ts +2 -1
- package/script/oas/contact/toContactV3.d.ts.map +1 -1
- package/script/oas/contact/toContactV3.js +2 -1
- package/script/oas/discriminator/toDiscriminatorV3.d.ts +3 -1
- package/script/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/script/oas/discriminator/toDiscriminatorV3.js +7 -2
- package/script/oas/document/toDocumentFieldsV3.d.ts +3 -1
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.js +10 -9
- package/script/oas/example/toExamplesV3.d.ts +10 -2
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +8 -7
- package/script/oas/externalDocs/toExternalDocs.d.ts +3 -1
- package/script/oas/externalDocs/toExternalDocs.d.ts.map +1 -1
- package/script/oas/externalDocs/toExternalDocs.js +1 -1
- package/script/oas/header/toHeadersV3.d.ts +3 -1
- package/script/oas/header/toHeadersV3.d.ts.map +1 -1
- package/script/oas/header/toHeadersV3.js +8 -7
- package/script/oas/info/toInfoV3.d.ts +3 -1
- package/script/oas/info/toInfoV3.d.ts.map +1 -1
- package/script/oas/info/toInfoV3.js +4 -3
- package/script/oas/integer/toInteger.d.ts +5 -2
- package/script/oas/integer/toInteger.d.ts.map +1 -1
- package/script/oas/integer/toInteger.js +17 -9
- package/script/oas/license/toLicenseV3.d.ts +2 -1
- package/script/oas/license/toLicenseV3.d.ts.map +1 -1
- package/script/oas/license/toLicenseV3.js +2 -1
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts +10 -3
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/script/oas/mediaType/toMediaTypeItemV3.js +9 -8
- package/script/oas/number/toNumber.d.ts +3 -1
- package/script/oas/number/toNumber.d.ts.map +1 -1
- package/script/oas/number/toNumber.js +15 -7
- package/script/oas/object/toAdditionalPropertiesV3.d.ts +3 -1
- package/script/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/script/oas/object/toAdditionalPropertiesV3.js +2 -2
- package/script/oas/object/toObject.d.ts +3 -1
- package/script/oas/object/toObject.d.ts.map +1 -1
- package/script/oas/object/toObject.js +15 -9
- package/script/oas/operation/toOperationsV3.d.ts +5 -2
- package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/script/oas/operation/toOperationsV3.js +14 -12
- package/script/oas/parameter/toParameterV3.d.ts +7 -3
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +18 -16
- package/script/oas/pathItem/toPathItemV3.d.ts +3 -1
- package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/script/oas/pathItem/toPathItemV3.js +3 -3
- package/script/oas/ref/toRefV31.d.ts +3 -1
- package/script/oas/ref/toRefV31.d.ts.map +1 -1
- package/script/oas/ref/toRefV31.js +3 -3
- package/script/oas/requestBody/toRequestBodiesV3.d.ts +5 -2
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +7 -7
- package/script/oas/response/toResponseV3.d.ts +7 -3
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +10 -9
- package/script/oas/schema/toSchemasV3.d.ts +9 -4
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +33 -25
- package/script/oas/securityRequirement/toSecurityRequirement.d.ts +3 -1
- package/script/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -1
- package/script/oas/securityRequirement/toSecurityRequirement.js +1 -1
- package/script/oas/securitySchemes/toSecuritySchemes.d.ts +3 -1
- package/script/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -1
- package/script/oas/securitySchemes/toSecuritySchemes.js +23 -8
- package/script/oas/server/toServerV3.d.ts +7 -3
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/server/toServerV3.js +7 -7
- package/script/oas/serverVariable/toServerVariableV3.d.ts +7 -3
- package/script/oas/serverVariable/toServerVariableV3.d.ts.map +1 -1
- package/script/oas/serverVariable/toServerVariableV3.js +6 -5
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
- package/script/oas/string/toString.d.ts +6 -2
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +18 -9
- package/script/oas/tag/toTagsV3.d.ts +5 -2
- package/script/oas/tag/toTagsV3.d.ts.map +1 -1
- package/script/oas/tag/toTagsV3.js +4 -3
- package/script/oas/union/toUnion.d.ts +3 -1
- package/script/oas/union/toUnion.d.ts.map +1 -1
- package/script/oas/union/toUnion.js +4 -4
- package/script/oas/unknown/toUnknown.d.ts +3 -1
- package/script/oas/unknown/toUnknown.d.ts.map +1 -1
- package/script/oas/unknown/toUnknown.js +2 -1
- package/script/run/toArtifacts.d.ts +4 -1
- package/script/run/toArtifacts.d.ts.map +1 -1
- package/script/run/toArtifacts.js +2 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasMediaType } from './MediaType.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
/**
|
|
5
6
|
* Arguments for transforming an OpenAPI v3 media type item into an OAS media type.
|
|
6
7
|
*/
|
|
@@ -9,6 +10,8 @@ type ToMediaTypeItemV3Args = {
|
|
|
9
10
|
mediaTypeItem: OpenAPIV3.MediaTypeObject;
|
|
10
11
|
/** The media type string (e.g., 'application/json', 'text/plain') */
|
|
11
12
|
mediaType: string;
|
|
13
|
+
/** The stack trail for tracing */
|
|
14
|
+
stackTrail: StackTrail;
|
|
12
15
|
/** The parsing context for tracing and processing */
|
|
13
16
|
context: ParseContextType;
|
|
14
17
|
};
|
|
@@ -114,13 +117,15 @@ type ToMediaTypeItemV3Args = {
|
|
|
114
117
|
* console.log(Object.keys(result.examples)); // ['success', 'error']
|
|
115
118
|
* ```
|
|
116
119
|
*/
|
|
117
|
-
export declare const toMediaTypeItemV3: ({ mediaTypeItem, mediaType, context }: ToMediaTypeItemV3Args) => OasMediaType;
|
|
120
|
+
export declare const toMediaTypeItemV3: ({ mediaTypeItem, mediaType, stackTrail, context }: ToMediaTypeItemV3Args) => OasMediaType;
|
|
118
121
|
/**
|
|
119
122
|
* Arguments for transforming multiple OpenAPI v3 media type items.
|
|
120
123
|
*/
|
|
121
124
|
type ToMediaTypeItemsV3Args = {
|
|
122
125
|
/** Map of media type strings to OpenAPI v3 MediaType objects */
|
|
123
126
|
content: Record<string, OpenAPIV3.MediaTypeObject>;
|
|
127
|
+
/** The stack trail for tracing */
|
|
128
|
+
stackTrail: StackTrail;
|
|
124
129
|
/** The parsing context for tracing and processing */
|
|
125
130
|
context: ParseContextType;
|
|
126
131
|
};
|
|
@@ -207,13 +212,15 @@ type ToMediaTypeItemsV3Args = {
|
|
|
207
212
|
* console.log(processed['application/x-www-form-urlencoded'].encoding); // Form encoding config
|
|
208
213
|
* ```
|
|
209
214
|
*/
|
|
210
|
-
export declare const toMediaTypeItemsV3: ({ content, context }: ToMediaTypeItemsV3Args) => Record<string, OasMediaType>;
|
|
215
|
+
export declare const toMediaTypeItemsV3: ({ content, stackTrail, context }: ToMediaTypeItemsV3Args) => Record<string, OasMediaType>;
|
|
211
216
|
/**
|
|
212
217
|
* Arguments for optionally transforming OpenAPI v3 media type items.
|
|
213
218
|
*/
|
|
214
219
|
type ToOptionalMediaTypeItemsV3Args = {
|
|
215
220
|
/** Optional map of media type strings to OpenAPI v3 MediaType objects */
|
|
216
221
|
content: Record<string, OpenAPIV3.MediaTypeObject> | undefined;
|
|
222
|
+
/** The stack trail for tracing */
|
|
223
|
+
stackTrail: StackTrail;
|
|
217
224
|
/** The parsing context for tracing and processing */
|
|
218
225
|
context: ParseContextType;
|
|
219
226
|
};
|
|
@@ -304,6 +311,6 @@ type ToOptionalMediaTypeItemsV3Args = {
|
|
|
304
311
|
* }
|
|
305
312
|
* ```
|
|
306
313
|
*/
|
|
307
|
-
export declare const toOptionalMediaTypeItemsV3: ({ content, context }: ToOptionalMediaTypeItemsV3Args) => Record<string, OasMediaType> | undefined;
|
|
314
|
+
export declare const toOptionalMediaTypeItemsV3: ({ content, stackTrail, context }: ToOptionalMediaTypeItemsV3Args) => Record<string, OasMediaType> | undefined;
|
|
308
315
|
export {};
|
|
309
316
|
//# sourceMappingURL=toMediaTypeItemV3.d.ts.map
|
|
@@ -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,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
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,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B,oDAAoD;IACpD,aAAa,EAAE,SAAS,CAAC,eAAe,CAAA;IACxC,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AACH,eAAO,MAAM,iBAAiB,GAAI,mDAK/B,qBAAqB,KAAG,YA8B1B,CAAA;AAED;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;IAClD,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,eAAO,MAAM,kBAAkB,GAAI,kCAIhC,sBAAsB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAWtD,CAAA;AAED;;GAEG;AACH,KAAK,8BAA8B,GAAG;IACpC,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC9D,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,eAAO,MAAM,0BAA0B,GAAI,kCAIxC,8BAA8B,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAMlE,CAAA"}
|
|
@@ -5,7 +5,6 @@ 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
7
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
8
|
-
const tracer_js_1 = require("../../helpers/tracer.js");
|
|
9
8
|
/**
|
|
10
9
|
* Transforms an OpenAPI v3 media type object into an internal OAS media type representation.
|
|
11
10
|
*
|
|
@@ -108,22 +107,24 @@ const tracer_js_1 = require("../../helpers/tracer.js");
|
|
|
108
107
|
* console.log(Object.keys(result.examples)); // ['success', 'error']
|
|
109
108
|
* ```
|
|
110
109
|
*/
|
|
111
|
-
const toMediaTypeItemV3 = ({ mediaTypeItem, mediaType, context }) => {
|
|
110
|
+
const toMediaTypeItemV3 = ({ mediaTypeItem, mediaType, stackTrail, context }) => {
|
|
112
111
|
const { schema, example, examples, encoding, ...skipped } = mediaTypeItem;
|
|
113
112
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
114
113
|
skipped,
|
|
115
114
|
parent: mediaTypeItem,
|
|
116
115
|
context,
|
|
116
|
+
stackTrail,
|
|
117
117
|
parentType: 'mediaType'
|
|
118
118
|
});
|
|
119
119
|
const fields = {
|
|
120
120
|
mediaType,
|
|
121
121
|
encoding,
|
|
122
|
-
schema:
|
|
123
|
-
examples:
|
|
122
|
+
schema: stackTrail.trace('schema', st => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, stackTrail: st, context })),
|
|
123
|
+
examples: stackTrail.trace('examples', st => (0, toExamplesV3_js_1.toExamplesV3)({
|
|
124
124
|
example,
|
|
125
125
|
examples,
|
|
126
126
|
exampleKey: mediaType,
|
|
127
|
+
stackTrail: st,
|
|
127
128
|
context
|
|
128
129
|
})),
|
|
129
130
|
extensionFields
|
|
@@ -214,11 +215,11 @@ exports.toMediaTypeItemV3 = toMediaTypeItemV3;
|
|
|
214
215
|
* console.log(processed['application/x-www-form-urlencoded'].encoding); // Form encoding config
|
|
215
216
|
* ```
|
|
216
217
|
*/
|
|
217
|
-
const toMediaTypeItemsV3 = ({ content, context }) => {
|
|
218
|
+
const toMediaTypeItemsV3 = ({ content, stackTrail, context }) => {
|
|
218
219
|
const output = {};
|
|
219
220
|
const entries = Object.entries(content);
|
|
220
221
|
for (const [mediaType, value] of entries) {
|
|
221
|
-
output[mediaType] =
|
|
222
|
+
output[mediaType] = stackTrail.trace(mediaType, st => (0, exports.toMediaTypeItemV3)({ mediaTypeItem: value, mediaType, stackTrail: st, context }));
|
|
222
223
|
}
|
|
223
224
|
return output;
|
|
224
225
|
};
|
|
@@ -310,10 +311,10 @@ exports.toMediaTypeItemsV3 = toMediaTypeItemsV3;
|
|
|
310
311
|
* }
|
|
311
312
|
* ```
|
|
312
313
|
*/
|
|
313
|
-
const toOptionalMediaTypeItemsV3 = ({ content, context }) => {
|
|
314
|
+
const toOptionalMediaTypeItemsV3 = ({ content, stackTrail, context }) => {
|
|
314
315
|
if (!content) {
|
|
315
316
|
return;
|
|
316
317
|
}
|
|
317
|
-
return (0, exports.toMediaTypeItemsV3)({ content, context });
|
|
318
|
+
return (0, exports.toMediaTypeItemsV3)({ content, stackTrail, context });
|
|
318
319
|
};
|
|
319
320
|
exports.toOptionalMediaTypeItemsV3 = toOptionalMediaTypeItemsV3;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasNumber } from './Number.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToNumberArgs = {
|
|
5
6
|
value: OpenAPIV3.SchemaObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toNumber: ({ context, value }: ToNumberArgs) => OasNumber;
|
|
10
|
+
export declare const toNumber: ({ context, value, stackTrail }: ToNumberArgs) => OasNumber;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toNumber.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toNumber.d.ts","sourceRoot":"","sources":["../../../src/oas/number/toNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAMvC,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"toNumber.d.ts","sourceRoot":"","sources":["../../../src/oas/number/toNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAMvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,gCAAgC,YAAY,KAAG,SAqCvE,CAAA"}
|
|
@@ -40,22 +40,25 @@ const number_types_js_1 = require("./number-types.js");
|
|
|
40
40
|
const parseNullable_js_1 = require("../_helpers/parseNullable.js");
|
|
41
41
|
const parseEnum_js_1 = require("../_helpers/parseEnum.js");
|
|
42
42
|
const v = __importStar(require("valibot"));
|
|
43
|
-
const toNumber = ({ context, value }) => {
|
|
43
|
+
const toNumber = ({ context, value, stackTrail }) => {
|
|
44
44
|
const { nullable, value: valueWithoutNullable } = (0, parseNullable_js_1.parseNullable)({
|
|
45
45
|
value,
|
|
46
|
-
context
|
|
46
|
+
context,
|
|
47
|
+
stackTrail
|
|
47
48
|
});
|
|
48
49
|
const { example: unparsedExample, ...valueWithoutExample } = valueWithoutNullable;
|
|
49
50
|
const example = parseExample({
|
|
50
51
|
example: unparsedExample,
|
|
51
52
|
context,
|
|
52
53
|
parent: valueWithoutNullable,
|
|
53
|
-
nullable
|
|
54
|
+
nullable,
|
|
55
|
+
stackTrail
|
|
54
56
|
});
|
|
55
57
|
const { enum: unparsedEnums, ...valueWithoutEnums } = valueWithoutExample;
|
|
56
58
|
const enums = (0, parseEnum_js_1.parseEnum)({
|
|
57
59
|
value: unparsedEnums,
|
|
58
60
|
nullable,
|
|
61
|
+
stackTrail,
|
|
59
62
|
parent: valueWithoutExample,
|
|
60
63
|
context,
|
|
61
64
|
check: isNumber,
|
|
@@ -66,15 +69,17 @@ const toNumber = ({ context, value }) => {
|
|
|
66
69
|
nullable,
|
|
67
70
|
example,
|
|
68
71
|
enums,
|
|
69
|
-
value: valueWithoutEnums
|
|
72
|
+
value: valueWithoutEnums,
|
|
73
|
+
stackTrail
|
|
70
74
|
});
|
|
71
75
|
};
|
|
72
76
|
exports.toNumber = toNumber;
|
|
73
|
-
const toParsedNumber = ({ context, nullable, example, enums, value: valueWithoutEnums }) => {
|
|
77
|
+
const toParsedNumber = ({ context, nullable, example, enums, value: valueWithoutEnums, stackTrail }) => {
|
|
74
78
|
const { format: unparsedFormat, ...valueWithoutFormat } = valueWithoutEnums;
|
|
75
79
|
const format = parseNumberFormat({
|
|
76
80
|
format: unparsedFormat,
|
|
77
81
|
context,
|
|
82
|
+
stackTrail,
|
|
78
83
|
parent: valueWithoutEnums
|
|
79
84
|
});
|
|
80
85
|
if (!v.is(number_types_js_1.oasNumberData, valueWithoutFormat)) {
|
|
@@ -85,6 +90,7 @@ const toParsedNumber = ({ context, nullable, example, enums, value: valueWithout
|
|
|
85
90
|
skipped,
|
|
86
91
|
parent: valueWithoutFormat,
|
|
87
92
|
context,
|
|
93
|
+
stackTrail,
|
|
88
94
|
parentType: 'schema:number'
|
|
89
95
|
});
|
|
90
96
|
return new Number_js_1.OasNumber({
|
|
@@ -106,7 +112,7 @@ const toParsedNumber = ({ context, nullable, example, enums, value: valueWithout
|
|
|
106
112
|
deprecated
|
|
107
113
|
});
|
|
108
114
|
};
|
|
109
|
-
const parseNumberFormat = ({ format, context, parent }) => {
|
|
115
|
+
const parseNumberFormat = ({ format, context, parent, stackTrail }) => {
|
|
110
116
|
if (format === undefined) {
|
|
111
117
|
return undefined;
|
|
112
118
|
}
|
|
@@ -116,13 +122,14 @@ const parseNumberFormat = ({ format, context, parent }) => {
|
|
|
116
122
|
level: 'warning',
|
|
117
123
|
message: `Invalid format: ${format}`,
|
|
118
124
|
parent,
|
|
125
|
+
stackTrail,
|
|
119
126
|
type: 'INVALID_FORMAT'
|
|
120
127
|
});
|
|
121
128
|
return undefined;
|
|
122
129
|
}
|
|
123
130
|
return format;
|
|
124
131
|
};
|
|
125
|
-
const parseExample = ({ example, context, parent, nullable }) => {
|
|
132
|
+
const parseExample = ({ example, context, parent, nullable, stackTrail }) => {
|
|
126
133
|
if (example === undefined) {
|
|
127
134
|
return undefined;
|
|
128
135
|
}
|
|
@@ -135,6 +142,7 @@ const parseExample = ({ example, context, parent, nullable }) => {
|
|
|
135
142
|
level: 'warning',
|
|
136
143
|
message: `Removed invalid example. Expected "number", got: ${example}`,
|
|
137
144
|
parent,
|
|
145
|
+
stackTrail,
|
|
138
146
|
type: 'INVALID_EXAMPLE'
|
|
139
147
|
});
|
|
140
148
|
return undefined;
|
|
@@ -2,10 +2,12 @@ import type { OpenAPIV3 } from 'openapi-types';
|
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import type { OasSchema } from '../schema/Schema.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToAdditionalPropertiesV3Args = {
|
|
6
7
|
additionalProperties: boolean | OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
context: ParseContextType;
|
|
8
10
|
};
|
|
9
|
-
export declare const toAdditionalPropertiesV3: ({ additionalProperties, context }: ToAdditionalPropertiesV3Args) => OasSchema | OasRef<"schema"> | boolean | undefined;
|
|
11
|
+
export declare const toAdditionalPropertiesV3: ({ additionalProperties, stackTrail, context }: ToAdditionalPropertiesV3Args) => OasSchema | OasRef<"schema"> | boolean | undefined;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=toAdditionalPropertiesV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IAC9F,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,+CAItC,4BAA4B,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,GAAG,SAU1E,CAAA"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toAdditionalPropertiesV3 = void 0;
|
|
4
4
|
const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
|
|
5
|
-
const toAdditionalPropertiesV3 = ({ additionalProperties, context }) => {
|
|
5
|
+
const toAdditionalPropertiesV3 = ({ additionalProperties, stackTrail, context }) => {
|
|
6
6
|
if (typeof additionalProperties === 'boolean') {
|
|
7
7
|
return additionalProperties;
|
|
8
8
|
}
|
|
9
9
|
if (additionalProperties === undefined) {
|
|
10
10
|
return undefined;
|
|
11
11
|
}
|
|
12
|
-
return (0, toSchemasV3_js_1.toSchemaV3)({ schema: additionalProperties, context });
|
|
12
|
+
return (0, toSchemasV3_js_1.toSchemaV3)({ schema: additionalProperties, stackTrail, context });
|
|
13
13
|
};
|
|
14
14
|
exports.toAdditionalPropertiesV3 = toAdditionalPropertiesV3;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasObject } from './Object.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToObjectArgs = {
|
|
5
6
|
value: OpenAPIV3.SchemaObject;
|
|
6
7
|
context: ParseContextType;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
};
|
|
8
|
-
export declare const toObject: ({ value, context }: ToObjectArgs) => OasObject;
|
|
10
|
+
export declare const toObject: ({ value, context, stackTrail }: ToObjectArgs) => OasObject;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toObject.d.ts.map
|
|
@@ -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,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,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,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAOvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,gBAAgB,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,gCAAgC,YAAY,KAAG,SAqCvE,CAAA"}
|
|
@@ -7,18 +7,19 @@ const toAdditionalPropertiesV3_js_1 = require("./toAdditionalPropertiesV3.js");
|
|
|
7
7
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
8
8
|
const parseNullable_js_1 = require("../_helpers/parseNullable.js");
|
|
9
9
|
const parseEnum_js_1 = require("../_helpers/parseEnum.js");
|
|
10
|
-
const
|
|
11
|
-
const toObject = ({ value, context }) => {
|
|
10
|
+
const toObject = ({ value, context, stackTrail }) => {
|
|
12
11
|
const { nullable, value: valueWithoutNullable } = (0, parseNullable_js_1.parseNullable)({
|
|
13
12
|
value,
|
|
14
|
-
context
|
|
13
|
+
context,
|
|
14
|
+
stackTrail
|
|
15
15
|
});
|
|
16
16
|
const { example: unparsedExample, ...valueWithoutExample } = valueWithoutNullable;
|
|
17
17
|
const example = parseExample({
|
|
18
18
|
example: unparsedExample,
|
|
19
19
|
context,
|
|
20
20
|
parent: valueWithoutNullable,
|
|
21
|
-
nullable
|
|
21
|
+
nullable,
|
|
22
|
+
stackTrail
|
|
22
23
|
});
|
|
23
24
|
const { enum: unparsedEnums, ...valueWithoutEnums } = valueWithoutExample;
|
|
24
25
|
const enums = (0, parseEnum_js_1.parseEnum)({
|
|
@@ -26,6 +27,7 @@ const toObject = ({ value, context }) => {
|
|
|
26
27
|
nullable,
|
|
27
28
|
parent: valueWithoutExample,
|
|
28
29
|
context,
|
|
30
|
+
stackTrail,
|
|
29
31
|
check: isObject,
|
|
30
32
|
toMessage: item => `Removed invalid enum. Expected "object", got: ${item}`
|
|
31
33
|
});
|
|
@@ -34,16 +36,18 @@ const toObject = ({ value, context }) => {
|
|
|
34
36
|
nullable,
|
|
35
37
|
example,
|
|
36
38
|
enums,
|
|
37
|
-
value: valueWithoutEnums
|
|
39
|
+
value: valueWithoutEnums,
|
|
40
|
+
stackTrail
|
|
38
41
|
});
|
|
39
42
|
};
|
|
40
43
|
exports.toObject = toObject;
|
|
41
|
-
const toParsedObject = ({ context, nullable, example, enums, value }) => {
|
|
44
|
+
const toParsedObject = ({ context, stackTrail, nullable, example, enums, value }) => {
|
|
42
45
|
const { type: _type, title, description, deprecated, properties, required, maxProperties, minProperties, additionalProperties, default: defaultValue, readOnly, writeOnly, ...skipped } = value;
|
|
43
46
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
44
47
|
skipped,
|
|
45
48
|
parent: value,
|
|
46
49
|
context,
|
|
50
|
+
stackTrail,
|
|
47
51
|
parentType: 'schema:object'
|
|
48
52
|
});
|
|
49
53
|
return new Object_js_1.OasObject({
|
|
@@ -52,14 +56,15 @@ const toParsedObject = ({ context, nullable, example, enums, value }) => {
|
|
|
52
56
|
nullable,
|
|
53
57
|
example,
|
|
54
58
|
enums,
|
|
55
|
-
properties:
|
|
59
|
+
properties: stackTrail.trace('properties', st => (0, toSchemasV3_js_1.toOptionalSchemasV3)({
|
|
56
60
|
schemas: properties,
|
|
61
|
+
stackTrail: st,
|
|
57
62
|
context
|
|
58
63
|
})),
|
|
59
64
|
required,
|
|
60
65
|
maxProperties,
|
|
61
66
|
minProperties,
|
|
62
|
-
additionalProperties:
|
|
67
|
+
additionalProperties: stackTrail.trace('additionalProperties', st => (0, toAdditionalPropertiesV3_js_1.toAdditionalPropertiesV3)({ additionalProperties, stackTrail: st, context })),
|
|
63
68
|
extensionFields,
|
|
64
69
|
default: defaultValue,
|
|
65
70
|
deprecated,
|
|
@@ -67,7 +72,7 @@ const toParsedObject = ({ context, nullable, example, enums, value }) => {
|
|
|
67
72
|
writeOnly
|
|
68
73
|
});
|
|
69
74
|
};
|
|
70
|
-
const parseExample = ({ example, context, parent, nullable }) => {
|
|
75
|
+
const parseExample = ({ example, context, parent, nullable, stackTrail }) => {
|
|
71
76
|
if (example === undefined) {
|
|
72
77
|
return undefined;
|
|
73
78
|
}
|
|
@@ -80,6 +85,7 @@ const parseExample = ({ example, context, parent, nullable }) => {
|
|
|
80
85
|
level: 'warning',
|
|
81
86
|
message: `Invalid example: ${example}`,
|
|
82
87
|
parent,
|
|
88
|
+
stackTrail,
|
|
83
89
|
type: 'INVALID_EXAMPLE'
|
|
84
90
|
});
|
|
85
91
|
return undefined;
|
|
@@ -3,6 +3,7 @@ import type { Method } from '../../types/Method.js';
|
|
|
3
3
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
4
4
|
import { OasOperation } from './Operation.js';
|
|
5
5
|
import type { OasPathItem } from '../pathItem/PathItem.js';
|
|
6
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
6
7
|
type OperationInfo = {
|
|
7
8
|
method: Method;
|
|
8
9
|
path: string;
|
|
@@ -11,13 +12,15 @@ type OperationInfo = {
|
|
|
11
12
|
type ToOperationV3Args = {
|
|
12
13
|
operation: OpenAPIV3.OperationObject;
|
|
13
14
|
operationInfo: OperationInfo;
|
|
15
|
+
stackTrail: StackTrail;
|
|
14
16
|
context: ParseContextType;
|
|
15
17
|
};
|
|
16
|
-
export declare const toOperationV3: ({ operation, operationInfo, context }: ToOperationV3Args) => OasOperation;
|
|
18
|
+
export declare const toOperationV3: ({ operation, operationInfo, stackTrail, context }: ToOperationV3Args) => OasOperation;
|
|
17
19
|
type ToOperationsV3Args = {
|
|
18
20
|
paths: OpenAPIV3.PathsObject;
|
|
21
|
+
stackTrail: StackTrail;
|
|
19
22
|
context: ParseContextType;
|
|
20
23
|
};
|
|
21
|
-
export declare const toOperationsV3: ({ paths, context }: ToOperationsV3Args) => OasOperation[];
|
|
24
|
+
export declare const toOperationsV3: ({ paths, stackTrail, context }: ToOperationsV3Args) => OasOperation[];
|
|
22
25
|
export {};
|
|
23
26
|
//# sourceMappingURL=toOperationsV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQ1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAA;CAClC,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAOD,eAAO,MAAM,aAAa,GAAI,mDAK3B,iBAAiB,KAAG,YAuDtB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,WAAW,CAAA;IAC5B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,gCAI5B,kBAAkB,KAAG,YAAY,EAwEnC,CAAA"}
|
|
@@ -14,16 +14,16 @@ const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toS
|
|
|
14
14
|
const toSecurityRequirement_js_1 = require("../securityRequirement/toSecurityRequirement.js");
|
|
15
15
|
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
|
16
16
|
const isEmpty_js_1 = require("../../helpers/isEmpty.js");
|
|
17
|
-
const tracer_js_1 = require("../../helpers/tracer.js");
|
|
18
17
|
const toExternalDocs_js_1 = require("../externalDocs/toExternalDocs.js");
|
|
19
18
|
const toServerV3_js_1 = require("../server/toServerV3.js");
|
|
20
|
-
const toOperationV3 = ({ operation, operationInfo, context }) => {
|
|
19
|
+
const toOperationV3 = ({ operation, operationInfo, stackTrail, context }) => {
|
|
21
20
|
const { method, path, pathItem } = operationInfo;
|
|
22
21
|
const { operationId, tags, summary, description, parameters, requestBody, responses, deprecated, security, externalDocs, servers, ...skipped } = operation;
|
|
23
22
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
24
23
|
skipped,
|
|
25
24
|
parent: operation,
|
|
26
25
|
context,
|
|
26
|
+
stackTrail,
|
|
27
27
|
parentType: 'operation'
|
|
28
28
|
});
|
|
29
29
|
return new Operation_js_1.OasOperation({
|
|
@@ -34,20 +34,20 @@ const toOperationV3 = ({ operation, operationInfo, context }) => {
|
|
|
34
34
|
summary,
|
|
35
35
|
tags,
|
|
36
36
|
description,
|
|
37
|
-
parameters:
|
|
38
|
-
requestBody:
|
|
39
|
-
responses:
|
|
37
|
+
parameters: stackTrail.trace('parameters', st => (0, toParameterV3_js_1.toParameterListV3)({ parameters, stackTrail: st, context })),
|
|
38
|
+
requestBody: stackTrail.trace('requestBody', st => (0, toRequestBodiesV3_js_1.toRequestBodyV3)({ requestBody, stackTrail: st, context })),
|
|
39
|
+
responses: stackTrail.trace('responses', st => (0, toResponseV3_js_1.toResponsesV3)({ responses, stackTrail: st, context })),
|
|
40
40
|
deprecated,
|
|
41
|
-
security:
|
|
42
|
-
externalDocs:
|
|
43
|
-
servers:
|
|
41
|
+
security: stackTrail.trace('security', st => (0, toSecurityRequirement_js_1.toSecurityRequirementsV3)({ security, stackTrail: st, context })),
|
|
42
|
+
externalDocs: stackTrail.trace('externalDocs', st => (0, toExternalDocs_js_1.toExternalDocs)({ externalDocs, stackTrail: st, context })),
|
|
43
|
+
servers: stackTrail.trace('servers', st => (0, toServerV3_js_1.toOptionalServersV3)({ servers, stackTrail: st, context })),
|
|
44
44
|
extensionFields
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
exports.toOperationV3 = toOperationV3;
|
|
48
|
-
const toOperationsV3 = ({ paths, context }) => {
|
|
48
|
+
const toOperationsV3 = ({ paths, stackTrail, context }) => {
|
|
49
49
|
return Object.entries(paths).flatMap(([path, pathItem]) => {
|
|
50
|
-
return
|
|
50
|
+
return stackTrail.trace(path, st => {
|
|
51
51
|
if (!pathItem) {
|
|
52
52
|
return [];
|
|
53
53
|
}
|
|
@@ -69,11 +69,11 @@ const toOperationsV3 = ({ paths, context }) => {
|
|
|
69
69
|
methodObject: {}
|
|
70
70
|
});
|
|
71
71
|
const pathItemObject = !(0, isEmpty_js_1.isEmpty)(cleaned.rest)
|
|
72
|
-
? (0, toPathItemV3_js_1.toPathItemV3)({ pathItem: cleaned.rest, context })
|
|
72
|
+
? (0, toPathItemV3_js_1.toPathItemV3)({ pathItem: cleaned.rest, stackTrail: st, context })
|
|
73
73
|
: undefined;
|
|
74
74
|
return Object.entries(cleaned.methodObject)
|
|
75
75
|
.map(([method, operation]) => {
|
|
76
|
-
return
|
|
76
|
+
return stackTrail.trace(method, st => {
|
|
77
77
|
if (!operation) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -85,6 +85,7 @@ const toOperationsV3 = ({ paths, context }) => {
|
|
|
85
85
|
path,
|
|
86
86
|
pathItem: pathItemObject
|
|
87
87
|
},
|
|
88
|
+
stackTrail: st,
|
|
88
89
|
context
|
|
89
90
|
});
|
|
90
91
|
}
|
|
@@ -95,6 +96,7 @@ const toOperationsV3 = ({ paths, context }) => {
|
|
|
95
96
|
parent: operation,
|
|
96
97
|
level: 'error',
|
|
97
98
|
error,
|
|
99
|
+
stackTrail: st,
|
|
98
100
|
type: 'INVALID_OPERATION'
|
|
99
101
|
});
|
|
100
102
|
return undefined;
|
|
@@ -2,20 +2,24 @@ import type { ParseContextType } from '../../context/parseTypes.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasParameter } from './Parameter.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToParameterListV3Args = {
|
|
6
7
|
parameters: (OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject)[] | undefined;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
context: ParseContextType;
|
|
8
10
|
};
|
|
9
|
-
export declare const toParameterListV3: ({ parameters, context }: ToParameterListV3Args) => (OasParameter | OasRef<"parameter">)[] | undefined;
|
|
11
|
+
export declare const toParameterListV3: ({ parameters, stackTrail, context }: ToParameterListV3Args) => (OasParameter | OasRef<"parameter">)[] | undefined;
|
|
10
12
|
type ToParametersV3Args = {
|
|
11
13
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject>;
|
|
14
|
+
stackTrail: StackTrail;
|
|
12
15
|
context: ParseContextType;
|
|
13
16
|
};
|
|
14
|
-
export declare const toParametersV3: ({ parameters, context }: ToParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">>;
|
|
17
|
+
export declare const toParametersV3: ({ parameters, stackTrail, context }: ToParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">>;
|
|
15
18
|
type ToOptionalParametersV3Args = {
|
|
16
19
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject> | undefined;
|
|
20
|
+
stackTrail: StackTrail;
|
|
17
21
|
context: ParseContextType;
|
|
18
22
|
};
|
|
19
|
-
export declare const toOptionalParametersV3: ({ parameters, context }: ToOptionalParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">> | undefined;
|
|
23
|
+
export declare const toOptionalParametersV3: ({ parameters, stackTrail, context }: ToOptionalParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">> | undefined;
|
|
20
24
|
export {};
|
|
21
25
|
//# sourceMappingURL=toParameterV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,EAAE,GAAG,SAAS,CAAA;IACjF,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,qCAI/B,qBAAqB,KAAG,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAQnE,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,CAAA;IACjF,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,qCAI5B,kBAAkB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAsBxE,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC7F,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,qCAIpC,0BAA0B,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,SAMpF,CAAA"}
|
|
@@ -48,22 +48,21 @@ const ts_pattern_1 = require("ts-pattern");
|
|
|
48
48
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
49
49
|
const v = __importStar(require("valibot"));
|
|
50
50
|
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
|
51
|
-
const
|
|
52
|
-
const toParameterListV3 = ({ parameters, context }) => {
|
|
51
|
+
const toParameterListV3 = ({ parameters, stackTrail, context }) => {
|
|
53
52
|
if (!parameters) {
|
|
54
53
|
return undefined;
|
|
55
54
|
}
|
|
56
55
|
return parameters.map((parameter, index) => {
|
|
57
|
-
return
|
|
56
|
+
return stackTrail.trace(`${index}`, st => toParameterV3({ parameter, stackTrail: st, context }));
|
|
58
57
|
});
|
|
59
58
|
};
|
|
60
59
|
exports.toParameterListV3 = toParameterListV3;
|
|
61
|
-
const toParametersV3 = ({ parameters, context }) => {
|
|
60
|
+
const toParametersV3 = ({ parameters, stackTrail, context }) => {
|
|
62
61
|
const output = {};
|
|
63
62
|
const entries = Object.entries(parameters);
|
|
64
63
|
for (const [key, parameter] of entries) {
|
|
65
64
|
try {
|
|
66
|
-
output[key] =
|
|
65
|
+
output[key] = stackTrail.trace(key, st => toParameterV3({ parameter, stackTrail: st, context }));
|
|
67
66
|
}
|
|
68
67
|
catch (error) {
|
|
69
68
|
(0, tiny_invariant_1.default)(error instanceof Error, 'Invalid error');
|
|
@@ -72,6 +71,7 @@ const toParametersV3 = ({ parameters, context }) => {
|
|
|
72
71
|
level: 'error',
|
|
73
72
|
error,
|
|
74
73
|
parent: parameter,
|
|
74
|
+
stackTrail,
|
|
75
75
|
type: 'INVALID_PARAMETER'
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -79,22 +79,23 @@ const toParametersV3 = ({ parameters, context }) => {
|
|
|
79
79
|
return output;
|
|
80
80
|
};
|
|
81
81
|
exports.toParametersV3 = toParametersV3;
|
|
82
|
-
const toOptionalParametersV3 = ({ parameters, context }) => {
|
|
82
|
+
const toOptionalParametersV3 = ({ parameters, stackTrail, context }) => {
|
|
83
83
|
if (!parameters) {
|
|
84
84
|
return undefined;
|
|
85
85
|
}
|
|
86
|
-
return (0, exports.toParametersV3)({ parameters, context });
|
|
86
|
+
return (0, exports.toParametersV3)({ parameters, stackTrail, context });
|
|
87
87
|
};
|
|
88
88
|
exports.toOptionalParametersV3 = toOptionalParametersV3;
|
|
89
|
-
const toParameterV3 = ({ parameter, context }) => {
|
|
89
|
+
const toParameterV3 = ({ parameter, stackTrail, context }) => {
|
|
90
90
|
if ((0, refFns_js_1.isRef)(parameter)) {
|
|
91
|
-
return (0, toRefV31_js_1.toRefV31)({ ref: parameter, refType: 'parameter', context });
|
|
91
|
+
return (0, toRefV31_js_1.toRefV31)({ ref: parameter, refType: 'parameter', stackTrail, context });
|
|
92
92
|
}
|
|
93
93
|
const { name, in: location, description, required, deprecated, allowEmptyValue, allowReserved, schema, example, examples, content, style, explode, ...skipped } = parameter;
|
|
94
94
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
95
95
|
skipped,
|
|
96
96
|
parent: parameter,
|
|
97
97
|
context,
|
|
98
|
+
stackTrail,
|
|
98
99
|
parentType: 'parameter'
|
|
99
100
|
});
|
|
100
101
|
const parsedLocation = v.parse(parameter_types_js_1.oasParameterLocation, location);
|
|
@@ -109,23 +110,24 @@ const toParameterV3 = ({ parameter, context }) => {
|
|
|
109
110
|
description,
|
|
110
111
|
required: defaultRequired,
|
|
111
112
|
deprecated,
|
|
112
|
-
style:
|
|
113
|
-
explode:
|
|
113
|
+
style: stackTrail.trace('style', st => toStyle({ style, location: parsedLocation, stackTrail: st })),
|
|
114
|
+
explode: stackTrail.trace('explode', st => toExplode({ explode, style, stackTrail: st })),
|
|
114
115
|
allowEmptyValue,
|
|
115
116
|
allowReserved,
|
|
116
|
-
schema:
|
|
117
|
-
examples:
|
|
117
|
+
schema: stackTrail.trace('schema', st => (0, toSchemasV3_js_1.toOptionalSchemaV3)({ schema, stackTrail: st, context })),
|
|
118
|
+
examples: stackTrail.trace('examples', st => (0, toExamplesV3_js_1.toExamplesV3)({
|
|
118
119
|
examples,
|
|
119
120
|
example,
|
|
120
121
|
exampleKey: `${name}-${parsedLocation}`,
|
|
122
|
+
stackTrail: st,
|
|
121
123
|
context
|
|
122
124
|
})),
|
|
123
|
-
content:
|
|
125
|
+
content: stackTrail.trace('content', st => (0, toMediaTypeItemV3_js_1.toOptionalMediaTypeItemsV3)({ content, stackTrail: st, context })),
|
|
124
126
|
extensionFields
|
|
125
127
|
};
|
|
126
128
|
return new Parameter_js_1.OasParameter(fields);
|
|
127
129
|
};
|
|
128
|
-
const toStyle = ({ style, location }) => {
|
|
130
|
+
const toStyle = ({ style, location, stackTrail }) => {
|
|
129
131
|
const parsed = v.parse(v.optional(parameter_types_js_1.oasParameterStyle), style);
|
|
130
132
|
return (parsed ??
|
|
131
133
|
(0, ts_pattern_1.match)(location)
|
|
@@ -135,7 +137,7 @@ const toStyle = ({ style, location }) => {
|
|
|
135
137
|
.with('cookie', () => 'form')
|
|
136
138
|
.exhaustive());
|
|
137
139
|
};
|
|
138
|
-
const toExplode = ({ explode, style }) => {
|
|
140
|
+
const toExplode = ({ explode, style, stackTrail }) => {
|
|
139
141
|
return (explode ??
|
|
140
142
|
(0, ts_pattern_1.match)(style)
|
|
141
143
|
.with('form', () => true)
|