@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,78 @@
|
|
|
1
|
+
import { OasTag } from '../../../oas/tag/Tag.js';
|
|
2
|
+
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
3
|
+
import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
|
|
4
|
+
export const toTagsV3 = ({ tags, stackTrail, context }) => {
|
|
5
|
+
if (!tags) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const parents = new Map(tags.map(({ name, parent }) => [name, parent]));
|
|
9
|
+
return tags.map(tag => {
|
|
10
|
+
const parentError = toParentError({ name: tag.name, parent: tag.parent, parents });
|
|
11
|
+
if (!parentError) {
|
|
12
|
+
return toTagV3({ tag, stackTrail, context });
|
|
13
|
+
}
|
|
14
|
+
context.logIssue({
|
|
15
|
+
key: 'parent',
|
|
16
|
+
level: 'warning',
|
|
17
|
+
message: `Tag '${tag.name}' ${parentError}; dropping 'parent'`,
|
|
18
|
+
parent: tag,
|
|
19
|
+
stackTrail,
|
|
20
|
+
type: 'INVALID_TAG_PARENT'
|
|
21
|
+
});
|
|
22
|
+
return toTagV3({ tag: { ...tag, parent: undefined }, stackTrail, context });
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
/** Describes why the tag's `parent` is invalid, or returns undefined when it is valid. */
|
|
26
|
+
const toParentError = ({ name, parent, parents }) => {
|
|
27
|
+
if (parent === undefined) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (!parents.has(parent)) {
|
|
31
|
+
return `names parent '${parent}', which is not a tag`;
|
|
32
|
+
}
|
|
33
|
+
if (leadsBackTo({ name, current: parent, parents, visited: new Set() })) {
|
|
34
|
+
return `is in a parent cycle through '${parent}'`;
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
};
|
|
38
|
+
/** Follows the parent chain from `current` and reports whether it reaches `name`. */
|
|
39
|
+
const leadsBackTo = ({ name, current, parents, visited }) => {
|
|
40
|
+
if (current === undefined) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (current === name) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
// The chain loops without reaching `name`: the cycle is above this tag, and
|
|
47
|
+
// the tags in it report it.
|
|
48
|
+
if (visited.has(current)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return leadsBackTo({
|
|
52
|
+
name,
|
|
53
|
+
current: parents.get(current),
|
|
54
|
+
parents,
|
|
55
|
+
visited: new Set([...visited, current])
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
export const toTagV3 = ({ tag, stackTrail, context }) => {
|
|
59
|
+
const { name, description, summary, parent, kind, externalDocs, ...skipped } = tag;
|
|
60
|
+
const parsedExternalDocs = stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context }));
|
|
61
|
+
const extensionFields = toSpecificationExtensionsV3({
|
|
62
|
+
skipped,
|
|
63
|
+
parent: tag,
|
|
64
|
+
context,
|
|
65
|
+
stackTrail,
|
|
66
|
+
parentType: 'tag'
|
|
67
|
+
});
|
|
68
|
+
const fields = {
|
|
69
|
+
name,
|
|
70
|
+
description,
|
|
71
|
+
summary,
|
|
72
|
+
parent,
|
|
73
|
+
kind,
|
|
74
|
+
externalDocs: parsedExternalDocs,
|
|
75
|
+
extensionFields
|
|
76
|
+
};
|
|
77
|
+
return new OasTag(fields);
|
|
78
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
3
|
+
import { OasUnion } from '../../../oas/union/Union.js';
|
|
4
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
5
|
+
export type ToUnionArgs = {
|
|
6
|
+
value: OpenAPIV3.SchemaObject;
|
|
7
|
+
members: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
|
|
8
|
+
parentType: 'anyOf' | 'oneOf';
|
|
9
|
+
stackTrail: StackTrail;
|
|
10
|
+
context: ParseContextType;
|
|
11
|
+
};
|
|
12
|
+
export declare const toUnion: ({ value, members, parentType, stackTrail, context }: ToUnionArgs) => OasUnion;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { OasUnion } from '../../../oas/union/Union.js';
|
|
2
|
+
import { toDiscriminatorV3 } from '../discriminator/toDiscriminatorV3.js';
|
|
3
|
+
import { toSchemaV3 } from '../schema/toSchemasV3.js';
|
|
4
|
+
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
5
|
+
import { parseNullable } from '../_helpers/parseNullable.js';
|
|
6
|
+
import { parseExample } from '../_helpers/parseExample.js';
|
|
7
|
+
import { parseDefault } from '../_helpers/parseDefault.js';
|
|
8
|
+
import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
|
|
9
|
+
export const toUnion = ({ value, members, parentType, stackTrail, context }) => {
|
|
10
|
+
const { nullable, value: valueWithoutNullable } = parseNullable({
|
|
11
|
+
value,
|
|
12
|
+
context,
|
|
13
|
+
stackTrail
|
|
14
|
+
});
|
|
15
|
+
const { discriminator, title, description, externalDocs, example: unparsedExample, default: unparsedDefaultValue, ...skipped } = valueWithoutNullable;
|
|
16
|
+
const example = parseExample({
|
|
17
|
+
value: unparsedExample,
|
|
18
|
+
context,
|
|
19
|
+
parent: value,
|
|
20
|
+
nullable,
|
|
21
|
+
check: isPresent,
|
|
22
|
+
toMessage: item => `Removed invalid example. Expected a non-null value, got: ${item}`,
|
|
23
|
+
stackTrail
|
|
24
|
+
});
|
|
25
|
+
const defaultValue = parseDefault({
|
|
26
|
+
value: unparsedDefaultValue,
|
|
27
|
+
context,
|
|
28
|
+
parent: value,
|
|
29
|
+
nullable,
|
|
30
|
+
check: isPresent,
|
|
31
|
+
toMessage: item => `Removed invalid default. Expected a non-null value, got: ${item}`,
|
|
32
|
+
stackTrail
|
|
33
|
+
});
|
|
34
|
+
const extensionFields = toSpecificationExtensionsV3({
|
|
35
|
+
skipped,
|
|
36
|
+
parent: value,
|
|
37
|
+
context,
|
|
38
|
+
stackTrail,
|
|
39
|
+
parentType: `schema:${parentType}`
|
|
40
|
+
});
|
|
41
|
+
const discriminatorParsed = stackTrail.trace('discriminator', st => toDiscriminatorV3({ discriminator, stackTrail: st, context }));
|
|
42
|
+
const membersParsed = members.reduce((acc, item, index) => {
|
|
43
|
+
if (item === undefined || item === null) {
|
|
44
|
+
return acc;
|
|
45
|
+
}
|
|
46
|
+
return [
|
|
47
|
+
...acc,
|
|
48
|
+
stackTrail.trace(`${index}`, st => toSchemaV3({ schema: item, stackTrail: st, context }))
|
|
49
|
+
];
|
|
50
|
+
}, []);
|
|
51
|
+
return context.withStackTrail(stackTrail, () => new OasUnion({
|
|
52
|
+
title,
|
|
53
|
+
description,
|
|
54
|
+
externalDocs: stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context })),
|
|
55
|
+
nullable,
|
|
56
|
+
default: defaultValue,
|
|
57
|
+
discriminator: discriminatorParsed,
|
|
58
|
+
members: membersParsed,
|
|
59
|
+
example,
|
|
60
|
+
extensionFields
|
|
61
|
+
}, context));
|
|
62
|
+
};
|
|
63
|
+
// A union (anyOf/oneOf) value may match any of its members, so the most we
|
|
64
|
+
// can validate without resolving members is that a present default/example
|
|
65
|
+
// is not a bare `null` on a non-nullable schema.
|
|
66
|
+
const isPresent = (value) => {
|
|
67
|
+
return value !== null && value !== undefined;
|
|
68
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
3
|
+
import { OasUnknown } from '../../../oas/unknown/Unknown.js';
|
|
4
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
5
|
+
export type ToUnknownArgs = {
|
|
6
|
+
value: OpenAPIV3.SchemaObject;
|
|
7
|
+
stackTrail: StackTrail;
|
|
8
|
+
context: ParseContextType;
|
|
9
|
+
};
|
|
10
|
+
export declare const toUnknown: ({ value, stackTrail, context }: ToUnknownArgs) => OasUnknown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OasUnknown } from '../../../oas/unknown/Unknown.js';
|
|
2
|
+
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
3
|
+
export const toUnknown = ({ value, stackTrail, context }) => {
|
|
4
|
+
const { type: _type, title, description, example, nullable, ...skipped } = value;
|
|
5
|
+
const extensionFields = toSpecificationExtensionsV3({
|
|
6
|
+
skipped,
|
|
7
|
+
parent: value,
|
|
8
|
+
context,
|
|
9
|
+
stackTrail,
|
|
10
|
+
parentType: 'schema:unknown'
|
|
11
|
+
});
|
|
12
|
+
return context.withStackTrail(stackTrail, () => new OasUnknown({
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
nullable,
|
|
16
|
+
extensionFields,
|
|
17
|
+
example
|
|
18
|
+
}, context));
|
|
19
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { Method } from '../../../types/Method.js';
|
|
3
|
+
import type { ParseContextType } from '../../../context/parseTypes.js';
|
|
4
|
+
import { OasWebhook } from '../../../oas/webhook/Webhook.js';
|
|
5
|
+
import type { OasPathItem } from '../../../oas/pathItem/PathItem.js';
|
|
6
|
+
import type { StackTrail } from '../../../context/StackTrail.js';
|
|
7
|
+
/**
|
|
8
|
+
* The 3.1 `webhooks` object: a map of webhook NAME → PathItem, identical
|
|
9
|
+
* in shape to `paths` but keyed by name rather than URL path. Inline
|
|
10
|
+
* PathItems only — a webhook PathItem `$ref` is a 3.1 edge case not yet
|
|
11
|
+
* handled (see the arc note §5 Refs).
|
|
12
|
+
*/
|
|
13
|
+
export type WebhooksObject = Record<string, OpenAPIV3.PathItemObject>;
|
|
14
|
+
type WebhookInfo = {
|
|
15
|
+
method: Method;
|
|
16
|
+
name: string;
|
|
17
|
+
pathItem: OasPathItem | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type ToWebhookV3Args = {
|
|
20
|
+
operation: OpenAPIV3.OperationObject;
|
|
21
|
+
webhookInfo: WebhookInfo;
|
|
22
|
+
stackTrail: StackTrail;
|
|
23
|
+
context: ParseContextType;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Parses a single webhook Operation Object into an {@link OasWebhook}.
|
|
27
|
+
*
|
|
28
|
+
* Mirrors `toOperationV3` and reuses the same leaf field parsers
|
|
29
|
+
* (`toParameterListV3` / `toRequestBodyV3` / `toResponsesV3` / …) — the
|
|
30
|
+
* inner Operation Object is structurally identical. Only the orchestration
|
|
31
|
+
* is duplicated (the dialect-shaped glue), and the output is an
|
|
32
|
+
* `OasWebhook` carrying a `name`, not an `OasOperation` carrying a `path`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const toWebhookV3: ({ operation, webhookInfo, stackTrail, context }: ToWebhookV3Args) => OasWebhook;
|
|
35
|
+
export type ToWebhooksV3Args = {
|
|
36
|
+
webhooks: WebhooksObject | undefined;
|
|
37
|
+
stackTrail: StackTrail;
|
|
38
|
+
context: ParseContextType;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Flattens the 3.1 `webhooks` map into `OasWebhook[]`, mirroring
|
|
42
|
+
* `toOperationsV3`'s `paths` → `OasOperation[]` flattening. Returns `[]`
|
|
43
|
+
* when no `webhooks` object is present (the common 3.0 / no-webhook case).
|
|
44
|
+
* The stack trail nests `webhooks` → `<name>` → `<method>` so
|
|
45
|
+
* `OasDocument.removeItem` can locate a webhook by name.
|
|
46
|
+
*/
|
|
47
|
+
export declare const toWebhooksV3: ({ webhooks, stackTrail, context }: ToWebhooksV3Args) => OasWebhook[];
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { toRequestBodyV3 } from '../requestBody/toRequestBodiesV3.js';
|
|
2
|
+
import { toResponsesV3 } from '../response/toResponseV3.js';
|
|
3
|
+
import { toParameterListV3 } from '../parameter/toParameterV3.js';
|
|
4
|
+
import { OasWebhook } from '../../../oas/webhook/Webhook.js';
|
|
5
|
+
import { toPathItemResultV3 } from '../pathItem/toPathItemV3.js';
|
|
6
|
+
import { toPathItemMethod } from '../methods.js';
|
|
7
|
+
import { dropAdditionalOperationsV3 } from '../pathItem/dropAdditionalOperationsV3.js';
|
|
8
|
+
import { warnQuerystringConflictsV3 } from '../parameter/warnQuerystringConflictsV3.js';
|
|
9
|
+
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
10
|
+
import { toSecurityRequirementsV3 } from '../securityRequirement/toSecurityRequirement.js';
|
|
11
|
+
import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
|
|
12
|
+
import { toOptionalServersV3 } from '../server/toServerV3.js';
|
|
13
|
+
/**
|
|
14
|
+
* Parses a single webhook Operation Object into an {@link OasWebhook}.
|
|
15
|
+
*
|
|
16
|
+
* Mirrors `toOperationV3` and reuses the same leaf field parsers
|
|
17
|
+
* (`toParameterListV3` / `toRequestBodyV3` / `toResponsesV3` / …) — the
|
|
18
|
+
* inner Operation Object is structurally identical. Only the orchestration
|
|
19
|
+
* is duplicated (the dialect-shaped glue), and the output is an
|
|
20
|
+
* `OasWebhook` carrying a `name`, not an `OasOperation` carrying a `path`.
|
|
21
|
+
*/
|
|
22
|
+
export const toWebhookV3 = ({ operation, webhookInfo, stackTrail, context }) => {
|
|
23
|
+
const { method, name, pathItem } = webhookInfo;
|
|
24
|
+
const { operationId, tags, summary, description, parameters, requestBody, responses, deprecated, security, externalDocs, servers, ...skipped } = operation;
|
|
25
|
+
const extensionFields = toSpecificationExtensionsV3({
|
|
26
|
+
skipped,
|
|
27
|
+
parent: operation,
|
|
28
|
+
context,
|
|
29
|
+
stackTrail,
|
|
30
|
+
parentType: 'operation'
|
|
31
|
+
});
|
|
32
|
+
const parsedParameters = stackTrail.trace('parameters', st => toParameterListV3({ parameters, stackTrail: st, context }));
|
|
33
|
+
warnQuerystringConflictsV3({ parameters: parsedParameters, pathItem, stackTrail, context });
|
|
34
|
+
const parsedRequestBody = stackTrail.trace('requestBody', st => toRequestBodyV3({ requestBody, stackTrail: st, context }));
|
|
35
|
+
const parsedResponses = stackTrail.trace('responses', st => toResponsesV3({ responses, stackTrail: st, context }));
|
|
36
|
+
const parsedSecurity = stackTrail.trace('security', st => toSecurityRequirementsV3({ security, stackTrail: st, context }));
|
|
37
|
+
const parsedExternalDocs = stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context }));
|
|
38
|
+
const parsedServers = stackTrail.trace('servers', st => toOptionalServersV3({ servers, stackTrail: st, context }));
|
|
39
|
+
return context.withStackTrail(stackTrail, () => new OasWebhook({
|
|
40
|
+
pathItem,
|
|
41
|
+
name,
|
|
42
|
+
method,
|
|
43
|
+
operationId,
|
|
44
|
+
summary,
|
|
45
|
+
tags,
|
|
46
|
+
description,
|
|
47
|
+
parameters: parsedParameters,
|
|
48
|
+
requestBody: parsedRequestBody,
|
|
49
|
+
responses: parsedResponses,
|
|
50
|
+
deprecated,
|
|
51
|
+
security: parsedSecurity,
|
|
52
|
+
externalDocs: parsedExternalDocs,
|
|
53
|
+
servers: parsedServers,
|
|
54
|
+
extensionFields
|
|
55
|
+
}, context));
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Flattens the 3.1 `webhooks` map into `OasWebhook[]`, mirroring
|
|
59
|
+
* `toOperationsV3`'s `paths` → `OasOperation[]` flattening. Returns `[]`
|
|
60
|
+
* when no `webhooks` object is present (the common 3.0 / no-webhook case).
|
|
61
|
+
* The stack trail nests `webhooks` → `<name>` → `<method>` so
|
|
62
|
+
* `OasDocument.removeItem` can locate a webhook by name.
|
|
63
|
+
*/
|
|
64
|
+
export const toWebhooksV3 = ({ webhooks, stackTrail, context }) => {
|
|
65
|
+
if (!webhooks) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
return Object.entries(webhooks).flatMap(([name, pathItem]) => {
|
|
69
|
+
return stackTrail.trace(name, nameStack => {
|
|
70
|
+
if (!pathItem) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
const fixedFields = dropAdditionalOperationsV3({ pathItem, stackTrail: nameStack, context });
|
|
74
|
+
const cleaned = Object.entries(fixedFields).reduce(({ rest, methodObject }, [key, operation]) => {
|
|
75
|
+
const method = toPathItemMethod(key);
|
|
76
|
+
if (method) {
|
|
77
|
+
const { [method]: _deleted, ...remaining } = rest;
|
|
78
|
+
return {
|
|
79
|
+
rest: remaining,
|
|
80
|
+
methodObject: {
|
|
81
|
+
...methodObject,
|
|
82
|
+
[method]: operation
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { rest, methodObject };
|
|
87
|
+
}, {
|
|
88
|
+
rest: fixedFields,
|
|
89
|
+
methodObject: {}
|
|
90
|
+
});
|
|
91
|
+
const pathItemResult = toPathItemResultV3({
|
|
92
|
+
pathItem: cleaned.rest,
|
|
93
|
+
stackTrail: nameStack,
|
|
94
|
+
context
|
|
95
|
+
});
|
|
96
|
+
if (!pathItemResult.valid) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
const pathItemObject = pathItemResult.pathItem;
|
|
100
|
+
return Object.entries(cleaned.methodObject)
|
|
101
|
+
.map(([method, operation]) => {
|
|
102
|
+
// Use `nameStack` (the trail with the webhook name already
|
|
103
|
+
// pushed) so downstream traces record webhooks:<name>:<method>:…
|
|
104
|
+
// — the trail `OasDocument.removeItem` matches a webhook on.
|
|
105
|
+
return nameStack.trace(method, st => {
|
|
106
|
+
if (!operation) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
return toWebhookV3({
|
|
111
|
+
operation,
|
|
112
|
+
webhookInfo: {
|
|
113
|
+
method: method,
|
|
114
|
+
name,
|
|
115
|
+
pathItem: pathItemObject
|
|
116
|
+
},
|
|
117
|
+
stackTrail: st,
|
|
118
|
+
context
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
123
|
+
context.logIssue({
|
|
124
|
+
key: method,
|
|
125
|
+
parent: operation,
|
|
126
|
+
level: 'error',
|
|
127
|
+
message: normalized.message,
|
|
128
|
+
cause: normalized,
|
|
129
|
+
stackTrail: st,
|
|
130
|
+
type: 'INVALID_OPERATION'
|
|
131
|
+
});
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
})
|
|
136
|
+
.filter((item) => Boolean(item));
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
};
|
package/esm/types/Method.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ import * as v from 'valibot';
|
|
|
5
5
|
*
|
|
6
6
|
* This constant array includes all HTTP methods that can be used
|
|
7
7
|
* in OpenAPI path operations, as defined by the OpenAPI specification.
|
|
8
|
-
* All methods are in lowercase to match OpenAPI conventions.
|
|
8
|
+
* All methods are in lowercase to match OpenAPI conventions. `query` is
|
|
9
|
+
* an OpenAPI 3.2 method; each parser tree reads its own list from
|
|
10
|
+
* `parse/v3-X/methods.ts`.
|
|
9
11
|
*/
|
|
10
|
-
export declare const methodValues: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
|
|
12
|
+
export declare const methodValues: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
|
|
11
13
|
/**
|
|
12
14
|
* Array of HTTP methods excluding TRACE.
|
|
13
15
|
*
|
|
@@ -23,8 +25,9 @@ export declare const method: v.UnionSchema<[
|
|
|
23
25
|
v.LiteralSchema<'delete', undefined>,
|
|
24
26
|
v.LiteralSchema<'head', undefined>,
|
|
25
27
|
v.LiteralSchema<'options', undefined>,
|
|
26
|
-
v.LiteralSchema<'trace', undefined
|
|
28
|
+
v.LiteralSchema<'trace', undefined>,
|
|
29
|
+
v.LiteralSchema<'query', undefined>
|
|
27
30
|
], undefined>;
|
|
28
|
-
export type Method = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
|
|
31
|
+
export type Method = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace' | 'query';
|
|
29
32
|
export declare const methods: v.ArraySchema<typeof method, undefined>;
|
|
30
33
|
export declare const isMethod: (arg: unknown) => arg is Method;
|
package/esm/types/Method.js
CHANGED
|
@@ -5,7 +5,9 @@ import * as v from 'valibot';
|
|
|
5
5
|
*
|
|
6
6
|
* This constant array includes all HTTP methods that can be used
|
|
7
7
|
* in OpenAPI path operations, as defined by the OpenAPI specification.
|
|
8
|
-
* All methods are in lowercase to match OpenAPI conventions.
|
|
8
|
+
* All methods are in lowercase to match OpenAPI conventions. `query` is
|
|
9
|
+
* an OpenAPI 3.2 method; each parser tree reads its own list from
|
|
10
|
+
* `parse/v3-X/methods.ts`.
|
|
9
11
|
*/
|
|
10
12
|
export const methodValues = [
|
|
11
13
|
'get',
|
|
@@ -15,7 +17,8 @@ export const methodValues = [
|
|
|
15
17
|
'options',
|
|
16
18
|
'head',
|
|
17
19
|
'patch',
|
|
18
|
-
'trace'
|
|
20
|
+
'trace',
|
|
21
|
+
'query'
|
|
19
22
|
];
|
|
20
23
|
/**
|
|
21
24
|
* Array of HTTP methods excluding TRACE.
|
|
@@ -23,7 +26,16 @@ export const methodValues = [
|
|
|
23
26
|
* This is a filtered version of {@link methodValues} that excludes the TRACE method,
|
|
24
27
|
* which is sometimes excluded from API operations for security reasons.
|
|
25
28
|
*/
|
|
26
|
-
export const methodValuesNoTrace = [
|
|
29
|
+
export const methodValuesNoTrace = [
|
|
30
|
+
'get',
|
|
31
|
+
'put',
|
|
32
|
+
'post',
|
|
33
|
+
'delete',
|
|
34
|
+
'options',
|
|
35
|
+
'head',
|
|
36
|
+
'patch',
|
|
37
|
+
'query'
|
|
38
|
+
];
|
|
27
39
|
export const method = v.union([
|
|
28
40
|
v.literal('get'),
|
|
29
41
|
v.literal('post'),
|
|
@@ -32,7 +44,8 @@ export const method = v.union([
|
|
|
32
44
|
v.literal('delete'),
|
|
33
45
|
v.literal('head'),
|
|
34
46
|
v.literal('options'),
|
|
35
|
-
v.literal('trace')
|
|
47
|
+
v.literal('trace'),
|
|
48
|
+
v.literal('query')
|
|
36
49
|
]);
|
|
37
50
|
export const methods = v.array(method);
|
|
38
51
|
export const isMethod = (arg) => {
|
package/esm/types/Preview.d.ts
CHANGED
|
@@ -139,7 +139,8 @@ export declare const oasOperationSource: v.ObjectSchema<{
|
|
|
139
139
|
v.LiteralSchema<'delete', undefined>,
|
|
140
140
|
v.LiteralSchema<'head', undefined>,
|
|
141
141
|
v.LiteralSchema<'options', undefined>,
|
|
142
|
-
v.LiteralSchema<'trace', undefined
|
|
142
|
+
v.LiteralSchema<'trace', undefined>,
|
|
143
|
+
v.LiteralSchema<'query', undefined>
|
|
143
144
|
], undefined>;
|
|
144
145
|
readonly variant: v.StringSchema<undefined>;
|
|
145
146
|
}, undefined>;
|
package/esm/types/Settings.js
CHANGED
|
@@ -52,13 +52,8 @@ import "../_dnt.polyfills.js";
|
|
|
52
52
|
import { generatorEnrichments } from './Enrichments.js';
|
|
53
53
|
import * as v from 'valibot';
|
|
54
54
|
import { method } from './Method.js';
|
|
55
|
+
import { hasParentSegment, isAbsolutePath, isValidWorkspacePath } from '../helpers/normalizeWorkspacePath.js';
|
|
55
56
|
import { toWorkspacePath } from '../helpers/toWorkspacePath.js';
|
|
56
|
-
/**
|
|
57
|
-
* Whether a relative path contains a `..` parent-reference segment.
|
|
58
|
-
* `..` is a parent reference only as a whole path segment — a
|
|
59
|
-
* directory name that merely contains dots is not flagged.
|
|
60
|
-
*/
|
|
61
|
-
const hasParentSegment = (path) => path.split(/[/\\]/).some(segment => segment === '..');
|
|
62
57
|
/**
|
|
63
58
|
* Valibot schema for {@link ModulePackage}.
|
|
64
59
|
*
|
|
@@ -175,7 +170,9 @@ export const anchorsSettings = v.object({
|
|
|
175
170
|
out: v.optional(v.string())
|
|
176
171
|
});
|
|
177
172
|
export const clientSettings = v.object({
|
|
178
|
-
basePath: v.optional(v.string()),
|
|
173
|
+
basePath: v.optional(v.pipe(v.string(), v.check(basePath => !isAbsolutePath(basePath), 'basePath must be relative to the SKMTC root (the directory containing .skmtc/); ' +
|
|
174
|
+
'absolute paths are not supported because generated output is always written under it'), v.check(basePath => !hasParentSegment(basePath), 'basePath must be a forward path with no ".." segments — it is the on-disk anchor ' +
|
|
175
|
+
'every generated file sits below'))),
|
|
179
176
|
schemaSource: v.optional(v.string()),
|
|
180
177
|
packages: v.optional(modulePackages),
|
|
181
178
|
enrichments: v.optional(generatorEnrichments),
|
|
@@ -185,7 +182,8 @@ export const clientSettings = v.object({
|
|
|
185
182
|
inputDirs: v.optional(v.array(v.string())),
|
|
186
183
|
formatter: v.optional(v.string()),
|
|
187
184
|
generatedSuffix: v.optional(v.string()),
|
|
188
|
-
ejected: v.optional(v.array(v.string()
|
|
185
|
+
ejected: v.optional(v.array(v.pipe(v.string(), v.check(isValidWorkspacePath, 'settings.ejected entries are export paths: a forward path below basePath, ' +
|
|
186
|
+
'with no ".." segment and not a Windows drive or UNC path'))))
|
|
189
187
|
});
|
|
190
188
|
/**
|
|
191
189
|
* Valibot schema for validating SKMTC client configuration.
|
|
@@ -59,12 +59,12 @@ export declare const toGqlParsedDocument: (value: GqlDocument) => SkmtcParsedDoc
|
|
|
59
59
|
* pipeline runs the protocol-appropriate parser before handing the
|
|
60
60
|
* post-parse {@link SkmtcParsedDocument} to the generate phase.
|
|
61
61
|
*
|
|
62
|
-
* - `oas.value` is an `OpenAPIV3.Document
|
|
63
|
-
* 3.
|
|
64
|
-
* `@skmtc/convert` before reaching `toArtifacts`.
|
|
65
|
-
* *on* that document as a retained member
|
|
66
|
-
* `webhooks`, so it is widened here) — the
|
|
67
|
-
* {@link OasDocument.webhooks}.
|
|
62
|
+
* - `oas.value` is an `OpenAPIV3.Document` carrying an OpenAPI 3.0, 3.1 or
|
|
63
|
+
* 3.2 document; each is parsed natively by its own parser tree. Swagger 2
|
|
64
|
+
* is converted to 3.0 by `@skmtc/convert` before reaching `toArtifacts`.
|
|
65
|
+
* 3.1 and 3.2 `webhooks` ride *on* that document as a retained member
|
|
66
|
+
* (the 3.0 base type omits `webhooks`, so it is widened here) — the
|
|
67
|
+
* parser flattens them into {@link OasDocument.webhooks}.
|
|
68
68
|
* - `gql.value` is either a raw SDL string or a pre-built
|
|
69
69
|
* `GraphQLSchema`. Strings are run through `buildSchema` inside the
|
|
70
70
|
* pipeline; pre-built `GraphQLSchema` instances are used as-is.
|
package/package.json
CHANGED
|
@@ -4,6 +4,17 @@ declare global {
|
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
export {};
|
|
7
|
+
declare global {
|
|
8
|
+
interface Object {
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether an object has a property with the specified name.
|
|
11
|
+
* @param o An object.
|
|
12
|
+
* @param v A property name.
|
|
13
|
+
*/
|
|
14
|
+
hasOwn(o: object, v: PropertyKey): boolean;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
7
18
|
/**
|
|
8
19
|
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
9
20
|
* but instead of using npm to install additional dependencies,
|
package/script/_dnt.polyfills.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.import_meta_ponyfill = exports.import_meta_ponyfill_esmodule = exports.import_meta_ponyfill_commonjs = void 0;
|
|
4
|
+
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
5
|
+
if (!Object.hasOwn) {
|
|
6
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
7
|
+
value: function (object, property) {
|
|
8
|
+
if (object == null) {
|
|
9
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
10
|
+
}
|
|
11
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
12
|
+
},
|
|
13
|
+
configurable: true,
|
|
14
|
+
enumerable: false,
|
|
15
|
+
writable: true,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
4
18
|
/**
|
|
5
19
|
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
6
20
|
* but instead of using npm to install additional dependencies,
|