@skmtc/core 0.0.939 → 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,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasPathItem } from './PathItem.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToPathItemV3Args = {
|
|
5
6
|
pathItem: OpenAPIV3.PathItemObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toPathItemV3: ({ pathItem, context }: ToPathItemV3Args) => OasPathItem;
|
|
10
|
+
export declare const toPathItemV3: ({ pathItem, stackTrail, context }: ToPathItemV3Args) => OasPathItem;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toPathItemV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAA;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,mCAAmC,gBAAgB,KAAG,WAiBlF,CAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { toParameterListV3 } from '../parameter/toParameterV3.js';
|
|
2
2
|
import { OasPathItem } from './PathItem.js';
|
|
3
3
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
4
|
-
|
|
5
|
-
export const toPathItemV3 = ({ pathItem, context }) => {
|
|
4
|
+
export const toPathItemV3 = ({ pathItem, stackTrail, context }) => {
|
|
6
5
|
const { summary, description, parameters, ...skipped } = pathItem;
|
|
7
6
|
return new OasPathItem({
|
|
8
7
|
summary,
|
|
9
8
|
description,
|
|
10
|
-
parameters:
|
|
9
|
+
parameters: stackTrail.trace('parameters', st => toParameterListV3({ parameters, stackTrail: st, context })),
|
|
11
10
|
extensionFields: toSpecificationExtensionsV3({
|
|
12
11
|
skipped,
|
|
13
12
|
parent: pathItem,
|
|
14
13
|
context,
|
|
14
|
+
stackTrail,
|
|
15
15
|
parentType: 'pathItem'
|
|
16
16
|
})
|
|
17
17
|
});
|
|
@@ -2,11 +2,13 @@ import type { OpenAPIV3_1 } from 'openapi-types';
|
|
|
2
2
|
import type { OasRefData } from './ref-types.js';
|
|
3
3
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
4
4
|
import { OasRef } from './Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToRefV31Args<T extends OasRefData['refType']> = {
|
|
6
7
|
ref: OpenAPIV3_1.ReferenceObject;
|
|
7
8
|
refType: T;
|
|
9
|
+
stackTrail: StackTrail;
|
|
8
10
|
context: ParseContextType;
|
|
9
11
|
};
|
|
10
|
-
export declare const toRefV31: <T extends OasRefData["refType"]>({ ref, refType, context }: ToRefV31Args<T>) => OasRef<T>;
|
|
12
|
+
export declare const toRefV31: <T extends OasRefData["refType"]>({ ref, refType, stackTrail, context }: ToRefV31Args<T>) => OasRef<T>;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=toRefV31.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRefV31.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/toRefV31.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"toRefV31.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/toRefV31.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,YAAY,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,IAAI;IACnD,GAAG,EAAE,WAAW,CAAC,eAAe,CAAA;IAChC,OAAO,EAAE,CAAC,CAAA;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE,uCAKvD,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,CAAC,CAgB5B,CAAA"}
|
package/esm/oas/ref/toRefV31.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { OasRef } from './Ref.js';
|
|
2
2
|
import { isEmpty } from '../../helpers/isEmpty.js';
|
|
3
|
-
export const toRefV31 = ({ ref, refType, context }) => {
|
|
3
|
+
export const toRefV31 = ({ ref, refType, stackTrail, context }) => {
|
|
4
4
|
const { $ref, ...skipped } = ref;
|
|
5
5
|
if (!isEmpty(skipped)) {
|
|
6
|
-
context.logSkippedFields({ skipped, parent: ref, parentType: 'ref' });
|
|
6
|
+
context.logSkippedFields({ skipped, parent: ref, parentType: 'ref', stackTrail });
|
|
7
7
|
}
|
|
8
|
-
context.registerRef(
|
|
8
|
+
context.registerRef(stackTrail.clone(), $ref);
|
|
9
9
|
return new OasRef({
|
|
10
10
|
refType,
|
|
11
11
|
$ref
|
|
@@ -2,16 +2,19 @@ import type { OpenAPIV3 } from 'openapi-types';
|
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasRequestBody } from './RequestBody.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToRequestBodyV3Args = {
|
|
6
7
|
requestBody: OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject | undefined;
|
|
7
8
|
forceRef?: boolean;
|
|
9
|
+
stackTrail: StackTrail;
|
|
8
10
|
context: ParseContextType;
|
|
9
11
|
};
|
|
10
|
-
export declare const toRequestBodyV3: ({ requestBody, context }: ToRequestBodyV3Args) => OasRequestBody | OasRef<"requestBody"> | undefined;
|
|
12
|
+
export declare const toRequestBodyV3: ({ requestBody, stackTrail, context }: ToRequestBodyV3Args) => OasRequestBody | OasRef<"requestBody"> | undefined;
|
|
11
13
|
type ToRequestBodiesV3Args = {
|
|
12
14
|
requestBodies: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject> | undefined;
|
|
15
|
+
stackTrail: StackTrail;
|
|
13
16
|
context: ParseContextType;
|
|
14
17
|
};
|
|
15
|
-
export declare const toRequestBodiesV3: ({ requestBodies, context }: ToRequestBodiesV3Args) => Record<string, OasRequestBody | OasRef<"requestBody">> | undefined;
|
|
18
|
+
export declare const toRequestBodiesV3: ({ requestBodies, stackTrail, context }: ToRequestBodiesV3Args) => Record<string, OasRequestBody | OasRef<"requestBody">> | undefined;
|
|
16
19
|
export {};
|
|
17
20
|
//# sourceMappingURL=toRequestBodiesV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRequestBodiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/toRequestBodiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toRequestBodiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/toRequestBodiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,iBAAiB,GAAG,SAAS,CAAA;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,sCAI7B,mBAAmB,KAAG,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SA6BjE,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;IAClG,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,qBAAqB,KAAG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,SAiBnF,CAAA"}
|
|
@@ -3,32 +3,32 @@ import { toRefV31 } from '../ref/toRefV31.js';
|
|
|
3
3
|
import { toMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
4
4
|
import { OasRequestBody } from './RequestBody.js';
|
|
5
5
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
6
|
-
|
|
7
|
-
export const toRequestBodyV3 = ({ requestBody, context }) => {
|
|
6
|
+
export const toRequestBodyV3 = ({ requestBody, stackTrail, context }) => {
|
|
8
7
|
if (!requestBody) {
|
|
9
8
|
return undefined;
|
|
10
9
|
}
|
|
11
10
|
if (isRef(requestBody)) {
|
|
12
|
-
return toRefV31({ ref: requestBody, refType: 'requestBody', context });
|
|
11
|
+
return toRefV31({ ref: requestBody, refType: 'requestBody', stackTrail, context });
|
|
13
12
|
}
|
|
14
13
|
const { description, content, required, ...skipped } = requestBody;
|
|
15
14
|
const extensionFields = toSpecificationExtensionsV3({
|
|
16
15
|
skipped,
|
|
17
16
|
parent: requestBody,
|
|
18
17
|
context,
|
|
18
|
+
stackTrail,
|
|
19
19
|
parentType: 'requestBody'
|
|
20
20
|
});
|
|
21
21
|
const fields = {
|
|
22
22
|
description,
|
|
23
|
-
content:
|
|
24
|
-
return toMediaTypeItemsV3({ content, context });
|
|
23
|
+
content: stackTrail.trace('content', st => {
|
|
24
|
+
return toMediaTypeItemsV3({ content, stackTrail: st, context });
|
|
25
25
|
}),
|
|
26
26
|
required,
|
|
27
27
|
extensionFields
|
|
28
28
|
};
|
|
29
29
|
return new OasRequestBody(fields);
|
|
30
30
|
};
|
|
31
|
-
export const toRequestBodiesV3 = ({ requestBodies, context }) => {
|
|
31
|
+
export const toRequestBodiesV3 = ({ requestBodies, stackTrail, context }) => {
|
|
32
32
|
if (!requestBodies) {
|
|
33
33
|
return undefined;
|
|
34
34
|
}
|
|
@@ -36,7 +36,7 @@ export const toRequestBodiesV3 = ({ requestBodies, context }) => {
|
|
|
36
36
|
.map(([key, value]) => {
|
|
37
37
|
return [
|
|
38
38
|
key,
|
|
39
|
-
|
|
39
|
+
stackTrail.trace(key, st => toRequestBodyV3({ requestBody: value, stackTrail: st, context }))
|
|
40
40
|
];
|
|
41
41
|
})
|
|
42
42
|
.filter(([, value]) => Boolean(value));
|
|
@@ -2,20 +2,24 @@ import type { ParseContextType } from '../../context/parseTypes.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasResponse } from './Response.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToResponsesV3Args = {
|
|
6
7
|
responses: OpenAPIV3.ResponsesObject;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
context: ParseContextType;
|
|
8
10
|
};
|
|
9
|
-
export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
|
|
11
|
+
export declare const toResponsesV3: ({ responses, stackTrail, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
|
|
10
12
|
type ToOptionalResponsesV3Args = {
|
|
11
13
|
responses: OpenAPIV3.ResponsesObject | undefined;
|
|
14
|
+
stackTrail: StackTrail;
|
|
12
15
|
context: ParseContextType;
|
|
13
16
|
};
|
|
14
|
-
export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
|
|
17
|
+
export declare const toOptionalResponsesV3: ({ responses, stackTrail, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
|
|
15
18
|
type ToResponseV3Args = {
|
|
16
19
|
response: OpenAPIV3.ReferenceObject | OpenAPIV3.ResponseObject;
|
|
20
|
+
stackTrail: StackTrail;
|
|
17
21
|
context: ParseContextType;
|
|
18
22
|
};
|
|
19
|
-
export declare const toResponseV3: ({ response, context }: ToResponseV3Args) => OasResponse | OasRef<"response">;
|
|
23
|
+
export declare const toResponseV3: ({ response, stackTrail, context }: ToResponseV3Args) => OasResponse | OasRef<"response">;
|
|
20
24
|
export {};
|
|
21
25
|
//# sourceMappingURL=toResponseV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,oCAI3B,iBAAiB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAuBrE,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAA;IAChD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,oCAInC,yBAAyB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,SAMjF,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,cAAc,CAAA;IAC9D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,mCAI1B,gBAAgB,KAAG,WAAW,GAAG,MAAM,CAAC,UAAU,CAuBpD,CAAA"}
|
|
@@ -5,13 +5,12 @@ import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
|
5
5
|
import { OasResponse } from './Response.js';
|
|
6
6
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
7
7
|
import invariant from 'tiny-invariant';
|
|
8
|
-
|
|
9
|
-
export const toResponsesV3 = ({ responses, context }) => {
|
|
8
|
+
export const toResponsesV3 = ({ responses, stackTrail, context }) => {
|
|
10
9
|
const output = {};
|
|
11
10
|
const entries = Object.entries(responses);
|
|
12
11
|
for (const [key, value] of entries) {
|
|
13
12
|
try {
|
|
14
|
-
output[key] =
|
|
13
|
+
output[key] = stackTrail.trace(key, st => toResponseV3({ response: value, stackTrail: st, context }));
|
|
15
14
|
}
|
|
16
15
|
catch (error) {
|
|
17
16
|
invariant(error instanceof Error, 'Invalid error');
|
|
@@ -20,33 +19,35 @@ export const toResponsesV3 = ({ responses, context }) => {
|
|
|
20
19
|
level: 'error',
|
|
21
20
|
error,
|
|
22
21
|
parent: value,
|
|
22
|
+
stackTrail,
|
|
23
23
|
type: 'INVALID_RESPONSE'
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
return output;
|
|
28
28
|
};
|
|
29
|
-
export const toOptionalResponsesV3 = ({ responses, context }) => {
|
|
29
|
+
export const toOptionalResponsesV3 = ({ responses, stackTrail, context }) => {
|
|
30
30
|
if (!responses) {
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
|
-
return toResponsesV3({ responses, context });
|
|
33
|
+
return toResponsesV3({ responses, stackTrail, context });
|
|
34
34
|
};
|
|
35
|
-
export const toResponseV3 = ({ response, context }) => {
|
|
35
|
+
export const toResponseV3 = ({ response, stackTrail, context }) => {
|
|
36
36
|
if (isRef(response)) {
|
|
37
|
-
return toRefV31({ ref: response, refType: 'response', context });
|
|
37
|
+
return toRefV31({ ref: response, refType: 'response', stackTrail, context });
|
|
38
38
|
}
|
|
39
39
|
const { description, headers, content, ...skipped } = response;
|
|
40
40
|
const extensionFields = toSpecificationExtensionsV3({
|
|
41
41
|
skipped,
|
|
42
42
|
parent: response,
|
|
43
43
|
context,
|
|
44
|
+
stackTrail,
|
|
44
45
|
parentType: 'response'
|
|
45
46
|
});
|
|
46
47
|
return new OasResponse({
|
|
47
48
|
description,
|
|
48
|
-
headers:
|
|
49
|
-
content:
|
|
49
|
+
headers: stackTrail.trace('headers', st => toHeadersV3({ headers, stackTrail: st, context })),
|
|
50
|
+
content: stackTrail.trace('content', st => toOptionalMediaTypeItemsV3({ content, stackTrail: st, context })),
|
|
50
51
|
extensionFields
|
|
51
52
|
});
|
|
52
53
|
};
|
|
@@ -2,25 +2,30 @@ import type { ParseContextType } from '../../context/parseTypes.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import type { OasSchema } from './Schema.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToSchemasV3Args = {
|
|
6
7
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject>;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
context: ParseContextType;
|
|
8
10
|
};
|
|
9
|
-
export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
|
|
11
|
+
export declare const toSchemasV3: ({ schemas, stackTrail, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
|
|
10
12
|
type ToOptionalSchemasV3Args = {
|
|
11
13
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject> | undefined;
|
|
14
|
+
stackTrail: StackTrail;
|
|
12
15
|
context: ParseContextType;
|
|
13
16
|
};
|
|
14
|
-
export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
|
|
17
|
+
export declare const toOptionalSchemasV3: ({ schemas, stackTrail, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
|
|
15
18
|
type ToSchemaV3Args = {
|
|
16
19
|
schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
|
|
20
|
+
stackTrail: StackTrail;
|
|
17
21
|
context: ParseContextType;
|
|
18
22
|
};
|
|
19
|
-
export declare const toSchemaV3: ({ schema, context }: ToSchemaV3Args) => OasSchema | OasRef<"schema">;
|
|
23
|
+
export declare const toSchemaV3: ({ schema, stackTrail, context }: ToSchemaV3Args) => OasSchema | OasRef<"schema">;
|
|
20
24
|
type ToOptionalSchemaV3Args = {
|
|
21
25
|
schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined;
|
|
26
|
+
stackTrail: StackTrail;
|
|
22
27
|
context: ParseContextType;
|
|
23
28
|
};
|
|
24
|
-
export declare const toOptionalSchemaV3: ({ schema, context }: ToOptionalSchemaV3Args) => OasSchema | OasRef<"schema"> | undefined;
|
|
29
|
+
export declare const toOptionalSchemaV3: ({ schema, stackTrail, context }: ToOptionalSchemaV3Args) => OasSchema | OasRef<"schema"> | undefined;
|
|
25
30
|
export {};
|
|
26
31
|
//# sourceMappingURL=toSchemasV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAa3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;IAC3E,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,kCAIzB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAsB/D,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,kCAIjC,uBAAuB,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAM3E,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;IAC1D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,iCAIxB,cAAc,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAiK9C,CAAA;AA+CD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IACtE,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,iCAIhC,sBAAsB,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAM1D,CAAA"}
|
|
@@ -13,13 +13,12 @@ import { toGetRef } from '../../helpers/refFns.js';
|
|
|
13
13
|
import { mergeIntersection } from '../_merge-all-of/merge-intersection.js';
|
|
14
14
|
import { mergeUnion } from '../_merge-all-of/merge-union.js';
|
|
15
15
|
import invariant from 'tiny-invariant';
|
|
16
|
-
|
|
17
|
-
export const toSchemasV3 = ({ schemas, context }) => {
|
|
16
|
+
export const toSchemasV3 = ({ schemas, stackTrail, context }) => {
|
|
18
17
|
const output = {};
|
|
19
18
|
const entries = Object.entries(schemas);
|
|
20
19
|
for (const [key, schema] of entries) {
|
|
21
20
|
try {
|
|
22
|
-
output[key] =
|
|
21
|
+
output[key] = stackTrail.trace(key, st => toSchemaV3({ schema, stackTrail: st, context }));
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
|
25
24
|
invariant(error instanceof Error, 'Invalid error');
|
|
@@ -28,34 +27,35 @@ export const toSchemasV3 = ({ schemas, context }) => {
|
|
|
28
27
|
level: 'error',
|
|
29
28
|
error,
|
|
30
29
|
parent: schema,
|
|
30
|
+
stackTrail,
|
|
31
31
|
type: 'INVALID_SCHEMA'
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return output;
|
|
36
36
|
};
|
|
37
|
-
export const toOptionalSchemasV3 = ({ schemas, context }) => {
|
|
37
|
+
export const toOptionalSchemasV3 = ({ schemas, stackTrail, context }) => {
|
|
38
38
|
if (!schemas) {
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
41
|
-
return toSchemasV3({ schemas, context });
|
|
41
|
+
return toSchemasV3({ schemas, stackTrail, context });
|
|
42
42
|
};
|
|
43
|
-
export const toSchemaV3 = ({ schema, context }) => {
|
|
43
|
+
export const toSchemaV3 = ({ schema, stackTrail, context }) => {
|
|
44
44
|
if (isRef(schema)) {
|
|
45
|
-
return toRefV31({ ref: schema, refType: 'schema', context });
|
|
45
|
+
return toRefV31({ ref: schema, refType: 'schema', stackTrail, context });
|
|
46
46
|
}
|
|
47
47
|
return match(schema)
|
|
48
48
|
.with({ allOf: P.array() }, schema => {
|
|
49
|
-
return
|
|
49
|
+
return stackTrail.trace('allOf', st => {
|
|
50
50
|
const merged = mergeIntersection({
|
|
51
51
|
schema,
|
|
52
52
|
getRef: toGetRef(context.documentObject)
|
|
53
53
|
});
|
|
54
|
-
return toSchemaV3({ schema: merged, context });
|
|
54
|
+
return toSchemaV3({ schema: merged, stackTrail: st, context });
|
|
55
55
|
});
|
|
56
56
|
})
|
|
57
57
|
.with({ oneOf: P.array() }, oneOf => {
|
|
58
|
-
return
|
|
58
|
+
return stackTrail.trace('oneOf', st => {
|
|
59
59
|
const merged = mergeUnion({
|
|
60
60
|
schema: oneOf,
|
|
61
61
|
getRef: toGetRef(context.documentObject),
|
|
@@ -69,18 +69,18 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
69
69
|
throw new Error('"oneOf" array is empty');
|
|
70
70
|
}
|
|
71
71
|
if (members.length === 1) {
|
|
72
|
-
return toSchemaV3({ schema: members[0], context });
|
|
72
|
+
return toSchemaV3({ schema: members[0], stackTrail: st, context });
|
|
73
73
|
}
|
|
74
|
-
return toUnion({ value, members, parentType: 'oneOf', context });
|
|
74
|
+
return toUnion({ value, members, parentType: 'oneOf', stackTrail: st, context });
|
|
75
75
|
});
|
|
76
76
|
})
|
|
77
77
|
.with({ anyOf: P.array() }, matched => {
|
|
78
|
-
return
|
|
78
|
+
return stackTrail.trace('anyOf', st => {
|
|
79
79
|
// deno-lint-ignore ban-ts-comment
|
|
80
80
|
// @ts-expect-error
|
|
81
81
|
if (matched['x-expansionResources']) {
|
|
82
82
|
const { anyOf, ...value } = matched;
|
|
83
|
-
return toUnion({ value, members: anyOf, parentType: 'anyOf', context });
|
|
83
|
+
return toUnion({ value, members: anyOf, parentType: 'anyOf', stackTrail: st, context });
|
|
84
84
|
}
|
|
85
85
|
const merged = mergeUnion({
|
|
86
86
|
schema: matched,
|
|
@@ -95,23 +95,24 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
95
95
|
throw new Error('"anyOf" array is empty');
|
|
96
96
|
}
|
|
97
97
|
if (members.length === 1) {
|
|
98
|
-
return toSchemaV3({ schema: members[0], context });
|
|
98
|
+
return toSchemaV3({ schema: members[0], stackTrail: st, context });
|
|
99
99
|
}
|
|
100
|
-
return toUnion({ value, members, parentType: 'anyOf', context });
|
|
100
|
+
return toUnion({ value, members, parentType: 'anyOf', stackTrail: st, context });
|
|
101
101
|
});
|
|
102
102
|
})
|
|
103
|
-
.with({ type: 'object' }, value => toObject({ value, context }))
|
|
104
|
-
.with({ type: 'array' }, value => toArray({ value, context }))
|
|
105
|
-
.with({ type: 'integer' }, value => toInteger({ value, context }))
|
|
106
|
-
.with({ type: 'number' }, value => toNumber({ value, context }))
|
|
107
|
-
.with({ type: 'boolean' }, value => toBoolean({ value, context }))
|
|
108
|
-
.with({ type: 'string' }, value => toString({ value, context }))
|
|
103
|
+
.with({ type: 'object' }, value => toObject({ value, stackTrail, context }))
|
|
104
|
+
.with({ type: 'array' }, value => toArray({ value, stackTrail, context }))
|
|
105
|
+
.with({ type: 'integer' }, value => toInteger({ value, stackTrail, context }))
|
|
106
|
+
.with({ type: 'number' }, value => toNumber({ value, stackTrail, context }))
|
|
107
|
+
.with({ type: 'boolean' }, value => toBoolean({ value, stackTrail, context }))
|
|
108
|
+
.with({ type: 'string' }, value => toString({ value, stackTrail, context }))
|
|
109
109
|
.otherwise(value => {
|
|
110
110
|
if (possibleObject(value)) {
|
|
111
111
|
context.logIssueNoKey({
|
|
112
112
|
level: 'warning',
|
|
113
113
|
message: 'Object has "properties" property, but is missing type="object" property',
|
|
114
114
|
parent: value,
|
|
115
|
+
stackTrail,
|
|
115
116
|
type: 'MISSING_OBJECT_TYPE'
|
|
116
117
|
});
|
|
117
118
|
return toObject({
|
|
@@ -119,6 +120,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
119
120
|
...value,
|
|
120
121
|
type: 'object'
|
|
121
122
|
},
|
|
123
|
+
stackTrail,
|
|
122
124
|
context
|
|
123
125
|
});
|
|
124
126
|
}
|
|
@@ -127,6 +129,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
127
129
|
level: 'warning',
|
|
128
130
|
message: 'Object has "items" property, but is missing type="array" property',
|
|
129
131
|
parent: value,
|
|
132
|
+
stackTrail,
|
|
130
133
|
type: 'MISSING_ARRAY_TYPE'
|
|
131
134
|
});
|
|
132
135
|
return toArray({
|
|
@@ -135,6 +138,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
135
138
|
type: 'array'
|
|
136
139
|
// Adding cast here since {} is a valid value for items
|
|
137
140
|
},
|
|
141
|
+
stackTrail,
|
|
138
142
|
context
|
|
139
143
|
});
|
|
140
144
|
}
|
|
@@ -143,6 +147,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
143
147
|
level: 'warning',
|
|
144
148
|
message: 'Object has a boolean "default" or "example" property, but is missing type="boolean" property',
|
|
145
149
|
parent: value,
|
|
150
|
+
stackTrail,
|
|
146
151
|
type: 'MISSING_BOOLEAN_TYPE'
|
|
147
152
|
});
|
|
148
153
|
return toBoolean({
|
|
@@ -150,6 +155,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
150
155
|
...value,
|
|
151
156
|
type: 'boolean'
|
|
152
157
|
},
|
|
158
|
+
stackTrail,
|
|
153
159
|
context
|
|
154
160
|
});
|
|
155
161
|
}
|
|
@@ -158,6 +164,7 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
158
164
|
level: 'warning',
|
|
159
165
|
message: 'Object has a string "default" or "example" property, but is missing type="string" property',
|
|
160
166
|
parent: value,
|
|
167
|
+
stackTrail,
|
|
161
168
|
type: 'MISSING_STRING_TYPE'
|
|
162
169
|
});
|
|
163
170
|
return toString({
|
|
@@ -165,10 +172,11 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
165
172
|
...value,
|
|
166
173
|
type: 'string'
|
|
167
174
|
},
|
|
175
|
+
stackTrail,
|
|
168
176
|
context
|
|
169
177
|
});
|
|
170
178
|
}
|
|
171
|
-
return toUnknown({ value, context });
|
|
179
|
+
return toUnknown({ value, stackTrail, context });
|
|
172
180
|
});
|
|
173
181
|
};
|
|
174
182
|
const possibleString = (value) => {
|
|
@@ -204,9 +212,9 @@ const possibleObject = (value) => {
|
|
|
204
212
|
typeof value.properties === 'object' &&
|
|
205
213
|
value.properties);
|
|
206
214
|
};
|
|
207
|
-
export const toOptionalSchemaV3 = ({ schema, context }) => {
|
|
215
|
+
export const toOptionalSchemaV3 = ({ schema, stackTrail, context }) => {
|
|
208
216
|
if (!schema) {
|
|
209
217
|
return undefined;
|
|
210
218
|
}
|
|
211
|
-
return toSchemaV3({ schema, context });
|
|
219
|
+
return toSchemaV3({ schema, stackTrail, context });
|
|
212
220
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
2
2
|
import { OasSecurityRequirement } from './SecurityRequirement.js';
|
|
3
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
3
4
|
type ToSecurityRequirementsV3Args = {
|
|
4
5
|
security: Record<string, string[]>[] | undefined;
|
|
6
|
+
stackTrail: StackTrail;
|
|
5
7
|
context: ParseContextType;
|
|
6
8
|
};
|
|
7
|
-
export declare const toSecurityRequirementsV3: ({ security, context }: ToSecurityRequirementsV3Args) => OasSecurityRequirement[] | undefined;
|
|
9
|
+
export declare const toSecurityRequirementsV3: ({ security, stackTrail, context }: ToSecurityRequirementsV3Args) => OasSecurityRequirement[] | undefined;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=toSecurityRequirement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/toSecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"toSecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/toSecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAA;IAChD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,mCAItC,4BAA4B,KAAG,sBAAsB,EAAE,GAAG,SAQ5D,CAAA"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import type { OasSecurityScheme } from './SecurityScheme.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToSecuritySchemesArgs = {
|
|
5
6
|
securitySchemes: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SecuritySchemeObject> | undefined;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toSecuritySchemesV3: ({ securitySchemes, context }: ToSecuritySchemesArgs) => // 'http' | 'apiKey' | 'oauth2' | 'openIdConnect'
|
|
10
|
+
export declare const toSecuritySchemesV3: ({ securitySchemes, stackTrail, context }: ToSecuritySchemesArgs) => // 'http' | 'apiKey' | 'oauth2' | 'openIdConnect'
|
|
9
11
|
Record<string, OasSecurityScheme> | undefined;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=toSecuritySchemes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../src/oas/securitySchemes/toSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAgBnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"toSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../src/oas/securitySchemes/toSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAgBnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAK5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,qBAAqB,GAAG;IAC3B,eAAe,EACX,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAC1E,SAAS,CAAA;IACb,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,0CAIjC,qBAAqB,KACxB,AAD2B,iDAAiD;AAC5E,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAenC,CAAA"}
|
|
@@ -4,28 +4,32 @@ import * as v from 'valibot';
|
|
|
4
4
|
import { oasApiKeySecuritySchemeData, oasHttpSecuritySchemeData, oasOAuth2SecuritySchemeData, oasOpenIdSecuritySchemeData } from './security-scheme-types.js';
|
|
5
5
|
import { toRefV31 } from '../ref/toRefV31.js';
|
|
6
6
|
import { isRef } from '../../helpers/refFns.js';
|
|
7
|
-
import { tracer } from '../../helpers/tracer.js';
|
|
8
7
|
import { isEmpty } from '../../helpers/isEmpty.js';
|
|
9
|
-
export const toSecuritySchemesV3 = ({ securitySchemes, context }) => {
|
|
8
|
+
export const toSecuritySchemesV3 = ({ securitySchemes, stackTrail, context }) => {
|
|
10
9
|
if (!securitySchemes) {
|
|
11
10
|
return undefined;
|
|
12
11
|
}
|
|
13
12
|
return Object.fromEntries(Object.entries(securitySchemes).map(([key, value]) => {
|
|
14
13
|
return [
|
|
15
14
|
key,
|
|
16
|
-
|
|
15
|
+
stackTrail.trace(key, st => toSecuritySchemeV3({ securityScheme: value, stackTrail: st, context }))
|
|
17
16
|
];
|
|
18
17
|
}));
|
|
19
18
|
};
|
|
20
|
-
const toSecuritySchemeV3 = ({ securityScheme, context }) => {
|
|
19
|
+
const toSecuritySchemeV3 = ({ securityScheme, stackTrail, context }) => {
|
|
21
20
|
if (isRef(securityScheme)) {
|
|
22
|
-
return toRefV31({ ref: securityScheme, refType: 'securityScheme', context });
|
|
21
|
+
return toRefV31({ ref: securityScheme, refType: 'securityScheme', stackTrail, context });
|
|
23
22
|
}
|
|
24
23
|
return match(securityScheme)
|
|
25
24
|
.with({ type: 'http' }, matched => {
|
|
26
25
|
const { type: _type, description, scheme, bearerFormat, ...skipped } = v.parse(oasHttpSecuritySchemeData, matched);
|
|
27
26
|
if (!isEmpty(skipped)) {
|
|
28
|
-
context.logSkippedFields({
|
|
27
|
+
context.logSkippedFields({
|
|
28
|
+
skipped,
|
|
29
|
+
parent: matched,
|
|
30
|
+
stackTrail,
|
|
31
|
+
parentType: 'securityScheme:http'
|
|
32
|
+
});
|
|
29
33
|
}
|
|
30
34
|
return new OasHttpSecurityScheme({
|
|
31
35
|
description,
|
|
@@ -36,7 +40,12 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
|
|
|
36
40
|
.with({ type: 'apiKey' }, matched => {
|
|
37
41
|
const { type: _type, in: location, description, name, ...skipped } = v.parse(oasApiKeySecuritySchemeData, matched);
|
|
38
42
|
if (!isEmpty(skipped)) {
|
|
39
|
-
context.logSkippedFields({
|
|
43
|
+
context.logSkippedFields({
|
|
44
|
+
skipped,
|
|
45
|
+
parent: matched,
|
|
46
|
+
stackTrail,
|
|
47
|
+
parentType: 'securityScheme:apiKey'
|
|
48
|
+
});
|
|
40
49
|
}
|
|
41
50
|
return new OasApiKeySecurityScheme({
|
|
42
51
|
description,
|
|
@@ -47,7 +56,12 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
|
|
|
47
56
|
.with({ type: 'oauth2' }, matched => {
|
|
48
57
|
const { type: _type, flows, description, ...skipped } = v.parse(oasOAuth2SecuritySchemeData, matched);
|
|
49
58
|
if (!isEmpty(skipped)) {
|
|
50
|
-
context.logSkippedFields({
|
|
59
|
+
context.logSkippedFields({
|
|
60
|
+
skipped,
|
|
61
|
+
parent: matched,
|
|
62
|
+
stackTrail,
|
|
63
|
+
parentType: 'securityScheme:oauth2'
|
|
64
|
+
});
|
|
51
65
|
}
|
|
52
66
|
return new OasOAuth2SecurityScheme({
|
|
53
67
|
description,
|
|
@@ -60,6 +74,7 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
|
|
|
60
74
|
context.logSkippedFields({
|
|
61
75
|
skipped,
|
|
62
76
|
parent: matched,
|
|
77
|
+
stackTrail,
|
|
63
78
|
parentType: 'securityScheme:openIdConnect'
|
|
64
79
|
});
|
|
65
80
|
}
|