@skmtc/core 0.39.0 → 0.40.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 +5 -4
- package/esm/context/GenerateContext.js +110 -37
- package/esm/context/ParseContext.d.ts +9 -1
- package/esm/context/ParseContext.js +12 -1
- package/esm/context/generateTypes.d.ts +19 -4
- package/esm/context/generateTypes.js +2 -0
- package/esm/context/toGenerationFailure.d.ts +21 -0
- package/esm/context/toGenerationFailure.js +38 -0
- 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/mod.d.ts +1 -0
- package/esm/mod.js +1 -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 +5 -1
- package/esm/oas/operation/Operation.js +17 -5
- package/esm/oas/operation/toEffectiveParameters.d.ts +16 -0
- package/esm/oas/operation/toEffectiveParameters.js +13 -0
- package/esm/oas/parameter/Parameter.d.ts +4 -0
- package/esm/oas/parameter/Parameter.js +8 -0
- package/esm/oas/ref/Ref.d.ts +147 -25
- package/esm/oas/ref/Ref.js +387 -25
- 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 +240 -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 +31 -0
- package/esm/oas/union/Union.js +100 -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 +6 -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/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/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-0/ref/toRefV31.js +2 -2
- 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/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-1/ref/toRefV31.js +2 -2
- 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/ref/toRefV31.d.ts +7 -1
- package/esm/parse/v3-2/ref/toRefV31.js +2 -2
- package/esm/parse/v3-2/schema/toSchemasV3.js +111 -16
- package/esm/types/OasBase.d.ts +1 -1
- package/esm/types/Settings.d.ts +34 -0
- package/esm/types/Settings.js +8 -0
- package/package.json +1 -1
- package/script/context/CoreContext.js +22 -8
- package/script/context/GenerateContext.d.ts +5 -4
- package/script/context/GenerateContext.js +110 -37
- package/script/context/ParseContext.d.ts +9 -1
- package/script/context/ParseContext.js +12 -1
- package/script/context/generateTypes.d.ts +19 -4
- package/script/context/generateTypes.js +2 -0
- package/script/context/toGenerationFailure.d.ts +21 -0
- package/script/context/toGenerationFailure.js +43 -0
- 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/mod.d.ts +1 -0
- package/script/mod.js +1 -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 +5 -1
- package/script/oas/operation/Operation.js +17 -5
- package/script/oas/operation/toEffectiveParameters.d.ts +16 -0
- package/script/oas/operation/toEffectiveParameters.js +17 -0
- package/script/oas/parameter/Parameter.d.ts +4 -0
- package/script/oas/parameter/Parameter.js +8 -0
- package/script/oas/ref/Ref.d.ts +147 -25
- package/script/oas/ref/Ref.js +387 -25
- 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 +295 -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 +31 -0
- package/script/oas/union/Union.js +100 -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 +6 -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/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/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-0/ref/toRefV31.js +2 -2
- 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/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-1/ref/toRefV31.js +2 -2
- 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/ref/toRefV31.d.ts +7 -1
- package/script/parse/v3-2/ref/toRefV31.js +2 -2
- package/script/parse/v3-2/schema/toSchemasV3.js +111 -16
- package/script/types/OasBase.d.ts +1 -1
- package/script/types/Settings.d.ts +34 -0
- package/script/types/Settings.js +9 -1
|
@@ -19,59 +19,25 @@
|
|
|
19
19
|
* declares only the fields it reads — keys other generators own are
|
|
20
20
|
* expected, not typos.
|
|
21
21
|
*
|
|
22
|
-
* A wrong-typed value
|
|
23
|
-
*
|
|
24
|
-
* throwing leaf doesn't hide a dropped key.
|
|
22
|
+
* A wrong-typed value throws ({@link parseEnrichmentValue}), naming each
|
|
23
|
+
* wrong value's place in `client.json`. Unknown-key detection runs first,
|
|
24
|
+
* so a throwing leaf doesn't hide a dropped key.
|
|
25
25
|
*
|
|
26
26
|
* @module parseEnrichmentUmbrella
|
|
27
27
|
*/
|
|
28
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
-
}
|
|
34
|
-
Object.defineProperty(o, k2, desc);
|
|
35
|
-
}) : (function(o, m, k, k2) {
|
|
36
|
-
if (k2 === undefined) k2 = k;
|
|
37
|
-
o[k2] = m[k];
|
|
38
|
-
}));
|
|
39
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
-
}) : function(o, v) {
|
|
42
|
-
o["default"] = v;
|
|
43
|
-
});
|
|
44
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
45
|
-
var ownKeys = function(o) {
|
|
46
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
47
|
-
var ar = [];
|
|
48
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
49
|
-
return ar;
|
|
50
|
-
};
|
|
51
|
-
return ownKeys(o);
|
|
52
|
-
};
|
|
53
|
-
return function (mod) {
|
|
54
|
-
if (mod && mod.__esModule) return mod;
|
|
55
|
-
var result = {};
|
|
56
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
57
|
-
__setModuleDefault(result, mod);
|
|
58
|
-
return result;
|
|
59
|
-
};
|
|
60
|
-
})();
|
|
61
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
29
|
exports.parseEnrichmentUmbrella = void 0;
|
|
63
|
-
const v = __importStar(require("valibot"));
|
|
64
30
|
const Enrichments_js_1 = require("../types/Enrichments.js");
|
|
65
31
|
const findUnknownKeys_js_1 = require("./findUnknownKeys.js");
|
|
66
32
|
const EnrichmentWarning_js_1 = require("./EnrichmentWarning.js");
|
|
33
|
+
const parseEnrichmentValue_js_1 = require("./parseEnrichmentValue.js");
|
|
67
34
|
/**
|
|
68
35
|
* Assemble and parse one `{ subject, generator, stack }` enrichment
|
|
69
36
|
* umbrella, recording the reads for the consumption audit and reporting
|
|
70
37
|
* schema-dropped keys.
|
|
71
38
|
*
|
|
72
|
-
* @throws on a wrong-typed value
|
|
73
|
-
*
|
|
74
|
-
* continues (fail-open).
|
|
39
|
+
* @throws on a wrong-typed value. The generator's item is recorded as
|
|
40
|
+
* `error`, and the run fails once every generator has run.
|
|
75
41
|
*/
|
|
76
42
|
const parseEnrichmentUmbrella = ({ context, generatorId, subjectSegments, schema }) => {
|
|
77
43
|
const raw = {
|
|
@@ -98,6 +64,22 @@ const parseEnrichmentUmbrella = ({ context, generatorId, subjectSegments, schema
|
|
|
98
64
|
...(suggestion !== undefined ? { suggestion } : {})
|
|
99
65
|
});
|
|
100
66
|
}
|
|
101
|
-
return
|
|
67
|
+
return (0, parseEnrichmentValue_js_1.parseEnrichmentValue)({
|
|
68
|
+
schema,
|
|
69
|
+
value: raw,
|
|
70
|
+
generatorId,
|
|
71
|
+
toRoutingPath: ([scope, ...leafPath]) => {
|
|
72
|
+
switch (scope) {
|
|
73
|
+
case 'subject':
|
|
74
|
+
return [generatorId, ...subjectSegments, ...leafPath];
|
|
75
|
+
case 'generator':
|
|
76
|
+
return [generatorId, Enrichments_js_1.GENERATOR_ENRICHMENT_KEY, ...leafPath];
|
|
77
|
+
case 'stack':
|
|
78
|
+
return [Enrichments_js_1.STACK_ENRICHMENT_KEY, ...leafPath];
|
|
79
|
+
default:
|
|
80
|
+
return [generatorId];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
102
84
|
};
|
|
103
85
|
exports.parseEnrichmentUmbrella = parseEnrichmentUmbrella;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
type ParseEnrichmentValueArgs<EnrichmentType> = {
|
|
3
|
+
schema: v.GenericSchema<EnrichmentType>;
|
|
4
|
+
value: unknown;
|
|
5
|
+
/** The generator whose schema reads `value`; `undefined` for the shared `_stack` bag. */
|
|
6
|
+
generatorId: string | undefined;
|
|
7
|
+
/** The `client.json#settings.enrichments` routing path of the value at `path` inside `value`. */
|
|
8
|
+
toRoutingPath: (path: readonly string[]) => string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* `value` parsed through a generator's enrichment schema. Enrichments are
|
|
12
|
+
* typed configuration, so a value that does not match throws, and the run
|
|
13
|
+
* fails. The message lists every value that does not match, at its place in
|
|
14
|
+
* `client.json`, so the user can fix them all in one pass.
|
|
15
|
+
*/
|
|
16
|
+
export declare const parseEnrichmentValue: <EnrichmentType>({ schema, value, generatorId, toRoutingPath }: ParseEnrichmentValueArgs<EnrichmentType>) => EnrichmentType;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseEnrichmentValue = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
const EnrichmentWarning_js_1 = require("./EnrichmentWarning.js");
|
|
39
|
+
/**
|
|
40
|
+
* `value` parsed through a generator's enrichment schema. Enrichments are
|
|
41
|
+
* typed configuration, so a value that does not match throws, and the run
|
|
42
|
+
* fails. The message lists every value that does not match, at its place in
|
|
43
|
+
* `client.json`, so the user can fix them all in one pass.
|
|
44
|
+
*/
|
|
45
|
+
const parseEnrichmentValue = ({ schema, value, generatorId, toRoutingPath }) => {
|
|
46
|
+
const result = v.safeParse(schema, value);
|
|
47
|
+
if (result.success) {
|
|
48
|
+
return result.output;
|
|
49
|
+
}
|
|
50
|
+
const lines = result.issues.map(issue => {
|
|
51
|
+
const path = (issue.path ?? []).map(item => String(item.key));
|
|
52
|
+
const at = (0, EnrichmentWarning_js_1.formatEnrichmentPath)(toRoutingPath(path));
|
|
53
|
+
return `- '${at}': ${toFix(issue, generatorId)}`;
|
|
54
|
+
});
|
|
55
|
+
const header = generatorId === undefined
|
|
56
|
+
? 'Stack enrichments do not match the schema a generator reads them with.'
|
|
57
|
+
: `Enrichments for '${generatorId}' do not match its enrichment schema.`;
|
|
58
|
+
throw new Error([`${header} Fix them in client.json (settings.enrichments):`, ...lines].join('\n'));
|
|
59
|
+
};
|
|
60
|
+
exports.parseEnrichmentValue = parseEnrichmentValue;
|
|
61
|
+
/** What to do about one value: a scope the generator does not read takes no value at all. */
|
|
62
|
+
const toFix = (issue, generatorId) => {
|
|
63
|
+
if (issue.expected !== 'undefined') {
|
|
64
|
+
return issue.message;
|
|
65
|
+
}
|
|
66
|
+
return generatorId === undefined
|
|
67
|
+
? 'No generator reads a value here. Remove the value.'
|
|
68
|
+
: `'${generatorId}' reads no enrichments here. Remove the value.`;
|
|
69
|
+
};
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module readEnrichments
|
|
25
25
|
*/
|
|
26
|
-
import * as v from 'valibot';
|
|
26
|
+
import type * as v from 'valibot';
|
|
27
27
|
import type { ClientSettings } from '../types/Settings.js';
|
|
28
28
|
/**
|
|
29
29
|
* Minimal structural view of the read context. Any `GenerateContext`
|
|
@@ -46,9 +46,9 @@ type EnrichmentReadContext = {
|
|
|
46
46
|
* `v.object({...})` (a missing block then throws); one with all-optional
|
|
47
47
|
* config passes `v.optional(v.object({...}))`.
|
|
48
48
|
*
|
|
49
|
-
* @throws on a malformed block
|
|
50
|
-
* `
|
|
51
|
-
* leaf.
|
|
49
|
+
* @throws on a malformed block, naming each wrong value's place in
|
|
50
|
+
* `client.json`. The item is recorded as `error`, and the run fails once
|
|
51
|
+
* every generator has run, exactly as for a bad subject leaf.
|
|
52
52
|
*/
|
|
53
53
|
export declare const toGeneratorEnrichment: <EnrichmentType>(context: EnrichmentReadContext, generatorId: string, schema: v.GenericSchema<EnrichmentType>) => EnrichmentType;
|
|
54
54
|
/**
|
|
@@ -62,7 +62,7 @@ export declare const toGeneratorEnrichment: <EnrichmentType>(context: Enrichment
|
|
|
62
62
|
* `v.object` ignores unknown keys, so fields other generators consume
|
|
63
63
|
* don't interfere. The return type is inferred from `schema`.
|
|
64
64
|
*
|
|
65
|
-
* @throws on a malformed block
|
|
65
|
+
* @throws on a malformed block, as above.
|
|
66
66
|
*/
|
|
67
67
|
export declare const toStackEnrichment: <EnrichmentType>(context: EnrichmentReadContext, schema: v.GenericSchema<EnrichmentType>) => EnrichmentType;
|
|
68
68
|
export {};
|
|
@@ -24,43 +24,10 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @module readEnrichments
|
|
26
26
|
*/
|
|
27
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
30
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
31
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(o, k2, desc);
|
|
34
|
-
}) : (function(o, m, k, k2) {
|
|
35
|
-
if (k2 === undefined) k2 = k;
|
|
36
|
-
o[k2] = m[k];
|
|
37
|
-
}));
|
|
38
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
39
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
40
|
-
}) : function(o, v) {
|
|
41
|
-
o["default"] = v;
|
|
42
|
-
});
|
|
43
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
44
|
-
var ownKeys = function(o) {
|
|
45
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
46
|
-
var ar = [];
|
|
47
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
48
|
-
return ar;
|
|
49
|
-
};
|
|
50
|
-
return ownKeys(o);
|
|
51
|
-
};
|
|
52
|
-
return function (mod) {
|
|
53
|
-
if (mod && mod.__esModule) return mod;
|
|
54
|
-
var result = {};
|
|
55
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
56
|
-
__setModuleDefault(result, mod);
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
|
-
})();
|
|
60
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
28
|
exports.toStackEnrichment = exports.toGeneratorEnrichment = void 0;
|
|
62
|
-
const v = __importStar(require("valibot"));
|
|
63
29
|
const Enrichments_js_1 = require("../types/Enrichments.js");
|
|
30
|
+
const parseEnrichmentValue_js_1 = require("./parseEnrichmentValue.js");
|
|
64
31
|
/**
|
|
65
32
|
* Read this generator's **generator-scoped** enrichment — the
|
|
66
33
|
* run-constant leaf at
|
|
@@ -74,11 +41,16 @@ const Enrichments_js_1 = require("../types/Enrichments.js");
|
|
|
74
41
|
* `v.object({...})` (a missing block then throws); one with all-optional
|
|
75
42
|
* config passes `v.optional(v.object({...}))`.
|
|
76
43
|
*
|
|
77
|
-
* @throws on a malformed block
|
|
78
|
-
* `
|
|
79
|
-
* leaf.
|
|
44
|
+
* @throws on a malformed block, naming each wrong value's place in
|
|
45
|
+
* `client.json`. The item is recorded as `error`, and the run fails once
|
|
46
|
+
* every generator has run, exactly as for a bad subject leaf.
|
|
80
47
|
*/
|
|
81
|
-
const toGeneratorEnrichment = (context, generatorId, schema) =>
|
|
48
|
+
const toGeneratorEnrichment = (context, generatorId, schema) => (0, parseEnrichmentValue_js_1.parseEnrichmentValue)({
|
|
49
|
+
schema,
|
|
50
|
+
value: context.settings?.enrichments?.[generatorId]?.[Enrichments_js_1.GENERATOR_ENRICHMENT_KEY],
|
|
51
|
+
generatorId,
|
|
52
|
+
toRoutingPath: path => [generatorId, Enrichments_js_1.GENERATOR_ENRICHMENT_KEY, ...path]
|
|
53
|
+
});
|
|
82
54
|
exports.toGeneratorEnrichment = toGeneratorEnrichment;
|
|
83
55
|
/**
|
|
84
56
|
* Read the **stack-scoped** enrichment — the run-constant leaf at
|
|
@@ -91,7 +63,12 @@ exports.toGeneratorEnrichment = toGeneratorEnrichment;
|
|
|
91
63
|
* `v.object` ignores unknown keys, so fields other generators consume
|
|
92
64
|
* don't interfere. The return type is inferred from `schema`.
|
|
93
65
|
*
|
|
94
|
-
* @throws on a malformed block
|
|
66
|
+
* @throws on a malformed block, as above.
|
|
95
67
|
*/
|
|
96
|
-
const toStackEnrichment = (context, schema) =>
|
|
68
|
+
const toStackEnrichment = (context, schema) => (0, parseEnrichmentValue_js_1.parseEnrichmentValue)({
|
|
69
|
+
schema,
|
|
70
|
+
value: context.settings?.enrichments?.[Enrichments_js_1.STACK_ENRICHMENT_KEY],
|
|
71
|
+
generatorId: undefined,
|
|
72
|
+
toRoutingPath: path => [Enrichments_js_1.STACK_ENRICHMENT_KEY, ...path]
|
|
73
|
+
});
|
|
97
74
|
exports.toStackEnrichment = toStackEnrichment;
|
package/script/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';
|
package/script/mod.js
CHANGED
|
@@ -96,6 +96,7 @@ __exportStar(require("./dsl/ContentSettings.js"), exports);
|
|
|
96
96
|
__exportStar(require("./dsl/Definition.js"), exports);
|
|
97
97
|
__exportStar(require("./dsl/FileBase.js"), exports);
|
|
98
98
|
__exportStar(require("./dsl/CodeFileBase.js"), exports);
|
|
99
|
+
__exportStar(require("./dsl/PendingDefinition.js"), exports);
|
|
99
100
|
__exportStar(require("./dsl/DefinitionContainer.js"), exports);
|
|
100
101
|
__exportStar(require("./dsl/ImportBase.js"), exports);
|
|
101
102
|
__exportStar(require("./dsl/ReExportBase.js"), exports);
|
|
@@ -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.
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OasArray = void 0;
|
|
4
4
|
require("../../_dnt.polyfills.js");
|
|
5
5
|
const traverseSchema_js_1 = require("../schemaPath/traverseSchema.js");
|
|
6
|
+
const siblings_js_1 = require("../schema/siblings.js");
|
|
6
7
|
const OasBase_js_1 = require("../../types/OasBase.js");
|
|
7
8
|
class OasArray extends OasBase_js_1.OasBase {
|
|
8
9
|
constructor(fields, context) {
|
|
@@ -155,6 +156,17 @@ class OasArray extends OasBase_js_1.OasBase {
|
|
|
155
156
|
writable: true,
|
|
156
157
|
value: void 0
|
|
157
158
|
});
|
|
159
|
+
/**
|
|
160
|
+
* The schema's `not`, kept as an `OasUnknown` under `client.json`
|
|
161
|
+
* `system.not: unknown`: the document says "not something", and core does
|
|
162
|
+
* not read what. `undefined` otherwise.
|
|
163
|
+
*/
|
|
164
|
+
Object.defineProperty(this, "not", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
configurable: true,
|
|
167
|
+
writable: true,
|
|
168
|
+
value: undefined
|
|
169
|
+
});
|
|
158
170
|
this.items = fields.items;
|
|
159
171
|
this.title = fields.title;
|
|
160
172
|
this.description = fields.description;
|
|
@@ -178,6 +190,41 @@ class OasArray extends OasBase_js_1.OasBase {
|
|
|
178
190
|
isRef() {
|
|
179
191
|
return false;
|
|
180
192
|
}
|
|
193
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
194
|
+
isReadOnly() {
|
|
195
|
+
return this.readOnly === true;
|
|
196
|
+
}
|
|
197
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
198
|
+
isWriteOnly() {
|
|
199
|
+
return this.writeOnly === true;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
203
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
204
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
205
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
206
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
207
|
+
*/
|
|
208
|
+
clone(ref) {
|
|
209
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
210
|
+
const copy = new OasArray({
|
|
211
|
+
...(0, siblings_js_1.toSiblingAnnotations)(this, ref),
|
|
212
|
+
example: (0, siblings_js_1.toSiblingValue)(ref?.example, siblings_js_1.isArrayValue) ?? this.example,
|
|
213
|
+
items: this.items,
|
|
214
|
+
nullable,
|
|
215
|
+
uniqueItems: ref?.uniqueItems ?? this.uniqueItems,
|
|
216
|
+
maxItems: ref?.maxItems ?? this.maxItems,
|
|
217
|
+
minItems: ref?.minItems ?? this.minItems,
|
|
218
|
+
enums: (0, siblings_js_1.toSiblingEnums)(ref?.enums, siblings_js_1.isArrayValue, nullable) ?? this.enums,
|
|
219
|
+
defaultValue: (0, siblings_js_1.toSiblingValue)(ref?.default, siblings_js_1.isArrayValue) ?? this.defaultValue,
|
|
220
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
221
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
222
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
223
|
+
});
|
|
224
|
+
copy.stackTrail = this.stackTrail;
|
|
225
|
+
copy.not = this.not;
|
|
226
|
+
return copy;
|
|
227
|
+
}
|
|
181
228
|
traverse(path) {
|
|
182
229
|
return (0, traverseSchema_js_1.traverseSchema)(this, path);
|
|
183
230
|
}
|
|
@@ -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.
|
|
@@ -3,16 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OasBoolean = void 0;
|
|
4
4
|
require("../../_dnt.polyfills.js");
|
|
5
5
|
const traverseSchema_js_1 = require("../schemaPath/traverseSchema.js");
|
|
6
|
+
const siblings_js_1 = require("../schema/siblings.js");
|
|
6
7
|
const OasBase_js_1 = require("../../types/OasBase.js");
|
|
7
8
|
class OasBoolean extends OasBase_js_1.OasBase {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new OasBoolean instance.
|
|
10
|
-
*
|
|
11
|
-
* @param fields - Boolean configuration fields including validation constraints and metadata
|
|
12
|
-
* @param context - Optional ParseContext. When passed and attribution is
|
|
13
|
-
* enabled, the current StackTrail is snapshotted onto the
|
|
14
|
-
* instance (via the {@link OasBase} base).
|
|
15
|
-
*/
|
|
16
9
|
constructor(fields = {}, context) {
|
|
17
10
|
super(context);
|
|
18
11
|
/**
|
|
@@ -116,6 +109,25 @@ class OasBoolean extends OasBase_js_1.OasBase {
|
|
|
116
109
|
writable: true,
|
|
117
110
|
value: void 0
|
|
118
111
|
});
|
|
112
|
+
/**
|
|
113
|
+
* Creates a new OasBoolean instance.
|
|
114
|
+
*
|
|
115
|
+
* @param fields - Boolean configuration fields including validation constraints and metadata
|
|
116
|
+
* @param context - Optional ParseContext. When passed and attribution is
|
|
117
|
+
* enabled, the current StackTrail is snapshotted onto the
|
|
118
|
+
* instance (via the {@link OasBase} base).
|
|
119
|
+
*/
|
|
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
|
+
Object.defineProperty(this, "not", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
configurable: true,
|
|
128
|
+
writable: true,
|
|
129
|
+
value: undefined
|
|
130
|
+
});
|
|
119
131
|
this.title = fields.title;
|
|
120
132
|
this.description = fields.description;
|
|
121
133
|
this.nullable = fields.nullable;
|
|
@@ -135,6 +147,37 @@ class OasBoolean extends OasBase_js_1.OasBase {
|
|
|
135
147
|
isRef() {
|
|
136
148
|
return false;
|
|
137
149
|
}
|
|
150
|
+
/** Whether the value is `readOnly`: sent by the API only, never in a request. */
|
|
151
|
+
isReadOnly() {
|
|
152
|
+
return this.readOnly === true;
|
|
153
|
+
}
|
|
154
|
+
/** Whether the value is `writeOnly`: sent in a request only, never by the API. */
|
|
155
|
+
isWriteOnly() {
|
|
156
|
+
return this.writeOnly === true;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* A copy of this schema with what `ref` adds at its site applied: its
|
|
160
|
+
* `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
|
|
161
|
+
* this type takes, a sibling's value winning. A value that does not fit
|
|
162
|
+
* this type is left out (the parser reports it). For `OasRef.resolve()`.
|
|
163
|
+
* This schema does not change, and the copy shares its child schemas.
|
|
164
|
+
*/
|
|
165
|
+
clone(ref) {
|
|
166
|
+
const nullable = this.nullable || ref?.nullable || undefined;
|
|
167
|
+
const copy = new OasBoolean({
|
|
168
|
+
...(0, siblings_js_1.toSiblingAnnotations)(this, ref),
|
|
169
|
+
example: (0, siblings_js_1.toSiblingValue)(ref?.example, siblings_js_1.isBooleanValue) ?? this.example,
|
|
170
|
+
nullable,
|
|
171
|
+
enums: (0, siblings_js_1.toSiblingEnums)(ref?.enums, siblings_js_1.isBooleanValue, nullable) ?? this.enums,
|
|
172
|
+
default: (0, siblings_js_1.toSiblingValue)(ref?.default, siblings_js_1.isBooleanValue) ?? this.default,
|
|
173
|
+
readOnly: this.readOnly || ref?.readOnly || undefined,
|
|
174
|
+
writeOnly: this.writeOnly || ref?.writeOnly || undefined,
|
|
175
|
+
deprecated: ref?.deprecated ?? this.deprecated,
|
|
176
|
+
});
|
|
177
|
+
copy.stackTrail = this.stackTrail;
|
|
178
|
+
copy.not = this.not;
|
|
179
|
+
return copy;
|
|
180
|
+
}
|
|
138
181
|
traverse(path) {
|
|
139
182
|
return (0, traverseSchema_js_1.traverseSchema)(this, path);
|
|
140
183
|
}
|
|
@@ -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;
|
|
@@ -65,6 +65,14 @@ class OasExample {
|
|
|
65
65
|
isRef() {
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
69
|
+
isReadOnly() {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
73
|
+
isWriteOnly() {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
/** Returns itself */
|
|
69
77
|
resolve() {
|
|
70
78
|
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;
|
|
@@ -102,6 +102,14 @@ class OasHeader {
|
|
|
102
102
|
isRef() {
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
|
+
/** Always `false`: `readOnly` is a schema keyword. */
|
|
106
|
+
isReadOnly() {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
/** Always `false`: `writeOnly` is a schema keyword. */
|
|
110
|
+
isWriteOnly() {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
105
113
|
/** Returns itself */
|
|
106
114
|
resolve() {
|
|
107
115
|
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>;
|