@skmtc/core 0.39.0 → 0.41.0
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.js +22 -8
- package/esm/context/GenerateContext.d.ts +6 -5
- package/esm/context/GenerateContext.js +112 -38
- package/esm/context/ParseContext.d.ts +18 -1
- package/esm/context/ParseContext.js +102 -3
- package/esm/context/generateTypes.d.ts +33 -4
- package/esm/context/generateTypes.js +4 -0
- package/esm/context/toGenerationFailure.d.ts +21 -0
- package/esm/context/toGenerationFailure.js +38 -0
- package/esm/context/tryParseAt.d.ts +4 -1
- package/esm/context/tryParseAt.js +10 -3
- package/esm/dsl/CustomValue.d.ts +4 -0
- package/esm/dsl/CustomValue.js +8 -0
- package/esm/dsl/Definition.d.ts +10 -0
- package/esm/dsl/Definition.js +14 -0
- package/esm/dsl/PendingDefinition.d.ts +47 -0
- package/esm/dsl/PendingDefinition.js +83 -0
- package/esm/dsl/model/ModelDriver.d.ts +55 -1
- package/esm/dsl/model/ModelDriver.js +228 -51
- package/esm/dsl/model/toModelEntry.d.ts +1 -1
- package/esm/dsl/model/toModelEntry.js +1 -1
- package/esm/dsl/model/types.d.ts +1 -1
- package/esm/dsl/operation/gql/GqlOperationDriver.js +1 -4
- package/esm/dsl/webhook/WebhookDriver.js +1 -4
- package/esm/enrichments/parseEnrichmentUmbrella.d.ts +5 -6
- package/esm/enrichments/parseEnrichmentUmbrella.js +23 -8
- package/esm/enrichments/parseEnrichmentValue.d.ts +17 -0
- package/esm/enrichments/parseEnrichmentValue.js +32 -0
- package/esm/enrichments/readEnrichments.d.ts +5 -5
- package/esm/enrichments/readEnrichments.js +17 -7
- package/esm/helpers/collateExamples.js +15 -5
- package/esm/helpers/refFns.d.ts +6 -2
- package/esm/helpers/refFns.js +24 -7
- package/esm/mod.d.ts +2 -0
- package/esm/mod.js +2 -0
- package/esm/oas/array/Array.d.ts +19 -0
- package/esm/oas/array/Array.js +47 -0
- package/esm/oas/boolean/Boolean.d.ts +19 -0
- package/esm/oas/boolean/Boolean.js +51 -8
- package/esm/oas/example/Example.d.ts +4 -0
- package/esm/oas/example/Example.js +8 -0
- package/esm/oas/header/Header.d.ts +4 -0
- package/esm/oas/header/Header.js +8 -0
- package/esm/oas/integer/Integer.d.ts +19 -0
- package/esm/oas/integer/Integer.js +49 -0
- package/esm/oas/link/Link.d.ts +4 -0
- package/esm/oas/link/Link.js +8 -0
- package/esm/oas/number/Number.d.ts +19 -0
- package/esm/oas/number/Number.js +49 -0
- package/esm/oas/object/Object.d.ts +19 -0
- package/esm/oas/object/Object.js +68 -18
- package/esm/oas/operation/Operation.d.ts +8 -1
- package/esm/oas/operation/Operation.js +18 -5
- package/esm/oas/operation/toEffectiveParameters.d.ts +24 -0
- package/esm/oas/operation/toEffectiveParameters.js +42 -0
- package/esm/oas/parameter/Parameter.d.ts +4 -0
- package/esm/oas/parameter/Parameter.js +8 -0
- package/esm/oas/ref/DanglingRefError.d.ts +22 -0
- package/esm/oas/ref/DanglingRefError.js +33 -0
- package/esm/oas/ref/Ref.d.ts +152 -25
- package/esm/oas/ref/Ref.js +414 -26
- package/esm/oas/requestBody/RequestBody.d.ts +4 -0
- package/esm/oas/requestBody/RequestBody.js +8 -0
- package/esm/oas/response/Response.d.ts +4 -0
- package/esm/oas/response/Response.js +8 -0
- package/esm/oas/schema/siblings.d.ts +127 -0
- package/esm/oas/schema/siblings.js +250 -0
- package/esm/oas/securitySchemes/SecurityScheme.d.ts +16 -0
- package/esm/oas/securitySchemes/SecurityScheme.js +32 -0
- package/esm/oas/string/String.d.ts +19 -0
- package/esm/oas/string/String.js +47 -0
- package/esm/oas/union/Union.d.ts +32 -0
- package/esm/oas/union/Union.js +111 -0
- package/esm/oas/unknown/Unknown.d.ts +18 -0
- package/esm/oas/unknown/Unknown.js +38 -0
- package/esm/oas/void/Void.d.ts +4 -0
- package/esm/oas/void/Void.js +8 -0
- package/esm/oas/webhook/Webhook.d.ts +2 -2
- package/esm/oas/webhook/Webhook.js +4 -5
- package/esm/parse/allOfSystem.d.ts +32 -0
- package/esm/parse/allOfSystem.js +30 -0
- package/esm/parse/anyOfSystem.d.ts +68 -0
- package/esm/parse/anyOfSystem.js +107 -0
- package/esm/parse/securityRequirements.d.ts +6 -0
- package/esm/parse/securityRequirements.js +8 -0
- package/esm/parse/toSiblingKeywords.d.ts +28 -0
- package/esm/parse/toSiblingKeywords.js +109 -0
- package/esm/parse/v3-0/_merge-all-of/decompose-union.d.ts +8 -0
- package/esm/parse/v3-0/_merge-all-of/decompose-union.js +9 -1
- package/esm/parse/v3-0/_merge-all-of/generic-merge.d.ts +2 -3
- package/esm/parse/v3-0/_merge-all-of/generic-merge.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-array-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-array-constraints.js +5 -5
- package/esm/parse/v3-0/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-integer-constraints.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-intersection.d.ts +3 -2
- package/esm/parse/v3-0/_merge-all-of/merge-intersection.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-number-constraints.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-object-constraints.js +3 -3
- package/esm/parse/v3-0/_merge-all-of/merge-properties.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-properties.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-string-constraints.js +3 -3
- package/esm/parse/v3-0/_merge-all-of/merge-union.d.ts +10 -3
- package/esm/parse/v3-0/_merge-all-of/merge-union.js +50 -12
- package/esm/parse/v3-0/_merge-all-of/merge.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge.js +78 -27
- package/esm/parse/v3-0/_merge-all-of/nullable-merge.d.ts +4 -0
- package/esm/parse/v3-0/_merge-all-of/nullable-merge.js +9 -7
- package/esm/parse/v3-0/_merge-all-of/types.d.ts +33 -0
- package/esm/parse/v3-0/mediaType/toMediaTypeItemV3.js +4 -3
- package/esm/parse/v3-0/parameter/toParameterV3.js +4 -3
- package/esm/parse/v3-0/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-0/ref/toRefV31.js +6 -3
- package/esm/parse/v3-0/schema/toSchemasV3.js +107 -15
- package/esm/parse/v3-1/_merge-all-of/decompose-union.d.ts +7 -1
- package/esm/parse/v3-1/_merge-all-of/decompose-union.js +8 -2
- package/esm/parse/v3-1/_merge-all-of/generic-merge.d.ts +2 -3
- package/esm/parse/v3-1/_merge-all-of/generic-merge.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-array-constraints.d.ts +3 -2
- package/esm/parse/v3-1/_merge-all-of/merge-array-constraints.js +5 -5
- package/esm/parse/v3-1/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-integer-constraints.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-intersection.d.ts +3 -2
- package/esm/parse/v3-1/_merge-all-of/merge-intersection.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-number-constraints.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-object-constraints.js +3 -3
- package/esm/parse/v3-1/_merge-all-of/merge-properties.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-properties.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/esm/parse/v3-1/_merge-all-of/merge-string-constraints.js +3 -3
- package/esm/parse/v3-1/_merge-all-of/merge-union.d.ts +10 -3
- package/esm/parse/v3-1/_merge-all-of/merge-union.js +54 -15
- package/esm/parse/v3-1/_merge-all-of/merge.d.ts +3 -2
- package/esm/parse/v3-1/_merge-all-of/merge.js +88 -29
- package/esm/parse/v3-1/_merge-all-of/nullable-merge.d.ts +4 -0
- package/esm/parse/v3-1/_merge-all-of/nullable-merge.js +9 -7
- package/esm/parse/v3-1/_merge-all-of/types.d.ts +37 -0
- package/esm/parse/v3-1/mediaType/toMediaTypeItemV3.js +4 -3
- package/esm/parse/v3-1/parameter/toParameterV3.js +4 -3
- package/esm/parse/v3-1/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-1/ref/toRefV31.js +6 -3
- package/esm/parse/v3-1/schema/toSchemasV3.js +111 -16
- package/esm/parse/v3-2/_merge-all-of/decompose-union.d.ts +7 -1
- package/esm/parse/v3-2/_merge-all-of/decompose-union.js +8 -2
- package/esm/parse/v3-2/_merge-all-of/generic-merge.d.ts +2 -3
- package/esm/parse/v3-2/_merge-all-of/generic-merge.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +3 -2
- package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.js +5 -5
- package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-intersection.d.ts +3 -2
- package/esm/parse/v3-2/_merge-all-of/merge-intersection.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.js +3 -3
- package/esm/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-properties.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.js +3 -3
- package/esm/parse/v3-2/_merge-all-of/merge-union.d.ts +10 -3
- package/esm/parse/v3-2/_merge-all-of/merge-union.js +54 -15
- package/esm/parse/v3-2/_merge-all-of/merge.d.ts +3 -2
- package/esm/parse/v3-2/_merge-all-of/merge.js +88 -29
- package/esm/parse/v3-2/_merge-all-of/nullable-merge.d.ts +4 -0
- package/esm/parse/v3-2/_merge-all-of/nullable-merge.js +9 -7
- package/esm/parse/v3-2/_merge-all-of/types.d.ts +37 -0
- package/esm/parse/v3-2/mediaType/toMediaTypeItemV3.js +4 -3
- package/esm/parse/v3-2/parameter/toParameterV3.js +4 -3
- package/esm/parse/v3-2/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-2/ref/toRefV31.js +6 -3
- package/esm/parse/v3-2/schema/toSchemasV3.js +111 -16
- package/esm/types/OasBase.d.ts +1 -1
- package/esm/types/Settings.d.ts +44 -0
- package/esm/types/Settings.js +9 -0
- package/package.json +5 -1
- package/script/context/CoreContext.js +22 -8
- package/script/context/GenerateContext.d.ts +6 -5
- package/script/context/GenerateContext.js +112 -38
- package/script/context/ParseContext.d.ts +18 -1
- package/script/context/ParseContext.js +102 -3
- package/script/context/generateTypes.d.ts +33 -4
- package/script/context/generateTypes.js +4 -0
- package/script/context/toGenerationFailure.d.ts +21 -0
- package/script/context/toGenerationFailure.js +43 -0
- package/script/context/tryParseAt.d.ts +4 -1
- package/script/context/tryParseAt.js +10 -3
- package/script/dsl/CustomValue.d.ts +4 -0
- package/script/dsl/CustomValue.js +8 -0
- package/script/dsl/Definition.d.ts +10 -0
- package/script/dsl/Definition.js +14 -0
- package/script/dsl/PendingDefinition.d.ts +47 -0
- package/script/dsl/PendingDefinition.js +87 -0
- package/script/dsl/model/ModelDriver.d.ts +55 -1
- package/script/dsl/model/ModelDriver.js +231 -52
- package/script/dsl/model/toModelEntry.d.ts +1 -1
- package/script/dsl/model/toModelEntry.js +1 -1
- package/script/dsl/model/types.d.ts +1 -1
- package/script/dsl/operation/gql/GqlOperationDriver.js +1 -4
- package/script/dsl/webhook/WebhookDriver.js +1 -4
- package/script/enrichments/parseEnrichmentUmbrella.d.ts +5 -6
- package/script/enrichments/parseEnrichmentUmbrella.js +23 -41
- package/script/enrichments/parseEnrichmentValue.d.ts +17 -0
- package/script/enrichments/parseEnrichmentValue.js +69 -0
- package/script/enrichments/readEnrichments.d.ts +5 -5
- package/script/enrichments/readEnrichments.js +17 -40
- package/script/helpers/collateExamples.js +15 -5
- package/script/helpers/refFns.d.ts +6 -2
- package/script/helpers/refFns.js +24 -7
- package/script/mod.d.ts +2 -0
- package/script/mod.js +2 -0
- package/script/oas/array/Array.d.ts +19 -0
- package/script/oas/array/Array.js +47 -0
- package/script/oas/boolean/Boolean.d.ts +19 -0
- package/script/oas/boolean/Boolean.js +51 -8
- package/script/oas/example/Example.d.ts +4 -0
- package/script/oas/example/Example.js +8 -0
- package/script/oas/header/Header.d.ts +4 -0
- package/script/oas/header/Header.js +8 -0
- package/script/oas/integer/Integer.d.ts +19 -0
- package/script/oas/integer/Integer.js +49 -0
- package/script/oas/link/Link.d.ts +4 -0
- package/script/oas/link/Link.js +8 -0
- package/script/oas/number/Number.d.ts +19 -0
- package/script/oas/number/Number.js +49 -0
- package/script/oas/object/Object.d.ts +19 -0
- package/script/oas/object/Object.js +68 -18
- package/script/oas/operation/Operation.d.ts +8 -1
- package/script/oas/operation/Operation.js +18 -5
- package/script/oas/operation/toEffectiveParameters.d.ts +24 -0
- package/script/oas/operation/toEffectiveParameters.js +47 -0
- package/script/oas/parameter/Parameter.d.ts +4 -0
- package/script/oas/parameter/Parameter.js +8 -0
- package/script/oas/ref/DanglingRefError.d.ts +22 -0
- package/script/oas/ref/DanglingRefError.js +37 -0
- package/script/oas/ref/Ref.d.ts +152 -25
- package/script/oas/ref/Ref.js +414 -26
- package/script/oas/requestBody/RequestBody.d.ts +4 -0
- package/script/oas/requestBody/RequestBody.js +8 -0
- package/script/oas/response/Response.d.ts +4 -0
- package/script/oas/response/Response.js +8 -0
- package/script/oas/schema/siblings.d.ts +127 -0
- package/script/oas/schema/siblings.js +305 -0
- package/script/oas/securitySchemes/SecurityScheme.d.ts +16 -0
- package/script/oas/securitySchemes/SecurityScheme.js +32 -0
- package/script/oas/string/String.d.ts +19 -0
- package/script/oas/string/String.js +47 -0
- package/script/oas/union/Union.d.ts +32 -0
- package/script/oas/union/Union.js +111 -0
- package/script/oas/unknown/Unknown.d.ts +18 -0
- package/script/oas/unknown/Unknown.js +38 -0
- package/script/oas/void/Void.d.ts +4 -0
- package/script/oas/void/Void.js +8 -0
- package/script/oas/webhook/Webhook.d.ts +2 -2
- package/script/oas/webhook/Webhook.js +4 -5
- package/script/parse/allOfSystem.d.ts +32 -0
- package/script/parse/allOfSystem.js +35 -0
- package/script/parse/anyOfSystem.d.ts +68 -0
- package/script/parse/anyOfSystem.js +116 -0
- package/script/parse/securityRequirements.d.ts +6 -0
- package/script/parse/securityRequirements.js +8 -0
- package/script/parse/toSiblingKeywords.d.ts +28 -0
- package/script/parse/toSiblingKeywords.js +146 -0
- package/script/parse/v3-0/_merge-all-of/decompose-union.d.ts +8 -0
- package/script/parse/v3-0/_merge-all-of/decompose-union.js +11 -2
- package/script/parse/v3-0/_merge-all-of/generic-merge.d.ts +2 -3
- package/script/parse/v3-0/_merge-all-of/generic-merge.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-array-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-array-constraints.js +5 -5
- package/script/parse/v3-0/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-integer-constraints.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-intersection.d.ts +3 -2
- package/script/parse/v3-0/_merge-all-of/merge-intersection.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-number-constraints.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-object-constraints.js +3 -3
- package/script/parse/v3-0/_merge-all-of/merge-properties.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-properties.js +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-string-constraints.js +3 -3
- package/script/parse/v3-0/_merge-all-of/merge-union.d.ts +10 -3
- package/script/parse/v3-0/_merge-all-of/merge-union.js +52 -13
- package/script/parse/v3-0/_merge-all-of/merge.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge.js +77 -26
- package/script/parse/v3-0/_merge-all-of/nullable-merge.d.ts +4 -0
- package/script/parse/v3-0/_merge-all-of/nullable-merge.js +9 -7
- package/script/parse/v3-0/_merge-all-of/types.d.ts +33 -0
- package/script/parse/v3-0/mediaType/toMediaTypeItemV3.js +4 -3
- package/script/parse/v3-0/parameter/toParameterV3.js +4 -3
- package/script/parse/v3-0/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-0/ref/toRefV31.js +6 -3
- package/script/parse/v3-0/schema/toSchemasV3.js +107 -15
- package/script/parse/v3-1/_merge-all-of/decompose-union.d.ts +7 -1
- package/script/parse/v3-1/_merge-all-of/decompose-union.js +8 -2
- package/script/parse/v3-1/_merge-all-of/generic-merge.d.ts +2 -3
- package/script/parse/v3-1/_merge-all-of/generic-merge.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-array-constraints.d.ts +3 -2
- package/script/parse/v3-1/_merge-all-of/merge-array-constraints.js +5 -5
- package/script/parse/v3-1/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-integer-constraints.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-intersection.d.ts +3 -2
- package/script/parse/v3-1/_merge-all-of/merge-intersection.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-number-constraints.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-object-constraints.js +3 -3
- package/script/parse/v3-1/_merge-all-of/merge-properties.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-properties.js +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/script/parse/v3-1/_merge-all-of/merge-string-constraints.js +3 -3
- package/script/parse/v3-1/_merge-all-of/merge-union.d.ts +10 -3
- package/script/parse/v3-1/_merge-all-of/merge-union.js +56 -16
- package/script/parse/v3-1/_merge-all-of/merge.d.ts +3 -2
- package/script/parse/v3-1/_merge-all-of/merge.js +87 -28
- package/script/parse/v3-1/_merge-all-of/nullable-merge.d.ts +4 -0
- package/script/parse/v3-1/_merge-all-of/nullable-merge.js +9 -7
- package/script/parse/v3-1/_merge-all-of/types.d.ts +37 -0
- package/script/parse/v3-1/mediaType/toMediaTypeItemV3.js +4 -3
- package/script/parse/v3-1/parameter/toParameterV3.js +4 -3
- package/script/parse/v3-1/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-1/ref/toRefV31.js +6 -3
- package/script/parse/v3-1/schema/toSchemasV3.js +111 -16
- package/script/parse/v3-2/_merge-all-of/decompose-union.d.ts +7 -1
- package/script/parse/v3-2/_merge-all-of/decompose-union.js +8 -2
- package/script/parse/v3-2/_merge-all-of/generic-merge.d.ts +2 -3
- package/script/parse/v3-2/_merge-all-of/generic-merge.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +3 -2
- package/script/parse/v3-2/_merge-all-of/merge-array-constraints.js +5 -5
- package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-intersection.d.ts +3 -2
- package/script/parse/v3-2/_merge-all-of/merge-intersection.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-number-constraints.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-object-constraints.js +3 -3
- package/script/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-properties.js +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +2 -2
- package/script/parse/v3-2/_merge-all-of/merge-string-constraints.js +3 -3
- package/script/parse/v3-2/_merge-all-of/merge-union.d.ts +10 -3
- package/script/parse/v3-2/_merge-all-of/merge-union.js +56 -16
- package/script/parse/v3-2/_merge-all-of/merge.d.ts +3 -2
- package/script/parse/v3-2/_merge-all-of/merge.js +87 -28
- package/script/parse/v3-2/_merge-all-of/nullable-merge.d.ts +4 -0
- package/script/parse/v3-2/_merge-all-of/nullable-merge.js +9 -7
- package/script/parse/v3-2/_merge-all-of/types.d.ts +37 -0
- package/script/parse/v3-2/mediaType/toMediaTypeItemV3.js +4 -3
- package/script/parse/v3-2/parameter/toParameterV3.js +4 -3
- package/script/parse/v3-2/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-2/ref/toRefV31.js +6 -3
- package/script/parse/v3-2/schema/toSchemasV3.js +111 -16
- package/script/types/OasBase.d.ts +1 -1
- package/script/types/Settings.d.ts +44 -0
- package/script/types/Settings.js +10 -1
package/esm/helpers/refFns.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ import type { ReferenceObject } from '../parse/v3-0/_merge-all-of/types.js';
|
|
|
9
9
|
* and extracts the final component as a branded RefName type. It's used throughout
|
|
10
10
|
* the SKMTC system to convert string references into type-safe reference names.
|
|
11
11
|
*
|
|
12
|
+
* A `$ref` is a URI fragment that holds a JSON pointer (RFC 6901), so the name
|
|
13
|
+
* is unescaped as one: `%20` is a space, and `~1` and `~0` are `/` and `~`.
|
|
14
|
+
* `#/components/schemas/Foo%20Bar` names the component `Foo Bar`.
|
|
15
|
+
*
|
|
12
16
|
* @param $ref - The OpenAPI reference string (e.g., '#/components/schemas/User')
|
|
13
17
|
* @returns The extracted reference name as a branded RefName type
|
|
14
18
|
*
|
|
@@ -117,7 +121,7 @@ export declare const isRef: (value: unknown) => value is Ref;
|
|
|
117
121
|
* @param oasDocument - The OpenAPI document containing the schemas to resolve against
|
|
118
122
|
* @returns A function that resolves reference objects to schema objects
|
|
119
123
|
*
|
|
120
|
-
* @throws {
|
|
124
|
+
* @throws {DanglingRefError} When a reference names no schema in the document
|
|
121
125
|
*
|
|
122
126
|
* @example Basic usage
|
|
123
127
|
* ```typescript
|
|
@@ -148,7 +152,7 @@ export declare const isRef: (value: unknown) => value is Ref;
|
|
|
148
152
|
* const schema = resolver({ $ref: '#/components/schemas/NonExistent' });
|
|
149
153
|
* } catch (error) {
|
|
150
154
|
* console.error('Reference resolution failed:', error.message);
|
|
151
|
-
* //
|
|
155
|
+
* // Ref "#/components/schemas/NonExistent" names nothing in the document
|
|
152
156
|
* }
|
|
153
157
|
* ```
|
|
154
158
|
*
|
package/esm/helpers/refFns.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../_dnt.polyfills.js";
|
|
2
|
+
import { DanglingRefError } from '../oas/ref/DanglingRefError.js';
|
|
2
3
|
/**
|
|
3
4
|
* Extracts a reference name from an OpenAPI $ref string.
|
|
4
5
|
*
|
|
@@ -6,6 +7,10 @@ import "../_dnt.polyfills.js";
|
|
|
6
7
|
* and extracts the final component as a branded RefName type. It's used throughout
|
|
7
8
|
* the SKMTC system to convert string references into type-safe reference names.
|
|
8
9
|
*
|
|
10
|
+
* A `$ref` is a URI fragment that holds a JSON pointer (RFC 6901), so the name
|
|
11
|
+
* is unescaped as one: `%20` is a space, and `~1` and `~0` are `/` and `~`.
|
|
12
|
+
* `#/components/schemas/Foo%20Bar` names the component `Foo Bar`.
|
|
13
|
+
*
|
|
9
14
|
* @param $ref - The OpenAPI reference string (e.g., '#/components/schemas/User')
|
|
10
15
|
* @returns The extracted reference name as a branded RefName type
|
|
11
16
|
*
|
|
@@ -41,12 +46,24 @@ import "../_dnt.polyfills.js";
|
|
|
41
46
|
* ```
|
|
42
47
|
*/
|
|
43
48
|
export const toRefName = ($ref) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (!refName) {
|
|
49
|
+
const segment = $ref.split('/').slice(-1)[0];
|
|
50
|
+
if (!segment) {
|
|
47
51
|
throw new Error('Invalid reference');
|
|
48
52
|
}
|
|
49
|
-
return
|
|
53
|
+
return toUnescapedSegment(segment);
|
|
54
|
+
};
|
|
55
|
+
/** A JSON pointer segment of a URI fragment, unescaped: percent escapes first, then `~1` and `~0`. */
|
|
56
|
+
const toUnescapedSegment = (segment) => {
|
|
57
|
+
return toPercentDecoded(segment).replaceAll('~1', '/').replaceAll('~0', '~');
|
|
58
|
+
};
|
|
59
|
+
const toPercentDecoded = (segment) => {
|
|
60
|
+
try {
|
|
61
|
+
return decodeURIComponent(segment);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// A `%` that starts no valid escape is read as written.
|
|
65
|
+
return segment;
|
|
66
|
+
}
|
|
50
67
|
};
|
|
51
68
|
/**
|
|
52
69
|
* Type guard function to check if a value is an OpenAPI reference object.
|
|
@@ -121,7 +138,7 @@ export const isRef = (value) => {
|
|
|
121
138
|
* @param oasDocument - The OpenAPI document containing the schemas to resolve against
|
|
122
139
|
* @returns A function that resolves reference objects to schema objects
|
|
123
140
|
*
|
|
124
|
-
* @throws {
|
|
141
|
+
* @throws {DanglingRefError} When a reference names no schema in the document
|
|
125
142
|
*
|
|
126
143
|
* @example Basic usage
|
|
127
144
|
* ```typescript
|
|
@@ -152,7 +169,7 @@ export const isRef = (value) => {
|
|
|
152
169
|
* const schema = resolver({ $ref: '#/components/schemas/NonExistent' });
|
|
153
170
|
* } catch (error) {
|
|
154
171
|
* console.error('Reference resolution failed:', error.message);
|
|
155
|
-
* //
|
|
172
|
+
* // Ref "#/components/schemas/NonExistent" names nothing in the document
|
|
156
173
|
* }
|
|
157
174
|
* ```
|
|
158
175
|
*
|
|
@@ -180,5 +197,5 @@ export const toGetRef = (oasDocument) => ({ $ref }) => {
|
|
|
180
197
|
if (item) {
|
|
181
198
|
return item;
|
|
182
199
|
}
|
|
183
|
-
throw new
|
|
200
|
+
throw new DanglingRefError($ref);
|
|
184
201
|
};
|
package/esm/mod.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export * from './dsl/ContentSettings.js';
|
|
|
80
80
|
export * from './dsl/Definition.js';
|
|
81
81
|
export * from './dsl/FileBase.js';
|
|
82
82
|
export * from './dsl/CodeFileBase.js';
|
|
83
|
+
export * from './dsl/PendingDefinition.js';
|
|
83
84
|
export * from './dsl/DefinitionContainer.js';
|
|
84
85
|
export * from './dsl/ImportBase.js';
|
|
85
86
|
export * from './dsl/ReExportBase.js';
|
|
@@ -162,6 +163,7 @@ export * from './oas/parameter/Parameter.js';
|
|
|
162
163
|
export * from './oas/parameter/parameter-types.js';
|
|
163
164
|
export * from './oas/pathItem/PathItem.js';
|
|
164
165
|
export * from './oas/ref/Ref.js';
|
|
166
|
+
export * from './oas/ref/DanglingRefError.js';
|
|
165
167
|
export * from './oas/ref/ref-types.js';
|
|
166
168
|
export * from './parse/v3-0/ref/toRefV31.js';
|
|
167
169
|
export * from './oas/requestBody/RequestBody.js';
|
package/esm/mod.js
CHANGED
|
@@ -80,6 +80,7 @@ export * from './dsl/ContentSettings.js';
|
|
|
80
80
|
export * from './dsl/Definition.js';
|
|
81
81
|
export * from './dsl/FileBase.js';
|
|
82
82
|
export * from './dsl/CodeFileBase.js';
|
|
83
|
+
export * from './dsl/PendingDefinition.js';
|
|
83
84
|
export * from './dsl/DefinitionContainer.js';
|
|
84
85
|
export * from './dsl/ImportBase.js';
|
|
85
86
|
export * from './dsl/ReExportBase.js';
|
|
@@ -162,6 +163,7 @@ export * from './oas/parameter/Parameter.js';
|
|
|
162
163
|
export * from './oas/parameter/parameter-types.js';
|
|
163
164
|
export * from './oas/pathItem/PathItem.js';
|
|
164
165
|
export * from './oas/ref/Ref.js';
|
|
166
|
+
export * from './oas/ref/DanglingRefError.js';
|
|
165
167
|
export * from './oas/ref/ref-types.js';
|
|
166
168
|
export * from './parse/v3-0/ref/toRefV31.js';
|
|
167
169
|
export * from './oas/requestBody/RequestBody.js';
|
package/esm/oas/array/Array.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
|
+
import type { OasUnknown } from '../unknown/Unknown.js';
|
|
2
3
|
import type { SchemaPath } from '../../types/SchemaPath.js';
|
|
3
4
|
import type { OasSchema, ToJsonSchemaOptions } from '../schema/Schema.js';
|
|
4
5
|
import type { OasRef } from '../ref/Ref.js';
|
|
@@ -109,6 +110,12 @@ export declare class OasArray<Nullable extends boolean | undefined = boolean | u
|
|
|
109
110
|
* Whether the array is deprecated.
|
|
110
111
|
*/
|
|
111
112
|
deprecated: boolean | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
115
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
116
|
+
* not read what. `undefined` otherwise.
|
|
117
|
+
*/
|
|
118
|
+
not: OasUnknown | undefined;
|
|
112
119
|
constructor(fields: ArrayFields<Nullable>, context?: ParseContextType);
|
|
113
120
|
/**
|
|
114
121
|
* Determines if this array is a reference object.
|
|
@@ -116,6 +123,18 @@ export declare class OasArray<Nullable extends boolean | undefined = boolean | u
|
|
|
116
123
|
* @returns Always returns false since this is a concrete array instance, not a reference
|
|
117
124
|
*/
|
|
118
125
|
isRef(): this is OasRef<'schema'>;
|
|
126
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
127
|
+
isReadOnly(): boolean;
|
|
128
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
129
|
+
isWriteOnly(): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
132
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
133
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
134
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
135
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
136
|
+
*/
|
|
137
|
+
clone(ref?: OasRef<'schema'>): OasArray;
|
|
119
138
|
traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
|
|
120
139
|
/**
|
|
121
140
|
* Resolves this array object.
|
package/esm/oas/array/Array.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import { traverseSchema } from '../schemaPath/traverseSchema.js';
|
|
3
|
+
import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isArrayValue } from '../schema/siblings.js';
|
|
3
4
|
import { OasBase } from '../../types/OasBase.js';
|
|
4
5
|
export class OasArray extends OasBase {
|
|
5
6
|
constructor(fields, context) {
|
|
@@ -152,6 +153,17 @@ export class OasArray extends OasBase {
|
|
|
152
153
|
writable: true,
|
|
153
154
|
value: void 0
|
|
154
155
|
});
|
|
156
|
+
/**
|
|
157
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
158
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
159
|
+
* not read what. `undefined` otherwise.
|
|
160
|
+
*/
|
|
161
|
+
Object.defineProperty(this, "not", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
configurable: true,
|
|
164
|
+
writable: true,
|
|
165
|
+
value: undefined
|
|
166
|
+
});
|
|
155
167
|
this.items = fields.items;
|
|
156
168
|
this.title = fields.title;
|
|
157
169
|
this.description = fields.description;
|
|
@@ -175,6 +187,41 @@ export class OasArray extends OasBase {
|
|
|
175
187
|
isRef() {
|
|
176
188
|
return false;
|
|
177
189
|
}
|
|
190
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
191
|
+
isReadOnly() {
|
|
192
|
+
return this.readOnly === true;
|
|
193
|
+
}
|
|
194
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
195
|
+
isWriteOnly() {
|
|
196
|
+
return this.writeOnly === true;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
200
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
201
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
202
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
203
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
204
|
+
*/
|
|
205
|
+
clone(ref) {
|
|
206
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
207
|
+
const copy = new OasArray({
|
|
208
|
+
...toSiblingAnnotations(this, ref),
|
|
209
|
+
example: toSiblingValue(ref?.example, isArrayValue) ?? this.example,
|
|
210
|
+
items: this.items,
|
|
211
|
+
nullable,
|
|
212
|
+
uniqueItems: ref?.uniqueItems ?? this.uniqueItems,
|
|
213
|
+
maxItems: ref?.maxItems ?? this.maxItems,
|
|
214
|
+
minItems: ref?.minItems ?? this.minItems,
|
|
215
|
+
enums: toSiblingEnums(ref?.enums, isArrayValue, nullable) ?? this.enums,
|
|
216
|
+
defaultValue: toSiblingValue(ref?.default, isArrayValue) ?? this.defaultValue,
|
|
217
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
218
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
219
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
220
|
+
});
|
|
221
|
+
copy.stackTrail = this.stackTrail;
|
|
222
|
+
copy.not = this.not;
|
|
223
|
+
return copy;
|
|
224
|
+
}
|
|
178
225
|
traverse(path) {
|
|
179
226
|
return traverseSchema(this, path);
|
|
180
227
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
|
+
import type { OasUnknown } from '../unknown/Unknown.js';
|
|
2
3
|
import type { SchemaPath } from '../../types/SchemaPath.js';
|
|
3
4
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
4
5
|
import type { OasRef } from '../ref/Ref.js';
|
|
@@ -82,6 +83,12 @@ export declare class OasBoolean<Nullable extends boolean | undefined = boolean |
|
|
|
82
83
|
* enabled, the current StackTrail is snapshotted onto the
|
|
83
84
|
* instance (via the {@link OasBase} base).
|
|
84
85
|
*/
|
|
86
|
+
/**
|
|
87
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
88
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
89
|
+
* not read what. `undefined` otherwise.
|
|
90
|
+
*/
|
|
91
|
+
not: OasUnknown | undefined;
|
|
85
92
|
constructor(fields?: BooleanFields<Nullable>, context?: ParseContextType);
|
|
86
93
|
/**
|
|
87
94
|
* Determines if this boolean is a reference object.
|
|
@@ -89,6 +96,18 @@ export declare class OasBoolean<Nullable extends boolean | undefined = boolean |
|
|
|
89
96
|
* @returns Always returns false since this is a concrete boolean instance, not a reference
|
|
90
97
|
*/
|
|
91
98
|
isRef(): this is OasRef<'schema'>;
|
|
99
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
100
|
+
isReadOnly(): boolean;
|
|
101
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
102
|
+
isWriteOnly(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
105
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
106
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
107
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
108
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
109
|
+
*/
|
|
110
|
+
clone(ref?: OasRef<'schema'>): OasBoolean;
|
|
92
111
|
traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
|
|
93
112
|
/**
|
|
94
113
|
* Resolves this boolean object.
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import { traverseSchema } from '../schemaPath/traverseSchema.js';
|
|
3
|
+
import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isBooleanValue } from '../schema/siblings.js';
|
|
3
4
|
import { OasBase } from '../../types/OasBase.js';
|
|
4
5
|
export class OasBoolean extends OasBase {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new OasBoolean instance.
|
|
7
|
-
*
|
|
8
|
-
* @param fields - Boolean configuration fields including validation constraints and metadata
|
|
9
|
-
* @param context - Optional ParseContext. When passed and attribution is
|
|
10
|
-
* enabled, the current StackTrail is snapshotted onto the
|
|
11
|
-
* instance (via the {@link OasBase} base).
|
|
12
|
-
*/
|
|
13
6
|
constructor(fields = {}, context) {
|
|
14
7
|
super(context);
|
|
15
8
|
/**
|
|
@@ -113,6 +106,25 @@ export class OasBoolean extends OasBase {
|
|
|
113
106
|
writable: true,
|
|
114
107
|
value: void 0
|
|
115
108
|
});
|
|
109
|
+
/**
|
|
110
|
+
* Creates a new OasBoolean instance.
|
|
111
|
+
*
|
|
112
|
+
* @param fields - Boolean configuration fields including validation constraints and metadata
|
|
113
|
+
* @param context - Optional ParseContext. When passed and attribution is
|
|
114
|
+
* enabled, the current StackTrail is snapshotted onto the
|
|
115
|
+
* instance (via the {@link OasBase} base).
|
|
116
|
+
*/
|
|
117
|
+
/**
|
|
118
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
119
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
120
|
+
* not read what. `undefined` otherwise.
|
|
121
|
+
*/
|
|
122
|
+
Object.defineProperty(this, "not", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
configurable: true,
|
|
125
|
+
writable: true,
|
|
126
|
+
value: undefined
|
|
127
|
+
});
|
|
116
128
|
this.title = fields.title;
|
|
117
129
|
this.description = fields.description;
|
|
118
130
|
this.nullable = fields.nullable;
|
|
@@ -132,6 +144,37 @@ export class OasBoolean extends OasBase {
|
|
|
132
144
|
isRef() {
|
|
133
145
|
return false;
|
|
134
146
|
}
|
|
147
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
148
|
+
isReadOnly() {
|
|
149
|
+
return this.readOnly === true;
|
|
150
|
+
}
|
|
151
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
152
|
+
isWriteOnly() {
|
|
153
|
+
return this.writeOnly === true;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
157
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
158
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
159
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
160
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
161
|
+
*/
|
|
162
|
+
clone(ref) {
|
|
163
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
164
|
+
const copy = new OasBoolean({
|
|
165
|
+
...toSiblingAnnotations(this, ref),
|
|
166
|
+
example: toSiblingValue(ref?.example, isBooleanValue) ?? this.example,
|
|
167
|
+
nullable,
|
|
168
|
+
enums: toSiblingEnums(ref?.enums, isBooleanValue, nullable) ?? this.enums,
|
|
169
|
+
default: toSiblingValue(ref?.default, isBooleanValue) ?? this.default,
|
|
170
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
171
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
172
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
173
|
+
});
|
|
174
|
+
copy.stackTrail = this.stackTrail;
|
|
175
|
+
copy.not = this.not;
|
|
176
|
+
return copy;
|
|
177
|
+
}
|
|
135
178
|
traverse(path) {
|
|
136
179
|
return traverseSchema(this, path);
|
|
137
180
|
}
|
|
@@ -34,6 +34,10 @@ export declare class OasExample {
|
|
|
34
34
|
constructor(fields: ExampleFields);
|
|
35
35
|
/** Returns true if object is a reference */
|
|
36
36
|
isRef(): this is OasRef<'example'>;
|
|
37
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
38
|
+
isReadOnly(): boolean;
|
|
39
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
40
|
+
isWriteOnly(): boolean;
|
|
37
41
|
/** Returns itself */
|
|
38
42
|
resolve(): OasExample;
|
|
39
43
|
resolveOnce(): OasExample;
|
|
@@ -62,6 +62,14 @@ export class OasExample {
|
|
|
62
62
|
isRef() {
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
66
|
+
isReadOnly() {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
70
|
+
isWriteOnly() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
65
73
|
/** Returns itself */
|
|
66
74
|
resolve() {
|
|
67
75
|
return this;
|
|
@@ -73,6 +73,10 @@ export declare class OasHeader {
|
|
|
73
73
|
constructor(fields: HeaderFields);
|
|
74
74
|
/** Returns true if object is a reference */
|
|
75
75
|
isRef(): this is OasRef<'header'>;
|
|
76
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
77
|
+
isReadOnly(): boolean;
|
|
78
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
79
|
+
isWriteOnly(): boolean;
|
|
76
80
|
/** Returns itself */
|
|
77
81
|
resolve(): OasHeader;
|
|
78
82
|
resolveOnce(): OasHeader;
|
package/esm/oas/header/Header.js
CHANGED
|
@@ -99,6 +99,14 @@ export class OasHeader {
|
|
|
99
99
|
isRef() {
|
|
100
100
|
return false;
|
|
101
101
|
}
|
|
102
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
103
|
+
isReadOnly() {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
107
|
+
isWriteOnly() {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
102
110
|
/** Returns itself */
|
|
103
111
|
resolve() {
|
|
104
112
|
return this;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
|
+
import type { OasUnknown } from '../unknown/Unknown.js';
|
|
2
3
|
import type { SchemaPath } from '../../types/SchemaPath.js';
|
|
3
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
4
5
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
@@ -116,8 +117,26 @@ export declare class OasInteger<Nullable extends boolean | undefined = boolean |
|
|
|
116
117
|
* Whether the integer is deprecated.
|
|
117
118
|
*/
|
|
118
119
|
deprecated: boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
122
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
123
|
+
* not read what. `undefined` otherwise.
|
|
124
|
+
*/
|
|
125
|
+
not: OasUnknown | undefined;
|
|
119
126
|
constructor(fields?: IntegerFields<Nullable>, context?: ParseContextType);
|
|
120
127
|
isRef(): this is OasRef<'schema'>;
|
|
128
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
129
|
+
isReadOnly(): boolean;
|
|
130
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
131
|
+
isWriteOnly(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
134
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
135
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
136
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
137
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
138
|
+
*/
|
|
139
|
+
clone(ref?: OasRef<'schema'>): OasInteger;
|
|
121
140
|
traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
|
|
122
141
|
resolve(): OasInteger<Nullable>;
|
|
123
142
|
resolveOnce(): OasInteger<Nullable>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import { traverseSchema } from '../schemaPath/traverseSchema.js';
|
|
3
|
+
import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isIntegerValue, isIntegerFormat } from '../schema/siblings.js';
|
|
3
4
|
import { OasBase } from '../../types/OasBase.js';
|
|
4
5
|
export class OasInteger extends OasBase {
|
|
5
6
|
constructor(fields = {}, context) {
|
|
@@ -165,6 +166,17 @@ export class OasInteger extends OasBase {
|
|
|
165
166
|
writable: true,
|
|
166
167
|
value: void 0
|
|
167
168
|
});
|
|
169
|
+
/**
|
|
170
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
171
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
172
|
+
* not read what. `undefined` otherwise.
|
|
173
|
+
*/
|
|
174
|
+
Object.defineProperty(this, "not", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
configurable: true,
|
|
177
|
+
writable: true,
|
|
178
|
+
value: undefined
|
|
179
|
+
});
|
|
168
180
|
this.title = fields.title;
|
|
169
181
|
this.description = fields.description;
|
|
170
182
|
this.nullable = fields.nullable;
|
|
@@ -185,6 +197,43 @@ export class OasInteger extends OasBase {
|
|
|
185
197
|
isRef() {
|
|
186
198
|
return false;
|
|
187
199
|
}
|
|
200
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
201
|
+
isReadOnly() {
|
|
202
|
+
return this.readOnly === true;
|
|
203
|
+
}
|
|
204
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
205
|
+
isWriteOnly() {
|
|
206
|
+
return this.writeOnly === true;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
210
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
211
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
212
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
213
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
214
|
+
*/
|
|
215
|
+
clone(ref) {
|
|
216
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
217
|
+
const copy = new OasInteger({
|
|
218
|
+
...toSiblingAnnotations(this, ref),
|
|
219
|
+
example: toSiblingValue(ref?.example, isIntegerValue) ?? this.example,
|
|
220
|
+
nullable,
|
|
221
|
+
format: toSiblingValue(ref?.format, isIntegerFormat) ?? this.format,
|
|
222
|
+
enums: toSiblingEnums(ref?.enums, isIntegerValue, nullable) ?? this.enums,
|
|
223
|
+
multipleOf: ref?.multipleOf ?? this.multipleOf,
|
|
224
|
+
maximum: ref?.maximum ?? this.maximum,
|
|
225
|
+
exclusiveMaximum: ref?.exclusiveMaximum ?? this.exclusiveMaximum,
|
|
226
|
+
minimum: ref?.minimum ?? this.minimum,
|
|
227
|
+
exclusiveMinimum: ref?.exclusiveMinimum ?? this.exclusiveMinimum,
|
|
228
|
+
default: toSiblingValue(ref?.default, isIntegerValue) ?? this.default,
|
|
229
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
230
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
231
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
232
|
+
});
|
|
233
|
+
copy.stackTrail = this.stackTrail;
|
|
234
|
+
copy.not = this.not;
|
|
235
|
+
return copy;
|
|
236
|
+
}
|
|
188
237
|
traverse(path) {
|
|
189
238
|
return traverseSchema(this, path);
|
|
190
239
|
}
|
package/esm/oas/link/Link.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export declare class OasLink {
|
|
|
60
60
|
constructor(fields: LinkFields);
|
|
61
61
|
/** Returns true if object is a reference */
|
|
62
62
|
isRef(): this is OasRef<'link'>;
|
|
63
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
64
|
+
isReadOnly(): boolean;
|
|
65
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
66
|
+
isWriteOnly(): boolean;
|
|
63
67
|
/** Returns itself */
|
|
64
68
|
resolve(): OasLink;
|
|
65
69
|
resolveOnce(): OasLink;
|
package/esm/oas/link/Link.js
CHANGED
|
@@ -87,6 +87,14 @@ export class OasLink {
|
|
|
87
87
|
isRef() {
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
91
|
+
isReadOnly() {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
95
|
+
isWriteOnly() {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
90
98
|
/** Returns itself */
|
|
91
99
|
resolve() {
|
|
92
100
|
return this;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
|
+
import type { OasUnknown } from '../unknown/Unknown.js';
|
|
2
3
|
import type { SchemaPath } from '../../types/SchemaPath.js';
|
|
3
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
4
5
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
@@ -116,8 +117,26 @@ export declare class OasNumber<Nullable extends boolean | undefined = boolean |
|
|
|
116
117
|
* Whether the number is deprecated.
|
|
117
118
|
*/
|
|
118
119
|
deprecated: boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
122
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
123
|
+
* not read what. `undefined` otherwise.
|
|
124
|
+
*/
|
|
125
|
+
not: OasUnknown | undefined;
|
|
119
126
|
constructor(fields?: NumberFields<Nullable>, context?: ParseContextType);
|
|
120
127
|
isRef(): this is OasRef<'schema'>;
|
|
128
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
129
|
+
isReadOnly(): boolean;
|
|
130
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
131
|
+
isWriteOnly(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
134
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
135
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
136
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
137
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
138
|
+
*/
|
|
139
|
+
clone(ref?: OasRef<'schema'>): OasNumber;
|
|
121
140
|
traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
|
|
122
141
|
resolve(): OasNumber<Nullable>;
|
|
123
142
|
resolveOnce(): OasNumber<Nullable>;
|
package/esm/oas/number/Number.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import { traverseSchema } from '../schemaPath/traverseSchema.js';
|
|
3
|
+
import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isNumberValue, isNumberFormat } from '../schema/siblings.js';
|
|
3
4
|
import { OasBase } from '../../types/OasBase.js';
|
|
4
5
|
export class OasNumber extends OasBase {
|
|
5
6
|
constructor(fields = {}, context) {
|
|
@@ -165,6 +166,17 @@ export class OasNumber extends OasBase {
|
|
|
165
166
|
writable: true,
|
|
166
167
|
value: void 0
|
|
167
168
|
});
|
|
169
|
+
/**
|
|
170
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
171
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
172
|
+
* not read what. `undefined` otherwise.
|
|
173
|
+
*/
|
|
174
|
+
Object.defineProperty(this, "not", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
configurable: true,
|
|
177
|
+
writable: true,
|
|
178
|
+
value: undefined
|
|
179
|
+
});
|
|
168
180
|
this.title = fields.title;
|
|
169
181
|
this.description = fields.description;
|
|
170
182
|
this.nullable = fields.nullable;
|
|
@@ -185,6 +197,43 @@ export class OasNumber extends OasBase {
|
|
|
185
197
|
isRef() {
|
|
186
198
|
return false;
|
|
187
199
|
}
|
|
200
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
201
|
+
isReadOnly() {
|
|
202
|
+
return this.readOnly === true;
|
|
203
|
+
}
|
|
204
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
205
|
+
isWriteOnly() {
|
|
206
|
+
return this.writeOnly === true;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
210
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
211
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
212
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
213
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
214
|
+
*/
|
|
215
|
+
clone(ref) {
|
|
216
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
217
|
+
const copy = new OasNumber({
|
|
218
|
+
...toSiblingAnnotations(this, ref),
|
|
219
|
+
example: toSiblingValue(ref?.example, isNumberValue) ?? this.example,
|
|
220
|
+
nullable,
|
|
221
|
+
default: toSiblingValue(ref?.default, isNumberValue) ?? this.default,
|
|
222
|
+
enums: toSiblingEnums(ref?.enums, isNumberValue, nullable) ?? this.enums,
|
|
223
|
+
format: toSiblingValue(ref?.format, isNumberFormat) ?? this.format,
|
|
224
|
+
multipleOf: ref?.multipleOf ?? this.multipleOf,
|
|
225
|
+
maximum: ref?.maximum ?? this.maximum,
|
|
226
|
+
exclusiveMaximum: ref?.exclusiveMaximum ?? this.exclusiveMaximum,
|
|
227
|
+
minimum: ref?.minimum ?? this.minimum,
|
|
228
|
+
exclusiveMinimum: ref?.exclusiveMinimum ?? this.exclusiveMinimum,
|
|
229
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
230
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
231
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
232
|
+
});
|
|
233
|
+
copy.stackTrail = this.stackTrail;
|
|
234
|
+
copy.not = this.not;
|
|
235
|
+
return copy;
|
|
236
|
+
}
|
|
188
237
|
traverse(path) {
|
|
189
238
|
return traverseSchema(this, path);
|
|
190
239
|
}
|