@kubb/agent 4.33.0 → 4.33.2
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +3554 -2113
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +5 -5
- package/.output/server/index.mjs +5 -5
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/index.js +17 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/constants.js +180 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/parse.js +1085 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/picomatch.js +341 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/scan.js +391 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/utils.js +72 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/package.json +83 -0
- package/.output/server/node_modules/@redocly/ajv/dist/2020.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +156 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +697 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +143 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +123 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +249 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +155 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +178 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +203 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +35 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +534 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +124 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +81 -0
- package/.output/server/node_modules/@redocly/ajv/dist/core.js +632 -0
- package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +56 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +107 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +132 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +139 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +92 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +8 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +84 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +25 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +86 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/package.json +130 -0
- package/.output/server/node_modules/@redocly/config/lib/common.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/config.js +17 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/entities.js +58 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/enum.js +6 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/shared.js +22 -0
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +54 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +186 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +283 -0
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +682 -0
- package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +88 -0
- package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +157 -0
- package/.output/server/node_modules/@redocly/config/lib/index.js +41 -0
- package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +43 -0
- package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +120 -0
- package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +518 -0
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +25 -0
- package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +558 -0
- package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +242 -0
- package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/index.js +21 -0
- package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +18 -0
- package/.output/server/node_modules/@redocly/config/package.json +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +85 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +257 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +74 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +310 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +335 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +338 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +51 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +98 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +88 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +116 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +79 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +365 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +49 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +171 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +123 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +56 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +109 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +326 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +106 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +52 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +139 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +53 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +269 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +22 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +215 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +78 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +37 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +145 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +62 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +150 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +93 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +130 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +83 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +33 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +82 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +190 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +12 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +172 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +482 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +1157 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +511 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +90 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +181 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +101 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +454 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +828 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +292 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +306 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +360 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +61 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +573 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +303 -0
- package/.output/server/node_modules/@redocly/openapi-core/package.json +74 -0
- package/.output/server/node_modules/ajv-formats/dist/formats.js +208 -0
- package/.output/server/node_modules/ajv-formats/dist/index.js +37 -0
- package/.output/server/node_modules/ajv-formats/dist/limit.js +69 -0
- package/.output/server/node_modules/ajv-formats/package.json +74 -0
- package/.output/server/node_modules/colorette/index.js +82 -0
- package/.output/server/node_modules/colorette/package.json +39 -0
- package/.output/server/node_modules/js-levenshtein/index.js +105 -0
- package/.output/server/node_modules/js-levenshtein/package.json +49 -0
- package/.output/server/node_modules/pluralize/package.json +40 -0
- package/.output/server/node_modules/pluralize/pluralize.js +503 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +45 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +644 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +40 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +1416 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +62 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +8 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +19 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +78 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +92 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +32 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +95 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +155 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +64 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +30 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +46 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +55 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +70 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +54 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/package.json +39 -0
- package/.output/server/package.json +9 -1
- package/package.json +18 -17
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/index.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/parse.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/picomatch.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/scan.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/utils.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/package.json +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const codegen_1 = require("../../compile/codegen");
|
|
4
|
+
const types_1 = require("../discriminator/types");
|
|
5
|
+
const compile_1 = require("../../compile");
|
|
6
|
+
const ref_error_1 = require("../../compile/ref_error");
|
|
7
|
+
const util_1 = require("../../compile/util");
|
|
8
|
+
const error = {
|
|
9
|
+
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
|
|
10
|
+
? `tag "${tagName}" must be string`
|
|
11
|
+
: `value of tag "${tagName}" must be in oneOf or anyOf`,
|
|
12
|
+
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
|
|
13
|
+
};
|
|
14
|
+
function getDiscriminatorPropertyFromAllOf(sch, tagName) {
|
|
15
|
+
var _a;
|
|
16
|
+
if (!sch.allOf || !Array.isArray(sch.allOf)) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
for (const subschema of sch.allOf) {
|
|
20
|
+
if ((_a = subschema === null || subschema === void 0 ? void 0 : subschema.properties) === null || _a === void 0 ? void 0 : _a[tagName]) {
|
|
21
|
+
return subschema.properties[tagName];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const def = {
|
|
27
|
+
keyword: "discriminator",
|
|
28
|
+
type: "object",
|
|
29
|
+
schemaType: "object",
|
|
30
|
+
error,
|
|
31
|
+
code(cxt) {
|
|
32
|
+
const { gen, data, schema, parentSchema, it } = cxt;
|
|
33
|
+
const keyword = parentSchema.oneOf ? "oneOf" : parentSchema.anyOf ? "anyOf" : undefined;
|
|
34
|
+
if (!it.opts.discriminator) {
|
|
35
|
+
throw new Error("discriminator: requires discriminator option");
|
|
36
|
+
}
|
|
37
|
+
const tagName = schema.propertyName;
|
|
38
|
+
if (typeof tagName != "string")
|
|
39
|
+
throw new Error("discriminator: requires propertyName");
|
|
40
|
+
if (!keyword)
|
|
41
|
+
throw new Error("discriminator: requires oneOf or anyOf composite keyword");
|
|
42
|
+
const parentSchemaVariants = parentSchema[keyword];
|
|
43
|
+
const valid = gen.let("valid", false);
|
|
44
|
+
const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
|
|
45
|
+
gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
|
|
46
|
+
cxt.ok(valid);
|
|
47
|
+
function validateMapping() {
|
|
48
|
+
const mapping = getMapping();
|
|
49
|
+
gen.if(false);
|
|
50
|
+
for (const tagValue in mapping) {
|
|
51
|
+
gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
|
|
52
|
+
gen.assign(valid, applyTagSchema(mapping[tagValue]));
|
|
53
|
+
}
|
|
54
|
+
gen.else();
|
|
55
|
+
cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
|
|
56
|
+
gen.endIf();
|
|
57
|
+
}
|
|
58
|
+
function applyTagSchema(schemaProp) {
|
|
59
|
+
const _valid = gen.name("valid");
|
|
60
|
+
const schCxt = cxt.subschema({ keyword, schemaProp }, _valid);
|
|
61
|
+
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
62
|
+
return _valid;
|
|
63
|
+
}
|
|
64
|
+
function getMapping() {
|
|
65
|
+
var _a;
|
|
66
|
+
const discriminatorMapping = {};
|
|
67
|
+
const topRequired = hasRequired(parentSchema);
|
|
68
|
+
let tagRequired = true;
|
|
69
|
+
for (let i = 0; i < parentSchemaVariants.length; i++) {
|
|
70
|
+
let sch = parentSchemaVariants[i];
|
|
71
|
+
const schRef = sch === null || sch === void 0 ? void 0 : sch.$ref;
|
|
72
|
+
if (schRef && schema.mapping) {
|
|
73
|
+
const { mapping } = schema;
|
|
74
|
+
const matchedKeys = Object.keys(mapping).filter((key) => mapping[key] === sch.$ref);
|
|
75
|
+
if (matchedKeys.length) {
|
|
76
|
+
for (const key of matchedKeys) {
|
|
77
|
+
addMapping(key, i);
|
|
78
|
+
}
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (schRef && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
83
|
+
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, schRef);
|
|
84
|
+
if (sch instanceof compile_1.SchemaEnv)
|
|
85
|
+
sch = sch.schema;
|
|
86
|
+
if (sch === undefined)
|
|
87
|
+
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, schRef);
|
|
88
|
+
}
|
|
89
|
+
let propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
|
|
90
|
+
if (!propSch && (sch === null || sch === void 0 ? void 0 : sch.allOf)) {
|
|
91
|
+
propSch = getDiscriminatorPropertyFromAllOf(sch, tagName);
|
|
92
|
+
}
|
|
93
|
+
if (typeof propSch != "object") {
|
|
94
|
+
throw new Error(`discriminator: ${keyword} subschemas (or referenced schemas) must have "properties/${tagName}" or match mapping`);
|
|
95
|
+
}
|
|
96
|
+
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
97
|
+
addMappings(propSch, i);
|
|
98
|
+
}
|
|
99
|
+
if (!tagRequired)
|
|
100
|
+
throw new Error(`discriminator: "${tagName}" must be required`);
|
|
101
|
+
return discriminatorMapping;
|
|
102
|
+
function hasRequired(sch) {
|
|
103
|
+
if (Array.isArray(sch.required) && sch.required.includes(tagName)) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
if (sch.allOf && Array.isArray(sch.allOf)) {
|
|
107
|
+
for (const subschema of sch.allOf) {
|
|
108
|
+
const subSch = subschema;
|
|
109
|
+
if (Array.isArray(subSch.required) && subSch.required.includes(tagName)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
function addMappings(sch, i) {
|
|
117
|
+
if (sch.const) {
|
|
118
|
+
addMapping(sch.const, i);
|
|
119
|
+
}
|
|
120
|
+
else if (sch.enum) {
|
|
121
|
+
for (const tagValue of sch.enum) {
|
|
122
|
+
addMapping(tagValue, i);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function addMapping(tagValue, i) {
|
|
130
|
+
if (typeof tagValue != "string" || tagValue in discriminatorMapping) {
|
|
131
|
+
throw new Error(`discriminator: "${tagName}" values must be unique strings`);
|
|
132
|
+
}
|
|
133
|
+
discriminatorMapping[tagValue] = i;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
exports.default = def;
|
|
139
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscrError = void 0;
|
|
4
|
+
var DiscrError;
|
|
5
|
+
(function (DiscrError) {
|
|
6
|
+
DiscrError["Tag"] = "tag";
|
|
7
|
+
DiscrError["Mapping"] = "mapping";
|
|
8
|
+
})(DiscrError || (exports.DiscrError = DiscrError = {}));
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("./core");
|
|
4
|
+
const validation_1 = require("./validation");
|
|
5
|
+
const applicator_1 = require("./applicator");
|
|
6
|
+
const dynamic_1 = require("./dynamic");
|
|
7
|
+
const next_1 = require("./next");
|
|
8
|
+
const unevaluated_1 = require("./unevaluated");
|
|
9
|
+
const format_1 = require("./format");
|
|
10
|
+
const metadata_1 = require("./metadata");
|
|
11
|
+
const draft2020Vocabularies = [
|
|
12
|
+
dynamic_1.default,
|
|
13
|
+
core_1.default,
|
|
14
|
+
validation_1.default,
|
|
15
|
+
(0, applicator_1.default)(true),
|
|
16
|
+
format_1.default,
|
|
17
|
+
metadata_1.metadataVocabulary,
|
|
18
|
+
metadata_1.contentVocabulary,
|
|
19
|
+
next_1.default,
|
|
20
|
+
unevaluated_1.default,
|
|
21
|
+
];
|
|
22
|
+
exports.default = draft2020Vocabularies;
|
|
23
|
+
//# sourceMappingURL=draft2020.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ref_1 = require("./core/ref");
|
|
4
|
+
const applicator_1 = require("./applicator");
|
|
5
|
+
const unevaluated_1 = require("./unevaluated");
|
|
6
|
+
const format_1 = require("./format");
|
|
7
|
+
const validation_1 = require("./validation");
|
|
8
|
+
const limitNumber_1 = require("./validation/draft04/limitNumber");
|
|
9
|
+
const limitNumberExclusive_1 = require("./validation/draft04/limitNumberExclusive");
|
|
10
|
+
const metadataVocabulary = ["title", "description", "default"];
|
|
11
|
+
const coreVocabulary = [
|
|
12
|
+
"$schema",
|
|
13
|
+
"id",
|
|
14
|
+
"$defs",
|
|
15
|
+
{ keyword: "$comment" },
|
|
16
|
+
"definitions",
|
|
17
|
+
ref_1.default,
|
|
18
|
+
];
|
|
19
|
+
const validation = [...validation_1.default.slice(1), limitNumber_1.default, limitNumberExclusive_1.default];
|
|
20
|
+
const draft4Vocabularies = [
|
|
21
|
+
coreVocabulary,
|
|
22
|
+
validation,
|
|
23
|
+
(0, applicator_1.default)(),
|
|
24
|
+
format_1.default,
|
|
25
|
+
metadataVocabulary,
|
|
26
|
+
unevaluated_1.default,
|
|
27
|
+
];
|
|
28
|
+
exports.default = draft4Vocabularies;
|
|
29
|
+
//# sourceMappingURL=draft4.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("./core");
|
|
4
|
+
const validation_1 = require("./validation");
|
|
5
|
+
const applicator_1 = require("./applicator");
|
|
6
|
+
const format_1 = require("./format");
|
|
7
|
+
const metadata_1 = require("./metadata");
|
|
8
|
+
const draft7Vocabularies = [
|
|
9
|
+
core_1.default,
|
|
10
|
+
validation_1.default,
|
|
11
|
+
(0, applicator_1.default)(),
|
|
12
|
+
format_1.default,
|
|
13
|
+
metadata_1.metadataVocabulary,
|
|
14
|
+
metadata_1.contentVocabulary,
|
|
15
|
+
];
|
|
16
|
+
exports.default = draft7Vocabularies;
|
|
17
|
+
//# sourceMappingURL=draft7.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamicAnchor = void 0;
|
|
4
|
+
const codegen_1 = require("../../compile/codegen");
|
|
5
|
+
const names_1 = require("../../compile/names");
|
|
6
|
+
const compile_1 = require("../../compile");
|
|
7
|
+
const ref_1 = require("../core/ref");
|
|
8
|
+
const def = {
|
|
9
|
+
keyword: "$dynamicAnchor",
|
|
10
|
+
schemaType: "string",
|
|
11
|
+
code: (cxt) => dynamicAnchor(cxt, cxt.schema),
|
|
12
|
+
};
|
|
13
|
+
function dynamicAnchor(cxt, anchor) {
|
|
14
|
+
const { gen, it } = cxt;
|
|
15
|
+
it.schemaEnv.root.dynamicAnchors[anchor] = true;
|
|
16
|
+
const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
|
|
17
|
+
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
|
|
18
|
+
gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate));
|
|
19
|
+
}
|
|
20
|
+
exports.dynamicAnchor = dynamicAnchor;
|
|
21
|
+
function _getValidate(cxt) {
|
|
22
|
+
const { schemaEnv, schema, self } = cxt.it;
|
|
23
|
+
const { root, baseId, localRefs, meta } = schemaEnv.root;
|
|
24
|
+
const { schemaId } = self.opts;
|
|
25
|
+
const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
|
|
26
|
+
compile_1.compileSchema.call(self, sch);
|
|
27
|
+
return (0, ref_1.getValidate)(cxt, sch);
|
|
28
|
+
}
|
|
29
|
+
exports.default = def;
|
|
30
|
+
//# sourceMappingURL=dynamicAnchor.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamicRef = void 0;
|
|
4
|
+
const codegen_1 = require("../../compile/codegen");
|
|
5
|
+
const names_1 = require("../../compile/names");
|
|
6
|
+
const ref_1 = require("../core/ref");
|
|
7
|
+
const def = {
|
|
8
|
+
keyword: "$dynamicRef",
|
|
9
|
+
schemaType: "string",
|
|
10
|
+
code: (cxt) => dynamicRef(cxt, cxt.schema),
|
|
11
|
+
};
|
|
12
|
+
function dynamicRef(cxt, ref) {
|
|
13
|
+
const { gen, keyword, it } = cxt;
|
|
14
|
+
if (ref[0] !== "#")
|
|
15
|
+
throw new Error(`"${keyword}" only supports hash fragment reference`);
|
|
16
|
+
const anchor = ref.slice(1);
|
|
17
|
+
if (it.allErrors) {
|
|
18
|
+
_dynamicRef();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const valid = gen.let("valid", false);
|
|
22
|
+
_dynamicRef(valid);
|
|
23
|
+
cxt.ok(valid);
|
|
24
|
+
}
|
|
25
|
+
function _dynamicRef(valid) {
|
|
26
|
+
// TODO the assumption here is that `recursiveRef: #` always points to the root
|
|
27
|
+
// of the schema object, which is not correct, because there may be $id that
|
|
28
|
+
// makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
|
|
29
|
+
// Because of that 2 tests in recursiveRef.json fail.
|
|
30
|
+
// This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
|
|
31
|
+
// (This problem is not tested in JSON-Schema-Test-Suite)
|
|
32
|
+
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
|
|
33
|
+
const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
|
|
34
|
+
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
_callRef(it.validateName, valid)();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _callRef(validate, valid) {
|
|
41
|
+
return valid
|
|
42
|
+
? () => gen.block(() => {
|
|
43
|
+
(0, ref_1.callRef)(cxt, validate);
|
|
44
|
+
gen.let(valid, true);
|
|
45
|
+
})
|
|
46
|
+
: () => (0, ref_1.callRef)(cxt, validate);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.dynamicRef = dynamicRef;
|
|
50
|
+
exports.default = def;
|
|
51
|
+
//# sourceMappingURL=dynamicRef.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dynamicAnchor_1 = require("./dynamicAnchor");
|
|
4
|
+
const dynamicRef_1 = require("./dynamicRef");
|
|
5
|
+
const recursiveAnchor_1 = require("./recursiveAnchor");
|
|
6
|
+
const recursiveRef_1 = require("./recursiveRef");
|
|
7
|
+
const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
|
|
8
|
+
exports.default = dynamic;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dynamicAnchor_1 = require("./dynamicAnchor");
|
|
4
|
+
const util_1 = require("../../compile/util");
|
|
5
|
+
const def = {
|
|
6
|
+
keyword: "$recursiveAnchor",
|
|
7
|
+
schemaType: "boolean",
|
|
8
|
+
code(cxt) {
|
|
9
|
+
if (cxt.schema)
|
|
10
|
+
(0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
|
|
11
|
+
else
|
|
12
|
+
(0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
exports.default = def;
|
|
16
|
+
//# sourceMappingURL=recursiveAnchor.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dynamicRef_1 = require("./dynamicRef");
|
|
4
|
+
const def = {
|
|
5
|
+
keyword: "$recursiveRef",
|
|
6
|
+
schemaType: "string",
|
|
7
|
+
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema),
|
|
8
|
+
};
|
|
9
|
+
exports.default = def;
|
|
10
|
+
//# sourceMappingURL=recursiveRef.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const codegen_1 = require("../../compile/codegen");
|
|
4
|
+
const error = {
|
|
5
|
+
message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`,
|
|
6
|
+
params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,
|
|
7
|
+
};
|
|
8
|
+
const def = {
|
|
9
|
+
keyword: "format",
|
|
10
|
+
type: ["number", "string"],
|
|
11
|
+
schemaType: "string",
|
|
12
|
+
$data: true,
|
|
13
|
+
error,
|
|
14
|
+
code(cxt, ruleType) {
|
|
15
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
16
|
+
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
17
|
+
if (!opts.validateFormats)
|
|
18
|
+
return;
|
|
19
|
+
if ($data)
|
|
20
|
+
validate$DataFormat();
|
|
21
|
+
else
|
|
22
|
+
validateFormat();
|
|
23
|
+
function validate$DataFormat() {
|
|
24
|
+
const fmts = gen.scopeValue("formats", {
|
|
25
|
+
ref: self.formats,
|
|
26
|
+
code: opts.code.formats,
|
|
27
|
+
});
|
|
28
|
+
const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`);
|
|
29
|
+
const fType = gen.let("fType");
|
|
30
|
+
const format = gen.let("format");
|
|
31
|
+
// TODO simplify
|
|
32
|
+
gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef));
|
|
33
|
+
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
34
|
+
function unknownFmt() {
|
|
35
|
+
if (opts.strictSchema === false)
|
|
36
|
+
return codegen_1.nil;
|
|
37
|
+
return (0, codegen_1._) `${schemaCode} && !${format}`;
|
|
38
|
+
}
|
|
39
|
+
function invalidFmt() {
|
|
40
|
+
const callFormat = schemaEnv.$async
|
|
41
|
+
? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
|
|
42
|
+
: (0, codegen_1._) `${format}(${data})`;
|
|
43
|
+
const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
44
|
+
return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function validateFormat() {
|
|
48
|
+
const formatDef = self.formats[schema];
|
|
49
|
+
if (!formatDef) {
|
|
50
|
+
unknownFormat();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (formatDef === true)
|
|
54
|
+
return;
|
|
55
|
+
const [fmtType, format, fmtRef] = getFormat(formatDef);
|
|
56
|
+
if (fmtType === ruleType)
|
|
57
|
+
cxt.pass(validCondition());
|
|
58
|
+
function unknownFormat() {
|
|
59
|
+
if (opts.strictSchema === false) {
|
|
60
|
+
self.logger.warn(unknownMsg());
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
throw new Error(unknownMsg());
|
|
64
|
+
function unknownMsg() {
|
|
65
|
+
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function getFormat(fmtDef) {
|
|
69
|
+
const code = fmtDef instanceof RegExp
|
|
70
|
+
? (0, codegen_1.regexpCode)(fmtDef)
|
|
71
|
+
: opts.code.formats
|
|
72
|
+
? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`
|
|
73
|
+
: undefined;
|
|
74
|
+
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
75
|
+
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
76
|
+
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];
|
|
77
|
+
}
|
|
78
|
+
return ["string", fmtDef, fmt];
|
|
79
|
+
}
|
|
80
|
+
function validCondition() {
|
|
81
|
+
if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
|
|
82
|
+
if (!schemaEnv.$async)
|
|
83
|
+
throw new Error("async format in sync schema");
|
|
84
|
+
return (0, codegen_1._) `await ${fmtRef}(${data})`;
|
|
85
|
+
}
|
|
86
|
+
return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
exports.default = def;
|
|
92
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contentVocabulary = exports.metadataVocabulary = void 0;
|
|
4
|
+
exports.metadataVocabulary = [
|
|
5
|
+
"title",
|
|
6
|
+
"description",
|
|
7
|
+
"default",
|
|
8
|
+
"deprecated",
|
|
9
|
+
/**
|
|
10
|
+
* readOnly/writeOnly are handled as validation keywords when OAS context is provided.
|
|
11
|
+
* Keeping them here would register them as annotation-only metadata and would
|
|
12
|
+
* prevent the context-aware validation behavior.
|
|
13
|
+
*
|
|
14
|
+
* @see ./validation/readOnly.ts
|
|
15
|
+
* @see ./validation/writeOnly.ts
|
|
16
|
+
*/
|
|
17
|
+
// "readOnly",
|
|
18
|
+
// "writeOnly",
|
|
19
|
+
"examples",
|
|
20
|
+
];
|
|
21
|
+
exports.contentVocabulary = [
|
|
22
|
+
"contentMediaType",
|
|
23
|
+
"contentEncoding",
|
|
24
|
+
"contentSchema",
|
|
25
|
+
];
|
|
26
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dependentRequired_1 = require("./validation/dependentRequired");
|
|
4
|
+
const dependentSchemas_1 = require("./applicator/dependentSchemas");
|
|
5
|
+
const limitContains_1 = require("./validation/limitContains");
|
|
6
|
+
const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
|
|
7
|
+
exports.default = next;
|
|
8
|
+
//# sourceMappingURL=next.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSkipCondition = void 0;
|
|
4
|
+
const codegen_1 = require("../compile/codegen");
|
|
5
|
+
const names_1 = require("../compile/names");
|
|
6
|
+
function getSkipCondition(schema, prop) {
|
|
7
|
+
var _a;
|
|
8
|
+
const propSchema = (_a = schema.properties) === null || _a === void 0 ? void 0 : _a[prop];
|
|
9
|
+
if (!propSchema)
|
|
10
|
+
return undefined;
|
|
11
|
+
const hasReadOnly = propSchema.readOnly === true;
|
|
12
|
+
const hasWriteOnly = propSchema.writeOnly === true;
|
|
13
|
+
if (!hasReadOnly && !hasWriteOnly)
|
|
14
|
+
return undefined;
|
|
15
|
+
const conditions = [];
|
|
16
|
+
const apiContext = (0, codegen_1._) `typeof ${names_1.default.this} == "object" && ${names_1.default.this} && ${names_1.default.this}.apiContext`;
|
|
17
|
+
if (hasReadOnly) {
|
|
18
|
+
conditions.push((0, codegen_1._) `${apiContext} === "request"`);
|
|
19
|
+
}
|
|
20
|
+
if (hasWriteOnly) {
|
|
21
|
+
conditions.push((0, codegen_1._) `${apiContext} === "response"`);
|
|
22
|
+
}
|
|
23
|
+
return (0, codegen_1.or)(...conditions);
|
|
24
|
+
}
|
|
25
|
+
exports.getSkipCondition = getSkipCondition;
|
|
26
|
+
//# sourceMappingURL=oasContext.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const unevaluatedProperties_1 = require("./unevaluatedProperties");
|
|
4
|
+
const unevaluatedItems_1 = require("./unevaluatedItems");
|
|
5
|
+
const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
|
|
6
|
+
exports.default = unevaluated;
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const codegen_1 = require("../../compile/codegen");
|
|
4
|
+
const util_1 = require("../../compile/util");
|
|
5
|
+
const error = {
|
|
6
|
+
message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
|
|
7
|
+
params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
|
|
8
|
+
};
|
|
9
|
+
const def = {
|
|
10
|
+
keyword: "unevaluatedItems",
|
|
11
|
+
type: "array",
|
|
12
|
+
schemaType: ["boolean", "object"],
|
|
13
|
+
error,
|
|
14
|
+
code(cxt) {
|
|
15
|
+
const { gen, schema, data, it } = cxt;
|
|
16
|
+
const items = it.items || 0;
|
|
17
|
+
if (items === true)
|
|
18
|
+
return;
|
|
19
|
+
const len = gen.const("len", (0, codegen_1._) `${data}.length`);
|
|
20
|
+
if (schema === false) {
|
|
21
|
+
cxt.setParams({ len: items });
|
|
22
|
+
cxt.fail((0, codegen_1._) `${len} > ${items}`);
|
|
23
|
+
}
|
|
24
|
+
else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
25
|
+
const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`);
|
|
26
|
+
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
|
|
27
|
+
cxt.ok(valid);
|
|
28
|
+
}
|
|
29
|
+
it.items = true;
|
|
30
|
+
function validateItems(valid, from) {
|
|
31
|
+
gen.forRange("i", from, len, (i) => {
|
|
32
|
+
cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
33
|
+
if (!it.allErrors)
|
|
34
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
exports.default = def;
|
|
40
|
+
//# sourceMappingURL=unevaluatedItems.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const codegen_1 = require("../../compile/codegen");
|
|
4
|
+
const util_1 = require("../../compile/util");
|
|
5
|
+
const names_1 = require("../../compile/names");
|
|
6
|
+
const error = {
|
|
7
|
+
message: "must NOT have unevaluated properties",
|
|
8
|
+
params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`,
|
|
9
|
+
};
|
|
10
|
+
const def = {
|
|
11
|
+
keyword: "unevaluatedProperties",
|
|
12
|
+
type: "object",
|
|
13
|
+
schemaType: ["boolean", "object"],
|
|
14
|
+
allowUndefined: true,
|
|
15
|
+
trackErrors: true,
|
|
16
|
+
error,
|
|
17
|
+
code(cxt) {
|
|
18
|
+
const { gen, schema = cxt.it.opts.defaultUnevaluatedProperties, data, errsCount, it } = cxt;
|
|
19
|
+
const isForced = cxt.schema === undefined && cxt.it.opts.defaultUnevaluatedProperties === false;
|
|
20
|
+
/* istanbul ignore if */
|
|
21
|
+
if (!errsCount)
|
|
22
|
+
throw new Error("ajv implementation error");
|
|
23
|
+
const { allErrors, props } = it;
|
|
24
|
+
if (props instanceof codegen_1.Name) {
|
|
25
|
+
gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
|
|
26
|
+
}
|
|
27
|
+
else if (props !== true) {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
29
|
+
const staticCheck = () => gen.forIn("key", data, (key) => props === undefined
|
|
30
|
+
? unevaluatedPropCode(key)
|
|
31
|
+
: gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
|
|
32
|
+
if (isForced && it.errorPath.emptyStr() && !it.compositeRule) {
|
|
33
|
+
// $refs are compiled into functions
|
|
34
|
+
// We need to check in runtime if function was called from allOf.
|
|
35
|
+
// We need to check only on the top level of the function:
|
|
36
|
+
// it is ensured with `it.errorPath.emptyStr()` check
|
|
37
|
+
gen.if((0, codegen_1._) `${names_1.default.isAllOfVariant} === 0`, staticCheck);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (!it.compositeRule || cxt.schema !== undefined) {
|
|
41
|
+
staticCheck();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!isForced) {
|
|
46
|
+
// disable shot-circut for forced unevaluatedProperties=false
|
|
47
|
+
// we may run or not the check in runtime so we can't short-circuit in compile-time
|
|
48
|
+
it.props = true;
|
|
49
|
+
}
|
|
50
|
+
cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
|
|
51
|
+
function unevaluatedPropCode(key) {
|
|
52
|
+
if (schema === false) {
|
|
53
|
+
cxt.setParams({ unevaluatedProperty: key });
|
|
54
|
+
cxt.error();
|
|
55
|
+
if (!allErrors)
|
|
56
|
+
gen.break();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
60
|
+
const valid = gen.name("valid");
|
|
61
|
+
cxt.subschema({
|
|
62
|
+
keyword: "unevaluatedProperties",
|
|
63
|
+
dataProp: key,
|
|
64
|
+
dataPropType: util_1.Type.Str,
|
|
65
|
+
}, valid);
|
|
66
|
+
if (!allErrors)
|
|
67
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function unevaluatedDynamic(evaluatedProps, key) {
|
|
71
|
+
return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`;
|
|
72
|
+
}
|
|
73
|
+
function unevaluatedStatic(evaluatedProps, key) {
|
|
74
|
+
const ps = [];
|
|
75
|
+
for (const p in evaluatedProps) {
|
|
76
|
+
if (evaluatedProps[p] === true)
|
|
77
|
+
ps.push((0, codegen_1._) `${key} !== ${p}`);
|
|
78
|
+
}
|
|
79
|
+
return (0, codegen_1.and)(...ps);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
exports.default = def;
|
|
84
|
+
//# sourceMappingURL=unevaluatedProperties.js.map
|