@skmtc/core 0.28.7 → 0.30.1
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/_dnt.polyfills.d.ts +11 -0
- package/esm/_dnt.polyfills.js +14 -0
- package/esm/context/GenerateContext.js +16 -16
- package/esm/context/ParseContext.js +9 -1
- package/esm/context/RenderContext.d.ts +7 -7
- package/esm/context/RenderContext.js +17 -12
- package/esm/context/generateTypes.d.ts +2 -2
- package/esm/context/generateTypes.js +3 -1
- package/esm/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.d.ts +16 -0
- package/esm/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.d.ts +16 -0
- package/esm/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.js +38 -0
- package/esm/dsl/GeneratorKeys.d.ts +2 -2
- package/esm/dsl/GeneratorKeys.js +6 -3
- package/esm/dsl/model/ModelDriver.js +4 -3
- package/esm/dsl/operation/gql/GqlOperationDriver.js +4 -3
- package/esm/dsl/operation/oas/OasOperationDriver.js +4 -3
- package/esm/dsl/webhook/WebhookDriver.js +4 -3
- package/esm/helpers/applyGeneratedSuffix.js +1 -1
- package/esm/helpers/isImported.d.ts +10 -74
- package/esm/helpers/isImported.js +12 -76
- package/esm/helpers/naming.d.ts +2 -1
- package/esm/helpers/naming.js +4 -2
- package/esm/helpers/normalizeWorkspacePath.d.ts +64 -0
- package/esm/helpers/normalizeWorkspacePath.js +98 -0
- package/esm/helpers/toResolvedArtifactPath.d.ts +8 -5
- package/esm/helpers/toResolvedArtifactPath.js +11 -7
- package/esm/helpers/toWorkspacePath.d.ts +3 -3
- package/esm/helpers/toWorkspacePath.js +5 -5
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- package/esm/oas/discriminator/Discriminator.d.ts +3 -0
- package/esm/oas/discriminator/Discriminator.js +7 -0
- package/esm/oas/document/Document.d.ts +7 -0
- package/esm/oas/document/Document.js +8 -0
- package/esm/oas/example/Example.d.ts +10 -1
- package/esm/oas/example/Example.js +16 -0
- package/esm/oas/mediaType/MediaType.d.ts +12 -0
- package/esm/oas/mediaType/MediaType.js +24 -0
- package/esm/oas/parameter/Parameter.d.ts +2 -1
- package/esm/oas/parameter/Parameter.js +5 -2
- package/esm/oas/parameter/parameter-types.d.ts +10 -2
- package/esm/oas/parameter/parameter-types.js +3 -1
- package/esm/oas/response/Response.d.ts +6 -1
- package/esm/oas/response/Response.js +8 -0
- package/esm/oas/securitySchemes/SecurityScheme.d.ts +47 -4
- package/esm/oas/securitySchemes/SecurityScheme.js +46 -1
- package/esm/oas/securitySchemes/security-scheme-types.d.ts +21 -0
- package/esm/oas/server/Server.d.ts +8 -2
- package/esm/oas/server/Server.js +10 -1
- package/esm/oas/tag/Tag.d.ts +9 -0
- package/esm/oas/tag/Tag.js +9 -0
- package/esm/parse/toOasDialect.d.ts +8 -7
- package/esm/parse/toOasDialect.js +4 -2
- package/esm/parse/v3-0/methods.d.ts +11 -0
- package/esm/parse/v3-0/methods.js +16 -0
- package/esm/parse/v3-0/operation/toOperationsV3.js +5 -5
- package/esm/parse/v3-0/parameter/toParameterV3.d.ts +4 -2
- package/esm/parse/v3-0/parameter/toParameterV3.js +17 -3
- package/esm/parse/v3-0/securitySchemes/toSecuritySchemes.js +50 -38
- package/esm/parse/v3-0/webhook/toWebhooksV3.js +5 -5
- package/esm/parse/v3-1/methods.d.ts +11 -0
- package/esm/parse/v3-1/methods.js +16 -0
- package/esm/parse/v3-1/operation/toOperationsV3.js +5 -5
- package/esm/parse/v3-1/parameter/toParameterV3.d.ts +4 -2
- package/esm/parse/v3-1/parameter/toParameterV3.js +17 -3
- package/esm/parse/v3-1/securitySchemes/toSecuritySchemes.js +50 -38
- package/esm/parse/v3-1/webhook/toWebhooksV3.js +5 -5
- package/esm/parse/v3-2/_helpers/parseDefault.d.ts +43 -0
- package/esm/parse/v3-2/_helpers/parseDefault.js +39 -0
- package/esm/parse/v3-2/_helpers/parseEnum.d.ts +13 -0
- package/esm/parse/v3-2/_helpers/parseEnum.js +23 -0
- package/esm/parse/v3-2/_helpers/parseExample.d.ts +41 -0
- package/esm/parse/v3-2/_helpers/parseExample.js +37 -0
- package/esm/parse/v3-2/_helpers/parseNullable.d.ts +141 -0
- package/esm/parse/v3-2/_helpers/parseNullable.js +140 -0
- package/esm/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.js +9 -0
- package/esm/parse/v3-2/_merge-all-of/check-at-least-one-type-match.d.ts +4 -0
- package/esm/parse/v3-2/_merge-all-of/check-at-least-one-type-match.js +5 -0
- package/esm/parse/v3-2/_merge-all-of/check-enum-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-enum-conflicts.js +11 -0
- package/esm/parse/v3-2/_merge-all-of/check-format-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-format-conflicts.js +5 -0
- package/esm/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.js +11 -0
- package/esm/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.js +5 -0
- package/esm/parse/v3-2/_merge-all-of/check-type-conflicts.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/check-type-conflicts.js +5 -0
- package/esm/parse/v3-2/_merge-all-of/cross-product.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/cross-product.js +3 -0
- package/esm/parse/v3-2/_merge-all-of/decompose-intersection.d.ts +6 -0
- package/esm/parse/v3-2/_merge-all-of/decompose-intersection.js +27 -0
- package/esm/parse/v3-2/_merge-all-of/decompose-union.d.ts +12 -0
- package/esm/parse/v3-2/_merge-all-of/decompose-union.js +69 -0
- package/esm/parse/v3-2/_merge-all-of/generic-merge.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/generic-merge.js +12 -0
- package/esm/parse/v3-2/_merge-all-of/is-equal.d.ts +1 -0
- package/esm/parse/v3-2/_merge-all-of/is-equal.js +19 -0
- package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.js +44 -0
- package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +7 -0
- package/esm/parse/v3-2/_merge-all-of/merge-enum-values.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-enum-values.js +32 -0
- package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.js +41 -0
- package/esm/parse/v3-2/_merge-all-of/merge-intersection.d.ts +8 -0
- package/esm/parse/v3-2/_merge-all-of/merge-intersection.js +16 -0
- package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.js +41 -0
- package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +5 -0
- package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.js +28 -0
- package/esm/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/merge-properties.js +25 -0
- package/esm/parse/v3-2/_merge-all-of/merge-required.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-required.js +10 -0
- package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.js +55 -0
- package/esm/parse/v3-2/_merge-all-of/merge-union.d.ts +15 -0
- package/esm/parse/v3-2/_merge-all-of/merge-union.js +53 -0
- package/esm/parse/v3-2/_merge-all-of/merge.d.ts +2 -0
- package/esm/parse/v3-2/_merge-all-of/merge.js +155 -0
- package/esm/parse/v3-2/_merge-all-of/nullable-merge.d.ts +3 -0
- package/esm/parse/v3-2/_merge-all-of/nullable-merge.js +12 -0
- package/esm/parse/v3-2/_merge-all-of/types.d.ts +14 -0
- package/esm/parse/v3-2/_merge-all-of/types.js +2 -0
- package/esm/parse/v3-2/array/toArray.d.ts +80 -0
- package/esm/parse/v3-2/array/toArray.js +165 -0
- package/esm/parse/v3-2/boolean/toBoolean.d.ts +78 -0
- package/esm/parse/v3-2/boolean/toBoolean.js +139 -0
- package/esm/parse/v3-2/components/toComponentsV3.d.ts +14 -0
- package/esm/parse/v3-2/components/toComponentsV3.js +43 -0
- package/esm/parse/v3-2/contact/toContactV3.d.ts +5 -0
- package/esm/parse/v3-2/contact/toContactV3.js +18 -0
- package/esm/parse/v3-2/discriminator/toDiscriminatorV3.d.ts +14 -0
- package/esm/parse/v3-2/discriminator/toDiscriminatorV3.js +21 -0
- package/esm/parse/v3-2/document/toDocumentFieldsV3.d.ts +16 -0
- package/esm/parse/v3-2/document/toDocumentFieldsV3.js +33 -0
- package/esm/parse/v3-2/example/toExamplesV3.d.ts +77 -0
- package/esm/parse/v3-2/example/toExamplesV3.js +143 -0
- package/esm/parse/v3-2/externalDocs/toExternalDocs.d.ts +10 -0
- package/esm/parse/v3-2/externalDocs/toExternalDocs.js +15 -0
- package/esm/parse/v3-2/header/toHeadersV3.d.ts +18 -0
- package/esm/parse/v3-2/header/toHeadersV3.js +47 -0
- package/esm/parse/v3-2/info/toInfoV3.d.ts +10 -0
- package/esm/parse/v3-2/info/toInfoV3.js +23 -0
- package/esm/parse/v3-2/integer/toInteger.d.ts +21 -0
- package/esm/parse/v3-2/integer/toInteger.js +115 -0
- package/esm/parse/v3-2/license/toLicenseV3.d.ts +5 -0
- package/esm/parse/v3-2/license/toLicenseV3.js +17 -0
- package/esm/parse/v3-2/link/toLinksV3.d.ts +16 -0
- package/esm/parse/v3-2/link/toLinksV3.js +40 -0
- package/esm/parse/v3-2/mediaType/toMediaTypeItemV3.d.ts +323 -0
- package/esm/parse/v3-2/mediaType/toMediaTypeItemV3.js +375 -0
- package/esm/parse/v3-2/methods.d.ts +17 -0
- package/esm/parse/v3-2/methods.js +21 -0
- package/esm/parse/v3-2/number/toNumber.d.ts +10 -0
- package/esm/parse/v3-2/number/toNumber.js +115 -0
- package/esm/parse/v3-2/object/toAdditionalPropertiesV3.d.ts +11 -0
- package/esm/parse/v3-2/object/toAdditionalPropertiesV3.js +10 -0
- package/esm/parse/v3-2/object/toObject.d.ts +10 -0
- package/esm/parse/v3-2/object/toObject.js +90 -0
- package/esm/parse/v3-2/operation/toOperationsV3.d.ts +25 -0
- package/esm/parse/v3-2/operation/toOperationsV3.js +129 -0
- package/esm/parse/v3-2/parameter/toParameterV3.d.ts +39 -0
- package/esm/parse/v3-2/parameter/toParameterV3.js +152 -0
- package/esm/parse/v3-2/parameter/warnQuerystringConflictsV3.d.ts +22 -0
- package/esm/parse/v3-2/parameter/warnQuerystringConflictsV3.js +39 -0
- package/esm/parse/v3-2/pathItem/dropAdditionalOperationsV3.d.ts +17 -0
- package/esm/parse/v3-2/pathItem/dropAdditionalOperationsV3.js +34 -0
- package/esm/parse/v3-2/pathItem/toPathItemV3.d.ts +23 -0
- package/esm/parse/v3-2/pathItem/toPathItemV3.js +45 -0
- package/esm/parse/v3-2/ref/toRefV31.d.ts +19 -0
- package/esm/parse/v3-2/ref/toRefV31.js +10 -0
- package/esm/parse/v3-2/requestBody/toRequestBodiesV3.d.ts +18 -0
- package/esm/parse/v3-2/requestBody/toRequestBodiesV3.js +44 -0
- package/esm/parse/v3-2/response/toResponseV3.d.ts +29 -0
- package/esm/parse/v3-2/response/toResponseV3.js +56 -0
- package/esm/parse/v3-2/schema/toSchemasV3.d.ts +29 -0
- package/esm/parse/v3-2/schema/toSchemasV3.js +511 -0
- package/esm/parse/v3-2/securityRequirement/toSecurityRequirement.d.ts +9 -0
- package/esm/parse/v3-2/securityRequirement/toSecurityRequirement.js +9 -0
- package/esm/parse/v3-2/securitySchemes/toSecuritySchemes.d.ts +17 -0
- package/esm/parse/v3-2/securitySchemes/toSecuritySchemes.js +152 -0
- package/esm/parse/v3-2/server/toServerV3.d.ts +26 -0
- package/esm/parse/v3-2/server/toServerV3.js +31 -0
- package/esm/parse/v3-2/serverVariable/toServerVariableV3.d.ts +22 -0
- package/esm/parse/v3-2/serverVariable/toServerVariableV3.js +30 -0
- package/esm/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.d.ts +14 -0
- package/esm/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.js +25 -0
- package/esm/parse/v3-2/string/toString.d.ts +146 -0
- package/esm/parse/v3-2/string/toString.js +211 -0
- package/esm/parse/v3-2/tag/toTagsV3.d.ts +22 -0
- package/esm/parse/v3-2/tag/toTagsV3.js +78 -0
- package/esm/parse/v3-2/union/toUnion.d.ts +12 -0
- package/esm/parse/v3-2/union/toUnion.js +68 -0
- package/esm/parse/v3-2/unknown/toUnknown.d.ts +10 -0
- package/esm/parse/v3-2/unknown/toUnknown.js +19 -0
- package/esm/parse/v3-2/webhook/toWebhooksV3.d.ts +48 -0
- package/esm/parse/v3-2/webhook/toWebhooksV3.js +139 -0
- package/esm/types/Method.d.ts +7 -4
- package/esm/types/Method.js +17 -4
- package/esm/types/Preview.d.ts +2 -1
- package/esm/types/Settings.js +6 -8
- package/esm/types/SkmtcDocument.d.ts +6 -6
- package/package.json +1 -1
- package/script/_dnt.polyfills.d.ts +11 -0
- package/script/_dnt.polyfills.js +14 -0
- package/script/context/GenerateContext.js +16 -16
- package/script/context/ParseContext.js +9 -1
- package/script/context/RenderContext.d.ts +7 -7
- package/script/context/RenderContext.js +17 -12
- package/script/context/generateTypes.d.ts +2 -2
- package/script/context/generateTypes.js +3 -1
- package/script/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.d.ts +16 -0
- package/script/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.js +26 -0
- package/script/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.d.ts +16 -0
- package/script/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.js +41 -0
- package/script/dsl/GeneratorKeys.d.ts +2 -2
- package/script/dsl/GeneratorKeys.js +6 -3
- package/script/dsl/model/ModelDriver.js +4 -3
- package/script/dsl/operation/gql/GqlOperationDriver.js +4 -3
- package/script/dsl/operation/oas/OasOperationDriver.js +4 -3
- package/script/dsl/webhook/WebhookDriver.js +4 -3
- package/script/helpers/applyGeneratedSuffix.js +1 -1
- package/script/helpers/isImported.d.ts +10 -74
- package/script/helpers/isImported.js +12 -76
- package/script/helpers/naming.d.ts +2 -1
- package/script/helpers/naming.js +4 -2
- package/script/helpers/normalizeWorkspacePath.d.ts +64 -0
- package/script/helpers/normalizeWorkspacePath.js +107 -0
- package/script/helpers/toResolvedArtifactPath.d.ts +8 -5
- package/script/helpers/toResolvedArtifactPath.js +11 -7
- package/script/helpers/toWorkspacePath.d.ts +3 -3
- package/script/helpers/toWorkspacePath.js +5 -5
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- package/script/oas/discriminator/Discriminator.d.ts +3 -0
- package/script/oas/discriminator/Discriminator.js +7 -0
- package/script/oas/document/Document.d.ts +7 -0
- package/script/oas/document/Document.js +8 -0
- package/script/oas/example/Example.d.ts +10 -1
- package/script/oas/example/Example.js +16 -0
- package/script/oas/mediaType/MediaType.d.ts +12 -0
- package/script/oas/mediaType/MediaType.js +24 -0
- package/script/oas/parameter/Parameter.d.ts +2 -1
- package/script/oas/parameter/Parameter.js +5 -2
- package/script/oas/parameter/parameter-types.d.ts +10 -2
- package/script/oas/parameter/parameter-types.js +3 -1
- package/script/oas/response/Response.d.ts +6 -1
- package/script/oas/response/Response.js +8 -0
- package/script/oas/securitySchemes/SecurityScheme.d.ts +47 -4
- package/script/oas/securitySchemes/SecurityScheme.js +46 -1
- package/script/oas/securitySchemes/security-scheme-types.d.ts +21 -0
- package/script/oas/server/Server.d.ts +8 -2
- package/script/oas/server/Server.js +10 -1
- package/script/oas/tag/Tag.d.ts +9 -0
- package/script/oas/tag/Tag.js +9 -0
- package/script/parse/toOasDialect.d.ts +8 -7
- package/script/parse/toOasDialect.js +4 -2
- package/script/parse/v3-0/methods.d.ts +11 -0
- package/script/parse/v3-0/methods.js +20 -0
- package/script/parse/v3-0/operation/toOperationsV3.js +5 -5
- package/script/parse/v3-0/parameter/toParameterV3.d.ts +4 -2
- package/script/parse/v3-0/parameter/toParameterV3.js +17 -3
- package/script/parse/v3-0/securitySchemes/toSecuritySchemes.js +49 -37
- package/script/parse/v3-0/webhook/toWebhooksV3.js +5 -5
- package/script/parse/v3-1/methods.d.ts +11 -0
- package/script/parse/v3-1/methods.js +20 -0
- package/script/parse/v3-1/operation/toOperationsV3.js +5 -5
- package/script/parse/v3-1/parameter/toParameterV3.d.ts +4 -2
- package/script/parse/v3-1/parameter/toParameterV3.js +17 -3
- package/script/parse/v3-1/securitySchemes/toSecuritySchemes.js +49 -37
- package/script/parse/v3-1/webhook/toWebhooksV3.js +5 -5
- package/script/parse/v3-2/_helpers/parseDefault.d.ts +43 -0
- package/script/parse/v3-2/_helpers/parseDefault.js +43 -0
- package/script/parse/v3-2/_helpers/parseEnum.d.ts +13 -0
- package/script/parse/v3-2/_helpers/parseEnum.js +27 -0
- package/script/parse/v3-2/_helpers/parseExample.d.ts +41 -0
- package/script/parse/v3-2/_helpers/parseExample.js +41 -0
- package/script/parse/v3-2/_helpers/parseNullable.d.ts +141 -0
- package/script/parse/v3-2/_helpers/parseNullable.js +144 -0
- package/script/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.js +13 -0
- package/script/parse/v3-2/_merge-all-of/check-at-least-one-type-match.d.ts +4 -0
- package/script/parse/v3-2/_merge-all-of/check-at-least-one-type-match.js +9 -0
- package/script/parse/v3-2/_merge-all-of/check-enum-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-enum-conflicts.js +15 -0
- package/script/parse/v3-2/_merge-all-of/check-format-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-format-conflicts.js +9 -0
- package/script/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.js +15 -0
- package/script/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.js +9 -0
- package/script/parse/v3-2/_merge-all-of/check-type-conflicts.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/check-type-conflicts.js +9 -0
- package/script/parse/v3-2/_merge-all-of/cross-product.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/cross-product.js +7 -0
- package/script/parse/v3-2/_merge-all-of/decompose-intersection.d.ts +6 -0
- package/script/parse/v3-2/_merge-all-of/decompose-intersection.js +31 -0
- package/script/parse/v3-2/_merge-all-of/decompose-union.d.ts +12 -0
- package/script/parse/v3-2/_merge-all-of/decompose-union.js +73 -0
- package/script/parse/v3-2/_merge-all-of/generic-merge.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/generic-merge.js +16 -0
- package/script/parse/v3-2/_merge-all-of/is-equal.d.ts +1 -0
- package/script/parse/v3-2/_merge-all-of/is-equal.js +23 -0
- package/script/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/merge-array-constraints.js +80 -0
- package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +43 -0
- package/script/parse/v3-2/_merge-all-of/merge-enum-values.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-enum-values.js +68 -0
- package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.js +77 -0
- package/script/parse/v3-2/_merge-all-of/merge-intersection.d.ts +8 -0
- package/script/parse/v3-2/_merge-all-of/merge-intersection.js +20 -0
- package/script/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-number-constraints.js +77 -0
- package/script/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +5 -0
- package/script/parse/v3-2/_merge-all-of/merge-object-constraints.js +65 -0
- package/script/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/merge-properties.js +29 -0
- package/script/parse/v3-2/_merge-all-of/merge-required.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-required.js +15 -0
- package/script/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/merge-string-constraints.js +91 -0
- package/script/parse/v3-2/_merge-all-of/merge-union.d.ts +15 -0
- package/script/parse/v3-2/_merge-all-of/merge-union.js +58 -0
- package/script/parse/v3-2/_merge-all-of/merge.d.ts +2 -0
- package/script/parse/v3-2/_merge-all-of/merge.js +159 -0
- package/script/parse/v3-2/_merge-all-of/nullable-merge.d.ts +3 -0
- package/script/parse/v3-2/_merge-all-of/nullable-merge.js +17 -0
- package/script/parse/v3-2/_merge-all-of/types.d.ts +14 -0
- package/script/parse/v3-2/_merge-all-of/types.js +38 -0
- package/script/parse/v3-2/array/toArray.d.ts +80 -0
- package/script/parse/v3-2/array/toArray.js +203 -0
- package/script/parse/v3-2/boolean/toBoolean.d.ts +78 -0
- package/script/parse/v3-2/boolean/toBoolean.js +177 -0
- package/script/parse/v3-2/components/toComponentsV3.d.ts +14 -0
- package/script/parse/v3-2/components/toComponentsV3.js +47 -0
- package/script/parse/v3-2/contact/toContactV3.d.ts +5 -0
- package/script/parse/v3-2/contact/toContactV3.js +22 -0
- package/script/parse/v3-2/discriminator/toDiscriminatorV3.d.ts +14 -0
- package/script/parse/v3-2/discriminator/toDiscriminatorV3.js +25 -0
- package/script/parse/v3-2/document/toDocumentFieldsV3.d.ts +16 -0
- package/script/parse/v3-2/document/toDocumentFieldsV3.js +37 -0
- package/script/parse/v3-2/example/toExamplesV3.d.ts +77 -0
- package/script/parse/v3-2/example/toExamplesV3.js +149 -0
- package/script/parse/v3-2/externalDocs/toExternalDocs.d.ts +10 -0
- package/script/parse/v3-2/externalDocs/toExternalDocs.js +52 -0
- package/script/parse/v3-2/header/toHeadersV3.d.ts +18 -0
- package/script/parse/v3-2/header/toHeadersV3.js +51 -0
- package/script/parse/v3-2/info/toInfoV3.d.ts +10 -0
- package/script/parse/v3-2/info/toInfoV3.js +27 -0
- package/script/parse/v3-2/integer/toInteger.d.ts +21 -0
- package/script/parse/v3-2/integer/toInteger.js +153 -0
- package/script/parse/v3-2/license/toLicenseV3.d.ts +5 -0
- package/script/parse/v3-2/license/toLicenseV3.js +21 -0
- package/script/parse/v3-2/link/toLinksV3.d.ts +16 -0
- package/script/parse/v3-2/link/toLinksV3.js +44 -0
- package/script/parse/v3-2/mediaType/toMediaTypeItemV3.d.ts +323 -0
- package/script/parse/v3-2/mediaType/toMediaTypeItemV3.js +381 -0
- package/script/parse/v3-2/methods.d.ts +17 -0
- package/script/parse/v3-2/methods.js +25 -0
- package/script/parse/v3-2/number/toNumber.d.ts +10 -0
- package/script/parse/v3-2/number/toNumber.js +152 -0
- package/script/parse/v3-2/object/toAdditionalPropertiesV3.d.ts +11 -0
- package/script/parse/v3-2/object/toAdditionalPropertiesV3.js +14 -0
- package/script/parse/v3-2/object/toObject.d.ts +10 -0
- package/script/parse/v3-2/object/toObject.js +94 -0
- package/script/parse/v3-2/operation/toOperationsV3.d.ts +25 -0
- package/script/parse/v3-2/operation/toOperationsV3.js +134 -0
- package/script/parse/v3-2/parameter/toParameterV3.d.ts +39 -0
- package/script/parse/v3-2/parameter/toParameterV3.js +191 -0
- package/script/parse/v3-2/parameter/warnQuerystringConflictsV3.d.ts +22 -0
- package/script/parse/v3-2/parameter/warnQuerystringConflictsV3.js +43 -0
- package/script/parse/v3-2/pathItem/dropAdditionalOperationsV3.d.ts +17 -0
- package/script/parse/v3-2/pathItem/dropAdditionalOperationsV3.js +38 -0
- package/script/parse/v3-2/pathItem/toPathItemV3.d.ts +23 -0
- package/script/parse/v3-2/pathItem/toPathItemV3.js +50 -0
- package/script/parse/v3-2/ref/toRefV31.d.ts +19 -0
- package/script/parse/v3-2/ref/toRefV31.js +14 -0
- package/script/parse/v3-2/requestBody/toRequestBodiesV3.d.ts +18 -0
- package/script/parse/v3-2/requestBody/toRequestBodiesV3.js +49 -0
- package/script/parse/v3-2/response/toResponseV3.d.ts +29 -0
- package/script/parse/v3-2/response/toResponseV3.js +62 -0
- package/script/parse/v3-2/schema/toSchemasV3.d.ts +29 -0
- package/script/parse/v3-2/schema/toSchemasV3.js +518 -0
- package/script/parse/v3-2/securityRequirement/toSecurityRequirement.d.ts +9 -0
- package/script/parse/v3-2/securityRequirement/toSecurityRequirement.js +13 -0
- package/script/parse/v3-2/securitySchemes/toSecuritySchemes.d.ts +17 -0
- package/script/parse/v3-2/securitySchemes/toSecuritySchemes.js +189 -0
- package/script/parse/v3-2/server/toServerV3.d.ts +26 -0
- package/script/parse/v3-2/server/toServerV3.js +37 -0
- package/script/parse/v3-2/serverVariable/toServerVariableV3.d.ts +22 -0
- package/script/parse/v3-2/serverVariable/toServerVariableV3.js +36 -0
- package/script/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.d.ts +14 -0
- package/script/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.js +30 -0
- package/script/parse/v3-2/string/toString.d.ts +146 -0
- package/script/parse/v3-2/string/toString.js +249 -0
- package/script/parse/v3-2/tag/toTagsV3.d.ts +22 -0
- package/script/parse/v3-2/tag/toTagsV3.js +83 -0
- package/script/parse/v3-2/union/toUnion.d.ts +12 -0
- package/script/parse/v3-2/union/toUnion.js +72 -0
- package/script/parse/v3-2/unknown/toUnknown.d.ts +10 -0
- package/script/parse/v3-2/unknown/toUnknown.js +23 -0
- package/script/parse/v3-2/webhook/toWebhooksV3.d.ts +48 -0
- package/script/parse/v3-2/webhook/toWebhooksV3.js +144 -0
- package/script/types/Method.d.ts +7 -4
- package/script/types/Method.js +17 -4
- package/script/types/Preview.d.ts +2 -1
- package/script/types/Settings.js +7 -9
- package/script/types/SkmtcDocument.d.ts +6 -6
- package/esm/deps/jsr.io/@std/path/1.1.6/extname.d.ts +0 -24
- package/esm/deps/jsr.io/@std/path/1.1.6/extname.js +0 -31
- package/esm/deps/jsr.io/@std/path/1.1.6/normalize.d.ts +0 -25
- package/esm/deps/jsr.io/@std/path/1.1.6/normalize.js +0 -32
- package/esm/deps/jsr.io/@std/path/1.1.6/windows/extname.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.1.6/windows/extname.js +0 -83
- package/script/deps/jsr.io/@std/path/1.1.6/extname.d.ts +0 -24
- package/script/deps/jsr.io/@std/path/1.1.6/extname.js +0 -34
- package/script/deps/jsr.io/@std/path/1.1.6/normalize.d.ts +0 -25
- package/script/deps/jsr.io/@std/path/1.1.6/normalize.js +0 -35
- package/script/deps/jsr.io/@std/path/1.1.6/windows/extname.d.ts +0 -17
- package/script/deps/jsr.io/@std/path/1.1.6/windows/extname.js +0 -86
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.toSecuritySchemesV3 = void 0;
|
|
37
|
+
const SecurityScheme_js_1 = require("../../../oas/securitySchemes/SecurityScheme.js");
|
|
38
|
+
const v = __importStar(require("valibot"));
|
|
39
|
+
const security_scheme_types_js_1 = require("../../../oas/securitySchemes/security-scheme-types.js");
|
|
40
|
+
const toRefV31_js_1 = require("../ref/toRefV31.js");
|
|
41
|
+
const refFns_js_1 = require("../../../helpers/refFns.js");
|
|
42
|
+
const tryParseAt_js_1 = require("../../../context/tryParseAt.js");
|
|
43
|
+
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
44
|
+
// The shared schemas are the 3.0/3.1 shape; these add the 3.2 fields.
|
|
45
|
+
const deprecatedField = v.optional(v.boolean());
|
|
46
|
+
const httpSecuritySchemeData = v.object({
|
|
47
|
+
...security_scheme_types_js_1.oasHttpSecuritySchemeData.entries,
|
|
48
|
+
deprecated: deprecatedField
|
|
49
|
+
});
|
|
50
|
+
const apiKeySecuritySchemeData = v.object({
|
|
51
|
+
...security_scheme_types_js_1.oasApiKeySecuritySchemeData.entries,
|
|
52
|
+
deprecated: deprecatedField
|
|
53
|
+
});
|
|
54
|
+
const deviceAuthorizationOAuth2FlowData = v.object({
|
|
55
|
+
deviceAuthorizationUrl: v.string(),
|
|
56
|
+
tokenUrl: v.string(),
|
|
57
|
+
refreshUrl: v.optional(v.string()),
|
|
58
|
+
scopes: v.optional(v.record(v.string(), v.string()))
|
|
59
|
+
});
|
|
60
|
+
const oAuth2FlowsData = v.object({
|
|
61
|
+
...security_scheme_types_js_1.oasOAuth2FlowsData.entries,
|
|
62
|
+
deviceAuthorization: v.optional(deviceAuthorizationOAuth2FlowData)
|
|
63
|
+
});
|
|
64
|
+
const oAuth2SecuritySchemeData = v.object({
|
|
65
|
+
...security_scheme_types_js_1.oasOAuth2SecuritySchemeData.entries,
|
|
66
|
+
deprecated: deprecatedField,
|
|
67
|
+
oauth2MetadataUrl: v.optional(v.string()),
|
|
68
|
+
flows: oAuth2FlowsData
|
|
69
|
+
});
|
|
70
|
+
const openIdSecuritySchemeData = v.object({
|
|
71
|
+
...security_scheme_types_js_1.oasOpenIdSecuritySchemeData.entries,
|
|
72
|
+
deprecated: deprecatedField
|
|
73
|
+
});
|
|
74
|
+
const toSecuritySchemesV3 = ({ securitySchemes, stackTrail, context }) => {
|
|
75
|
+
if (!securitySchemes) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const output = {};
|
|
79
|
+
for (const [key, value] of Object.entries(securitySchemes)) {
|
|
80
|
+
// Isolate per scheme: a single malformed security scheme is logged and
|
|
81
|
+
// skipped, the rest of the record continues (parity with toSchemasV3).
|
|
82
|
+
const parsed = (0, tryParseAt_js_1.tryParseAt)({
|
|
83
|
+
stackTrail,
|
|
84
|
+
key,
|
|
85
|
+
context,
|
|
86
|
+
type: 'INVALID_SECURITY_SCHEME',
|
|
87
|
+
parent: value,
|
|
88
|
+
fn: st => toSecuritySchemeV3({ securityScheme: value, stackTrail: st, context })
|
|
89
|
+
});
|
|
90
|
+
if (parsed !== undefined) {
|
|
91
|
+
output[key] = parsed;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return output;
|
|
95
|
+
};
|
|
96
|
+
exports.toSecuritySchemesV3 = toSecuritySchemesV3;
|
|
97
|
+
/**
|
|
98
|
+
* Log the keys of `value` that `known` does not name as skipped fields.
|
|
99
|
+
* `v.parse` on a `v.object` schema strips unknown keys, so they are read
|
|
100
|
+
* off the raw object. `x-` extensions are not logged.
|
|
101
|
+
*/
|
|
102
|
+
const logSkippedKeys = ({ value, known, parentType, stackTrail, context }) => {
|
|
103
|
+
const skipped = Object.fromEntries(Object.entries(value).filter(([key]) => !Object.hasOwn(known, key)));
|
|
104
|
+
(0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({ skipped, parent: value, parentType, stackTrail, context });
|
|
105
|
+
};
|
|
106
|
+
const toSecuritySchemeV3 = ({ securityScheme, stackTrail, context }) => {
|
|
107
|
+
if ((0, refFns_js_1.isRef)(securityScheme)) {
|
|
108
|
+
return (0, toRefV31_js_1.toRefV31)({ ref: securityScheme, refType: 'securityScheme', stackTrail, context });
|
|
109
|
+
}
|
|
110
|
+
switch (securityScheme.type) {
|
|
111
|
+
case 'http': {
|
|
112
|
+
const { description, deprecated, scheme, bearerFormat } = v.parse(httpSecuritySchemeData, securityScheme);
|
|
113
|
+
logSkippedKeys({
|
|
114
|
+
value: securityScheme,
|
|
115
|
+
known: httpSecuritySchemeData.entries,
|
|
116
|
+
parentType: 'securityScheme:http',
|
|
117
|
+
stackTrail,
|
|
118
|
+
context
|
|
119
|
+
});
|
|
120
|
+
return new SecurityScheme_js_1.OasHttpSecurityScheme({
|
|
121
|
+
description,
|
|
122
|
+
deprecated,
|
|
123
|
+
scheme,
|
|
124
|
+
bearerFormat
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
case 'apiKey': {
|
|
128
|
+
const { in: location, description, deprecated, name } = v.parse(apiKeySecuritySchemeData, securityScheme);
|
|
129
|
+
logSkippedKeys({
|
|
130
|
+
value: securityScheme,
|
|
131
|
+
known: apiKeySecuritySchemeData.entries,
|
|
132
|
+
parentType: 'securityScheme:apiKey',
|
|
133
|
+
stackTrail,
|
|
134
|
+
context
|
|
135
|
+
});
|
|
136
|
+
return new SecurityScheme_js_1.OasApiKeySecurityScheme({
|
|
137
|
+
description,
|
|
138
|
+
deprecated,
|
|
139
|
+
name,
|
|
140
|
+
in: location
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
case 'oauth2': {
|
|
144
|
+
const { flows, description, deprecated, oauth2MetadataUrl } = v.parse(oAuth2SecuritySchemeData, securityScheme);
|
|
145
|
+
logSkippedKeys({
|
|
146
|
+
value: securityScheme,
|
|
147
|
+
known: oAuth2SecuritySchemeData.entries,
|
|
148
|
+
parentType: 'securityScheme:oauth2',
|
|
149
|
+
stackTrail,
|
|
150
|
+
context
|
|
151
|
+
});
|
|
152
|
+
stackTrail.trace('flows', st => logSkippedKeys({
|
|
153
|
+
value: securityScheme.flows,
|
|
154
|
+
known: oAuth2FlowsData.entries,
|
|
155
|
+
parentType: 'oauthFlows',
|
|
156
|
+
stackTrail: st,
|
|
157
|
+
context
|
|
158
|
+
}));
|
|
159
|
+
return new SecurityScheme_js_1.OasOAuth2SecurityScheme({
|
|
160
|
+
description,
|
|
161
|
+
deprecated,
|
|
162
|
+
oauth2MetadataUrl,
|
|
163
|
+
flows
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
case 'openIdConnect': {
|
|
167
|
+
const { description, deprecated, openIdConnectUrl } = v.parse(openIdSecuritySchemeData, securityScheme);
|
|
168
|
+
logSkippedKeys({
|
|
169
|
+
value: securityScheme,
|
|
170
|
+
known: openIdSecuritySchemeData.entries,
|
|
171
|
+
parentType: 'securityScheme:openIdConnect',
|
|
172
|
+
stackTrail,
|
|
173
|
+
context
|
|
174
|
+
});
|
|
175
|
+
return new SecurityScheme_js_1.OasOpenIdSecurityScheme({
|
|
176
|
+
description,
|
|
177
|
+
deprecated,
|
|
178
|
+
openIdConnectUrl
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
default: {
|
|
182
|
+
// Exhaustive over the discriminated union: a value reaching here has a
|
|
183
|
+
// `type` outside the OpenAPI set. `tryParseAt` isolates the throw to
|
|
184
|
+
// this one scheme.
|
|
185
|
+
const _exhaustiveCheck = securityScheme;
|
|
186
|
+
throw new Error(`Unknown security scheme type: ${JSON.stringify(_exhaustiveCheck)}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
import { OasServer } from '../../../oas/server/Server.js';
|
|
4
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
5
|
+
/** A 3.2 Server Object: the 3.0 shape plus `name`. */
|
|
6
|
+
export type ServerObjectV32 = OpenAPIV3.ServerObject & {
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ToServersV3Args = {
|
|
10
|
+
servers: ServerObjectV32[];
|
|
11
|
+
stackTrail: StackTrail;
|
|
12
|
+
context: ParseContextType;
|
|
13
|
+
};
|
|
14
|
+
export declare const toServersV3: ({ servers, stackTrail, context }: ToServersV3Args) => OasServer[];
|
|
15
|
+
export type ToOptionalServersV3Args = {
|
|
16
|
+
servers: ServerObjectV32[] | undefined;
|
|
17
|
+
stackTrail: StackTrail;
|
|
18
|
+
context: ParseContextType;
|
|
19
|
+
};
|
|
20
|
+
export declare const toOptionalServersV3: ({ servers, stackTrail, context }: ToOptionalServersV3Args) => OasServer[] | undefined;
|
|
21
|
+
export type ToServerV3Args = {
|
|
22
|
+
server: ServerObjectV32;
|
|
23
|
+
stackTrail: StackTrail;
|
|
24
|
+
context: ParseContextType;
|
|
25
|
+
};
|
|
26
|
+
export declare const toServerV3: ({ server, stackTrail, context }: ToServerV3Args) => OasServer;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toServerV3 = exports.toOptionalServersV3 = exports.toServersV3 = void 0;
|
|
4
|
+
const Server_js_1 = require("../../../oas/server/Server.js");
|
|
5
|
+
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
6
|
+
const toServerVariableV3_js_1 = require("../serverVariable/toServerVariableV3.js");
|
|
7
|
+
const toServersV3 = ({ servers, stackTrail, context }) => {
|
|
8
|
+
return servers.map((server, index) => {
|
|
9
|
+
return stackTrail.trace(server.url ?? index, st => (0, exports.toServerV3)({ server, stackTrail: st, context }));
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.toServersV3 = toServersV3;
|
|
13
|
+
const toOptionalServersV3 = ({ servers, stackTrail, context }) => {
|
|
14
|
+
if (!servers) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return (0, exports.toServersV3)({ servers, stackTrail, context });
|
|
18
|
+
};
|
|
19
|
+
exports.toOptionalServersV3 = toOptionalServersV3;
|
|
20
|
+
const toServerV3 = ({ server, stackTrail, context }) => {
|
|
21
|
+
const { description, name, url, variables, ...skipped } = server;
|
|
22
|
+
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
23
|
+
skipped,
|
|
24
|
+
parent: server,
|
|
25
|
+
context,
|
|
26
|
+
stackTrail,
|
|
27
|
+
parentType: 'server'
|
|
28
|
+
});
|
|
29
|
+
return new Server_js_1.OasServer({
|
|
30
|
+
description,
|
|
31
|
+
name,
|
|
32
|
+
url,
|
|
33
|
+
variables: (0, toServerVariableV3_js_1.toOptionalServerVariablesV3)({ serverVariables: variables, stackTrail, context }),
|
|
34
|
+
extensionFields
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.toServerV3 = toServerV3;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
import { OasServerVariable } from '../../../oas/serverVariable/ServerVariable.js';
|
|
4
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
5
|
+
export type ToServerVariablesV3Args = {
|
|
6
|
+
serverVariables: Record<string, OpenAPIV3.ServerVariableObject>;
|
|
7
|
+
stackTrail: StackTrail;
|
|
8
|
+
context: ParseContextType;
|
|
9
|
+
};
|
|
10
|
+
export declare const toServerVariablesV3: ({ serverVariables, stackTrail, context }: ToServerVariablesV3Args) => Record<string, OasServerVariable>;
|
|
11
|
+
export type ToOptionalServerVariablesV3Args = {
|
|
12
|
+
serverVariables: Record<string, OpenAPIV3.ServerVariableObject> | undefined;
|
|
13
|
+
stackTrail: StackTrail;
|
|
14
|
+
context: ParseContextType;
|
|
15
|
+
};
|
|
16
|
+
export declare const toOptionalServerVariablesV3: ({ serverVariables, stackTrail, context }: ToOptionalServerVariablesV3Args) => Record<string, OasServerVariable> | undefined;
|
|
17
|
+
export type ToServerVariableV3Args = {
|
|
18
|
+
serverVariable: OpenAPIV3.ServerVariableObject;
|
|
19
|
+
stackTrail: StackTrail;
|
|
20
|
+
context: ParseContextType;
|
|
21
|
+
};
|
|
22
|
+
export declare const toServerVariableV3: ({ serverVariable, stackTrail, context }: ToServerVariableV3Args) => OasServerVariable;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toServerVariableV3 = exports.toOptionalServerVariablesV3 = exports.toServerVariablesV3 = void 0;
|
|
4
|
+
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
5
|
+
const ServerVariable_js_1 = require("../../../oas/serverVariable/ServerVariable.js");
|
|
6
|
+
const toServerVariablesV3 = ({ serverVariables, stackTrail, context }) => {
|
|
7
|
+
return Object.fromEntries(Object.entries(serverVariables).map(([key, serverVariable]) => [
|
|
8
|
+
key,
|
|
9
|
+
(0, exports.toServerVariableV3)({ serverVariable, stackTrail, context })
|
|
10
|
+
]));
|
|
11
|
+
};
|
|
12
|
+
exports.toServerVariablesV3 = toServerVariablesV3;
|
|
13
|
+
const toOptionalServerVariablesV3 = ({ serverVariables, stackTrail, context }) => {
|
|
14
|
+
if (!serverVariables) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return (0, exports.toServerVariablesV3)({ serverVariables, stackTrail, context });
|
|
18
|
+
};
|
|
19
|
+
exports.toOptionalServerVariablesV3 = toOptionalServerVariablesV3;
|
|
20
|
+
const toServerVariableV3 = ({ serverVariable, stackTrail, context }) => {
|
|
21
|
+
const { description, default: defaultValue, enum: enums, ...skipped } = serverVariable;
|
|
22
|
+
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
23
|
+
skipped,
|
|
24
|
+
parent: serverVariable,
|
|
25
|
+
context,
|
|
26
|
+
stackTrail,
|
|
27
|
+
parentType: 'serverVariable'
|
|
28
|
+
});
|
|
29
|
+
return new ServerVariable_js_1.OasServerVariable({
|
|
30
|
+
description,
|
|
31
|
+
default: defaultValue,
|
|
32
|
+
enums,
|
|
33
|
+
extensionFields
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
exports.toServerVariableV3 = toServerVariableV3;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
2
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
3
|
+
export type ToSpecificationExtensionsV3Args = {
|
|
4
|
+
skipped: Record<string, unknown>;
|
|
5
|
+
parent: unknown;
|
|
6
|
+
parentType: string;
|
|
7
|
+
stackTrail: StackTrail;
|
|
8
|
+
context: ParseContextType;
|
|
9
|
+
};
|
|
10
|
+
export declare const toSpecificationExtensionsV3: ({ skipped: s, parent, parentType, stackTrail, context }: ToSpecificationExtensionsV3Args) => Record<string, unknown> | undefined;
|
|
11
|
+
export declare const extractExtensions: (item: Record<string, unknown>) => {
|
|
12
|
+
skipped: Record<string, unknown> | undefined;
|
|
13
|
+
extensionFields: Record<string, unknown> | undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractExtensions = exports.toSpecificationExtensionsV3 = void 0;
|
|
4
|
+
const isEmpty_js_1 = require("../../../helpers/isEmpty.js");
|
|
5
|
+
const toSpecificationExtensionsV3 = ({ skipped: s, parent, parentType, stackTrail, context }) => {
|
|
6
|
+
const { skipped, extensionFields } = (0, exports.extractExtensions)(s);
|
|
7
|
+
if (skipped) {
|
|
8
|
+
context.logSkippedFields({ skipped, parent, stackTrail, parentType });
|
|
9
|
+
}
|
|
10
|
+
return extensionFields;
|
|
11
|
+
};
|
|
12
|
+
exports.toSpecificationExtensionsV3 = toSpecificationExtensionsV3;
|
|
13
|
+
const extractExtensions = (item) => {
|
|
14
|
+
const entries = Object.entries(item);
|
|
15
|
+
const skipped = {};
|
|
16
|
+
const extensionFields = {};
|
|
17
|
+
for (const [key, value] of entries) {
|
|
18
|
+
if (!key.startsWith('x-')) {
|
|
19
|
+
skipped[key] = value;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
extensionFields[key] = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
skipped: (0, isEmpty_js_1.isEmpty)(skipped) ? undefined : skipped,
|
|
27
|
+
extensionFields: (0, isEmpty_js_1.isEmpty)(extensionFields) ? undefined : extensionFields
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.extractExtensions = extractExtensions;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
3
|
+
import { OasString } from '../../../oas/string/String.js';
|
|
4
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for transforming an OpenAPI string schema into OAS representation.
|
|
7
|
+
*/
|
|
8
|
+
export type ToStringArgs = {
|
|
9
|
+
/** The OpenAPI v3 schema object to transform (must be type 'string') */
|
|
10
|
+
value: OpenAPIV3.SchemaObject;
|
|
11
|
+
/** The stack trail for tracing */
|
|
12
|
+
stackTrail: StackTrail;
|
|
13
|
+
/** Parse context providing utilities and tracing capabilities */
|
|
14
|
+
context: ParseContextType;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Transforms an OpenAPI v3 string schema object into an internal OAS string representation.
|
|
18
|
+
*
|
|
19
|
+
* This function processes OpenAPI string schemas by extracting and parsing nullable values,
|
|
20
|
+
* examples, enumerations, and default values. It handles the complete transformation from
|
|
21
|
+
* raw OpenAPI JSON to the SKMTC internal string representation with proper validation
|
|
22
|
+
* of string formats and constraints.
|
|
23
|
+
*
|
|
24
|
+
* The transformation follows a pipeline approach:
|
|
25
|
+
* 1. Parse nullable flag and extract base value
|
|
26
|
+
* 2. Parse example values with nullable support
|
|
27
|
+
* 3. Parse enumeration constraints
|
|
28
|
+
* 4. Parse default values
|
|
29
|
+
* 5. Create final OasString instance with format validation
|
|
30
|
+
*
|
|
31
|
+
* @param args - Transformation arguments
|
|
32
|
+
* @param args.context - Parse context providing utilities and tracing
|
|
33
|
+
* @param args.value - The OpenAPI v3 string schema object to transform
|
|
34
|
+
* @returns Transformed OAS string object with parsed properties
|
|
35
|
+
*
|
|
36
|
+
* @example Basic string transformation
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { toString } from '@skmtc/core';
|
|
39
|
+
*
|
|
40
|
+
* const openApiString = {
|
|
41
|
+
* type: 'string',
|
|
42
|
+
* format: 'email',
|
|
43
|
+
* maxLength: 255,
|
|
44
|
+
* pattern: '^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,}$'
|
|
45
|
+
* };
|
|
46
|
+
*
|
|
47
|
+
* const oasString = toString({
|
|
48
|
+
* context: parseContext,
|
|
49
|
+
* value: openApiString
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* console.log(oasString.format); // 'email'
|
|
53
|
+
* console.log(oasString.maxLength); // 255
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example String with nullable and enums
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const statusString = {
|
|
59
|
+
* type: 'string',
|
|
60
|
+
* nullable: true,
|
|
61
|
+
* enum: ['active', 'inactive', 'pending', null],
|
|
62
|
+
* default: 'active',
|
|
63
|
+
* example: 'pending'
|
|
64
|
+
* };
|
|
65
|
+
*
|
|
66
|
+
* const oasString = toString({
|
|
67
|
+
* context: parseContext,
|
|
68
|
+
* value: statusString
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* console.log(oasString.nullable); // true
|
|
72
|
+
* console.log(oasString.enums); // ['active', 'inactive', 'pending', null]
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare const toString: ({ context, value, stackTrail }: ToStringArgs) => OasString;
|
|
76
|
+
type ToParsedStringArgs<Nullable extends boolean | undefined> = {
|
|
77
|
+
value: Omit<OpenAPIV3.SchemaObject, 'nullable' | 'example' | 'enums' | 'default'>;
|
|
78
|
+
context: ParseContextType;
|
|
79
|
+
nullable: Nullable;
|
|
80
|
+
example: Nullable extends true ? string | null | undefined : string | undefined;
|
|
81
|
+
enums: Nullable extends true ? (string | null)[] | undefined : string[] | undefined;
|
|
82
|
+
defaultValue: Nullable extends true ? string | null | undefined : string | undefined;
|
|
83
|
+
stackTrail: StackTrail;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Creates an OAS string instance from pre-parsed string schema components.
|
|
87
|
+
*
|
|
88
|
+
* This function is the final step in the string transformation pipeline, taking
|
|
89
|
+
* already-parsed nullable, example, enum, and default values and combining them
|
|
90
|
+
* with the remaining string properties to create the complete OasString instance.
|
|
91
|
+
*
|
|
92
|
+
* The function handles format validation against known OpenAPI string formats,
|
|
93
|
+
* length constraints parsing, pattern validation, and specification extension
|
|
94
|
+
* processing. It logs warnings for unrecognized formats while still preserving
|
|
95
|
+
* them in the output.
|
|
96
|
+
*
|
|
97
|
+
* @template Nullable - Boolean type indicating if the string can be null
|
|
98
|
+
* @param args - Pre-parsed string components
|
|
99
|
+
* @param args.context - Parse context for tracing and issue logging
|
|
100
|
+
* @param args.nullable - Parsed nullable flag
|
|
101
|
+
* @param args.example - Parsed example value (type-safe with nullable)
|
|
102
|
+
* @param args.enums - Parsed enumeration constraints (type-safe with nullable)
|
|
103
|
+
* @param args.defaultValue - Parsed default value (type-safe with nullable)
|
|
104
|
+
* @param args.value - OpenAPI string object without parsed fields
|
|
105
|
+
* @returns Complete OAS string instance with all properties and validation
|
|
106
|
+
*
|
|
107
|
+
* @example Date-time string with validation
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const dateTimeString = toParsedString({
|
|
110
|
+
* context: parseContext,
|
|
111
|
+
* nullable: false,
|
|
112
|
+
* example: '2023-12-25T10:00:00Z',
|
|
113
|
+
* enums: undefined,
|
|
114
|
+
* defaultValue: undefined,
|
|
115
|
+
* value: {
|
|
116
|
+
* type: 'string',
|
|
117
|
+
* format: 'date-time',
|
|
118
|
+
* title: 'Event Date',
|
|
119
|
+
* description: 'When the event occurs'
|
|
120
|
+
* }
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* console.log(dateTimeString.format); // 'date-time'
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* @example String with custom format (generates warning)
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const customFormatString = toParsedString({
|
|
129
|
+
* context: parseContext,
|
|
130
|
+
* nullable: false,
|
|
131
|
+
* example: 'ABC123',
|
|
132
|
+
* enums: undefined,
|
|
133
|
+
* defaultValue: undefined,
|
|
134
|
+
* value: {
|
|
135
|
+
* type: 'string',
|
|
136
|
+
* format: 'custom-id', // Unknown format, will log warning
|
|
137
|
+
* pattern: '^[A-Z]{3}[0-9]{3}$'
|
|
138
|
+
* }
|
|
139
|
+
* });
|
|
140
|
+
*
|
|
141
|
+
* // Logs: "Unexpected format: custom-id"
|
|
142
|
+
* console.log(customFormatString.format); // 'custom-id' (still preserved)
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export declare const toParsedString: <Nullable extends boolean | undefined>({ context, nullable, example, enums, defaultValue, value, stackTrail }: ToParsedStringArgs<Nullable>) => OasString<Nullable>;
|
|
146
|
+
export {};
|