@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 { decomposeIntersection } from './decompose-intersection.js';
|
|
2
|
+
import { mergeSchemasOrRefs } from './merge.js';
|
|
3
|
+
export const mergeIntersection = ({ schema, getRef }) => {
|
|
4
|
+
const decomposed = decomposeIntersection({ schema });
|
|
5
|
+
if (decomposed.length === 1) {
|
|
6
|
+
return decomposed[0];
|
|
7
|
+
}
|
|
8
|
+
const dereffed = decomposed.map(decomposed => {
|
|
9
|
+
return '$ref' in decomposed ? getRef(decomposed) : decomposed;
|
|
10
|
+
});
|
|
11
|
+
const result = dereffed.reduce((acc, decomposed) => {
|
|
12
|
+
const merged = mergeSchemasOrRefs(acc, decomposed, getRef);
|
|
13
|
+
return merged;
|
|
14
|
+
}, {});
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { GetRefFn } from './types.js';
|
|
3
|
+
export declare function mergeNumberConstraints(first: OpenAPIV3.SchemaObject, second: OpenAPIV3.SchemaObject, getRef: GetRefFn): OpenAPIV3.SchemaObject;
|
|
4
|
+
//# sourceMappingURL=merge-number-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-number-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-number-constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,wBAAgB,sBAAsB,CACpC,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 mergeNumberConstraints(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 = 'number';
|
|
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,6 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
type SchemaObject = OpenAPIV3.SchemaObject;
|
|
3
|
+
type ReferenceObject = OpenAPIV3.ReferenceObject;
|
|
4
|
+
export declare const mergeObjectConstraints: (first: SchemaObject, second: SchemaObject, getRef: (ref: ReferenceObject) => SchemaObject) => SchemaObject;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=merge-object-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-object-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-object-constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,KAAK,YAAY,GAAG,SAAS,CAAC,YAAY,CAAA;AAC1C,KAAK,eAAe,GAAG,SAAS,CAAC,eAAe,CAAA;AAEhD,eAAO,MAAM,sBAAsB,UAC1B,YAAY,UACX,YAAY,UACZ,CAAC,GAAG,EAAE,eAAe,KAAK,YAAY,KAC7C,YAmCF,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 const mergeObjectConstraints = (first, second, getRef) => {
|
|
6
|
+
// Check for type conflicts
|
|
7
|
+
checkTypeConflicts(first, second);
|
|
8
|
+
const result = genericMerge(first, second, getRef, v.record(v.string(), v.any()));
|
|
9
|
+
if (typeof second.additionalProperties === 'object' &&
|
|
10
|
+
typeof first.additionalProperties === 'object') {
|
|
11
|
+
// If both have additionalProperties as schemas, merge them
|
|
12
|
+
result.additionalProperties = mergeSchemasOrRefs(first.additionalProperties, second.additionalProperties, getRef);
|
|
13
|
+
}
|
|
14
|
+
else if (second.additionalProperties !== undefined) {
|
|
15
|
+
result.additionalProperties = second.additionalProperties;
|
|
16
|
+
}
|
|
17
|
+
else if (first.additionalProperties !== undefined) {
|
|
18
|
+
result.additionalProperties = first.additionalProperties;
|
|
19
|
+
}
|
|
20
|
+
// Merge minProperties and maxProperties
|
|
21
|
+
if (second.minProperties !== undefined || first.minProperties !== undefined) {
|
|
22
|
+
result.minProperties = Math.max(second.minProperties ?? 0, first.minProperties ?? 0);
|
|
23
|
+
}
|
|
24
|
+
if (second.maxProperties !== undefined || first.maxProperties !== undefined) {
|
|
25
|
+
result.maxProperties = Math.min(second.maxProperties ?? Infinity, first.maxProperties ?? Infinity);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-properties.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,eAAO,MAAM,eAAe,UACnB,YAAY,UACX,YAAY,UACZ,QAAQ,KACf,YAAY,GAAG,SAsBjB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mergeSchemasOrRefs } from './merge.js';
|
|
2
|
+
export const mergeProperties = (first, second, getRef) => {
|
|
3
|
+
if (containsProperties(first, second)) {
|
|
4
|
+
const properties = { ...first.properties };
|
|
5
|
+
if (!properties) {
|
|
6
|
+
return {
|
|
7
|
+
properties: second.properties
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
for (const key in second.properties) {
|
|
11
|
+
if (key in properties) {
|
|
12
|
+
properties[key] = mergeSchemasOrRefs(properties[key], second.properties[key], getRef);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
properties[key] = second.properties[key];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
properties
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const containsProperties = (first, second) => {
|
|
24
|
+
return Boolean(first.properties || second.properties);
|
|
25
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SchemaObject } from './types.js';
|
|
2
|
+
export declare const containsRequired: (first: SchemaObject, second: SchemaObject) => boolean;
|
|
3
|
+
export declare const mergeRequired: (first: SchemaObject, second: SchemaObject) => SchemaObject | undefined;
|
|
4
|
+
//# sourceMappingURL=merge-required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-required.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-required.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,gBAAgB,UAAW,YAAY,UAAU,YAAY,KAAG,OAE5E,CAAA;AAED,eAAO,MAAM,aAAa,UACjB,YAAY,UACX,YAAY,KACnB,YAAY,GAAG,SAMjB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const containsRequired = (first, second) => {
|
|
2
|
+
return Boolean(first.required || second.required);
|
|
3
|
+
};
|
|
4
|
+
export const mergeRequired = (first, second) => {
|
|
5
|
+
if (containsRequired(first, second)) {
|
|
6
|
+
return {
|
|
7
|
+
required: [...(first.required ?? []), ...(second.required ?? [])]
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { GetRefFn } from './types.js';
|
|
3
|
+
export declare function mergeStringConstraints(first: OpenAPIV3.SchemaObject, second: OpenAPIV3.SchemaObject, getRef: GetRefFn): OpenAPIV3.SchemaObject;
|
|
4
|
+
//# sourceMappingURL=merge-string-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-string-constraints.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-string-constraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAI1C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,CAAC,YAAY,EAC7B,MAAM,EAAE,SAAS,CAAC,YAAY,EAC9B,MAAM,EAAE,QAAQ,GACf,SAAS,CAAC,YAAY,CAwDxB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { genericMerge } from './generic-merge.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { checkTypeConflicts } from './check-type-conflicts.js';
|
|
4
|
+
import { checkAtLeastOneTypeMatch } from './check-at-least-one-type-match.js';
|
|
5
|
+
export function mergeStringConstraints(first, second, getRef) {
|
|
6
|
+
checkTypeConflicts(first, second);
|
|
7
|
+
if (!checkAtLeastOneTypeMatch(first, second, 'string')) {
|
|
8
|
+
return genericMerge(first, second, getRef);
|
|
9
|
+
}
|
|
10
|
+
// First merge enum values if present
|
|
11
|
+
const result = genericMerge(first, second, getRef, v.string());
|
|
12
|
+
// Then merge other constraints
|
|
13
|
+
result.type = 'string';
|
|
14
|
+
// Merge minLength
|
|
15
|
+
if (first.minLength !== undefined || second.minLength !== undefined) {
|
|
16
|
+
const minA = first.minLength ?? 0;
|
|
17
|
+
const minB = second.minLength ?? 0;
|
|
18
|
+
result.minLength = Math.max(minA, minB);
|
|
19
|
+
}
|
|
20
|
+
// Merge maxLength
|
|
21
|
+
if (first.maxLength !== undefined || second.maxLength !== undefined) {
|
|
22
|
+
const maxA = first.maxLength ?? Infinity;
|
|
23
|
+
const maxB = second.maxLength ?? Infinity;
|
|
24
|
+
result.maxLength = Math.min(maxA, maxB);
|
|
25
|
+
}
|
|
26
|
+
// Merge pattern
|
|
27
|
+
if (first.pattern !== undefined && second.pattern !== undefined) {
|
|
28
|
+
// If both have patterns, they must match
|
|
29
|
+
if (first.pattern !== second.pattern) {
|
|
30
|
+
throw new Error(`Cannot merge schemas: conflicting patterns '${first.pattern}' and '${second.pattern}'`);
|
|
31
|
+
}
|
|
32
|
+
result.pattern = first.pattern;
|
|
33
|
+
}
|
|
34
|
+
else if (first.pattern !== undefined) {
|
|
35
|
+
result.pattern = first.pattern;
|
|
36
|
+
}
|
|
37
|
+
else if (second.pattern !== undefined) {
|
|
38
|
+
result.pattern = second.pattern;
|
|
39
|
+
}
|
|
40
|
+
// Merge format
|
|
41
|
+
if (first.format !== undefined && second.format !== undefined) {
|
|
42
|
+
// If both have formats, they must match
|
|
43
|
+
if (first.format !== second.format) {
|
|
44
|
+
throw new Error('Incompatible string formats');
|
|
45
|
+
}
|
|
46
|
+
result.format = first.format;
|
|
47
|
+
}
|
|
48
|
+
else if (first.format !== undefined) {
|
|
49
|
+
result.format = first.format;
|
|
50
|
+
}
|
|
51
|
+
else if (second.format !== undefined) {
|
|
52
|
+
result.format = second.format;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GetRefFn, SchemaOrReference, SchemaObject } from './types.js';
|
|
2
|
+
type MergeUnionArgs = {
|
|
3
|
+
schema: SchemaObject;
|
|
4
|
+
getRef: GetRefFn;
|
|
5
|
+
groupType: 'oneOf' | 'anyOf';
|
|
6
|
+
};
|
|
7
|
+
export declare const mergeUnion: ({ schema, getRef, groupType }: MergeUnionArgs) => SchemaOrReference;
|
|
8
|
+
type MergeCrossProductArgs = {
|
|
9
|
+
first: SchemaObject;
|
|
10
|
+
second: SchemaObject;
|
|
11
|
+
getRef: GetRefFn;
|
|
12
|
+
groupType: 'oneOf' | 'anyOf';
|
|
13
|
+
};
|
|
14
|
+
export declare const mergeCrossProduct: ({ first, second, getRef, groupType }: MergeCrossProductArgs) => SchemaObject;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=merge-union.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-union.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge-union.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAI3E,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,QAAQ,CAAA;IAChB,SAAS,EAAE,OAAO,GAAG,OAAO,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,UAAU,kCAAmC,cAAc,KAAG,iBAiC1E,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,YAAY,CAAA;IACnB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,QAAQ,CAAA;IAChB,SAAS,EAAE,OAAO,GAAG,OAAO,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,iBAAiB,yCAK3B,qBAAqB,KAAG,YAyB1B,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { decomposeUnion } from './decompose-union.js';
|
|
2
|
+
import { mergeSchemasOrRefs } from './merge.js';
|
|
3
|
+
import { crossProduct } from './cross-product.js';
|
|
4
|
+
import { isRef } from '../../helpers/refFns.js';
|
|
5
|
+
export const mergeUnion = ({ schema, getRef, groupType }) => {
|
|
6
|
+
const { beforeExcluded, decomposed, afterExcluded } = decomposeUnion({ schema, groupType });
|
|
7
|
+
// if (decomposed.length === 1) {
|
|
8
|
+
// console.log('DECOMPOSED', JSON.stringify(decomposed[0], null, 2))
|
|
9
|
+
// const result = {
|
|
10
|
+
// ...beforeExcluded,
|
|
11
|
+
// ...decomposed[0],
|
|
12
|
+
// ...afterExcluded
|
|
13
|
+
// }
|
|
14
|
+
// console.log('MERGED UNION - SHORT', JSON.stringify(result, null, 2))
|
|
15
|
+
// return result
|
|
16
|
+
// }
|
|
17
|
+
const dereffed = decomposed.map(decomposed => {
|
|
18
|
+
return '$ref' in decomposed ? getRef(decomposed) : decomposed;
|
|
19
|
+
});
|
|
20
|
+
const result = dereffed.reduce((acc, decomposed) => {
|
|
21
|
+
const merged = mergeCrossProduct({ first: acc, second: decomposed, getRef, groupType });
|
|
22
|
+
return merged;
|
|
23
|
+
}, {});
|
|
24
|
+
const output = {
|
|
25
|
+
...beforeExcluded,
|
|
26
|
+
...result,
|
|
27
|
+
...afterExcluded
|
|
28
|
+
};
|
|
29
|
+
return output;
|
|
30
|
+
};
|
|
31
|
+
export const mergeCrossProduct = ({ first, second, getRef, groupType }) => {
|
|
32
|
+
const firstGroup = Array.isArray(first[groupType]) ? first[groupType] : [first];
|
|
33
|
+
const secondGroup = Array.isArray(second[groupType]) ? second[groupType] : [second];
|
|
34
|
+
const mergedGroup = crossProduct(firstGroup, secondGroup)
|
|
35
|
+
.map(([firstItem, secondItem]) => {
|
|
36
|
+
try {
|
|
37
|
+
const result = mergeSchemasOrRefs(firstItem, secondItem, getRef);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (_error) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.filter(item => item !== undefined);
|
|
45
|
+
return {
|
|
46
|
+
[groupType]: mergedGroup.flatMap(item => {
|
|
47
|
+
if (!isRef(item) && Array.isArray(item[groupType])) {
|
|
48
|
+
return item[groupType];
|
|
49
|
+
}
|
|
50
|
+
return [item];
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/merge.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAiC,QAAQ,EAAE,MAAM,YAAY,CAAA;AAiB5F,eAAO,MAAM,kBAAkB,UACtB,iBAAiB,UAChB,iBAAiB,UACjB,QAAQ,KACf,iBAgCF,CAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { isRef } from '../../helpers/refFns.js';
|
|
2
|
+
import { isEmpty } from 'lodash-es';
|
|
3
|
+
import { checkTypeConflicts } from './check-type-conflicts.js';
|
|
4
|
+
import { checkReadOnlyWriteOnlyConflicts } from './check-read-only-write-only-conflicts.js';
|
|
5
|
+
import { checkFormatConflicts } from './check-format-conflicts.js';
|
|
6
|
+
import { checkEnumConflicts } from './check-enum-conflicts.js';
|
|
7
|
+
import { checkNumberConstraintsConflicts } from './check-number-constraints-conflicts.js';
|
|
8
|
+
import { checkArrayItemTypeConflicts } from './check-array-item-type-conflicts.js';
|
|
9
|
+
import { mergeObjectConstraints } from './merge-object-constraints.js';
|
|
10
|
+
import { mergeArrayConstraints } from './merge-array-constraints.js';
|
|
11
|
+
import { mergeStringConstraints } from './merge-string-constraints.js';
|
|
12
|
+
import { mergeNumberConstraints } from './merge-number-constraints.js';
|
|
13
|
+
import { mergeIntegerConstraints } from './merge-integer-constraints.js';
|
|
14
|
+
import { mergeBooleanConstraints } from './merge-boolean-constraints.js';
|
|
15
|
+
import { genericMerge } from './generic-merge.js';
|
|
16
|
+
import { checkAtLeastOneTypeMatch } from './check-at-least-one-type-match.js';
|
|
17
|
+
import { mergeIntersection } from './merge-intersection.js';
|
|
18
|
+
import { mergeCrossProduct } from './merge-union.js';
|
|
19
|
+
export const mergeSchemasOrRefs = (first, second, getRef) => {
|
|
20
|
+
if (containsRef(first, second)) {
|
|
21
|
+
return mergeWithRef(first, second, getRef);
|
|
22
|
+
}
|
|
23
|
+
if (isRef(first)) {
|
|
24
|
+
throw new Error('Ref in first');
|
|
25
|
+
}
|
|
26
|
+
if (isRef(second)) {
|
|
27
|
+
throw new Error('Ref in second');
|
|
28
|
+
}
|
|
29
|
+
if (containsAllOf(first) || containsAllOf(second)) {
|
|
30
|
+
const mergedFirst = containsAllOf(first) ? mergeIntersection({ schema: first, getRef }) : first;
|
|
31
|
+
const mergedSecond = containsAllOf(second)
|
|
32
|
+
? mergeIntersection({ schema: second, getRef })
|
|
33
|
+
: second;
|
|
34
|
+
return mergeSchemasOrRefs(mergedFirst, mergedSecond, getRef);
|
|
35
|
+
}
|
|
36
|
+
if (containsOneOf(first, second)) {
|
|
37
|
+
return mergeCrossProduct({ first, second, getRef, groupType: 'oneOf' });
|
|
38
|
+
}
|
|
39
|
+
if (containsAnyOf(first, second)) {
|
|
40
|
+
return mergeCrossProduct({ first, second, getRef, groupType: 'anyOf' });
|
|
41
|
+
}
|
|
42
|
+
return mergeSchemas(first, second, getRef);
|
|
43
|
+
};
|
|
44
|
+
const containsAllOf = (schema) => {
|
|
45
|
+
if (schema.allOf) {
|
|
46
|
+
if (schema.allOf?.length) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
throw new Error('Empty allOf');
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
|
+
const containsAnyOf = (first, second) => {
|
|
54
|
+
if (first.anyOf) {
|
|
55
|
+
if (first.anyOf?.length) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
throw new Error('Empty anyOf');
|
|
59
|
+
}
|
|
60
|
+
if (second.anyOf) {
|
|
61
|
+
if (second.anyOf?.length) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
throw new Error('Empty anyOf');
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
const containsOneOf = (first, second) => {
|
|
69
|
+
if (first.oneOf) {
|
|
70
|
+
if (first.oneOf?.length) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
throw new Error('Empty oneOf');
|
|
74
|
+
}
|
|
75
|
+
if (second.oneOf) {
|
|
76
|
+
if (second.oneOf?.length) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
throw new Error('Empty oneOf');
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
83
|
+
const containsRef = (first, second) => {
|
|
84
|
+
return isRef(first) || isRef(second);
|
|
85
|
+
};
|
|
86
|
+
const mergeSchemas = (first, second, getRef) => {
|
|
87
|
+
try {
|
|
88
|
+
checkTypeConflicts(first, second);
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
throw e;
|
|
92
|
+
}
|
|
93
|
+
checkReadOnlyWriteOnlyConflicts(first, second);
|
|
94
|
+
checkFormatConflicts(first, second);
|
|
95
|
+
checkEnumConflicts(first, second);
|
|
96
|
+
checkNumberConstraintsConflicts(first, second);
|
|
97
|
+
checkArrayItemTypeConflicts(first, second);
|
|
98
|
+
if (first.not || second.not) {
|
|
99
|
+
throw new Error('Merging schemas with "not" keyword is not supported');
|
|
100
|
+
}
|
|
101
|
+
return typedMerge(first, second, getRef);
|
|
102
|
+
};
|
|
103
|
+
const typedMerge = (first, second, getRef) => {
|
|
104
|
+
if (!first.type && !second.type) {
|
|
105
|
+
return genericMerge(first, second, getRef);
|
|
106
|
+
}
|
|
107
|
+
if (checkAtLeastOneTypeMatch(first, second, 'object')) {
|
|
108
|
+
return mergeObjectConstraints(first, second, getRef);
|
|
109
|
+
}
|
|
110
|
+
if (checkAtLeastOneTypeMatch(first, second, 'array')) {
|
|
111
|
+
return mergeArrayConstraints(first, second, getRef);
|
|
112
|
+
}
|
|
113
|
+
if (checkAtLeastOneTypeMatch(first, second, 'string')) {
|
|
114
|
+
return mergeStringConstraints(first, second, getRef);
|
|
115
|
+
}
|
|
116
|
+
if (checkAtLeastOneTypeMatch(first, second, 'number')) {
|
|
117
|
+
return mergeNumberConstraints(first, second, getRef);
|
|
118
|
+
}
|
|
119
|
+
if (checkAtLeastOneTypeMatch(first, second, 'integer')) {
|
|
120
|
+
return mergeIntegerConstraints(first, second, getRef);
|
|
121
|
+
}
|
|
122
|
+
if (checkAtLeastOneTypeMatch(first, second, 'boolean')) {
|
|
123
|
+
return mergeBooleanConstraints(first, second, getRef);
|
|
124
|
+
}
|
|
125
|
+
throw new Error(`Cannot merge schemas with type "${first.type}" with type "${second.type}"`);
|
|
126
|
+
};
|
|
127
|
+
const mergeWithRef = (first, second, getRef) => {
|
|
128
|
+
if (isRef(first) && isRef(second)) {
|
|
129
|
+
if (first.$ref === second.$ref) {
|
|
130
|
+
return {
|
|
131
|
+
...first,
|
|
132
|
+
...second
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return mergeSchemas(getRef(first), getRef(second), getRef);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (isRef(first) && !isRef(second)) {
|
|
140
|
+
const merged = isEmpty(second) ? first : mergeSchemas(getRef(first), second, getRef);
|
|
141
|
+
return merged;
|
|
142
|
+
}
|
|
143
|
+
if (!isRef(first) && isRef(second)) {
|
|
144
|
+
const merged = isEmpty(first) ? second : mergeSchemas(first, getRef(second), getRef);
|
|
145
|
+
return merged;
|
|
146
|
+
}
|
|
147
|
+
throw new Error('Invalid input');
|
|
148
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export type GetRefFn = (ref: OpenAPIV3.ReferenceObject) => OpenAPIV3.SchemaObject;
|
|
4
|
+
export type OneOfObject = {
|
|
5
|
+
oneOf?: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
|
|
6
|
+
} & OpenAPIV3.SchemaObject;
|
|
7
|
+
export type AnyOfObject = {
|
|
8
|
+
anyOf?: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
|
|
9
|
+
} & OpenAPIV3.SchemaObject;
|
|
10
|
+
export type SchemaObject = OpenAPIV3.SchemaObject;
|
|
11
|
+
export type ReferenceObject = OpenAPIV3.ReferenceObject;
|
|
12
|
+
export type SchemaOrReference = SchemaObject | ReferenceObject;
|
|
13
|
+
export type ArraySchemaObject = OpenAPIV3.ArraySchemaObject;
|
|
14
|
+
export declare const IntegerSchema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, "The number must be an integer.">]>;
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/oas/_merge-all-of/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,eAAe,KAAK,SAAS,CAAC,YAAY,CAAA;AAEjF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAA;CAC/D,GAAG,SAAS,CAAC,YAAY,CAAA;AAE1B,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAA;CAC/D,GAAG,SAAS,CAAC,YAAY,CAAA;AAE1B,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAA;AACjD,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAA;AACvD,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAA;AAE9D,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAA;AAE3D,eAAO,MAAM,aAAa,mHAAkE,CAAA"}
|
package/esm/oas/array/Array.d.ts
CHANGED
|
@@ -2,19 +2,23 @@ import "../../_dnt.polyfills.js";
|
|
|
2
2
|
import type { OasSchema, ToJsonSchemaOptions } from '../schema/Schema.js';
|
|
3
3
|
import type { OasRef } from '../ref/Ref.js';
|
|
4
4
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
5
|
-
export type ArrayFields = {
|
|
5
|
+
export type ArrayFields<Nullable extends boolean | undefined> = {
|
|
6
6
|
items: OasSchema | OasRef<'schema'>;
|
|
7
7
|
title?: string;
|
|
8
8
|
description?: string;
|
|
9
|
-
nullable?:
|
|
9
|
+
nullable?: Nullable;
|
|
10
10
|
uniqueItems?: boolean;
|
|
11
11
|
extensionFields?: Record<string, unknown>;
|
|
12
|
-
example?:
|
|
12
|
+
example?: Nullable extends true ? unknown[] | null | undefined : unknown[] | undefined;
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
minItems?: number;
|
|
15
|
+
enums?: Nullable extends true ? (unknown | null)[] | undefined : unknown[] | undefined;
|
|
16
|
+
defaultValue?: Nullable extends true ? unknown[] | null | undefined : unknown[] | undefined;
|
|
13
17
|
};
|
|
14
18
|
/**
|
|
15
19
|
* Object representing an array in the OpenAPI Specification.
|
|
16
20
|
*/
|
|
17
|
-
export declare class OasArray {
|
|
21
|
+
export declare class OasArray<Nullable extends boolean | undefined = boolean | undefined> {
|
|
18
22
|
/**
|
|
19
23
|
* Object is part the 'schema' set which is used
|
|
20
24
|
* to define data types in an OpenAPI document.
|
|
@@ -39,7 +43,7 @@ export declare class OasArray {
|
|
|
39
43
|
/**
|
|
40
44
|
* Indicates whether value can be null.
|
|
41
45
|
*/
|
|
42
|
-
nullable:
|
|
46
|
+
nullable: Nullable | undefined;
|
|
43
47
|
/**
|
|
44
48
|
* Indicates whether the array items must be unique.
|
|
45
49
|
*/
|
|
@@ -49,11 +53,27 @@ export declare class OasArray {
|
|
|
49
53
|
/**
|
|
50
54
|
* An example of the array.
|
|
51
55
|
*/
|
|
52
|
-
example:
|
|
53
|
-
|
|
56
|
+
example: Nullable extends true ? unknown[] | null | undefined : unknown[] | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The maximum number of items in the array.
|
|
59
|
+
*/
|
|
60
|
+
maxItems: number | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The minimum number of items in the array.
|
|
63
|
+
*/
|
|
64
|
+
minItems: number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The enum values for the array.
|
|
67
|
+
*/
|
|
68
|
+
enums: Nullable extends true ? (unknown | null)[] | undefined : unknown[] | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The default value for the array.
|
|
71
|
+
*/
|
|
72
|
+
defaultValue: Nullable extends true ? unknown[] | null | undefined : unknown[] | undefined;
|
|
73
|
+
constructor(fields: ArrayFields<Nullable>);
|
|
54
74
|
isRef(): this is OasRef<'schema'>;
|
|
55
|
-
resolve(): OasArray
|
|
56
|
-
resolveOnce(): OasArray
|
|
75
|
+
resolve(): OasArray<Nullable>;
|
|
76
|
+
resolveOnce(): OasArray<Nullable>;
|
|
57
77
|
toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.ArraySchemaObject;
|
|
58
78
|
}
|
|
59
79
|
//# sourceMappingURL=Array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../../src/oas/array/Array.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG;
|
|
1
|
+
{"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../../src/oas/array/Array.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAC9D,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,OAAO,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACtF,YAAY,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;CAC5F,CAAA;AAED;;GAEG;AACH,qBAAa,QAAQ,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS;IAC9E;;;OAGG;IACH,OAAO,WAAoB;IAC3B;;OAEG;IACH,IAAI,UAAmB;IACvB;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B;;OAEG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B;;OAEG;IACH,WAAW,EAAE,OAAO,GAAG,SAAS,CAAA;IAEhC,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IAEpD;;OAEG;IACH,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACrF;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAE5B;;OAEG;IACH,KAAK,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IAErF;;OAEG;IACH,YAAY,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;gBAE9E,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC;IAczC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAI7B,WAAW,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAIjC,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,iBAAiB;CAexE"}
|
package/esm/oas/array/Array.js
CHANGED
|
@@ -84,6 +84,42 @@ export class OasArray {
|
|
|
84
84
|
writable: true,
|
|
85
85
|
value: void 0
|
|
86
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* The maximum number of items in the array.
|
|
89
|
+
*/
|
|
90
|
+
Object.defineProperty(this, "maxItems", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
configurable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
value: void 0
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* The minimum number of items in the array.
|
|
98
|
+
*/
|
|
99
|
+
Object.defineProperty(this, "minItems", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
configurable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
value: void 0
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* The enum values for the array.
|
|
107
|
+
*/
|
|
108
|
+
Object.defineProperty(this, "enums", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
value: void 0
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* The default value for the array.
|
|
116
|
+
*/
|
|
117
|
+
Object.defineProperty(this, "defaultValue", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
configurable: true,
|
|
120
|
+
writable: true,
|
|
121
|
+
value: void 0
|
|
122
|
+
});
|
|
87
123
|
this.items = fields.items;
|
|
88
124
|
this.title = fields.title;
|
|
89
125
|
this.description = fields.description;
|
|
@@ -91,6 +127,10 @@ export class OasArray {
|
|
|
91
127
|
this.uniqueItems = fields.uniqueItems;
|
|
92
128
|
this.extensionFields = fields.extensionFields;
|
|
93
129
|
this.example = fields.example;
|
|
130
|
+
this.maxItems = fields.maxItems;
|
|
131
|
+
this.minItems = fields.minItems;
|
|
132
|
+
this.enums = fields.enums;
|
|
133
|
+
this.defaultValue = fields.defaultValue;
|
|
94
134
|
}
|
|
95
135
|
isRef() {
|
|
96
136
|
return false;
|
|
@@ -106,9 +146,14 @@ export class OasArray {
|
|
|
106
146
|
type: 'array',
|
|
107
147
|
items: this.items.toJsonSchema(options),
|
|
108
148
|
title: this.title,
|
|
149
|
+
enum: this.enums,
|
|
109
150
|
description: this.description,
|
|
110
151
|
nullable: this.nullable,
|
|
111
|
-
example: this.example
|
|
152
|
+
example: this.example,
|
|
153
|
+
maxItems: this.maxItems,
|
|
154
|
+
minItems: this.minItems,
|
|
155
|
+
uniqueItems: this.uniqueItems,
|
|
156
|
+
default: this.defaultValue
|
|
112
157
|
};
|
|
113
158
|
}
|
|
114
159
|
}
|