@skmtc/core 0.0.940 → 0.0.942
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,20 +1,24 @@
|
|
|
1
1
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasServer } from './Server.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToServersV3Args = {
|
|
5
6
|
servers: OpenAPIV3.ServerObject[];
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toServersV3: ({ servers, context }: ToServersV3Args) => OasServer[];
|
|
10
|
+
export declare const toServersV3: ({ servers, stackTrail, context }: ToServersV3Args) => OasServer[];
|
|
9
11
|
type ToOptionalServersV3Args = {
|
|
10
12
|
servers: OpenAPIV3.ServerObject[] | undefined;
|
|
13
|
+
stackTrail: StackTrail;
|
|
11
14
|
context: ParseContextType;
|
|
12
15
|
};
|
|
13
|
-
export declare const toOptionalServersV3: ({ servers, context }: ToOptionalServersV3Args) => OasServer[] | undefined;
|
|
16
|
+
export declare const toOptionalServersV3: ({ servers, stackTrail, context }: ToOptionalServersV3Args) => OasServer[] | undefined;
|
|
14
17
|
type ToServerV3Args = {
|
|
15
18
|
server: OpenAPIV3.ServerObject;
|
|
19
|
+
stackTrail: StackTrail;
|
|
16
20
|
context: ParseContextType;
|
|
17
21
|
};
|
|
18
|
-
export declare const toServerV3: ({ server, context }: ToServerV3Args) => OasServer;
|
|
22
|
+
export declare const toServerV3: ({ server, stackTrail, context }: ToServerV3Args) => OasServer;
|
|
19
23
|
export {};
|
|
20
24
|
//# sourceMappingURL=toServerV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,CAAA;IACjC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,kCAAkC,eAAe,KAAG,SAAS,EAMxF,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,CAAA;IAC7C,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,kCAIjC,uBAAuB,KAAG,SAAS,EAAE,GAAG,SAM1C,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,YAAY,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,iCAAiC,cAAc,KAAG,SAiB5E,CAAA"}
|
|
@@ -4,32 +4,32 @@ exports.toServerV3 = exports.toOptionalServersV3 = exports.toServersV3 = void 0;
|
|
|
4
4
|
const Server_js_1 = require("./Server.js");
|
|
5
5
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
6
6
|
const toServerVariableV3_js_1 = require("../serverVariable/toServerVariableV3.js");
|
|
7
|
-
const
|
|
8
|
-
const toServersV3 = ({ servers, context }) => {
|
|
7
|
+
const toServersV3 = ({ servers, stackTrail, context }) => {
|
|
9
8
|
return servers.map((server, index) => {
|
|
10
|
-
return
|
|
9
|
+
return stackTrail.trace(server.url ?? index, st => (0, exports.toServerV3)({ server, stackTrail: st, context }));
|
|
11
10
|
});
|
|
12
11
|
};
|
|
13
12
|
exports.toServersV3 = toServersV3;
|
|
14
|
-
const toOptionalServersV3 = ({ servers, context }) => {
|
|
13
|
+
const toOptionalServersV3 = ({ servers, stackTrail, context }) => {
|
|
15
14
|
if (!servers) {
|
|
16
15
|
return undefined;
|
|
17
16
|
}
|
|
18
|
-
return (0, exports.toServersV3)({ servers, context });
|
|
17
|
+
return (0, exports.toServersV3)({ servers, stackTrail, context });
|
|
19
18
|
};
|
|
20
19
|
exports.toOptionalServersV3 = toOptionalServersV3;
|
|
21
|
-
const toServerV3 = ({ server, context }) => {
|
|
20
|
+
const toServerV3 = ({ server, stackTrail, context }) => {
|
|
22
21
|
const { description, url, variables, ...skipped } = server;
|
|
23
22
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
24
23
|
skipped,
|
|
25
24
|
parent: server,
|
|
26
25
|
context,
|
|
26
|
+
stackTrail,
|
|
27
27
|
parentType: 'server'
|
|
28
28
|
});
|
|
29
29
|
return new Server_js_1.OasServer({
|
|
30
30
|
description,
|
|
31
31
|
url,
|
|
32
|
-
variables: (0, toServerVariableV3_js_1.toOptionalServerVariablesV3)({ serverVariables: variables, context }),
|
|
32
|
+
variables: (0, toServerVariableV3_js_1.toOptionalServerVariablesV3)({ serverVariables: variables, stackTrail, context }),
|
|
33
33
|
extensionFields
|
|
34
34
|
});
|
|
35
35
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasServerVariable } from './ServerVariable.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToServerVariablesV3Args = {
|
|
5
6
|
serverVariables: Record<string, OpenAPIV3.ServerVariableObject>;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toServerVariablesV3: ({ serverVariables, context }: ToServerVariablesV3Args) => Record<string, OasServerVariable>;
|
|
10
|
+
export declare const toServerVariablesV3: ({ serverVariables, stackTrail, context }: ToServerVariablesV3Args) => Record<string, OasServerVariable>;
|
|
9
11
|
type ToOptionalServerVariablesV3Args = {
|
|
10
12
|
serverVariables: Record<string, OpenAPIV3.ServerVariableObject> | undefined;
|
|
13
|
+
stackTrail: StackTrail;
|
|
11
14
|
context: ParseContextType;
|
|
12
15
|
};
|
|
13
|
-
export declare const toOptionalServerVariablesV3: ({ serverVariables, context }: ToOptionalServerVariablesV3Args) => Record<string, OasServerVariable> | undefined;
|
|
16
|
+
export declare const toOptionalServerVariablesV3: ({ serverVariables, stackTrail, context }: ToOptionalServerVariablesV3Args) => Record<string, OasServerVariable> | undefined;
|
|
14
17
|
type ToServerVariableV3Args = {
|
|
15
18
|
serverVariable: OpenAPIV3.ServerVariableObject;
|
|
19
|
+
stackTrail: StackTrail;
|
|
16
20
|
context: ParseContextType;
|
|
17
21
|
};
|
|
18
|
-
export declare const toServerVariableV3: ({ serverVariable, context }: ToServerVariableV3Args) => OasServerVariable;
|
|
22
|
+
export declare const toServerVariableV3: ({ serverVariable, stackTrail, context }: ToServerVariableV3Args) => OasServerVariable;
|
|
19
23
|
export {};
|
|
20
24
|
//# sourceMappingURL=toServerVariableV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toServerVariableV3.d.ts","sourceRoot":"","sources":["../../../src/oas/serverVariable/toServerVariableV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"toServerVariableV3.d.ts","sourceRoot":"","sources":["../../../src/oas/serverVariable/toServerVariableV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,uBAAuB,GAAG;IAC7B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,oBAAoB,CAAC,CAAA;IAC/D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,0CAIjC,uBAAuB,KAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAO5D,CAAA;AAED,KAAK,+BAA+B,GAAG;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAA;IAC3E,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,2BAA2B,GAAI,0CAIzC,+BAA+B,KAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAMxE,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,SAAS,CAAC,oBAAoB,CAAA;IAC9C,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,yCAIhC,sBAAsB,KAAG,iBAiB3B,CAAA"}
|
|
@@ -3,26 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toServerVariableV3 = exports.toOptionalServerVariablesV3 = exports.toServerVariablesV3 = void 0;
|
|
4
4
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
5
5
|
const ServerVariable_js_1 = require("./ServerVariable.js");
|
|
6
|
-
const toServerVariablesV3 = ({ serverVariables, context }) => {
|
|
6
|
+
const toServerVariablesV3 = ({ serverVariables, stackTrail, context }) => {
|
|
7
7
|
return Object.fromEntries(Object.entries(serverVariables).map(([key, serverVariable]) => [
|
|
8
8
|
key,
|
|
9
|
-
(0, exports.toServerVariableV3)({ serverVariable, context })
|
|
9
|
+
(0, exports.toServerVariableV3)({ serverVariable, stackTrail, context })
|
|
10
10
|
]));
|
|
11
11
|
};
|
|
12
12
|
exports.toServerVariablesV3 = toServerVariablesV3;
|
|
13
|
-
const toOptionalServerVariablesV3 = ({ serverVariables, context }) => {
|
|
13
|
+
const toOptionalServerVariablesV3 = ({ serverVariables, stackTrail, context }) => {
|
|
14
14
|
if (!serverVariables) {
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
17
|
-
return (0, exports.toServerVariablesV3)({ serverVariables, context });
|
|
17
|
+
return (0, exports.toServerVariablesV3)({ serverVariables, stackTrail, context });
|
|
18
18
|
};
|
|
19
19
|
exports.toOptionalServerVariablesV3 = toOptionalServerVariablesV3;
|
|
20
|
-
const toServerVariableV3 = ({ serverVariable, context }) => {
|
|
20
|
+
const toServerVariableV3 = ({ serverVariable, stackTrail, context }) => {
|
|
21
21
|
const { description, default: defaultValue, enum: enums, ...skipped } = serverVariable;
|
|
22
22
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
23
23
|
skipped,
|
|
24
24
|
parent: serverVariable,
|
|
25
25
|
context,
|
|
26
|
+
stackTrail,
|
|
26
27
|
parentType: 'serverVariable'
|
|
27
28
|
});
|
|
28
29
|
return new ServerVariable_js_1.OasServerVariable({
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
2
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
2
3
|
type ToSpecificationExtensionsV3Args = {
|
|
3
4
|
skipped: Record<string, unknown>;
|
|
4
5
|
parent: unknown;
|
|
5
6
|
parentType: string;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toSpecificationExtensionsV3: ({ skipped: s, parent, parentType, context }: ToSpecificationExtensionsV3Args) => Record<string, unknown> | undefined;
|
|
10
|
+
export declare const toSpecificationExtensionsV3: ({ skipped: s, parent, parentType, stackTrail, context }: ToSpecificationExtensionsV3Args) => Record<string, unknown> | undefined;
|
|
9
11
|
export declare const extractExtensions: (item: Record<string, unknown>) => {
|
|
10
12
|
skipped: Record<string, unknown> | undefined;
|
|
11
13
|
extensionFields: Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSpecificationExtensionsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/specificationExtensions/toSpecificationExtensionsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"toSpecificationExtensionsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/specificationExtensions/toSpecificationExtensionsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,+BAA+B,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,2BAA2B,GAAI,yDAMzC,+BAA+B,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAQ9D,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;CAkB9D,CAAA"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractExtensions = exports.toSpecificationExtensionsV3 = void 0;
|
|
4
4
|
const isEmpty_js_1 = require("../../helpers/isEmpty.js");
|
|
5
|
-
const toSpecificationExtensionsV3 = ({ skipped: s, parent, parentType, context }) => {
|
|
5
|
+
const toSpecificationExtensionsV3 = ({ skipped: s, parent, parentType, stackTrail, context }) => {
|
|
6
6
|
const { skipped, extensionFields } = (0, exports.extractExtensions)(s);
|
|
7
7
|
if (skipped) {
|
|
8
|
-
context.logSkippedFields({ skipped, parent, parentType });
|
|
8
|
+
context.logSkippedFields({ skipped, parent, stackTrail, parentType });
|
|
9
9
|
}
|
|
10
10
|
return extensionFields;
|
|
11
11
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasString } from './String.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
/**
|
|
5
6
|
* Arguments for transforming an OpenAPI string schema into OAS representation.
|
|
6
7
|
*/
|
|
7
8
|
type ToStringArgs = {
|
|
8
9
|
/** The OpenAPI v3 schema object to transform (must be type 'string') */
|
|
9
10
|
value: OpenAPIV3.SchemaObject;
|
|
11
|
+
/** The stack trail for tracing */
|
|
12
|
+
stackTrail: StackTrail;
|
|
10
13
|
/** Parse context providing utilities and tracing capabilities */
|
|
11
14
|
context: ParseContextType;
|
|
12
15
|
};
|
|
@@ -69,7 +72,7 @@ type ToStringArgs = {
|
|
|
69
72
|
* console.log(oasString.enums); // ['active', 'inactive', 'pending', null]
|
|
70
73
|
* ```
|
|
71
74
|
*/
|
|
72
|
-
export declare const toString: ({ context, value }: ToStringArgs) => OasString;
|
|
75
|
+
export declare const toString: ({ context, value, stackTrail }: ToStringArgs) => OasString;
|
|
73
76
|
type ToParsedStringArgs<Nullable extends boolean | undefined> = {
|
|
74
77
|
value: Omit<OpenAPIV3.SchemaObject, 'nullable' | 'example' | 'enums' | 'default'>;
|
|
75
78
|
context: ParseContextType;
|
|
@@ -77,6 +80,7 @@ type ToParsedStringArgs<Nullable extends boolean | undefined> = {
|
|
|
77
80
|
example: Nullable extends true ? string | null | undefined : string | undefined;
|
|
78
81
|
enums: Nullable extends true ? (string | null)[] | undefined : string[] | undefined;
|
|
79
82
|
defaultValue: Nullable extends true ? string | null | undefined : string | undefined;
|
|
83
|
+
stackTrail: StackTrail;
|
|
80
84
|
};
|
|
81
85
|
/**
|
|
82
86
|
* Creates an OAS string instance from pre-parsed string schema components.
|
|
@@ -138,6 +142,6 @@ type ToParsedStringArgs<Nullable extends boolean | undefined> = {
|
|
|
138
142
|
* console.log(customFormatString.format); // 'custom-id' (still preserved)
|
|
139
143
|
* ```
|
|
140
144
|
*/
|
|
141
|
-
export declare const toParsedString: <Nullable extends boolean | undefined>({ context, nullable, example, enums, defaultValue, value }: ToParsedStringArgs<Nullable>) => OasString<Nullable>;
|
|
145
|
+
export declare const toParsedString: <Nullable extends boolean | undefined>({ context, nullable, example, enums, defaultValue, value, stackTrail }: ToParsedStringArgs<Nullable>) => OasString<Nullable>;
|
|
142
146
|
export {};
|
|
143
147
|
//# sourceMappingURL=toString.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toString.d.ts","sourceRoot":"","sources":["../../../src/oas/string/toString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"toString.d.ts","sourceRoot":"","sources":["../../../src/oas/string/toString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAMvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D;;GAEG;AACH,KAAK,YAAY,GAAG;IAClB,wEAAwE;IACxE,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,kCAAkC;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,iEAAiE;IACjE,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,QAAQ,GAAI,gCAAgC,YAAY,KAAG,SAgDvE,CAAA;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAC9D,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;IACjF,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;IACnF,YAAY,EAAE,QAAQ,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;IACpF,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,wEAQlE,kBAAkB,CAAC,QAAQ,CAAC,KAAG,SAAS,CAAC,QAAQ,CAsDnD,CAAA"}
|
|
@@ -99,17 +99,19 @@ const parseEnum_js_1 = require("../_helpers/parseEnum.js");
|
|
|
99
99
|
* console.log(oasString.enums); // ['active', 'inactive', 'pending', null]
|
|
100
100
|
* ```
|
|
101
101
|
*/
|
|
102
|
-
const toString = ({ context, value }) => {
|
|
102
|
+
const toString = ({ context, value, stackTrail }) => {
|
|
103
103
|
const { nullable, value: valueWithoutNullable } = (0, parseNullable_js_1.parseNullable)({
|
|
104
104
|
value,
|
|
105
|
-
context
|
|
105
|
+
context,
|
|
106
|
+
stackTrail
|
|
106
107
|
});
|
|
107
108
|
const { example: unparsedExample, ...valueWithoutExample } = valueWithoutNullable;
|
|
108
109
|
const example = parseExample({
|
|
109
110
|
example: unparsedExample,
|
|
110
111
|
context,
|
|
111
112
|
parent: valueWithoutNullable,
|
|
112
|
-
nullable
|
|
113
|
+
nullable,
|
|
114
|
+
stackTrail
|
|
113
115
|
});
|
|
114
116
|
const { enum: unparsedEnums, ...valueWithoutEnums } = valueWithoutExample;
|
|
115
117
|
const enums = (0, parseEnum_js_1.parseEnum)({
|
|
@@ -118,14 +120,16 @@ const toString = ({ context, value }) => {
|
|
|
118
120
|
parent: valueWithoutExample,
|
|
119
121
|
context,
|
|
120
122
|
check: isString,
|
|
121
|
-
toMessage: item => `Removed invalid enum. Expected "string", got: ${item}
|
|
123
|
+
toMessage: item => `Removed invalid enum. Expected "string", got: ${item}`,
|
|
124
|
+
stackTrail
|
|
122
125
|
});
|
|
123
126
|
const { default: unparsedDefaultValue, ...valueWithoutDefault } = valueWithoutEnums;
|
|
124
127
|
const defaultValue = parseDefault({
|
|
125
128
|
defaultValue: unparsedDefaultValue,
|
|
126
129
|
context,
|
|
127
130
|
parent: valueWithoutEnums,
|
|
128
|
-
nullable
|
|
131
|
+
nullable,
|
|
132
|
+
stackTrail
|
|
129
133
|
});
|
|
130
134
|
return (0, exports.toParsedString)({
|
|
131
135
|
context,
|
|
@@ -133,7 +137,8 @@ const toString = ({ context, value }) => {
|
|
|
133
137
|
example,
|
|
134
138
|
enums,
|
|
135
139
|
defaultValue,
|
|
136
|
-
value: valueWithoutDefault
|
|
140
|
+
value: valueWithoutDefault,
|
|
141
|
+
stackTrail
|
|
137
142
|
});
|
|
138
143
|
};
|
|
139
144
|
exports.toString = toString;
|
|
@@ -197,7 +202,7 @@ exports.toString = toString;
|
|
|
197
202
|
* console.log(customFormatString.format); // 'custom-id' (still preserved)
|
|
198
203
|
* ```
|
|
199
204
|
*/
|
|
200
|
-
const toParsedString = ({ context, nullable, example, enums, defaultValue, value }) => {
|
|
205
|
+
const toParsedString = ({ context, nullable, example, enums, defaultValue, value, stackTrail }) => {
|
|
201
206
|
if (!v.is(string_types_js_1.oasStringData, value)) {
|
|
202
207
|
v.parse(string_types_js_1.oasStringData, value);
|
|
203
208
|
}
|
|
@@ -206,6 +211,7 @@ const toParsedString = ({ context, nullable, example, enums, defaultValue, value
|
|
|
206
211
|
skipped,
|
|
207
212
|
parent: value,
|
|
208
213
|
context,
|
|
214
|
+
stackTrail,
|
|
209
215
|
parentType: 'schema:string'
|
|
210
216
|
});
|
|
211
217
|
if (format && !v.is(string_types_js_1.stringFormat, format)) {
|
|
@@ -214,6 +220,7 @@ const toParsedString = ({ context, nullable, example, enums, defaultValue, value
|
|
|
214
220
|
level: 'warning',
|
|
215
221
|
message: `Unexpected format: ${format}`,
|
|
216
222
|
parent: value,
|
|
223
|
+
stackTrail,
|
|
217
224
|
type: 'UNEXPECTED_FORMAT'
|
|
218
225
|
});
|
|
219
226
|
}
|
|
@@ -238,7 +245,7 @@ exports.toParsedString = toParsedString;
|
|
|
238
245
|
const isString = (value) => {
|
|
239
246
|
return typeof value === 'string';
|
|
240
247
|
};
|
|
241
|
-
const parseExample = ({ example, context, parent, nullable }) => {
|
|
248
|
+
const parseExample = ({ example, context, parent, nullable, stackTrail }) => {
|
|
242
249
|
if (example === undefined) {
|
|
243
250
|
return undefined;
|
|
244
251
|
}
|
|
@@ -251,13 +258,14 @@ const parseExample = ({ example, context, parent, nullable }) => {
|
|
|
251
258
|
level: 'warning',
|
|
252
259
|
message: `Removed invalid example. Expected "string", got: ${example}`,
|
|
253
260
|
parent,
|
|
261
|
+
stackTrail,
|
|
254
262
|
type: 'INVALID_EXAMPLE'
|
|
255
263
|
});
|
|
256
264
|
return undefined;
|
|
257
265
|
}
|
|
258
266
|
return example;
|
|
259
267
|
};
|
|
260
|
-
const parseDefault = ({ defaultValue, context, parent, nullable }) => {
|
|
268
|
+
const parseDefault = ({ defaultValue, context, parent, nullable, stackTrail }) => {
|
|
261
269
|
if (defaultValue === undefined) {
|
|
262
270
|
return undefined;
|
|
263
271
|
}
|
|
@@ -270,6 +278,7 @@ const parseDefault = ({ defaultValue, context, parent, nullable }) => {
|
|
|
270
278
|
level: 'warning',
|
|
271
279
|
message: `Removed invalid default. Expected "string", got: ${defaultValue}`,
|
|
272
280
|
parent,
|
|
281
|
+
stackTrail,
|
|
273
282
|
type: 'INVALID_DEFAULT'
|
|
274
283
|
});
|
|
275
284
|
return undefined;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasTag } from './Tag.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToTagsV3Args = {
|
|
5
6
|
tags: OpenAPIV3.TagObject[] | undefined;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toTagsV3: ({ tags, context }: ToTagsV3Args) => OasTag[] | undefined;
|
|
10
|
+
export declare const toTagsV3: ({ tags, stackTrail, context }: ToTagsV3Args) => OasTag[] | undefined;
|
|
9
11
|
type ToTagV3Args = {
|
|
10
12
|
tag: OpenAPIV3.TagObject;
|
|
13
|
+
stackTrail: StackTrail;
|
|
11
14
|
context: ParseContextType;
|
|
12
15
|
};
|
|
13
|
-
export declare const toTagV3: ({ tag, context }: ToTagV3Args) => OasTag;
|
|
16
|
+
export declare const toTagV3: ({ tag, stackTrail, context }: ToTagV3Args) => OasTag;
|
|
14
17
|
export {};
|
|
15
18
|
//# sourceMappingURL=toTagsV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toTagsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/tag/toTagsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"toTagsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/tag/toTagsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,GAAG,SAAS,CAAA;IACvC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,+BAA+B,YAAY,KAAG,MAAM,EAAE,GAAG,SAMjF,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,SAAS,CAAC,SAAS,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,8BAA8B,WAAW,KAAG,MAkBnE,CAAA"}
|
|
@@ -3,19 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toTagV3 = exports.toTagsV3 = void 0;
|
|
4
4
|
const Tag_js_1 = require("./Tag.js");
|
|
5
5
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
6
|
-
const toTagsV3 = ({ tags, context }) => {
|
|
6
|
+
const toTagsV3 = ({ tags, stackTrail, context }) => {
|
|
7
7
|
if (!tags) {
|
|
8
8
|
return undefined;
|
|
9
9
|
}
|
|
10
|
-
return tags.map(tag => (0, exports.toTagV3)({ tag, context }));
|
|
10
|
+
return tags.map(tag => (0, exports.toTagV3)({ tag, stackTrail, context }));
|
|
11
11
|
};
|
|
12
12
|
exports.toTagsV3 = toTagsV3;
|
|
13
|
-
const toTagV3 = ({ tag, context }) => {
|
|
13
|
+
const toTagV3 = ({ tag, stackTrail, context }) => {
|
|
14
14
|
const { name, description, ...skipped } = tag;
|
|
15
15
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
16
16
|
skipped,
|
|
17
17
|
parent: tag,
|
|
18
18
|
context,
|
|
19
|
+
stackTrail,
|
|
19
20
|
parentType: 'tag'
|
|
20
21
|
});
|
|
21
22
|
const fields = {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasUnion } from './Union.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToUnionArgs = {
|
|
5
6
|
value: OpenAPIV3.SchemaObject;
|
|
6
7
|
members: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
|
|
7
8
|
parentType: 'anyOf' | 'oneOf';
|
|
9
|
+
stackTrail: StackTrail;
|
|
8
10
|
context: ParseContextType;
|
|
9
11
|
};
|
|
10
|
-
export declare const toUnion: ({ value, members, parentType, context }: ToUnionArgs) => OasUnion;
|
|
12
|
+
export declare const toUnion: ({ value, members, parentType, stackTrail, context }: ToUnionArgs) => OasUnion;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=toUnion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toUnion.d.ts","sourceRoot":"","sources":["../../../src/oas/union/toUnion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"toUnion.d.ts","sourceRoot":"","sources":["../../../src/oas/union/toUnion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAMrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAA;IAC/D,UAAU,EAAE,OAAO,GAAG,OAAO,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,qDAMrB,WAAW,KAAG,QAwChB,CAAA"}
|
|
@@ -5,13 +5,13 @@ const Union_js_1 = require("./Union.js");
|
|
|
5
5
|
const toDiscriminatorV3_js_1 = require("../discriminator/toDiscriminatorV3.js");
|
|
6
6
|
const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
|
|
7
7
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
8
|
-
const
|
|
9
|
-
const toUnion = ({ value, members, parentType, context }) => {
|
|
8
|
+
const toUnion = ({ value, members, parentType, stackTrail, context }) => {
|
|
10
9
|
const { discriminator, title, description, nullable, example, default: defaultValue, ...skipped } = value;
|
|
11
10
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
12
11
|
skipped,
|
|
13
12
|
parent: value,
|
|
14
13
|
context,
|
|
14
|
+
stackTrail,
|
|
15
15
|
parentType: `schema:${parentType}`
|
|
16
16
|
});
|
|
17
17
|
return new Union_js_1.OasUnion({
|
|
@@ -19,14 +19,14 @@ const toUnion = ({ value, members, parentType, context }) => {
|
|
|
19
19
|
description,
|
|
20
20
|
nullable,
|
|
21
21
|
default: defaultValue,
|
|
22
|
-
discriminator:
|
|
22
|
+
discriminator: stackTrail.trace('discriminator', st => (0, toDiscriminatorV3_js_1.toDiscriminatorV3)({ discriminator, stackTrail: st, context })),
|
|
23
23
|
members: members.reduce((acc, item, index) => {
|
|
24
24
|
if (item === undefined || item === null) {
|
|
25
25
|
return acc;
|
|
26
26
|
}
|
|
27
27
|
return [
|
|
28
28
|
...acc,
|
|
29
|
-
|
|
29
|
+
stackTrail.trace(`${index}`, st => (0, toSchemasV3_js_1.toSchemaV3)({ schema: item, stackTrail: st, context }))
|
|
30
30
|
];
|
|
31
31
|
}, []),
|
|
32
32
|
example,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { ParseContextType } from '../../context/parseTypes.js';
|
|
3
3
|
import { OasUnknown } from './Unknown.js';
|
|
4
|
+
import type { StackTrail } from '../../context/StackTrail.js';
|
|
4
5
|
type ToUnknownArgs = {
|
|
5
6
|
value: OpenAPIV3.SchemaObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
6
8
|
context: ParseContextType;
|
|
7
9
|
};
|
|
8
|
-
export declare const toUnknown: ({ value, context }: ToUnknownArgs) => OasUnknown;
|
|
10
|
+
export declare const toUnknown: ({ value, stackTrail, context }: ToUnknownArgs) => OasUnknown;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=toUnknown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toUnknown.d.ts","sourceRoot":"","sources":["../../../src/oas/unknown/toUnknown.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":"toUnknown.d.ts","sourceRoot":"","sources":["../../../src/oas/unknown/toUnknown.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;AAEzC,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,UAkBzE,CAAA"}
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toUnknown = void 0;
|
|
4
4
|
const Unknown_js_1 = require("./Unknown.js");
|
|
5
5
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
6
|
-
const toUnknown = ({ value, context }) => {
|
|
6
|
+
const toUnknown = ({ value, stackTrail, context }) => {
|
|
7
7
|
const { type: _type, title, description, example, nullable, ...skipped } = value;
|
|
8
8
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
9
9
|
skipped,
|
|
10
10
|
parent: value,
|
|
11
11
|
context,
|
|
12
|
+
stackTrail,
|
|
12
13
|
parentType: 'schema:unknown'
|
|
13
14
|
});
|
|
14
15
|
return new Unknown_js_1.OasUnknown({
|
|
@@ -3,6 +3,7 @@ import type { PrettierConfigType } from '../types/PrettierConfig.js';
|
|
|
3
3
|
import type { ManifestContent } from '../types/Manifest.js';
|
|
4
4
|
import type { GeneratorsMapContainer } from '../types/GeneratorType.js';
|
|
5
5
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
6
|
+
import type { StackTrail } from '../context/StackTrail.js';
|
|
6
7
|
/**
|
|
7
8
|
* Arguments for the {@link toArtifacts} transformation function.
|
|
8
9
|
*
|
|
@@ -35,6 +36,8 @@ type TransformArgs = {
|
|
|
35
36
|
prettier?: PrettierConfigType;
|
|
36
37
|
/** Optional path for writing log files */
|
|
37
38
|
logsPath?: string;
|
|
39
|
+
/** Stack trail for distributed tracing */
|
|
40
|
+
stackTrail: StackTrail;
|
|
38
41
|
/** Function that returns the generator configuration map */
|
|
39
42
|
toGeneratorConfigMap: <EnrichmentType = undefined>() => GeneratorsMapContainer<EnrichmentType>;
|
|
40
43
|
/** Timestamp when transformation started */
|
|
@@ -128,7 +131,7 @@ type TransformArgs = {
|
|
|
128
131
|
* }
|
|
129
132
|
* ```
|
|
130
133
|
*/
|
|
131
|
-
export declare const toArtifacts: ({ traceId, spanId, documentObject, settings, prettier, toGeneratorConfigMap, logsPath, startAt, silent }: TransformArgs) => {
|
|
134
|
+
export declare const toArtifacts: ({ traceId, spanId, documentObject, settings, prettier, toGeneratorConfigMap, logsPath, startAt, silent, stackTrail }: TransformArgs) => {
|
|
132
135
|
artifacts: Record<string, string>;
|
|
133
136
|
manifest: ManifestContent;
|
|
134
137
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toArtifacts.d.ts","sourceRoot":"","sources":["../../src/run/toArtifacts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toArtifacts.d.ts","sourceRoot":"","sources":["../../src/run/toArtifacts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,KAAK,aAAa,GAAG;IACnB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,0DAA0D;IAC1D,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAA;IACtB,4DAA4D;IAC5D,oBAAoB,EAAE,CAAC,cAAc,GAAG,SAAS,OAAO,sBAAsB,CAAC,cAAc,CAAC,CAAA;IAC9F,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,eAAO,MAAM,WAAW,GAAI,sHAWzB,aAAa,KAAG;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CA0BhF,CAAA"}
|
|
@@ -122,13 +122,14 @@ const CoreContext_js_1 = require("../context/CoreContext.js");
|
|
|
122
122
|
* }
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
|
-
const toArtifacts = ({ traceId, spanId, documentObject, settings, prettier, toGeneratorConfigMap, logsPath, startAt, silent }) => {
|
|
125
|
+
const toArtifacts = ({ traceId, spanId, documentObject, settings, prettier, toGeneratorConfigMap, logsPath, startAt, silent, stackTrail }) => {
|
|
126
126
|
const context = new CoreContext_js_1.CoreContext({ spanId, logsPath, silent });
|
|
127
127
|
const { artifacts, files, previews, results, mappings } = context.toArtifacts({
|
|
128
128
|
settings,
|
|
129
129
|
toGeneratorConfigMap,
|
|
130
130
|
prettier,
|
|
131
131
|
documentObject,
|
|
132
|
+
stackTrail,
|
|
132
133
|
silent
|
|
133
134
|
});
|
|
134
135
|
const manifest = {
|