@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
|
@@ -7,8 +7,7 @@ import { toRequestBodiesV3 } from '../requestBody/toRequestBodiesV3.js';
|
|
|
7
7
|
import { OasComponents } from './Components.js';
|
|
8
8
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
9
9
|
import { toSecuritySchemesV3 } from '../securitySchemes/toSecuritySchemes.js';
|
|
10
|
-
|
|
11
|
-
export const toComponentsV3 = ({ components, context }) => {
|
|
10
|
+
export const toComponentsV3 = ({ components, stackTrail, context }) => {
|
|
12
11
|
if (!components) {
|
|
13
12
|
return undefined;
|
|
14
13
|
}
|
|
@@ -17,21 +16,23 @@ export const toComponentsV3 = ({ components, context }) => {
|
|
|
17
16
|
skipped,
|
|
18
17
|
parent: components,
|
|
19
18
|
context,
|
|
19
|
+
stackTrail,
|
|
20
20
|
parentType: 'components'
|
|
21
21
|
});
|
|
22
22
|
const fields = {
|
|
23
|
-
schemas:
|
|
24
|
-
responses:
|
|
25
|
-
parameters:
|
|
23
|
+
schemas: stackTrail.trace('schemas', st => toOptionalSchemasV3({ schemas, stackTrail: st, context })),
|
|
24
|
+
responses: stackTrail.trace('responses', st => toOptionalResponsesV3({ responses, stackTrail: st, context })),
|
|
25
|
+
parameters: stackTrail.trace('parameters', st => toOptionalParametersV3({ parameters, stackTrail: st, context })),
|
|
26
26
|
examples: toExamplesV3({
|
|
27
27
|
examples,
|
|
28
28
|
example: undefined,
|
|
29
29
|
exampleKey: 'TEMP',
|
|
30
|
+
stackTrail,
|
|
30
31
|
context
|
|
31
32
|
}),
|
|
32
|
-
requestBodies:
|
|
33
|
-
headers:
|
|
34
|
-
securitySchemes:
|
|
33
|
+
requestBodies: stackTrail.trace('requestBodies', st => toRequestBodiesV3({ requestBodies, stackTrail: st, context })),
|
|
34
|
+
headers: stackTrail.trace('headers', st => toHeadersV3({ headers, stackTrail: st, context })),
|
|
35
|
+
securitySchemes: stackTrail.trace('securitySchemes', st => toSecuritySchemesV3({ securitySchemes, stackTrail: st, context })),
|
|
35
36
|
extensionFields
|
|
36
37
|
};
|
|
37
38
|
return new OasComponents(fields);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasContact } from './Contact.js';
|
|
4
|
-
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
|
+
export declare const toContactV3: (contact: OpenAPIV3.ContactObject, stackTrail: StackTrail, context: ParseContextType) => OasContact;
|
|
5
6
|
//# sourceMappingURL=toContactV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toContactV3.d.ts","sourceRoot":"","sources":["../../../src/oas/contact/toContactV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"toContactV3.d.ts","sourceRoot":"","sources":["../../../src/oas/contact/toContactV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,eAAO,MAAM,WAAW,GACtB,SAAS,SAAS,CAAC,aAAa,EAChC,YAAY,UAAU,EACtB,SAAS,gBAAgB,KACxB,UAiBF,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
2
2
|
import { OasContact } from './Contact.js';
|
|
3
|
-
export const toContactV3 = (contact, context) => {
|
|
3
|
+
export const toContactV3 = (contact, stackTrail, context) => {
|
|
4
4
|
const { name, url, email, ...skipped } = contact;
|
|
5
5
|
const extensionFields = toSpecificationExtensionsV3({
|
|
6
6
|
skipped,
|
|
7
7
|
parent: contact,
|
|
8
8
|
context,
|
|
9
|
+
stackTrail,
|
|
9
10
|
parentType: 'contact'
|
|
10
11
|
});
|
|
11
12
|
return new OasContact({
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasDiscriminator } from './Discriminator.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToDiscriminatorV3Args = {
|
|
5
6
|
discriminator: OpenAPIV3.DiscriminatorObject | undefined;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toDiscriminatorV3: ({ discriminator, context }: ToDiscriminatorV3Args) => OasDiscriminator | undefined;
|
|
10
|
+
export declare const toDiscriminatorV3: ({ discriminator, stackTrail, context }: ToDiscriminatorV3Args) => OasDiscriminator | undefined;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toDiscriminatorV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDiscriminatorV3.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/toDiscriminatorV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"toDiscriminatorV3.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/toDiscriminatorV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,SAAS,CAAC,mBAAmB,GAAG,SAAS,CAAA;IACxD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,qBAAqB,KAAG,gBAAgB,GAAG,SAoB7C,CAAA"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { OasDiscriminator } from './Discriminator.js';
|
|
2
2
|
import { isEmpty } from '../../helpers/isEmpty.js';
|
|
3
|
-
export const toDiscriminatorV3 = ({ discriminator, context }) => {
|
|
3
|
+
export const toDiscriminatorV3 = ({ discriminator, stackTrail, context }) => {
|
|
4
4
|
if (!discriminator) {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
7
|
const { propertyName, mapping, ...skipped } = discriminator;
|
|
8
8
|
if (!isEmpty(skipped)) {
|
|
9
|
-
context.logSkippedFields({
|
|
9
|
+
context.logSkippedFields({
|
|
10
|
+
skipped,
|
|
11
|
+
parent: discriminator,
|
|
12
|
+
parentType: 'discriminator',
|
|
13
|
+
stackTrail
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
16
|
return new OasDiscriminator({
|
|
12
17
|
propertyName,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import type { DocumentFields } from './Document.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToDocumentV3Args = {
|
|
5
6
|
documentObject: OpenAPIV3.Document;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toDocumentFieldsV3: ({ documentObject, context }: ToDocumentV3Args) => DocumentFields;
|
|
10
|
+
export declare const toDocumentFieldsV3: ({ documentObject, stackTrail, context }: ToDocumentV3Args) => DocumentFields;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toDocumentFieldsV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,gBAAgB,GAAG;IACtB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,yCAIhC,gBAAgB,KAAG,cA+BrB,CAAA"}
|
|
@@ -5,25 +5,26 @@ import { toInfoV3 } from '../info/toInfoV3.js';
|
|
|
5
5
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
6
6
|
import { toOptionalServersV3 } from '../server/toServerV3.js';
|
|
7
7
|
import { toSecurityRequirementsV3 } from '../securityRequirement/toSecurityRequirement.js';
|
|
8
|
-
import { tracer } from '../../helpers/tracer.js';
|
|
9
8
|
import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
|
|
10
|
-
export const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
9
|
+
export const toDocumentFieldsV3 = ({ documentObject, stackTrail, context }) => {
|
|
11
10
|
const { openapi, info, paths, components, tags, servers, security, externalDocs, ...skipped } = documentObject;
|
|
12
11
|
const extensionFields = toSpecificationExtensionsV3({
|
|
13
12
|
skipped,
|
|
14
13
|
parent: documentObject,
|
|
15
14
|
context,
|
|
15
|
+
stackTrail,
|
|
16
16
|
parentType: 'document'
|
|
17
17
|
});
|
|
18
18
|
return {
|
|
19
19
|
openapi,
|
|
20
|
-
info:
|
|
21
|
-
servers:
|
|
22
|
-
operations:
|
|
23
|
-
components:
|
|
24
|
-
tags:
|
|
25
|
-
security:
|
|
20
|
+
info: stackTrail.trace('info', st => toInfoV3({ info, stackTrail: st, context })),
|
|
21
|
+
servers: stackTrail.trace('servers', st => toOptionalServersV3({ servers, stackTrail: st, context })),
|
|
22
|
+
operations: stackTrail.trace('paths', st => toOperationsV3({ paths, stackTrail: st, context })),
|
|
23
|
+
components: stackTrail.trace('components', st => toComponentsV3({ components, stackTrail: st, context })),
|
|
24
|
+
tags: stackTrail.trace('tags', st => toTagsV3({ tags, stackTrail: st, context })),
|
|
25
|
+
security: stackTrail.trace('security', st => toSecurityRequirementsV3({ security, stackTrail: st, context })),
|
|
26
26
|
extensionFields,
|
|
27
|
-
externalDocs:
|
|
27
|
+
externalDocs: stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context }))
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
+
// stackTrail.trace('info', (x) => formatNumber(x))
|
|
@@ -2,8 +2,13 @@ import type { ParseContextType } from '../../context/parseTypes.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasExample } from './Example.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToExampleSimpleV3Args = {
|
|
6
7
|
example: OpenAPIV3.ExampleObject;
|
|
8
|
+
/** The stack trail for tracing */
|
|
9
|
+
stackTrail: StackTrail;
|
|
10
|
+
/** Parse context for tracing and error handling */
|
|
11
|
+
context: ParseContextType;
|
|
7
12
|
};
|
|
8
13
|
/**
|
|
9
14
|
* Creates a simple OAS example from a value.
|
|
@@ -28,6 +33,8 @@ export type ToExamplesV3Args = {
|
|
|
28
33
|
examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject> | undefined;
|
|
29
34
|
/** Key name for the example context */
|
|
30
35
|
exampleKey: string;
|
|
36
|
+
/** The stack trail for tracing */
|
|
37
|
+
stackTrail: StackTrail;
|
|
31
38
|
/** Parse context for tracing and error handling */
|
|
32
39
|
context: ParseContextType;
|
|
33
40
|
};
|
|
@@ -41,9 +48,10 @@ export type ToExamplesV3Args = {
|
|
|
41
48
|
* @param args - Arguments containing example data and context
|
|
42
49
|
* @returns Record of processed examples, or undefined if no examples
|
|
43
50
|
*/
|
|
44
|
-
export declare const toExamplesV3: ({ example, examples, exampleKey, context }: ToExamplesV3Args) => Record<string, OasExample | OasRef<"example">> | undefined;
|
|
51
|
+
export declare const toExamplesV3: ({ example, examples, exampleKey, stackTrail, context }: ToExamplesV3Args) => Record<string, OasExample | OasRef<"example">> | undefined;
|
|
45
52
|
type ToExampleV3Args = {
|
|
46
53
|
example: OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject;
|
|
54
|
+
stackTrail: StackTrail;
|
|
47
55
|
context: ParseContextType;
|
|
48
56
|
};
|
|
49
57
|
/**
|
|
@@ -56,6 +64,6 @@ type ToExampleV3Args = {
|
|
|
56
64
|
* @param args - Arguments containing the example and parsing context
|
|
57
65
|
* @returns OasExample object or reference to an example
|
|
58
66
|
*/
|
|
59
|
-
export declare const toExampleV3: ({ example, context }: ToExampleV3Args) => OasExample | OasRef<"example">;
|
|
67
|
+
export declare const toExampleV3: ({ example, stackTrail, context }: ToExampleV3Args) => OasExample | OasRef<"example">;
|
|
60
68
|
export {};
|
|
61
69
|
//# sourceMappingURL=toExamplesV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAC,aAAa,CAAA;IAChC,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,mDAAmD;IACnD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAE/B,qBAAqB,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CASvD,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gDAAgD;IAChD,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IACzF,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,mDAAmD;IACnD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,wDAM1B,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAoCtE,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAA;IAC5D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB,eAAe,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAqBjD,CAAA"}
|
|
@@ -2,7 +2,6 @@ import { isRef } from '../../helpers/refFns.js';
|
|
|
2
2
|
import { toRefV31 } from '../ref/toRefV31.js';
|
|
3
3
|
import { OasExample } from './Example.js';
|
|
4
4
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
5
|
-
import { tracer } from '../../helpers/tracer.js';
|
|
6
5
|
/**
|
|
7
6
|
* Creates a simple OAS example from a value.
|
|
8
7
|
*
|
|
@@ -31,27 +30,28 @@ export const toExampleSimpleV3 = ({ example }) => {
|
|
|
31
30
|
* @param args - Arguments containing example data and context
|
|
32
31
|
* @returns Record of processed examples, or undefined if no examples
|
|
33
32
|
*/
|
|
34
|
-
export const toExamplesV3 = ({ example, examples, exampleKey, context }) => {
|
|
33
|
+
export const toExamplesV3 = ({ example, examples, exampleKey, stackTrail, context }) => {
|
|
35
34
|
if (example && examples) {
|
|
36
35
|
context.logIssue({
|
|
37
36
|
key: 'example',
|
|
38
37
|
level: 'warning',
|
|
39
38
|
message: `Both example and examples are defined for ${exampleKey}`,
|
|
40
39
|
parent: examples,
|
|
40
|
+
stackTrail,
|
|
41
41
|
type: 'EXAMPLE_AND_EXAMPLES_DEFINED'
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
if (example) {
|
|
45
45
|
return {
|
|
46
|
-
[exampleKey]:
|
|
46
|
+
[exampleKey]: stackTrail.trace('example', st => toExampleSimpleV3({ example, stackTrail: st, context }))
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
if (examples) {
|
|
50
|
-
return
|
|
50
|
+
return stackTrail.trace('examples', st => {
|
|
51
51
|
const output = {};
|
|
52
52
|
const entries = Object.entries(examples);
|
|
53
53
|
for (const [key, value] of entries) {
|
|
54
|
-
output[key] =
|
|
54
|
+
output[key] = st.trace(key, st2 => toExampleV3({ example: value, stackTrail: st2, context }));
|
|
55
55
|
}
|
|
56
56
|
return output;
|
|
57
57
|
});
|
|
@@ -68,15 +68,16 @@ export const toExamplesV3 = ({ example, examples, exampleKey, context }) => {
|
|
|
68
68
|
* @param args - Arguments containing the example and parsing context
|
|
69
69
|
* @returns OasExample object or reference to an example
|
|
70
70
|
*/
|
|
71
|
-
export const toExampleV3 = ({ example, context }) => {
|
|
71
|
+
export const toExampleV3 = ({ example, stackTrail, context }) => {
|
|
72
72
|
if (isRef(example)) {
|
|
73
|
-
return toRefV31({ ref: example, refType: 'example', context });
|
|
73
|
+
return toRefV31({ ref: example, refType: 'example', stackTrail, context });
|
|
74
74
|
}
|
|
75
75
|
const { summary, description, value, ...skipped } = example;
|
|
76
76
|
const extensionFields = toSpecificationExtensionsV3({
|
|
77
77
|
skipped,
|
|
78
78
|
parent: example,
|
|
79
79
|
context,
|
|
80
|
+
stackTrail,
|
|
80
81
|
parentType: 'example'
|
|
81
82
|
});
|
|
82
83
|
return new OasExample({
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { OasExternalDocs } from './ExternalDocs.js';
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToExternalDocsArgs = {
|
|
5
6
|
externalDocs: OpenAPIV3.ExternalDocumentationObject | undefined;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toExternalDocs: ({ externalDocs }: ToExternalDocsArgs) => OasExternalDocs | undefined;
|
|
10
|
+
export declare const toExternalDocs: ({ externalDocs, stackTrail }: ToExternalDocsArgs) => OasExternalDocs | undefined;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toExternalDocs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toExternalDocs.d.ts","sourceRoot":"","sources":["../../../src/oas/externalDocs/toExternalDocs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"toExternalDocs.d.ts","sourceRoot":"","sources":["../../../src/oas/externalDocs/toExternalDocs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,SAAS,CAAC,2BAA2B,GAAG,SAAS,CAAA;IAC/D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,8BAG5B,kBAAkB,KAAG,eAAe,GAAG,SAazC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OasExternalDocs } from './ExternalDocs.js';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
import { oasExternalDocsData } from './externalDocsTypes.js';
|
|
4
|
-
export const toExternalDocs = ({ externalDocs }) => {
|
|
4
|
+
export const toExternalDocs = ({ externalDocs, stackTrail }) => {
|
|
5
5
|
if (!externalDocs) {
|
|
6
6
|
return undefined;
|
|
7
7
|
}
|
|
@@ -2,10 +2,12 @@ import type { ParseContextType } from '../../context/parseTypes.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasHeader } from './Header.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
6
|
type ToHeadersV3Args = {
|
|
6
7
|
headers: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.HeaderObject> | undefined;
|
|
8
|
+
stackTrail: StackTrail;
|
|
7
9
|
context: ParseContextType;
|
|
8
10
|
};
|
|
9
|
-
export declare const toHeadersV3: ({ headers, context }: ToHeadersV3Args) => Record<string, OasHeader | OasRef<"header">> | undefined;
|
|
11
|
+
export declare const toHeadersV3: ({ headers, stackTrail, context }: ToHeadersV3Args) => Record<string, OasHeader | OasRef<"header">> | undefined;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=toHeadersV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,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,GAAG,SAAS,CAAA;IACvF,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,CAAC,GAAG,SAenE,CAAA"}
|
|
@@ -5,41 +5,42 @@ import { isRef } from '../../helpers/refFns.js';
|
|
|
5
5
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
6
6
|
import { OasHeader } from './Header.js';
|
|
7
7
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
8
|
-
|
|
9
|
-
export const toHeadersV3 = ({ headers, context }) => {
|
|
8
|
+
export const toHeadersV3 = ({ headers, stackTrail, context }) => {
|
|
10
9
|
if (!headers) {
|
|
11
10
|
return undefined;
|
|
12
11
|
}
|
|
13
12
|
const output = {};
|
|
14
13
|
const entries = Object.entries(headers);
|
|
15
14
|
for (const [key, value] of entries) {
|
|
16
|
-
output[key] =
|
|
15
|
+
output[key] = stackTrail.trace(key, st => toHeaderV3({ header: value, stackTrail: st, context }));
|
|
17
16
|
}
|
|
18
17
|
return output;
|
|
19
18
|
};
|
|
20
|
-
const toHeaderV3 = ({ header, context }) => {
|
|
19
|
+
const toHeaderV3 = ({ header, stackTrail, context }) => {
|
|
21
20
|
if (isRef(header)) {
|
|
22
|
-
return toRefV31({ ref: header, refType: 'header', context });
|
|
21
|
+
return toRefV31({ ref: header, refType: 'header', stackTrail, context });
|
|
23
22
|
}
|
|
24
23
|
const { description, required, deprecated, schema, example, examples, content, ...skipped } = header;
|
|
25
24
|
const extensionFields = toSpecificationExtensionsV3({
|
|
26
25
|
skipped,
|
|
27
26
|
parent: header,
|
|
28
27
|
context,
|
|
28
|
+
stackTrail,
|
|
29
29
|
parentType: 'header'
|
|
30
30
|
});
|
|
31
31
|
const fields = {
|
|
32
32
|
description,
|
|
33
33
|
required,
|
|
34
34
|
deprecated,
|
|
35
|
-
schema:
|
|
35
|
+
schema: stackTrail.trace('schema', st => toOptionalSchemaV3({ schema, stackTrail: st, context })),
|
|
36
36
|
examples: toExamplesV3({
|
|
37
37
|
examples,
|
|
38
38
|
example,
|
|
39
39
|
exampleKey: `TEMP`,
|
|
40
|
+
stackTrail,
|
|
40
41
|
context
|
|
41
42
|
}),
|
|
42
|
-
content:
|
|
43
|
+
content: stackTrail.trace('content', st => toOptionalMediaTypeItemsV3({ content, stackTrail: st, context })),
|
|
43
44
|
extensionFields
|
|
44
45
|
};
|
|
45
46
|
return new OasHeader(fields);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasInfo } from './Info.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToInfoV3Args = {
|
|
5
6
|
info: OpenAPIV3.InfoObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toInfoV3: ({ info, context }: ToInfoV3Args) => OasInfo;
|
|
10
|
+
export declare const toInfoV3: ({ info, stackTrail, context }: ToInfoV3Args) => OasInfo;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toInfoV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toInfoV3.d.ts","sourceRoot":"","sources":["../../../src/oas/info/toInfoV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"toInfoV3.d.ts","sourceRoot":"","sources":["../../../src/oas/info/toInfoV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC,UAAU,CAAA;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,+BAA+B,YAAY,KAAG,OAoBtE,CAAA"}
|
package/esm/oas/info/toInfoV3.js
CHANGED
|
@@ -2,20 +2,21 @@ import { OasInfo } from './Info.js';
|
|
|
2
2
|
import { toContactV3 } from '../contact/toContactV3.js';
|
|
3
3
|
import { toLicenseV3 } from '../license/toLicenseV3.js';
|
|
4
4
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
5
|
-
export const toInfoV3 = ({ info, context }) => {
|
|
5
|
+
export const toInfoV3 = ({ info, stackTrail, context }) => {
|
|
6
6
|
const { title, description, termsOfService, contact, license, version, ...skipped } = info;
|
|
7
7
|
const extensionFields = toSpecificationExtensionsV3({
|
|
8
8
|
skipped,
|
|
9
9
|
parent: info,
|
|
10
10
|
context,
|
|
11
|
+
stackTrail,
|
|
11
12
|
parentType: 'info'
|
|
12
13
|
});
|
|
13
14
|
return new OasInfo({
|
|
14
15
|
title,
|
|
15
16
|
description,
|
|
16
17
|
termsOfService,
|
|
17
|
-
contact: contact ? toContactV3(contact, context) : undefined,
|
|
18
|
-
license: license ? toLicenseV3(license, context) : undefined,
|
|
18
|
+
contact: contact ? toContactV3(contact, stackTrail, context) : undefined,
|
|
19
|
+
license: license ? toLicenseV3(license, stackTrail, context) : undefined,
|
|
19
20
|
version,
|
|
20
21
|
extensionFields
|
|
21
22
|
});
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasInteger } from './Integer.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToIntegerArgs = {
|
|
5
6
|
value: OpenAPIV3.SchemaObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toInteger: ({ value, context }: ToIntegerArgs) => OasInteger;
|
|
10
|
+
export declare const toInteger: ({ value, stackTrail, context }: ToIntegerArgs) => OasInteger;
|
|
9
11
|
type ToParsedIntegerArgs<Nullable extends boolean | undefined> = {
|
|
10
12
|
value: Omit<OpenAPIV3.SchemaObject, 'nullable' | 'example' | 'enums'>;
|
|
13
|
+
stackTrail: StackTrail;
|
|
11
14
|
context: ParseContextType;
|
|
12
15
|
nullable: Nullable;
|
|
13
16
|
example: Nullable extends true ? number | null | undefined : number | undefined;
|
|
14
17
|
enums: Nullable extends true ? (number | null)[] | undefined : number[] | undefined;
|
|
15
18
|
};
|
|
16
|
-
export declare const toParsedInteger: <Nullable extends boolean | undefined>({ context, nullable, example, enums, value: valueWithoutEnums }: ToParsedIntegerArgs<Nullable>) => OasInteger<Nullable>;
|
|
19
|
+
export declare const toParsedInteger: <Nullable extends boolean | undefined>({ context, nullable, example, enums, value: valueWithoutEnums, stackTrail }: ToParsedIntegerArgs<Nullable>) => OasInteger<Nullable>;
|
|
17
20
|
export {};
|
|
18
21
|
//# sourceMappingURL=toInteger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toInteger.d.ts","sourceRoot":"","sources":["../../../src/oas/integer/toInteger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"toInteger.d.ts","sourceRoot":"","sources":["../../../src/oas/integer/toInteger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAMzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,gCAAgC,aAAa,KAAG,UAqCzE,CAAA;AAED,KAAK,mBAAmB,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAC/D,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;IACrE,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;IAC/E,KAAK,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CACpF,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,6EAOnE,mBAAmB,CAAC,QAAQ,CAAC,KAAG,UAAU,CAAC,QAAQ,CAwDrD,CAAA"}
|
|
@@ -4,17 +4,19 @@ import { oasIntegerData, integerFormat } from './integer-types.js';
|
|
|
4
4
|
import { parseNullable } from '../_helpers/parseNullable.js';
|
|
5
5
|
import { parseEnum } from '../_helpers/parseEnum.js';
|
|
6
6
|
import * as v from 'valibot';
|
|
7
|
-
export const toInteger = ({ value, context }) => {
|
|
7
|
+
export const toInteger = ({ value, stackTrail, context }) => {
|
|
8
8
|
const { nullable, value: valueWithoutNullable } = parseNullable({
|
|
9
9
|
value,
|
|
10
|
-
context
|
|
10
|
+
context,
|
|
11
|
+
stackTrail
|
|
11
12
|
});
|
|
12
13
|
const { example: unparsedExample, ...valueWithoutExample } = valueWithoutNullable;
|
|
13
14
|
const example = parseExample({
|
|
14
15
|
example: unparsedExample,
|
|
15
16
|
context,
|
|
16
17
|
parent: valueWithoutNullable,
|
|
17
|
-
nullable
|
|
18
|
+
nullable,
|
|
19
|
+
stackTrail
|
|
18
20
|
});
|
|
19
21
|
const { enum: unparsedEnums, ...valueWithoutEnums } = valueWithoutExample;
|
|
20
22
|
const enums = parseEnum({
|
|
@@ -23,22 +25,25 @@ export const toInteger = ({ value, context }) => {
|
|
|
23
25
|
parent: valueWithoutExample,
|
|
24
26
|
context,
|
|
25
27
|
check: Number.isInteger,
|
|
26
|
-
toMessage: item => `Removed invalid enum. Expected "integer", got: ${item}
|
|
28
|
+
toMessage: item => `Removed invalid enum. Expected "integer", got: ${item}`,
|
|
29
|
+
stackTrail
|
|
27
30
|
});
|
|
28
31
|
return toParsedInteger({
|
|
29
32
|
context,
|
|
30
33
|
nullable,
|
|
31
34
|
example,
|
|
32
35
|
enums,
|
|
33
|
-
value: valueWithoutEnums
|
|
36
|
+
value: valueWithoutEnums,
|
|
37
|
+
stackTrail
|
|
34
38
|
});
|
|
35
39
|
};
|
|
36
|
-
export const toParsedInteger = ({ context, nullable, example, enums, value: valueWithoutEnums }) => {
|
|
40
|
+
export const toParsedInteger = ({ context, nullable, example, enums, value: valueWithoutEnums, stackTrail }) => {
|
|
37
41
|
const { format: unparsedFormat, ...valueWithoutFormat } = valueWithoutEnums;
|
|
38
42
|
const format = parseIntegerFormat({
|
|
39
43
|
format: unparsedFormat,
|
|
40
44
|
context,
|
|
41
|
-
parent: valueWithoutEnums
|
|
45
|
+
parent: valueWithoutEnums,
|
|
46
|
+
stackTrail
|
|
42
47
|
});
|
|
43
48
|
if (!v.is(oasIntegerData, valueWithoutFormat)) {
|
|
44
49
|
v.parse(oasIntegerData, valueWithoutFormat);
|
|
@@ -48,6 +53,7 @@ export const toParsedInteger = ({ context, nullable, example, enums, value: valu
|
|
|
48
53
|
skipped,
|
|
49
54
|
parent: valueWithoutEnums,
|
|
50
55
|
context,
|
|
56
|
+
stackTrail,
|
|
51
57
|
parentType: 'schema:integer'
|
|
52
58
|
});
|
|
53
59
|
return new OasInteger({
|
|
@@ -69,7 +75,7 @@ export const toParsedInteger = ({ context, nullable, example, enums, value: valu
|
|
|
69
75
|
deprecated
|
|
70
76
|
});
|
|
71
77
|
};
|
|
72
|
-
const parseIntegerFormat = ({ format, context, parent }) => {
|
|
78
|
+
const parseIntegerFormat = ({ format, context, parent, stackTrail }) => {
|
|
73
79
|
if (format === undefined) {
|
|
74
80
|
return undefined;
|
|
75
81
|
}
|
|
@@ -79,13 +85,14 @@ const parseIntegerFormat = ({ format, context, parent }) => {
|
|
|
79
85
|
level: 'warning',
|
|
80
86
|
message: `Invalid format: ${format}`,
|
|
81
87
|
parent,
|
|
88
|
+
stackTrail,
|
|
82
89
|
type: 'INVALID_FORMAT'
|
|
83
90
|
});
|
|
84
91
|
return undefined;
|
|
85
92
|
}
|
|
86
93
|
return format;
|
|
87
94
|
};
|
|
88
|
-
const parseExample = ({ example, context, parent, nullable }) => {
|
|
95
|
+
const parseExample = ({ example, context, parent, nullable, stackTrail }) => {
|
|
89
96
|
if (example === undefined) {
|
|
90
97
|
return undefined;
|
|
91
98
|
}
|
|
@@ -98,6 +105,7 @@ const parseExample = ({ example, context, parent, nullable }) => {
|
|
|
98
105
|
level: 'warning',
|
|
99
106
|
message: `Removed invalid example. Expected "integer", got: ${example}`,
|
|
100
107
|
parent,
|
|
108
|
+
stackTrail,
|
|
101
109
|
type: 'INVALID_EXAMPLE'
|
|
102
110
|
});
|
|
103
111
|
return undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasLicense } from './License.js';
|
|
4
|
-
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
5
|
+
export declare const toLicenseV3: (license: OpenAPIV3.LicenseObject, stackTrail: StackTrail, context: ParseContextType) => OasLicense;
|
|
5
6
|
//# sourceMappingURL=toLicenseV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toLicenseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/license/toLicenseV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"toLicenseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/license/toLicenseV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,eAAO,MAAM,WAAW,GACtB,SAAS,SAAS,CAAC,aAAa,EAChC,YAAY,UAAU,EACtB,SAAS,gBAAgB,KACxB,UAgBF,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
2
2
|
import { OasLicense } from './License.js';
|
|
3
|
-
export const toLicenseV3 = (license, context) => {
|
|
3
|
+
export const toLicenseV3 = (license, stackTrail, context) => {
|
|
4
4
|
const { name, url, ...skipped } = license;
|
|
5
5
|
const extensionFields = toSpecificationExtensionsV3({
|
|
6
6
|
skipped,
|
|
7
7
|
parent: license,
|
|
8
8
|
context,
|
|
9
|
+
stackTrail,
|
|
9
10
|
parentType: 'license'
|
|
10
11
|
});
|
|
11
12
|
return new OasLicense({
|