@skmtc/core 0.0.598 → 0.0.600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +1 -0
- package/esm/context/GenerateContext.d.ts +2 -2
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +2 -2
- package/esm/context/ParseContext.d.ts +43 -4
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +56 -9
- package/esm/context/StackTrail.d.ts +1 -6
- package/esm/context/StackTrail.d.ts.map +1 -1
- package/esm/context/StackTrail.js +1 -23
- package/esm/context/types.d.ts +1 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +12 -16
- 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 +2 -2
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +11 -5
- 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 +13 -16
- 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 +1 -2
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +10 -9
- package/esm/oas/header/toHeadersV3.d.ts +1 -2
- package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
- package/esm/oas/header/toHeadersV3.js +8 -3
- 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.d.ts +2 -3
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +10 -7
- 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 +1 -2
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +5 -7
- package/esm/oas/response/toResponseV3.d.ts +2 -3
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +22 -7
- 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 +2 -3
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +154 -23
- 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 +31 -16
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/string-types.js +30 -49
- 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/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +1 -0
- package/script/context/GenerateContext.d.ts +2 -2
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +2 -2
- package/script/context/ParseContext.d.ts +43 -4
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +79 -9
- package/script/context/StackTrail.d.ts +1 -6
- package/script/context/StackTrail.d.ts.map +1 -1
- package/script/context/StackTrail.js +1 -23
- package/script/context/types.d.ts +1 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +12 -16
- 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 +2 -2
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +11 -5
- 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 +13 -16
- 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 +1 -2
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +10 -9
- package/script/oas/header/toHeadersV3.d.ts +1 -2
- package/script/oas/header/toHeadersV3.d.ts.map +1 -1
- package/script/oas/header/toHeadersV3.js +8 -3
- 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.d.ts +2 -3
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +33 -7
- 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 +1 -2
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +5 -7
- package/script/oas/response/toResponseV3.d.ts +2 -3
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +22 -7
- 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 +2 -3
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +154 -23
- 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 +31 -16
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/string-types.js +53 -49
- 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
|
@@ -13,7 +13,9 @@ export const toRequestBodyV3 = ({ requestBody, context }) => {
|
|
|
13
13
|
const { description, content, required, ...skipped } = requestBody;
|
|
14
14
|
const extensionFields = toSpecificationExtensionsV3({
|
|
15
15
|
skipped,
|
|
16
|
-
|
|
16
|
+
parent: requestBody,
|
|
17
|
+
context,
|
|
18
|
+
parentType: 'requestBody'
|
|
17
19
|
});
|
|
18
20
|
const fields = {
|
|
19
21
|
description,
|
|
@@ -25,17 +27,13 @@ export const toRequestBodyV3 = ({ requestBody, context }) => {
|
|
|
25
27
|
};
|
|
26
28
|
return new OasRequestBody(fields);
|
|
27
29
|
};
|
|
28
|
-
export const toRequestBodiesV3 = ({ requestBodies, context }
|
|
30
|
+
export const toRequestBodiesV3 = ({ requestBodies, context }) => {
|
|
29
31
|
if (!requestBodies) {
|
|
30
32
|
return undefined;
|
|
31
33
|
}
|
|
32
34
|
const entries = Object.entries(requestBodies)
|
|
33
35
|
.map(([key, value]) => {
|
|
34
|
-
return [
|
|
35
|
-
key,
|
|
36
|
-
context.trace(key, () => toRequestBodyV3({ requestBody: value, context })),
|
|
37
|
-
options
|
|
38
|
-
];
|
|
36
|
+
return [key, context.trace(key, () => toRequestBodyV3({ requestBody: value, context }))];
|
|
39
37
|
})
|
|
40
38
|
.filter(([, value]) => Boolean(value));
|
|
41
39
|
return Object.fromEntries(entries);
|
|
@@ -2,17 +2,16 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasResponse } from './Response.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToResponsesV3Args = {
|
|
7
6
|
responses: OpenAPIV3.ResponsesObject;
|
|
8
7
|
context: ParseContext;
|
|
9
8
|
};
|
|
10
|
-
export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args
|
|
9
|
+
export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
|
|
11
10
|
type ToOptionalResponsesV3Args = {
|
|
12
11
|
responses: OpenAPIV3.ResponsesObject | undefined;
|
|
13
12
|
context: ParseContext;
|
|
14
13
|
};
|
|
15
|
-
export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args
|
|
14
|
+
export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
|
|
16
15
|
type ToResponseV3Args = {
|
|
17
16
|
response: OpenAPIV3.ReferenceObject | OpenAPIV3.ResponseObject;
|
|
18
17
|
context: ParseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,aAAa,2BAGvB,iBAAiB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAmBrE,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAA;IAChD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,2BAG/B,yBAAyB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,SAMjF,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,cAAc,CAAA;IAC9D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,0BAGtB,gBAAgB,KAAG,WAAW,GAAG,MAAM,CAAC,UAAU,CAsBpD,CAAA"}
|
|
@@ -4,16 +4,29 @@ import { isRef } from '../../helpers/refFns.js';
|
|
|
4
4
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
5
5
|
import { OasResponse } from './Response.js';
|
|
6
6
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
7
|
-
export const toResponsesV3 = ({ responses, context }
|
|
8
|
-
return Object.fromEntries(Object.entries(responses)
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const toResponsesV3 = ({ responses, context }) => {
|
|
8
|
+
return Object.fromEntries(Object.entries(responses)
|
|
9
|
+
.map(([key, value]) => {
|
|
10
|
+
try {
|
|
11
|
+
return [key, context.trace(key, () => toResponseV3({ response: value, context }))];
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
context.logWarning({
|
|
15
|
+
key,
|
|
16
|
+
message: error instanceof Error ? error.message : 'Failed to parse response',
|
|
17
|
+
parent: value,
|
|
18
|
+
type: 'INVALID_RESPONSE'
|
|
19
|
+
});
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
.filter(item => item !== undefined));
|
|
11
24
|
};
|
|
12
|
-
export const toOptionalResponsesV3 = ({ responses, context }
|
|
25
|
+
export const toOptionalResponsesV3 = ({ responses, context }) => {
|
|
13
26
|
if (!responses) {
|
|
14
27
|
return undefined;
|
|
15
28
|
}
|
|
16
|
-
return toResponsesV3({ responses, context }
|
|
29
|
+
return toResponsesV3({ responses, context });
|
|
17
30
|
};
|
|
18
31
|
export const toResponseV3 = ({ response, context }) => {
|
|
19
32
|
if (isRef(response)) {
|
|
@@ -22,7 +35,9 @@ export const toResponseV3 = ({ response, context }) => {
|
|
|
22
35
|
const { description, headers, content, ...skipped } = response;
|
|
23
36
|
const extensionFields = toSpecificationExtensionsV3({
|
|
24
37
|
skipped,
|
|
25
|
-
|
|
38
|
+
parent: response,
|
|
39
|
+
context,
|
|
40
|
+
parentType: 'response'
|
|
26
41
|
});
|
|
27
42
|
const fields = {
|
|
28
43
|
description,
|
|
@@ -7,8 +7,7 @@ import type { OasObject } from '../object/Object.js';
|
|
|
7
7
|
import type { OasString } from '../string/String.js';
|
|
8
8
|
import type { OasUnknown } from '../unknown/Unknown.js';
|
|
9
9
|
import type { OasUnion } from '../union/Union.js';
|
|
10
|
-
|
|
11
|
-
export type OasSchema = OasArray | OasBoolean | OasInteger | OasNumber | OasObject | OasString | OasUnknown | OasUnion | OasIntersection;
|
|
10
|
+
export type OasSchema = OasArray | OasBoolean | OasInteger | OasNumber | OasObject | OasString | OasUnknown | OasUnion;
|
|
12
11
|
export type ToJsonSchemaOptions = {
|
|
13
12
|
resolve: boolean;
|
|
14
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,QAAQ,CAAA;AAEZ,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
import { type OasArrayData } from '../array/array-types.js';
|
|
3
3
|
import { type OasBooleanData } from '../boolean/boolean-types.js';
|
|
4
|
-
import { type OasNullData } from '../null/null-types.js';
|
|
5
4
|
import { type OasUnknownData } from '../unknown/unknown-types.js';
|
|
6
5
|
import { type OasUnionData } from '../union/union-types.js';
|
|
7
6
|
import { type OasIntegerData } from '../integer/integer-types.js';
|
|
8
7
|
import { type OasNumberData } from '../number/number-types.js';
|
|
9
|
-
import { type OasIntersectionData } from '../intersection/intersection-types.js';
|
|
10
8
|
import { type OasStringData } from '../string/string-types.js';
|
|
11
9
|
import { type OasObjectData } from '../object/object-types.js';
|
|
12
|
-
export type OasSchemaData = OasArrayData | OasBooleanData |
|
|
13
|
-
export declare const oasSchemaData:
|
|
10
|
+
export type OasSchemaData = OasArrayData | OasBooleanData | OasIntegerData | OasNumberData | OasStringData | OasObjectData | OasUnionData | OasUnknownData;
|
|
11
|
+
export declare const oasSchemaData: v.GenericSchema<OasSchemaData>;
|
|
14
12
|
//# sourceMappingURL=schema-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-types.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/schema-types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema-types.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/schema-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE7E,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,cAAc,GACd,cAAc,GACd,aAAa,GACb,aAAa,GACb,aAAa,GACb,YAAY,GACZ,cAAc,CAAA;AAElB,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CASvD,CAAA"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
import { oasArrayData } from '../array/array-types.js';
|
|
3
3
|
import { oasBooleanData } from '../boolean/boolean-types.js';
|
|
4
|
-
import { oasNullData } from '../null/null-types.js';
|
|
5
4
|
import { oasUnknownData } from '../unknown/unknown-types.js';
|
|
6
5
|
import { oasUnionData } from '../union/union-types.js';
|
|
7
6
|
import { oasIntegerData } from '../integer/integer-types.js';
|
|
8
7
|
import { oasNumberData } from '../number/number-types.js';
|
|
9
|
-
import { oasIntersectionData } from '../intersection/intersection-types.js';
|
|
10
8
|
import { oasStringData } from '../string/string-types.js';
|
|
11
9
|
import { oasObjectData } from '../object/object-types.js';
|
|
12
|
-
export const oasSchemaData =
|
|
10
|
+
export const oasSchemaData = v.union([
|
|
13
11
|
oasObjectData,
|
|
14
|
-
oasArrayData,
|
|
12
|
+
v.lazy(() => oasArrayData),
|
|
15
13
|
oasBooleanData,
|
|
16
14
|
oasStringData,
|
|
17
15
|
oasNumberData,
|
|
18
|
-
oasNullData,
|
|
19
16
|
oasIntegerData,
|
|
20
17
|
oasUnionData,
|
|
21
|
-
oasIntersectionData,
|
|
22
18
|
oasUnknownData
|
|
23
19
|
]);
|
|
@@ -2,17 +2,16 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import type { OasSchema } from './Schema.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToSchemasV3Args = {
|
|
7
6
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject>;
|
|
8
7
|
context: ParseContext;
|
|
9
8
|
};
|
|
10
|
-
export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args
|
|
9
|
+
export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
|
|
11
10
|
type ToOptionalSchemasV3Args = {
|
|
12
11
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject> | undefined;
|
|
13
12
|
context: ParseContext;
|
|
14
13
|
};
|
|
15
|
-
export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args
|
|
14
|
+
export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
|
|
16
15
|
type ToSchemaV3Args = {
|
|
17
16
|
schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
|
|
18
17
|
context: ParseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAY3C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;IAC3E,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAwB/D,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,yBAG7B,uBAAuB,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAM3E,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;IAC1D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,wBAAyB,cAAc,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAmI3F,CAAA;AA+CD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IACtE,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,wBAG5B,sBAAsB,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAM1D,CAAA"}
|
|
@@ -9,17 +9,37 @@ import { toBoolean } from '../boolean/toBoolean.js';
|
|
|
9
9
|
import { toString } from '../string/toString.js';
|
|
10
10
|
import { toUnknown } from '../unknown/toUnknown.js';
|
|
11
11
|
import { toUnion } from '../union/toUnion.js';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
import { toGetRef } from '../../helpers/refFns.js';
|
|
13
|
+
import { mergeIntersection } from '../_merge-all-of/merge-intersection.js';
|
|
14
|
+
import { mergeUnion } from '../_merge-all-of/merge-union.js';
|
|
15
|
+
export const toSchemasV3 = ({ schemas, context }) => {
|
|
16
|
+
return Object.fromEntries(Object.entries(schemas)
|
|
17
|
+
.map(([key, schema]) => {
|
|
18
|
+
try {
|
|
19
|
+
return [
|
|
20
|
+
key,
|
|
21
|
+
context.trace(key, () => {
|
|
22
|
+
return toSchemaV3({ schema, context });
|
|
23
|
+
})
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
context.logWarning({
|
|
28
|
+
key,
|
|
29
|
+
message: error instanceof Error ? error.message : 'Failed to parse schema',
|
|
30
|
+
parent: schema,
|
|
31
|
+
type: 'INVALID_SCHEMA'
|
|
32
|
+
});
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
.filter(item => item !== undefined));
|
|
17
37
|
};
|
|
18
|
-
export const toOptionalSchemasV3 = ({ schemas, context }
|
|
38
|
+
export const toOptionalSchemasV3 = ({ schemas, context }) => {
|
|
19
39
|
if (!schemas) {
|
|
20
40
|
return undefined;
|
|
21
41
|
}
|
|
22
|
-
return toSchemasV3({ schemas, context }
|
|
42
|
+
return toSchemasV3({ schemas, context });
|
|
23
43
|
};
|
|
24
44
|
export const toSchemaV3 = ({ schema, context }) => {
|
|
25
45
|
if (isRef(schema)) {
|
|
@@ -30,23 +50,42 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
30
50
|
// schema.nullable = true
|
|
31
51
|
// }
|
|
32
52
|
return match(schema)
|
|
33
|
-
.with({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
53
|
+
.with({ allOf: P.array() }, schema => {
|
|
54
|
+
return context.trace('allOf', () => {
|
|
55
|
+
const merged = mergeIntersection({
|
|
56
|
+
schema,
|
|
57
|
+
getRef: toGetRef(context.documentObject)
|
|
58
|
+
});
|
|
59
|
+
return toSchemaV3({ schema: merged, context });
|
|
60
|
+
});
|
|
38
61
|
})
|
|
39
|
-
.with({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
62
|
+
.with({ oneOf: P.array() }, oneOf => {
|
|
63
|
+
return context.trace('oneOf', () => {
|
|
64
|
+
const merged = mergeUnion({
|
|
65
|
+
schema: oneOf,
|
|
66
|
+
getRef: toGetRef(context.documentObject),
|
|
67
|
+
groupType: 'oneOf'
|
|
68
|
+
});
|
|
69
|
+
if (!('oneOf' in merged) || !Array.isArray(merged.oneOf)) {
|
|
70
|
+
throw new Error('Missing "oneOf" array');
|
|
71
|
+
}
|
|
72
|
+
const { oneOf: members, ...value } = merged;
|
|
73
|
+
return toUnion({ value, members, parentType: 'oneOf', context });
|
|
74
|
+
});
|
|
44
75
|
})
|
|
45
|
-
.with({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
.with({ anyOf: P.array() }, anyOf => {
|
|
77
|
+
return context.trace('anyOf', () => {
|
|
78
|
+
const merged = mergeUnion({
|
|
79
|
+
schema: anyOf,
|
|
80
|
+
getRef: toGetRef(context.documentObject),
|
|
81
|
+
groupType: 'anyOf'
|
|
82
|
+
});
|
|
83
|
+
if (!('anyOf' in merged) || !Array.isArray(merged.anyOf)) {
|
|
84
|
+
throw new Error('Missing "anyOf" array');
|
|
85
|
+
}
|
|
86
|
+
const { anyOf: members, ...value } = merged;
|
|
87
|
+
return toUnion({ value, members, parentType: 'anyOf', context });
|
|
88
|
+
});
|
|
50
89
|
})
|
|
51
90
|
.with({ type: 'object' }, value => toObject({ value, context }))
|
|
52
91
|
.with({ type: 'array' }, value => toArray({ value, context }))
|
|
@@ -54,7 +93,99 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
54
93
|
.with({ type: 'number' }, value => toNumber({ value, context }))
|
|
55
94
|
.with({ type: 'boolean' }, value => toBoolean({ value, context }))
|
|
56
95
|
.with({ type: 'string' }, value => toString({ value, context }))
|
|
57
|
-
.otherwise(value =>
|
|
96
|
+
.otherwise(value => {
|
|
97
|
+
if (possibleObject(value)) {
|
|
98
|
+
context.logWarningNoKey({
|
|
99
|
+
message: 'Object has "properties" property, but is missing type="object" property',
|
|
100
|
+
parent: value,
|
|
101
|
+
type: 'MISSING_OBJECT_TYPE'
|
|
102
|
+
});
|
|
103
|
+
return toObject({
|
|
104
|
+
value: {
|
|
105
|
+
...value,
|
|
106
|
+
type: 'object'
|
|
107
|
+
},
|
|
108
|
+
context
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (possibleArray(value)) {
|
|
112
|
+
context.logWarningNoKey({
|
|
113
|
+
message: 'Object has "items" property, but is missing type="array" property',
|
|
114
|
+
parent: value,
|
|
115
|
+
type: 'MISSING_ARRAY_TYPE'
|
|
116
|
+
});
|
|
117
|
+
return toArray({
|
|
118
|
+
value: {
|
|
119
|
+
...value,
|
|
120
|
+
type: 'array'
|
|
121
|
+
// Adding cast here since {} is a valid value for items
|
|
122
|
+
},
|
|
123
|
+
context
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (possibleBoolean(value)) {
|
|
127
|
+
context.logWarningNoKey({
|
|
128
|
+
message: 'Object has a boolean "default" or "example" property, but is missing type="boolean" property',
|
|
129
|
+
parent: value,
|
|
130
|
+
type: 'MISSING_BOOLEAN_TYPE'
|
|
131
|
+
});
|
|
132
|
+
return toBoolean({
|
|
133
|
+
value: {
|
|
134
|
+
...value,
|
|
135
|
+
type: 'boolean'
|
|
136
|
+
},
|
|
137
|
+
context
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (possibleString(value)) {
|
|
141
|
+
context.logWarningNoKey({
|
|
142
|
+
message: 'Object has a string "default" or "example" property, but is missing type="string" property',
|
|
143
|
+
parent: value,
|
|
144
|
+
type: 'MISSING_STRING_TYPE'
|
|
145
|
+
});
|
|
146
|
+
return toString({
|
|
147
|
+
value: {
|
|
148
|
+
...value,
|
|
149
|
+
type: 'string'
|
|
150
|
+
},
|
|
151
|
+
context
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return toUnknown({ value, context });
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const possibleString = (value) => {
|
|
158
|
+
return (value &&
|
|
159
|
+
typeof value === 'object' &&
|
|
160
|
+
(('default' in value && typeof value.default === 'string') ||
|
|
161
|
+
('example' in value && typeof value.example === 'string') ||
|
|
162
|
+
('enum' in value &&
|
|
163
|
+
Array.isArray(value.enum) &&
|
|
164
|
+
value.enum.every(item => typeof item === 'string')) ||
|
|
165
|
+
('format' in value &&
|
|
166
|
+
typeof value.format === 'string' &&
|
|
167
|
+
['date', 'date-time', 'binary', 'byte'].includes(value.format))));
|
|
168
|
+
};
|
|
169
|
+
const possibleBoolean = (value) => {
|
|
170
|
+
return (value &&
|
|
171
|
+
typeof value === 'object' &&
|
|
172
|
+
(('default' in value && typeof value.default === 'boolean') ||
|
|
173
|
+
('example' in value && typeof value.example === 'boolean')));
|
|
174
|
+
};
|
|
175
|
+
const possibleArray = (value) => {
|
|
176
|
+
return (value &&
|
|
177
|
+
typeof value === 'object' &&
|
|
178
|
+
'items' in value &&
|
|
179
|
+
value.items &&
|
|
180
|
+
typeof value.items === 'object' &&
|
|
181
|
+
value.items);
|
|
182
|
+
};
|
|
183
|
+
const possibleObject = (value) => {
|
|
184
|
+
return (value &&
|
|
185
|
+
typeof value === 'object' &&
|
|
186
|
+
'properties' in value &&
|
|
187
|
+
typeof value.properties === 'object' &&
|
|
188
|
+
value.properties);
|
|
58
189
|
};
|
|
59
190
|
export const toOptionalSchemaV3 = ({ schema, context }) => {
|
|
60
191
|
if (!schema) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
export type SecurityFields = {
|
|
3
|
+
requirement: Record<string, string[]>;
|
|
4
|
+
};
|
|
5
|
+
export declare class OasSecurityRequirement {
|
|
6
|
+
oasType: 'securityRequirement';
|
|
7
|
+
requirement: Record<string, string[]>;
|
|
8
|
+
constructor(fields: SecurityFields);
|
|
9
|
+
toJsonSchema(): OpenAPIV3.SecurityRequirementObject;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=SecurityRequirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/SecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CACtC,CAAA;AAED,qBAAa,sBAAsB;IACjC,OAAO,EAAE,qBAAqB,CAAwB;IACtD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;gBAEzB,MAAM,EAAE,cAAc;IAIlC,YAAY,IAAI,SAAS,CAAC,yBAAyB;CAKpD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class OasSecurityRequirement {
|
|
2
|
+
constructor(fields) {
|
|
3
|
+
Object.defineProperty(this, "oasType", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
configurable: true,
|
|
6
|
+
writable: true,
|
|
7
|
+
value: 'securityRequirement'
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(this, "requirement", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: void 0
|
|
14
|
+
});
|
|
15
|
+
this.requirement = fields.requirement;
|
|
16
|
+
}
|
|
17
|
+
toJsonSchema() {
|
|
18
|
+
return {
|
|
19
|
+
...this.requirement
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
2
|
+
import { OasSecurityRequirement } from './SecurityRequirement.js';
|
|
3
|
+
type ToSecurityRequirementsV3Args = {
|
|
4
|
+
security: Record<string, string[]>[] | undefined;
|
|
5
|
+
context: ParseContext;
|
|
6
|
+
};
|
|
7
|
+
export declare const toSecurityRequirementsV3: ({ security }: ToSecurityRequirementsV3Args) => OasSecurityRequirement[] | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=toSecurityRequirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/toSecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAA;IAChD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,wBAAwB,iBAElC,4BAA4B,KAAG,sBAAsB,EAAE,GAAG,SAQ5D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OasSecurityRequirement } from './SecurityRequirement.js';
|
|
2
|
+
export const toSecurityRequirementsV3 = ({ security }) => {
|
|
3
|
+
if (!security) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
return security.map(requirement => {
|
|
7
|
+
return new OasSecurityRequirement({ requirement });
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { OasRef } from '../ref/Ref.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
export type SecuritySchemeFields = HttpSecuritySchemeFields | ApiKeySecuritySchemeFields | OAuth2SecuritySchemeFields | OpenIdSecuritySchemeFields;
|
|
4
|
+
export type HttpSecuritySchemeFields = {
|
|
5
|
+
description?: string;
|
|
6
|
+
scheme: string;
|
|
7
|
+
bearerFormat?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ApiKeySecuritySchemeFields = {
|
|
10
|
+
description?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
in: 'header' | 'query' | 'cookie';
|
|
13
|
+
};
|
|
14
|
+
export type OAuth2SecuritySchemeFields = {
|
|
15
|
+
description?: string;
|
|
16
|
+
flows: {
|
|
17
|
+
authorizationCode: {
|
|
18
|
+
authorizationUrl: string;
|
|
19
|
+
tokenUrl: string;
|
|
20
|
+
refreshUrl?: string | undefined;
|
|
21
|
+
scopes: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
clientCredentials: {
|
|
24
|
+
tokenUrl: string;
|
|
25
|
+
refreshUrl?: string | undefined;
|
|
26
|
+
scopes: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
implicit: {
|
|
29
|
+
authorizationUrl: string;
|
|
30
|
+
refreshUrl?: string | undefined;
|
|
31
|
+
scopes: Record<string, string>;
|
|
32
|
+
};
|
|
33
|
+
password: {
|
|
34
|
+
tokenUrl: string;
|
|
35
|
+
refreshUrl?: string | undefined;
|
|
36
|
+
scopes: Record<string, string>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type OpenIdSecuritySchemeFields = {
|
|
41
|
+
description?: string;
|
|
42
|
+
openIdConnectUrl: string;
|
|
43
|
+
};
|
|
44
|
+
export declare class OasHttpSecurityScheme {
|
|
45
|
+
oasType: 'securityScheme';
|
|
46
|
+
type: 'http';
|
|
47
|
+
description: string | undefined;
|
|
48
|
+
scheme: string;
|
|
49
|
+
bearerFormat: string | undefined;
|
|
50
|
+
constructor(fields: HttpSecuritySchemeFields);
|
|
51
|
+
isRef(): this is OasRef<'securityScheme'>;
|
|
52
|
+
resolve(): OasHttpSecurityScheme;
|
|
53
|
+
resolveOnce(): OasHttpSecurityScheme;
|
|
54
|
+
toJsonSchema(): OpenAPIV3.HttpSecurityScheme;
|
|
55
|
+
}
|
|
56
|
+
export declare class OasApiKeySecurityScheme {
|
|
57
|
+
oasType: 'securityScheme';
|
|
58
|
+
type: 'apiKey';
|
|
59
|
+
description: string | undefined;
|
|
60
|
+
name: string;
|
|
61
|
+
location: 'query' | 'header' | 'cookie';
|
|
62
|
+
constructor(fields: ApiKeySecuritySchemeFields);
|
|
63
|
+
isRef(): this is OasRef<'securityScheme'>;
|
|
64
|
+
resolve(): OasApiKeySecurityScheme;
|
|
65
|
+
resolveOnce(): OasApiKeySecurityScheme;
|
|
66
|
+
toJsonSchema(): OpenAPIV3.ApiKeySecurityScheme;
|
|
67
|
+
}
|
|
68
|
+
export declare class OasOAuth2SecurityScheme {
|
|
69
|
+
oasType: 'securityScheme';
|
|
70
|
+
type: 'oauth2';
|
|
71
|
+
description: string | undefined;
|
|
72
|
+
flows: {
|
|
73
|
+
authorizationCode: {
|
|
74
|
+
authorizationUrl: string;
|
|
75
|
+
tokenUrl: string;
|
|
76
|
+
refreshUrl?: string | undefined;
|
|
77
|
+
scopes: Record<string, string>;
|
|
78
|
+
};
|
|
79
|
+
clientCredentials: {
|
|
80
|
+
tokenUrl: string;
|
|
81
|
+
refreshUrl?: string | undefined;
|
|
82
|
+
scopes: Record<string, string>;
|
|
83
|
+
};
|
|
84
|
+
implicit: {
|
|
85
|
+
authorizationUrl: string;
|
|
86
|
+
refreshUrl?: string | undefined;
|
|
87
|
+
scopes: Record<string, string>;
|
|
88
|
+
};
|
|
89
|
+
password: {
|
|
90
|
+
tokenUrl: string;
|
|
91
|
+
refreshUrl?: string | undefined;
|
|
92
|
+
scopes: Record<string, string>;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
constructor(fields: OAuth2SecuritySchemeFields);
|
|
96
|
+
isRef(): this is OasRef<'securityScheme'>;
|
|
97
|
+
resolve(): OasOAuth2SecurityScheme;
|
|
98
|
+
resolveOnce(): OasOAuth2SecurityScheme;
|
|
99
|
+
toJsonSchema(): OpenAPIV3.OAuth2SecurityScheme;
|
|
100
|
+
}
|
|
101
|
+
export declare class OasOpenIdSecurityScheme {
|
|
102
|
+
oasType: 'securityScheme';
|
|
103
|
+
type: 'openIdConnect';
|
|
104
|
+
description: string | undefined;
|
|
105
|
+
openIdConnectUrl: string;
|
|
106
|
+
constructor(fields: OpenIdSecuritySchemeFields);
|
|
107
|
+
isRef(): this is OasRef<'securityScheme'>;
|
|
108
|
+
resolve(): OasOpenIdSecurityScheme;
|
|
109
|
+
resolveOnce(): OasOpenIdSecurityScheme;
|
|
110
|
+
toJsonSchema(): OpenAPIV3.OpenIdSecurityScheme;
|
|
111
|
+
}
|
|
112
|
+
export type OasSecurityScheme = OasHttpSecurityScheme | OasApiKeySecurityScheme | OasOAuth2SecurityScheme | OasOpenIdSecurityScheme;
|
|
113
|
+
//# sourceMappingURL=SecurityScheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityScheme.d.ts","sourceRoot":"","sources":["../../../src/oas/securitySchemes/SecurityScheme.ts"],"names":[],"mappings":"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"}
|