@skmtc/core 0.0.599 → 0.0.601
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/context/ParseContext.d.ts +41 -2
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +54 -7
- package/esm/context/types.d.ts +1 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/toModelConfig.d.ts +3 -3
- package/esm/dsl/model/toModelConfig.d.ts.map +1 -1
- package/esm/dsl/model/toModelInsertable.d.ts +2 -2
- package/esm/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/esm/dsl/model/toModelInsertable.js +3 -3
- package/esm/dsl/model/types.d.ts +2 -2
- package/esm/dsl/model/types.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationConfig.d.ts +3 -3
- package/esm/dsl/operation/toOperationConfig.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationConfig.js +3 -3
- package/esm/dsl/operation/toOperationInsertable.d.ts +2 -2
- package/esm/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationInsertable.js +3 -3
- package/esm/dsl/operation/types.d.ts +2 -2
- package/esm/dsl/operation/types.d.ts.map +1 -1
- package/esm/helpers/refFns.d.ts +3 -0
- package/esm/helpers/refFns.d.ts.map +1 -1
- package/esm/helpers/refFns.js +12 -4
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +9 -3
- package/esm/mod.d.ts +0 -3
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +0 -3
- package/esm/oas/_helpers/parseDefault.d.ts +16 -0
- package/esm/oas/_helpers/parseDefault.d.ts.map +1 -0
- package/esm/oas/_helpers/parseDefault.js +16 -0
- package/esm/oas/_helpers/parseEnum.d.ts +16 -0
- package/esm/oas/_helpers/parseEnum.d.ts.map +1 -0
- package/esm/oas/_helpers/parseEnum.js +16 -0
- package/esm/oas/_helpers/parseExample.d.ts +16 -0
- package/esm/oas/_helpers/parseExample.d.ts.map +1 -0
- package/esm/oas/_helpers/parseExample.js +16 -0
- package/esm/oas/_helpers/parseFormat.d.ts +15 -0
- package/esm/oas/_helpers/parseFormat.d.ts.map +1 -0
- package/esm/oas/_helpers/parseFormat.js +16 -0
- package/esm/oas/_helpers/parseNullable.d.ts +12 -0
- package/esm/oas/_helpers/parseNullable.d.ts.map +1 -0
- package/esm/oas/_helpers/parseNullable.js +16 -0
- package/esm/oas/_merge-all-of/check-array-item-type-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-array-item-type-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-array-item-type-conflicts.js +9 -0
- package/esm/oas/_merge-all-of/check-at-least-one-type-match.d.ts +5 -0
- package/esm/oas/_merge-all-of/check-at-least-one-type-match.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-at-least-one-type-match.js +5 -0
- package/esm/oas/_merge-all-of/check-enum-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-enum-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-enum-conflicts.js +11 -0
- package/esm/oas/_merge-all-of/check-format-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-format-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-format-conflicts.js +5 -0
- package/esm/oas/_merge-all-of/check-number-constraints-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-number-constraints-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-number-constraints-conflicts.js +11 -0
- package/esm/oas/_merge-all-of/check-read-only-write-only-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-read-only-write-only-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-read-only-write-only-conflicts.js +5 -0
- package/esm/oas/_merge-all-of/check-type-conflicts.d.ts +3 -0
- package/esm/oas/_merge-all-of/check-type-conflicts.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/check-type-conflicts.js +5 -0
- package/esm/oas/_merge-all-of/cross-product.d.ts +3 -0
- package/esm/oas/_merge-all-of/cross-product.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/cross-product.js +3 -0
- package/esm/oas/_merge-all-of/decompose-intersection.d.ts +7 -0
- package/esm/oas/_merge-all-of/decompose-intersection.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/decompose-intersection.js +27 -0
- package/esm/oas/_merge-all-of/decompose-union.d.ts +13 -0
- package/esm/oas/_merge-all-of/decompose-union.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/decompose-union.js +52 -0
- package/esm/oas/_merge-all-of/generic-merge.d.ts +4 -0
- package/esm/oas/_merge-all-of/generic-merge.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/generic-merge.js +12 -0
- package/esm/oas/_merge-all-of/is-equal.d.ts +2 -0
- package/esm/oas/_merge-all-of/is-equal.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/is-equal.js +19 -0
- package/esm/oas/_merge-all-of/merge-array-constraints.d.ts +3 -0
- package/esm/oas/_merge-all-of/merge-array-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-array-constraints.js +44 -0
- package/esm/oas/_merge-all-of/merge-boolean-constraints.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-boolean-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-boolean-constraints.js +7 -0
- package/esm/oas/_merge-all-of/merge-enum-values.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-enum-values.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-enum-values.js +32 -0
- package/esm/oas/_merge-all-of/merge-integer-constraints.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-integer-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-integer-constraints.js +41 -0
- package/esm/oas/_merge-all-of/merge-intersection.d.ts +9 -0
- package/esm/oas/_merge-all-of/merge-intersection.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-intersection.js +16 -0
- package/esm/oas/_merge-all-of/merge-number-constraints.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-number-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-number-constraints.js +41 -0
- package/esm/oas/_merge-all-of/merge-object-constraints.d.ts +6 -0
- package/esm/oas/_merge-all-of/merge-object-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-object-constraints.js +28 -0
- package/esm/oas/_merge-all-of/merge-properties.d.ts +3 -0
- package/esm/oas/_merge-all-of/merge-properties.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-properties.js +25 -0
- package/esm/oas/_merge-all-of/merge-required.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-required.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-required.js +10 -0
- package/esm/oas/_merge-all-of/merge-string-constraints.d.ts +4 -0
- package/esm/oas/_merge-all-of/merge-string-constraints.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-string-constraints.js +55 -0
- package/esm/oas/_merge-all-of/merge-union.d.ts +16 -0
- package/esm/oas/_merge-all-of/merge-union.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge-union.js +53 -0
- package/esm/oas/_merge-all-of/merge.d.ts +3 -0
- package/esm/oas/_merge-all-of/merge.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/merge.js +148 -0
- package/esm/oas/_merge-all-of/types.d.ts +15 -0
- package/esm/oas/_merge-all-of/types.d.ts.map +1 -0
- package/esm/oas/_merge-all-of/types.js +2 -0
- package/esm/oas/array/Array.d.ts +29 -9
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +46 -1
- package/esm/oas/array/array-types.d.ts +16 -3
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +11 -14
- package/esm/oas/array/toArray.d.ts +9 -0
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +58 -4
- package/esm/oas/boolean/Boolean.d.ts +19 -9
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +23 -1
- package/esm/oas/boolean/boolean-types.d.ts +4 -4
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/boolean/boolean-types.js +7 -7
- package/esm/oas/boolean/toBoolean.d.ts +10 -1
- package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.js +47 -2
- package/esm/oas/components/Components.d.ts +4 -0
- package/esm/oas/components/Components.d.ts.map +1 -1
- package/esm/oas/components/Components.js +4 -0
- package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
- package/esm/oas/components/toComponentsV3.js +9 -2
- package/esm/oas/contact/toContactV3.d.ts.map +1 -1
- package/esm/oas/contact/toContactV3.js +3 -1
- package/esm/oas/discriminator/Discriminator.d.ts +2 -0
- package/esm/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/esm/oas/discriminator/Discriminator.js +7 -0
- package/esm/oas/discriminator/discriminator-types.d.ts +6 -2
- package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/esm/oas/discriminator/discriminator-types.js +5 -5
- package/esm/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/esm/oas/discriminator/toDiscriminatorV3.js +6 -6
- package/esm/oas/document/Document.d.ts +4 -0
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/document/Document.js +7 -0
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.js +6 -2
- package/esm/oas/example/example-types.d.ts +7 -2
- package/esm/oas/example/example-types.d.ts.map +1 -1
- package/esm/oas/example/example-types.js +6 -6
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +6 -1
- package/esm/oas/header/toHeadersV3.js +6 -1
- package/esm/oas/info/toInfoV3.d.ts.map +1 -1
- package/esm/oas/info/toInfoV3.js +3 -1
- package/esm/oas/integer/Integer.d.ts +41 -11
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +67 -1
- package/esm/oas/integer/integer-types.d.ts +24 -3
- package/esm/oas/integer/integer-types.d.ts.map +1 -1
- package/esm/oas/integer/integer-types.js +18 -19
- package/esm/oas/integer/toInteger.d.ts +9 -1
- package/esm/oas/integer/toInteger.d.ts.map +1 -1
- package/esm/oas/integer/toInteger.js +45 -5
- package/esm/oas/license/toLicenseV3.d.ts.map +1 -1
- package/esm/oas/license/toLicenseV3.js +3 -1
- package/esm/oas/markdown/markdown-types.d.ts +2 -2
- package/esm/oas/markdown/markdown-types.d.ts.map +1 -1
- package/esm/oas/markdown/markdown-types.js +2 -2
- package/esm/oas/mediaType/mediaType-types.d.ts +12 -2
- package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/esm/oas/mediaType/mediaType-types.js +6 -6
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.js +3 -1
- package/esm/oas/number/Number.d.ts +49 -9
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +88 -1
- package/esm/oas/number/number-types.d.ts +27 -4
- package/esm/oas/number/number-types.d.ts.map +1 -1
- package/esm/oas/number/number-types.js +16 -13
- package/esm/oas/number/toNumber.d.ts +2 -2
- package/esm/oas/number/toNumber.d.ts.map +1 -1
- package/esm/oas/number/toNumber.js +50 -4
- package/esm/oas/object/Object.d.ts +25 -9
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +51 -1
- package/esm/oas/object/object-types.d.ts +7 -3
- package/esm/oas/object/object-types.d.ts.map +1 -1
- package/esm/oas/object/object-types.js +14 -18
- package/esm/oas/object/toObject.d.ts +1 -1
- package/esm/oas/object/toObject.d.ts.map +1 -1
- package/esm/oas/object/toObject.js +44 -7
- package/esm/oas/operation/Operation.d.ts +4 -1
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +7 -0
- package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/esm/oas/operation/toOperationsV3.js +29 -11
- package/esm/oas/parameter/parameter-types.d.ts +59 -4
- package/esm/oas/parameter/parameter-types.d.ts.map +1 -1
- package/esm/oas/parameter/parameter-types.js +28 -30
- package/esm/oas/parameter/toParameterV3.js +6 -3
- package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/esm/oas/pathItem/toPathItemV3.js +6 -1
- package/esm/oas/ref/Ref.d.ts +2 -1
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +2 -0
- package/esm/oas/ref/ref-types.d.ts +15 -9
- package/esm/oas/ref/ref-types.d.ts.map +1 -1
- package/esm/oas/ref/ref-types.js +45 -39
- package/esm/oas/ref/toRefV31.js +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +3 -1
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +19 -4
- package/esm/oas/schema/Schema.d.ts +1 -2
- package/esm/oas/schema/Schema.d.ts.map +1 -1
- package/esm/oas/schema/schema-types.d.ts +3 -5
- package/esm/oas/schema/schema-types.d.ts.map +1 -1
- package/esm/oas/schema/schema-types.js +3 -7
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +151 -25
- package/esm/oas/securityRequirement/SecurityRequirement.d.ts +11 -0
- package/esm/oas/securityRequirement/SecurityRequirement.d.ts.map +1 -0
- package/esm/oas/securityRequirement/SecurityRequirement.js +22 -0
- package/esm/oas/securityRequirement/toSecurityRequirement.d.ts +9 -0
- package/esm/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -0
- package/esm/oas/securityRequirement/toSecurityRequirement.js +9 -0
- package/esm/oas/securitySchemes/SecurityScheme.d.ts +113 -0
- package/esm/oas/securitySchemes/SecurityScheme.d.ts.map +1 -0
- package/esm/oas/securitySchemes/SecurityScheme.js +204 -0
- package/esm/oas/securitySchemes/security-scheme-types.d.ts +181 -0
- package/esm/oas/securitySchemes/security-scheme-types.d.ts.map +1 -0
- package/esm/oas/securitySchemes/security-scheme-types.js +56 -0
- package/esm/oas/securitySchemes/toSecuritySchemes.d.ts +11 -0
- package/esm/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -0
- package/esm/oas/securitySchemes/toSecuritySchemes.js +62 -0
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/server/toServerV3.js +3 -1
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
- package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
- package/esm/oas/string/String.d.ts +21 -11
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +23 -4
- package/esm/oas/string/string-types.d.ts +30 -3
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/string-types.js +30 -32
- package/esm/oas/string/toString.d.ts +11 -2
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +51 -5
- package/esm/oas/tag/toTagsV3.d.ts.map +1 -1
- package/esm/oas/tag/toTagsV3.js +3 -1
- package/esm/oas/union/Union.d.ts +5 -0
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +11 -0
- package/esm/oas/union/toUnion.d.ts +2 -1
- package/esm/oas/union/toUnion.d.ts.map +1 -1
- package/esm/oas/union/toUnion.js +12 -4
- package/esm/oas/union/union-types.d.ts +13 -2
- package/esm/oas/union/union-types.d.ts.map +1 -1
- package/esm/oas/union/union-types.js +8 -8
- package/esm/oas/unknown/toUnknown.d.ts.map +1 -1
- package/esm/oas/unknown/toUnknown.js +3 -1
- package/esm/oas/unknown/unknown-types.d.ts +8 -2
- package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
- package/esm/oas/unknown/unknown-types.js +7 -7
- package/esm/types/EnrichmentRequest.d.ts +2 -2
- package/esm/types/EnrichmentRequest.d.ts.map +1 -1
- package/esm/types/Manifest.d.ts +58 -276
- package/esm/types/Manifest.d.ts.map +1 -1
- package/esm/types/Manifest.js +23 -29
- package/esm/types/Method.d.ts +3 -5
- package/esm/types/Method.d.ts.map +1 -1
- package/esm/types/Method.js +12 -6
- package/esm/types/Preview.d.ts +46 -158
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +25 -27
- package/esm/types/Results.d.ts +3 -9
- package/esm/types/Results.d.ts.map +1 -1
- package/esm/types/Results.js +9 -9
- package/esm/types/SchemaOptions.d.ts +20 -64
- package/esm/types/SchemaOptions.d.ts.map +1 -1
- package/esm/types/SchemaOptions.js +31 -31
- package/esm/types/Settings.d.ts +97 -437
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +38 -51
- package/esm/types/TypeSystem.d.ts +1 -11
- package/esm/types/TypeSystem.d.ts.map +1 -1
- package/esm/types/prettierConfig.d.ts +25 -2
- package/esm/types/prettierConfig.d.ts.map +1 -1
- package/esm/types/prettierConfig.js +24 -30
- package/package.json +4 -6
- package/script/context/ParseContext.d.ts +41 -2
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +77 -7
- package/script/context/types.d.ts +1 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/toModelConfig.d.ts +3 -3
- package/script/dsl/model/toModelConfig.d.ts.map +1 -1
- package/script/dsl/model/toModelInsertable.d.ts +2 -2
- package/script/dsl/model/toModelInsertable.d.ts.map +1 -1
- package/script/dsl/model/toModelInsertable.js +26 -3
- package/script/dsl/model/types.d.ts +2 -2
- package/script/dsl/model/types.d.ts.map +1 -1
- package/script/dsl/operation/toOperationConfig.d.ts +3 -3
- package/script/dsl/operation/toOperationConfig.d.ts.map +1 -1
- package/script/dsl/operation/toOperationConfig.js +26 -3
- package/script/dsl/operation/toOperationInsertable.d.ts +2 -2
- package/script/dsl/operation/toOperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationInsertable.js +26 -3
- package/script/dsl/operation/types.d.ts +2 -2
- package/script/dsl/operation/types.d.ts.map +1 -1
- package/script/helpers/refFns.d.ts +3 -0
- package/script/helpers/refFns.d.ts.map +1 -1
- package/script/helpers/refFns.js +14 -5
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +9 -3
- package/script/mod.d.ts +0 -3
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +0 -3
- package/script/oas/_helpers/parseDefault.d.ts +16 -0
- package/script/oas/_helpers/parseDefault.d.ts.map +1 -0
- package/script/oas/_helpers/parseDefault.js +43 -0
- package/script/oas/_helpers/parseEnum.d.ts +16 -0
- package/script/oas/_helpers/parseEnum.d.ts.map +1 -0
- package/script/oas/_helpers/parseEnum.js +43 -0
- package/script/oas/_helpers/parseExample.d.ts +16 -0
- package/script/oas/_helpers/parseExample.d.ts.map +1 -0
- package/script/oas/_helpers/parseExample.js +43 -0
- package/script/oas/_helpers/parseFormat.d.ts +15 -0
- package/script/oas/_helpers/parseFormat.d.ts.map +1 -0
- package/script/oas/_helpers/parseFormat.js +43 -0
- package/script/oas/_helpers/parseNullable.d.ts +12 -0
- package/script/oas/_helpers/parseNullable.d.ts.map +1 -0
- package/script/oas/_helpers/parseNullable.js +43 -0
- package/script/oas/_merge-all-of/check-array-item-type-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-array-item-type-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-array-item-type-conflicts.js +13 -0
- package/script/oas/_merge-all-of/check-at-least-one-type-match.d.ts +5 -0
- package/script/oas/_merge-all-of/check-at-least-one-type-match.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-at-least-one-type-match.js +9 -0
- package/script/oas/_merge-all-of/check-enum-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-enum-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-enum-conflicts.js +15 -0
- package/script/oas/_merge-all-of/check-format-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-format-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-format-conflicts.js +9 -0
- package/script/oas/_merge-all-of/check-number-constraints-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-number-constraints-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-number-constraints-conflicts.js +15 -0
- package/script/oas/_merge-all-of/check-read-only-write-only-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-read-only-write-only-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-read-only-write-only-conflicts.js +9 -0
- package/script/oas/_merge-all-of/check-type-conflicts.d.ts +3 -0
- package/script/oas/_merge-all-of/check-type-conflicts.d.ts.map +1 -0
- package/script/oas/_merge-all-of/check-type-conflicts.js +9 -0
- package/script/oas/_merge-all-of/cross-product.d.ts +3 -0
- package/script/oas/_merge-all-of/cross-product.d.ts.map +1 -0
- package/script/oas/_merge-all-of/cross-product.js +7 -0
- package/script/oas/_merge-all-of/decompose-intersection.d.ts +7 -0
- package/script/oas/_merge-all-of/decompose-intersection.d.ts.map +1 -0
- package/script/oas/_merge-all-of/decompose-intersection.js +31 -0
- package/script/oas/_merge-all-of/decompose-union.d.ts +13 -0
- package/script/oas/_merge-all-of/decompose-union.d.ts.map +1 -0
- package/script/oas/_merge-all-of/decompose-union.js +56 -0
- package/script/oas/_merge-all-of/generic-merge.d.ts +4 -0
- package/script/oas/_merge-all-of/generic-merge.d.ts.map +1 -0
- package/script/oas/_merge-all-of/generic-merge.js +16 -0
- package/script/oas/_merge-all-of/is-equal.d.ts +2 -0
- package/script/oas/_merge-all-of/is-equal.d.ts.map +1 -0
- package/script/oas/_merge-all-of/is-equal.js +23 -0
- package/script/oas/_merge-all-of/merge-array-constraints.d.ts +3 -0
- package/script/oas/_merge-all-of/merge-array-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-array-constraints.js +70 -0
- package/script/oas/_merge-all-of/merge-boolean-constraints.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-boolean-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-boolean-constraints.js +33 -0
- package/script/oas/_merge-all-of/merge-enum-values.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-enum-values.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-enum-values.js +58 -0
- package/script/oas/_merge-all-of/merge-integer-constraints.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-integer-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-integer-constraints.js +67 -0
- package/script/oas/_merge-all-of/merge-intersection.d.ts +9 -0
- package/script/oas/_merge-all-of/merge-intersection.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-intersection.js +20 -0
- package/script/oas/_merge-all-of/merge-number-constraints.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-number-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-number-constraints.js +67 -0
- package/script/oas/_merge-all-of/merge-object-constraints.d.ts +6 -0
- package/script/oas/_merge-all-of/merge-object-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-object-constraints.js +55 -0
- package/script/oas/_merge-all-of/merge-properties.d.ts +3 -0
- package/script/oas/_merge-all-of/merge-properties.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-properties.js +29 -0
- package/script/oas/_merge-all-of/merge-required.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-required.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-required.js +15 -0
- package/script/oas/_merge-all-of/merge-string-constraints.d.ts +4 -0
- package/script/oas/_merge-all-of/merge-string-constraints.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-string-constraints.js +81 -0
- package/script/oas/_merge-all-of/merge-union.d.ts +16 -0
- package/script/oas/_merge-all-of/merge-union.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge-union.js +58 -0
- package/script/oas/_merge-all-of/merge.d.ts +3 -0
- package/script/oas/_merge-all-of/merge.d.ts.map +1 -0
- package/script/oas/_merge-all-of/merge.js +152 -0
- package/script/oas/_merge-all-of/types.d.ts +15 -0
- package/script/oas/_merge-all-of/types.d.ts.map +1 -0
- package/script/oas/_merge-all-of/types.js +28 -0
- package/script/oas/array/Array.d.ts +29 -9
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +46 -1
- package/script/oas/array/array-types.d.ts +16 -3
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +34 -14
- package/script/oas/array/toArray.d.ts +9 -0
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +84 -6
- package/script/oas/boolean/Boolean.d.ts +19 -9
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +23 -1
- package/script/oas/boolean/boolean-types.d.ts +4 -4
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/boolean/boolean-types.js +30 -7
- package/script/oas/boolean/toBoolean.d.ts +10 -1
- package/script/oas/boolean/toBoolean.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.js +73 -4
- package/script/oas/components/Components.d.ts +4 -0
- package/script/oas/components/Components.d.ts.map +1 -1
- package/script/oas/components/Components.js +4 -0
- package/script/oas/components/toComponentsV3.d.ts.map +1 -1
- package/script/oas/components/toComponentsV3.js +9 -2
- package/script/oas/contact/toContactV3.d.ts.map +1 -1
- package/script/oas/contact/toContactV3.js +3 -1
- package/script/oas/discriminator/Discriminator.d.ts +2 -0
- package/script/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/script/oas/discriminator/Discriminator.js +7 -0
- package/script/oas/discriminator/discriminator-types.d.ts +6 -2
- package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/script/oas/discriminator/discriminator-types.js +28 -5
- package/script/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/script/oas/discriminator/toDiscriminatorV3.js +6 -6
- package/script/oas/document/Document.d.ts +4 -0
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/document/Document.js +7 -0
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.js +6 -2
- package/script/oas/example/example-types.d.ts +7 -2
- package/script/oas/example/example-types.d.ts.map +1 -1
- package/script/oas/example/example-types.js +29 -6
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +6 -1
- package/script/oas/header/toHeadersV3.js +6 -1
- package/script/oas/info/toInfoV3.d.ts.map +1 -1
- package/script/oas/info/toInfoV3.js +3 -1
- package/script/oas/integer/Integer.d.ts +41 -11
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +67 -1
- package/script/oas/integer/integer-types.d.ts +24 -3
- package/script/oas/integer/integer-types.d.ts.map +1 -1
- package/script/oas/integer/integer-types.js +42 -20
- package/script/oas/integer/toInteger.d.ts +9 -1
- package/script/oas/integer/toInteger.d.ts.map +1 -1
- package/script/oas/integer/toInteger.js +70 -6
- package/script/oas/license/toLicenseV3.d.ts.map +1 -1
- package/script/oas/license/toLicenseV3.js +3 -1
- package/script/oas/markdown/markdown-types.d.ts +2 -2
- package/script/oas/markdown/markdown-types.d.ts.map +1 -1
- package/script/oas/markdown/markdown-types.js +25 -2
- package/script/oas/mediaType/mediaType-types.d.ts +12 -2
- package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/script/oas/mediaType/mediaType-types.js +29 -6
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/script/oas/mediaType/toMediaTypeItemV3.js +3 -1
- package/script/oas/number/Number.d.ts +49 -9
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +88 -1
- package/script/oas/number/number-types.d.ts +27 -4
- package/script/oas/number/number-types.d.ts.map +1 -1
- package/script/oas/number/number-types.js +40 -14
- package/script/oas/number/toNumber.d.ts +2 -2
- package/script/oas/number/toNumber.d.ts.map +1 -1
- package/script/oas/number/toNumber.js +74 -5
- package/script/oas/object/Object.d.ts +25 -9
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +51 -1
- package/script/oas/object/object-types.d.ts +7 -3
- package/script/oas/object/object-types.d.ts.map +1 -1
- package/script/oas/object/object-types.js +37 -18
- package/script/oas/object/toObject.d.ts +1 -1
- package/script/oas/object/toObject.d.ts.map +1 -1
- package/script/oas/object/toObject.js +68 -8
- package/script/oas/operation/Operation.d.ts +4 -1
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +7 -0
- package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/script/oas/operation/toOperationsV3.js +29 -11
- package/script/oas/parameter/parameter-types.d.ts +59 -4
- package/script/oas/parameter/parameter-types.d.ts.map +1 -1
- package/script/oas/parameter/parameter-types.js +51 -30
- package/script/oas/parameter/toParameterV3.js +29 -3
- package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/script/oas/pathItem/toPathItemV3.js +6 -1
- package/script/oas/ref/Ref.d.ts +2 -1
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +2 -0
- package/script/oas/ref/ref-types.d.ts +15 -9
- package/script/oas/ref/ref-types.d.ts.map +1 -1
- package/script/oas/ref/ref-types.js +74 -45
- package/script/oas/ref/toRefV31.js +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +3 -1
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +19 -4
- package/script/oas/schema/Schema.d.ts +1 -2
- package/script/oas/schema/Schema.d.ts.map +1 -1
- package/script/oas/schema/schema-types.d.ts +3 -5
- package/script/oas/schema/schema-types.d.ts.map +1 -1
- package/script/oas/schema/schema-types.js +26 -7
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +151 -25
- package/script/oas/securityRequirement/SecurityRequirement.d.ts +11 -0
- package/script/oas/securityRequirement/SecurityRequirement.d.ts.map +1 -0
- package/script/oas/securityRequirement/SecurityRequirement.js +26 -0
- package/script/oas/securityRequirement/toSecurityRequirement.d.ts +9 -0
- package/script/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -0
- package/script/oas/securityRequirement/toSecurityRequirement.js +13 -0
- package/script/oas/securitySchemes/SecurityScheme.d.ts +113 -0
- package/script/oas/securitySchemes/SecurityScheme.d.ts.map +1 -0
- package/script/oas/securitySchemes/SecurityScheme.js +211 -0
- package/script/oas/securitySchemes/security-scheme-types.d.ts +181 -0
- package/script/oas/securitySchemes/security-scheme-types.d.ts.map +1 -0
- package/script/oas/securitySchemes/security-scheme-types.js +82 -0
- package/script/oas/securitySchemes/toSecuritySchemes.d.ts +11 -0
- package/script/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -0
- package/script/oas/securitySchemes/toSecuritySchemes.js +89 -0
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/server/toServerV3.js +3 -1
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
- package/script/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
- package/script/oas/string/String.d.ts +21 -11
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +23 -4
- package/script/oas/string/string-types.d.ts +30 -3
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/string-types.js +53 -32
- package/script/oas/string/toString.d.ts +11 -2
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +77 -7
- package/script/oas/tag/toTagsV3.d.ts.map +1 -1
- package/script/oas/tag/toTagsV3.js +3 -1
- package/script/oas/union/Union.d.ts +5 -0
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +11 -0
- package/script/oas/union/toUnion.d.ts +2 -1
- package/script/oas/union/toUnion.d.ts.map +1 -1
- package/script/oas/union/toUnion.js +12 -4
- package/script/oas/union/union-types.d.ts +13 -2
- package/script/oas/union/union-types.d.ts.map +1 -1
- package/script/oas/union/union-types.js +31 -8
- package/script/oas/unknown/toUnknown.d.ts.map +1 -1
- package/script/oas/unknown/toUnknown.js +3 -1
- package/script/oas/unknown/unknown-types.d.ts +8 -2
- package/script/oas/unknown/unknown-types.d.ts.map +1 -1
- package/script/oas/unknown/unknown-types.js +30 -7
- package/script/types/EnrichmentRequest.d.ts +2 -2
- package/script/types/EnrichmentRequest.d.ts.map +1 -1
- package/script/types/Manifest.d.ts +58 -276
- package/script/types/Manifest.d.ts.map +1 -1
- package/script/types/Manifest.js +45 -28
- package/script/types/Method.d.ts +3 -5
- package/script/types/Method.d.ts.map +1 -1
- package/script/types/Method.js +35 -6
- package/script/types/Preview.d.ts +46 -158
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +48 -27
- package/script/types/Results.d.ts +3 -9
- package/script/types/Results.d.ts.map +1 -1
- package/script/types/Results.js +33 -10
- package/script/types/SchemaOptions.d.ts +20 -64
- package/script/types/SchemaOptions.d.ts.map +1 -1
- package/script/types/SchemaOptions.js +54 -31
- package/script/types/Settings.d.ts +97 -437
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +61 -51
- package/script/types/TypeSystem.d.ts +1 -11
- package/script/types/TypeSystem.d.ts.map +1 -1
- package/script/types/prettierConfig.d.ts +25 -2
- package/script/types/prettierConfig.d.ts.map +1 -1
- package/script/types/prettierConfig.js +47 -30
- package/esm/oas/intersection/Intersection.d.ts +0 -30
- package/esm/oas/intersection/Intersection.d.ts.map +0 -1
- package/esm/oas/intersection/Intersection.js +0 -83
- package/esm/oas/intersection/intersection-types.d.ts +0 -14
- package/esm/oas/intersection/intersection-types.d.ts.map +0 -1
- package/esm/oas/intersection/intersection-types.js +0 -12
- package/esm/oas/intersection/toIntersection.d.ts +0 -11
- package/esm/oas/intersection/toIntersection.d.ts.map +0 -1
- package/esm/oas/intersection/toIntersection.js +0 -16
- package/esm/oas/null/null-types.d.ts +0 -10
- package/esm/oas/null/null-types.d.ts.map +0 -1
- package/esm/oas/null/null-types.js +0 -8
- package/script/oas/intersection/Intersection.d.ts +0 -30
- package/script/oas/intersection/Intersection.d.ts.map +0 -1
- package/script/oas/intersection/Intersection.js +0 -87
- package/script/oas/intersection/intersection-types.d.ts +0 -14
- package/script/oas/intersection/intersection-types.d.ts.map +0 -1
- package/script/oas/intersection/intersection-types.js +0 -15
- package/script/oas/intersection/toIntersection.d.ts +0 -11
- package/script/oas/intersection/toIntersection.d.ts.map +0 -1
- package/script/oas/intersection/toIntersection.js +0 -20
- package/script/oas/null/null-types.d.ts +0 -10
- package/script/oas/null/null-types.d.ts.map +0 -1
- package/script/oas/null/null-types.js +0 -11
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
type ParseExampleArgs<T, Nullable extends boolean | undefined, Value extends OpenAPIV3.SchemaObject> = {
|
|
5
|
+
value: Omit<Value, 'nullable'>;
|
|
6
|
+
nullable: Nullable;
|
|
7
|
+
valibotSchema: v.GenericSchema<T>;
|
|
8
|
+
context: ParseContext;
|
|
9
|
+
};
|
|
10
|
+
type ParseExampleReturn<T, Nullable extends boolean | undefined, Value extends OpenAPIV3.SchemaObject> = {
|
|
11
|
+
example: Nullable extends true ? T | null | undefined : T | undefined;
|
|
12
|
+
value: Omit<Value, 'nullable' | 'example'>;
|
|
13
|
+
};
|
|
14
|
+
export declare const parseExample: <T, Nullable extends boolean | undefined, Value extends OpenAPIV3.SchemaObject>({ value, nullable, valibotSchema, context }: ParseExampleArgs<T, Nullable, Value>) => ParseExampleReturn<T, Nullable, Value>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=parseExample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseExample.d.ts","sourceRoot":"","sources":["../../../src/oas/_helpers/parseExample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,KAAK,gBAAgB,CACnB,CAAC,EACD,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,KAAK,SAAS,SAAS,CAAC,YAAY,IAClC;IACF,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAC9B,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,KAAK,kBAAkB,CACrB,CAAC,EACD,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,KAAK,SAAS,SAAS,CAAC,YAAY,IAClC;IACF,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAAA;IACrE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,YAAY,GACvB,CAAC,EACD,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,KAAK,SAAS,SAAS,CAAC,YAAY,+CAMnC,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAG,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAgB9E,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const parseExample = ({ value, nullable, valibotSchema, context }) => {
|
|
3
|
+
const { example, ...rest } = value;
|
|
4
|
+
const parsedExample = context.provisionalParse({
|
|
5
|
+
key: 'example',
|
|
6
|
+
value: example,
|
|
7
|
+
parent: value,
|
|
8
|
+
schema: nullable === true ? v.nullable(valibotSchema) : valibotSchema,
|
|
9
|
+
toMessage: value => `Removed invalid example. Expected ${valibotSchema.type}, got: ${value}`,
|
|
10
|
+
type: 'INVALID_EXAMPLE'
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
example: parsedExample,
|
|
14
|
+
value: rest
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
type ParseFormatArgs<T> = {
|
|
5
|
+
value: Omit<OpenAPIV3.SchemaObject, 'nullable' | 'example' | 'enums'>;
|
|
6
|
+
valibotSchema: v.GenericSchema<T>;
|
|
7
|
+
context: ParseContext;
|
|
8
|
+
};
|
|
9
|
+
type ParseFormatReturn<T, Value extends OpenAPIV3.SchemaObject> = {
|
|
10
|
+
format: T | undefined;
|
|
11
|
+
value: Omit<Value, 'format'>;
|
|
12
|
+
};
|
|
13
|
+
export declare const parseFormat: <T, Value extends OpenAPIV3.SchemaObject>({ value, valibotSchema, context }: ParseFormatArgs<T>) => ParseFormatReturn<T, Value>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=parseFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFormat.d.ts","sourceRoot":"","sources":["../../../src/oas/_helpers/parseFormat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;IACrE,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,KAAK,iBAAiB,CAAC,CAAC,EAAE,KAAK,SAAS,SAAS,CAAC,YAAY,IAAI;IAChE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAA;IACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,KAAK,SAAS,SAAS,CAAC,YAAY,qCAIhE,eAAe,CAAC,CAAC,CAAC,KAAG,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAgBjD,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const parseFormat = ({ value, valibotSchema, context }) => {
|
|
3
|
+
const { format, ...rest } = value;
|
|
4
|
+
const parsedFormat = context.provisionalParse({
|
|
5
|
+
key: 'format',
|
|
6
|
+
value: format,
|
|
7
|
+
parent: value,
|
|
8
|
+
schema: v.optional(valibotSchema),
|
|
9
|
+
toMessage: value => `Unexpected "${rest.type}" format: ${value}`,
|
|
10
|
+
type: 'INVALID_FORMAT'
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
format: parsedFormat,
|
|
14
|
+
value: rest
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
|
+
export type ParseNullableArgs<Value extends OpenAPIV3.SchemaObject> = {
|
|
4
|
+
value: Value;
|
|
5
|
+
context: ParseContext;
|
|
6
|
+
};
|
|
7
|
+
export type ParseNullableReturn<Value extends OpenAPIV3.SchemaObject> = {
|
|
8
|
+
nullable: boolean | undefined;
|
|
9
|
+
value: Omit<Value, 'nullable'>;
|
|
10
|
+
};
|
|
11
|
+
export declare const parseNullable: <Value extends OpenAPIV3.SchemaObject>({ value, context }: ParseNullableArgs<Value>) => ParseNullableReturn<Value>;
|
|
12
|
+
//# sourceMappingURL=parseNullable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseNullable.d.ts","sourceRoot":"","sources":["../../../src/oas/_helpers/parseNullable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,SAAS,CAAC,YAAY,IAAI;IACpE,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,SAAS,CAAC,YAAY,IAAI;IACtE,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,SAAS,CAAC,YAAY,sBAG/D,iBAAiB,CAAC,KAAK,CAAC,KAAG,mBAAmB,CAAC,KAAK,CAgBtD,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const parseNullable = ({ value, context }) => {
|
|
3
|
+
const { nullable, ...rest } = value;
|
|
4
|
+
const parsedNullable = context.provisionalParse({
|
|
5
|
+
key: 'nullable',
|
|
6
|
+
value: nullable,
|
|
7
|
+
parent: value,
|
|
8
|
+
schema: v.optional(v.boolean()),
|
|
9
|
+
toMessage: (input) => `Invalid nullable: ${input}`,
|
|
10
|
+
type: 'INVALID_NULLABLE'
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
nullable: parsedNullable,
|
|
14
|
+
value: rest
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-array-item-type-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-array-item-type-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,2BAA2B,MACnC,SAAS,CAAC,YAAY,KACtB,SAAS,CAAC,YAAY,KACxB,IAUF,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const checkArrayItemTypeConflicts = (a, b) => {
|
|
2
|
+
if (a.type === 'array' && b.type === 'array' && 'items' in a && 'items' in b) {
|
|
3
|
+
const aItems = a.items;
|
|
4
|
+
const bItems = b.items;
|
|
5
|
+
if (aItems.type && bItems.type && aItems.type !== bItems.type) {
|
|
6
|
+
throw new Error(`Cannot merge schemas: array items have conflicting types '${aItems.type}' and '${bItems.type}'`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SchemaObject } from './types.js';
|
|
2
|
+
type SchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
|
|
3
|
+
export declare const checkAtLeastOneTypeMatch: (first: SchemaObject, second: SchemaObject, type: SchemaType) => boolean;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=check-at-least-one-type-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-at-least-one-type-match.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-at-least-one-type-match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAElF,eAAO,MAAM,wBAAwB,UAC5B,YAAY,UACX,YAAY,QACd,UAAU,KACf,OAMF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-enum-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-enum-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,kBAAkB,UACtB,SAAS,CAAC,YAAY,UACrB,SAAS,CAAC,YAAY,KAC7B,IAUF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isEqual } from './is-equal.js';
|
|
2
|
+
export const checkEnumConflicts = (first, second) => {
|
|
3
|
+
if (first.enum && second.enum) {
|
|
4
|
+
const intersection = first.enum.filter(value => {
|
|
5
|
+
return second.enum.some(bValue => isEqual(value, bValue));
|
|
6
|
+
});
|
|
7
|
+
if (intersection.length === 0) {
|
|
8
|
+
throw new Error('Cannot merge schemas: enum values have no intersection');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-format-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-format-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,oBAAoB,MAC5B,SAAS,CAAC,YAAY,KACtB,SAAS,CAAC,YAAY,KACxB,IAIF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-number-constraints-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-number-constraints-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,+BAA+B,MACvC,SAAS,CAAC,YAAY,KACtB,SAAS,CAAC,YAAY,KACxB,IAYF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const checkNumberConstraintsConflicts = (a, b) => {
|
|
2
|
+
if (a.type === 'number' && b.type === 'number') {
|
|
3
|
+
const aMin = a.minimum ?? -Infinity;
|
|
4
|
+
const aMax = a.maximum ?? Infinity;
|
|
5
|
+
const bMin = b.minimum ?? -Infinity;
|
|
6
|
+
const bMax = b.maximum ?? Infinity;
|
|
7
|
+
if (aMin > bMax || bMin > aMax) {
|
|
8
|
+
throw new Error(`Cannot merge schemas: incompatible number ranges [${aMin},${aMax}] and [${bMin},${bMax}]`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-read-only-write-only-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-read-only-write-only-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,+BAA+B,MACvC,SAAS,CAAC,YAAY,KACtB,SAAS,CAAC,YAAY,KACxB,IAIF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-type-conflicts.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/check-type-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,kBAAkB,UACtB,SAAS,CAAC,YAAY,UACrB,SAAS,CAAC,YAAY,KAC7B,IAQF,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const checkTypeConflicts = (first, second) => {
|
|
2
|
+
if (first.type && second.type && first.type !== second.type) {
|
|
3
|
+
throw new Error(`Cannot merge schemas: conflicting types '${first.type}' and '${second.type}', ${JSON.stringify(first)} and ${JSON.stringify(second)}`);
|
|
4
|
+
}
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-product.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/cross-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,eAAO,MAAM,YAAY,MAAO,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,6CAK1E,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
type DecomposeIntersectionArgs = {
|
|
3
|
+
schema: OpenAPIV3.SchemaObject;
|
|
4
|
+
};
|
|
5
|
+
export declare const decomposeIntersection: ({ schema }: DecomposeIntersectionArgs) => (OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject)[];
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=decompose-intersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompose-intersection.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/decompose-intersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAQ9C,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC,YAAY,CAAA;CAC/B,CAAA;AAGD,eAAO,MAAM,qBAAqB,eAE/B,yBAAyB,KAAG,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,eAAe,CAAC,EA4BlF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Convert a schema object into an array of schemas that can be merged iteratively into a new schema
|
|
2
|
+
export const decomposeIntersection = ({ schema }) => {
|
|
3
|
+
if (!schema.allOf) {
|
|
4
|
+
return [schema];
|
|
5
|
+
}
|
|
6
|
+
let location = 'before';
|
|
7
|
+
const output = {
|
|
8
|
+
before: [],
|
|
9
|
+
inside: [],
|
|
10
|
+
after: []
|
|
11
|
+
};
|
|
12
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
13
|
+
if (key === 'allOf') {
|
|
14
|
+
// do not decompose wrapper for unions (oneOf, anyOf)
|
|
15
|
+
output.inside = value;
|
|
16
|
+
location = 'after';
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
output[location].push([key, value]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return [
|
|
23
|
+
output.before.length > 0 ? Object.fromEntries(output.before) : undefined,
|
|
24
|
+
...output.inside,
|
|
25
|
+
output.after.length > 0 ? Object.fromEntries(output.after) : undefined
|
|
26
|
+
].filter(item => item !== undefined);
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SchemaObject, ReferenceObject } from './types.js';
|
|
2
|
+
type DecomposeUnionArgs = {
|
|
3
|
+
schema: SchemaObject;
|
|
4
|
+
groupType: 'oneOf' | 'anyOf';
|
|
5
|
+
};
|
|
6
|
+
type DecomposeUnionReturn = {
|
|
7
|
+
beforeExcluded: SchemaObject;
|
|
8
|
+
decomposed: (SchemaObject | ReferenceObject)[];
|
|
9
|
+
afterExcluded: SchemaObject;
|
|
10
|
+
};
|
|
11
|
+
export declare const decomposeUnion: ({ schema, groupType }: DecomposeUnionArgs) => DecomposeUnionReturn;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=decompose-union.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompose-union.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/decompose-union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQ/D,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,EAAE,OAAO,GAAG,OAAO,CAAA;CAC7B,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,YAAY,CAAA;IAC5B,UAAU,EAAE,CAAC,YAAY,GAAG,eAAe,CAAC,EAAE,CAAA;IAC9C,aAAa,EAAE,YAAY,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,cAAc,0BAA2B,kBAAkB,KAAG,oBA6C1E,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Convert a schema object into an array of schemas that can be merged iteratively into a new schema
|
|
2
|
+
export const decomposeUnion = ({ schema, groupType }) => {
|
|
3
|
+
if (!schema[groupType]) {
|
|
4
|
+
console.log('NO GROUP TYPE', JSON.stringify(schema, null, 2));
|
|
5
|
+
return {
|
|
6
|
+
beforeExcluded: {},
|
|
7
|
+
decomposed: [schema],
|
|
8
|
+
afterExcluded: {}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
let location = 'before';
|
|
12
|
+
const output = {
|
|
13
|
+
before: [],
|
|
14
|
+
inside: [],
|
|
15
|
+
after: []
|
|
16
|
+
};
|
|
17
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
18
|
+
if (key === groupType) {
|
|
19
|
+
// do not decompose wrapper for unions (oneOf, anyOf)
|
|
20
|
+
output.inside = [{ [groupType]: value }];
|
|
21
|
+
location = 'after';
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
output[location].push([key, value]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const { retained: before, excluded: beforeExcluded } = exclude(output.before);
|
|
28
|
+
const { retained: after, excluded: afterExcluded } = exclude(output.after);
|
|
29
|
+
const decomposed = [
|
|
30
|
+
before.length > 0 ? Object.fromEntries(before) : undefined,
|
|
31
|
+
...output.inside,
|
|
32
|
+
after.length > 0 ? Object.fromEntries(after) : undefined
|
|
33
|
+
].filter(item => item !== undefined);
|
|
34
|
+
const result = {
|
|
35
|
+
beforeExcluded: Object.fromEntries(beforeExcluded),
|
|
36
|
+
decomposed,
|
|
37
|
+
afterExcluded: Object.fromEntries(afterExcluded)
|
|
38
|
+
};
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
const excludedProperties = ['discriminator', 'default'];
|
|
42
|
+
const exclude = (entries) => {
|
|
43
|
+
return entries.reduce((acc, [key, value]) => {
|
|
44
|
+
if (excludedProperties.includes(key)) {
|
|
45
|
+
acc.excluded.push([key, value]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
acc.retained.push([key, value]);
|
|
49
|
+
}
|
|
50
|
+
return acc;
|
|
51
|
+
}, { retained: [], excluded: [] });
|
|
52
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SchemaObject, GetRefFn } from './types.js';
|
|
2
|
+
import type * as v from 'valibot';
|
|
3
|
+
export declare const genericMerge: <T>(first: SchemaObject, second: SchemaObject, getRef: GetRefFn, typeCheck?: v.GenericSchema<T>) => SchemaObject;
|
|
4
|
+
//# sourceMappingURL=generic-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-merge.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/generic-merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIxD,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AACjC,eAAO,MAAM,YAAY,GAAI,CAAC,SACrB,YAAY,UACX,YAAY,UACZ,QAAQ,cACJ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAC7B,YAQF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { mergeEnumValues } from './merge-enum-values.js';
|
|
2
|
+
import { mergeProperties } from './merge-properties.js';
|
|
3
|
+
import { mergeRequired } from './merge-required.js';
|
|
4
|
+
export const genericMerge = (first, second, getRef, typeCheck) => {
|
|
5
|
+
return {
|
|
6
|
+
...first,
|
|
7
|
+
...second,
|
|
8
|
+
...mergeProperties(first, second, getRef),
|
|
9
|
+
...mergeRequired(first, second),
|
|
10
|
+
...mergeEnumValues(first, second, typeCheck)
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-equal.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/is-equal.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAW,OAAO,UAAU,OAAO,KAAG,OAuBzD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const isEqual = (first, second) => {
|
|
2
|
+
if (Array.isArray(first) && Array.isArray(second)) {
|
|
3
|
+
if (first.length !== second.length)
|
|
4
|
+
return false;
|
|
5
|
+
return first.every((value, index) => isEqual(value, second[index]));
|
|
6
|
+
}
|
|
7
|
+
if (typeof first === 'object' &&
|
|
8
|
+
typeof second === 'object' &&
|
|
9
|
+
first !== null &&
|
|
10
|
+
second !== null) {
|
|
11
|
+
const aKeys = Object.keys(first);
|
|
12
|
+
const bKeys = Object.keys(second);
|
|
13
|
+
if (aKeys.length !== bKeys.length)
|
|
14
|
+
return false;
|
|
15
|
+
return aKeys.every(key => bKeys.includes(key) &&
|
|
16
|
+
isEqual(first[key], second[key]));
|
|
17
|
+
}
|
|
18
|
+
return first === second;
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ArraySchemaObject, GetRefFn, SchemaObject } from './types.js';
|
|
2
|
+
export declare function mergeArrayConstraints(first: ArraySchemaObject | SchemaObject, second: ArraySchemaObject | SchemaObject, getRef: GetRefFn): ArraySchemaObject;
|
|
3
|
+
//# sourceMappingURL=merge-array-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-array-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-array-constraints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAqB,MAAM,YAAY,CAAA;AAI9F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GAAG,YAAY,EACvC,MAAM,EAAE,iBAAiB,GAAG,YAAY,EACxC,MAAM,EAAE,QAAQ,GACf,iBAAiB,CAiCnB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mergeSchemasOrRefs } from './merge.js';
|
|
2
|
+
import { genericMerge } from './generic-merge.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { checkTypeConflicts } from './check-type-conflicts.js';
|
|
5
|
+
export function mergeArrayConstraints(first, second, getRef) {
|
|
6
|
+
checkTypeConflicts(first, second);
|
|
7
|
+
if (!('items' in first) && !('items' in second)) {
|
|
8
|
+
throw new Error('Cannot merge array constraints: no items found');
|
|
9
|
+
}
|
|
10
|
+
const result = {
|
|
11
|
+
...genericMerge(first, second, getRef, v.array(v.any())),
|
|
12
|
+
type: 'array',
|
|
13
|
+
items: mergeItems(first, second, getRef)
|
|
14
|
+
};
|
|
15
|
+
// Merge minItems
|
|
16
|
+
if (first.minItems !== undefined || second.minItems !== undefined) {
|
|
17
|
+
const minA = first.minItems ?? 0;
|
|
18
|
+
const minB = second.minItems ?? 0;
|
|
19
|
+
result.minItems = Math.max(minA, minB);
|
|
20
|
+
}
|
|
21
|
+
// Merge maxItems
|
|
22
|
+
if (first.maxItems !== undefined || second.maxItems !== undefined) {
|
|
23
|
+
const maxA = first.maxItems ?? Infinity;
|
|
24
|
+
const maxB = second.maxItems ?? Infinity;
|
|
25
|
+
result.maxItems = Math.min(maxA, maxB);
|
|
26
|
+
}
|
|
27
|
+
// Merge uniqueItems
|
|
28
|
+
if (first.uniqueItems || second.uniqueItems) {
|
|
29
|
+
result.uniqueItems = true;
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
const mergeItems = (first, second, getRef) => {
|
|
34
|
+
if ('items' in first && 'items' in second && first.items && second.items) {
|
|
35
|
+
return mergeSchemasOrRefs(first.items, second.items, getRef);
|
|
36
|
+
}
|
|
37
|
+
if ('items' in first && first.items) {
|
|
38
|
+
return first.items;
|
|
39
|
+
}
|
|
40
|
+
if ('items' in second && second.items) {
|
|
41
|
+
return second.items;
|
|
42
|
+
}
|
|
43
|
+
throw new Error('Cannot merge array constraints: no items found');
|
|
44
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { GetRefFn } from './types.js';
|
|
3
|
+
export declare function mergeBooleanConstraints(first: OpenAPIV3.SchemaObject, second: OpenAPIV3.SchemaObject, getRef: GetRefFn): OpenAPIV3.SchemaObject;
|
|
4
|
+
//# sourceMappingURL=merge-boolean-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-boolean-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-boolean-constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,CAAC,YAAY,EAC7B,MAAM,EAAE,SAAS,CAAC,YAAY,EAC9B,MAAM,EAAE,QAAQ,GACf,SAAS,CAAC,YAAY,CAIxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { genericMerge } from './generic-merge.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { checkTypeConflicts } from './check-type-conflicts.js';
|
|
4
|
+
export function mergeBooleanConstraints(first, second, getRef) {
|
|
5
|
+
checkTypeConflicts(first, second);
|
|
6
|
+
return genericMerge(first, second, getRef, v.boolean());
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SchemaObject } from './types.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export declare function mergeEnumValues<T>(first: SchemaObject, second: SchemaObject, typeCheck?: v.GenericSchema<T>): Pick<SchemaObject, 'enum'>;
|
|
4
|
+
//# sourceMappingURL=merge-enum-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-enum-values.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-enum-values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,SAAS,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAC7B,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CA+B5B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isEqual } from './is-equal.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
const containsEnum = (schema) => {
|
|
4
|
+
return Array.isArray(schema.enum);
|
|
5
|
+
};
|
|
6
|
+
export function mergeEnumValues(first, second, typeCheck) {
|
|
7
|
+
if (!containsEnum(first) && !containsEnum(second)) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
if (!containsEnum(first) && containsEnum(second)) {
|
|
11
|
+
return {
|
|
12
|
+
enum: second.enum
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (containsEnum(first) && !containsEnum(second)) {
|
|
16
|
+
return {
|
|
17
|
+
enum: first.enum
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// Find intersection of enum values
|
|
21
|
+
const intersection = first
|
|
22
|
+
.enum.filter(value => second.enum.some(bValue => isEqual(value, bValue)))
|
|
23
|
+
.map(value => (typeCheck ? v.parse(typeCheck, value) : value));
|
|
24
|
+
// If intersection is empty, throw error
|
|
25
|
+
if (intersection.length === 0) {
|
|
26
|
+
throw new Error('Merged schema has empty enum array');
|
|
27
|
+
}
|
|
28
|
+
// Return merged schema with intersection of enum values
|
|
29
|
+
return {
|
|
30
|
+
enum: intersection
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { GetRefFn } from './types.js';
|
|
3
|
+
export declare function mergeIntegerConstraints(first: OpenAPIV3.SchemaObject, second: OpenAPIV3.SchemaObject, getRef: GetRefFn): OpenAPIV3.SchemaObject;
|
|
4
|
+
//# sourceMappingURL=merge-integer-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-integer-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-integer-constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,CAAC,YAAY,EAC7B,MAAM,EAAE,SAAS,CAAC,YAAY,EAC9B,MAAM,EAAE,QAAQ,GACf,SAAS,CAAC,YAAY,CA2CxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { genericMerge } from './generic-merge.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { checkTypeConflicts } from './check-type-conflicts.js';
|
|
4
|
+
export function mergeIntegerConstraints(first, second, getRef) {
|
|
5
|
+
checkTypeConflicts(first, second);
|
|
6
|
+
// First merge enum values if present
|
|
7
|
+
const result = genericMerge(first, second, getRef, v.number());
|
|
8
|
+
// Then merge other constraints
|
|
9
|
+
result.type = 'integer';
|
|
10
|
+
// Merge minimum and exclusiveMinimum
|
|
11
|
+
if (first.minimum !== undefined || second.minimum !== undefined) {
|
|
12
|
+
const minA = first.minimum ?? -Infinity;
|
|
13
|
+
const minB = second.minimum ?? -Infinity;
|
|
14
|
+
result.minimum = Math.max(minA, minB);
|
|
15
|
+
// If either minimum is exclusive, the result is exclusive
|
|
16
|
+
if (first.exclusiveMinimum || second.exclusiveMinimum) {
|
|
17
|
+
result.exclusiveMinimum = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Merge maximum and exclusiveMaximum
|
|
21
|
+
if (first.maximum !== undefined || second.maximum !== undefined) {
|
|
22
|
+
const maxA = first.maximum ?? Infinity;
|
|
23
|
+
const maxB = second.maximum ?? Infinity;
|
|
24
|
+
result.maximum = Math.min(maxA, maxB);
|
|
25
|
+
// If either maximum is exclusive, the result is exclusive
|
|
26
|
+
if (first.exclusiveMaximum || second.exclusiveMaximum) {
|
|
27
|
+
result.exclusiveMaximum = true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Merge multipleOf
|
|
31
|
+
if (first.multipleOf !== undefined && second.multipleOf !== undefined) {
|
|
32
|
+
result.multipleOf = first.multipleOf * second.multipleOf;
|
|
33
|
+
}
|
|
34
|
+
else if (first.multipleOf !== undefined) {
|
|
35
|
+
result.multipleOf = first.multipleOf;
|
|
36
|
+
}
|
|
37
|
+
else if (second.multipleOf !== undefined) {
|
|
38
|
+
result.multipleOf = second.multipleOf;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GetRefFn, SchemaOrReference, SchemaObject } from './types.js';
|
|
2
|
+
type MergeIntersectionArgs = {
|
|
3
|
+
schema: SchemaObject;
|
|
4
|
+
getRef: GetRefFn;
|
|
5
|
+
throwOnConflict?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const mergeIntersection: ({ schema, getRef }: MergeIntersectionArgs) => SchemaOrReference;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=merge-intersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-intersection.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-intersection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAG3E,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,QAAQ,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB,uBAAwB,qBAAqB,KAAG,iBAkB7E,CAAA"}
|