@kubb/agent 4.33.1 → 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 +18 -87
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- 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 +16 -16
- /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,303 @@
|
|
|
1
|
+
import { YamlParseError } from './errors/yaml-parse-error.js';
|
|
2
|
+
import { Location, isRef } from './ref-utils.js';
|
|
3
|
+
import { isNamedType, SpecExtension } from './types/index.js';
|
|
4
|
+
import { getOwn } from './utils/get-own.js';
|
|
5
|
+
import { isPlainObject } from './utils/is-plain-object.js';
|
|
6
|
+
import { makeRefId } from './utils/make-ref-id.js';
|
|
7
|
+
import { pushStack, popStack } from './utils/stack.js';
|
|
8
|
+
function collectParents(ctx) {
|
|
9
|
+
const parents = {};
|
|
10
|
+
while (ctx.parent) {
|
|
11
|
+
parents[ctx.parent.type.name] = ctx.parent.activatedOn?.value.node;
|
|
12
|
+
ctx = ctx.parent;
|
|
13
|
+
}
|
|
14
|
+
return parents;
|
|
15
|
+
}
|
|
16
|
+
function collectParentsLocations(ctx) {
|
|
17
|
+
const locations = {};
|
|
18
|
+
while (ctx.parent) {
|
|
19
|
+
if (ctx.parent.activatedOn?.value.location) {
|
|
20
|
+
locations[ctx.parent.type.name] = ctx.parent.activatedOn?.value.location;
|
|
21
|
+
}
|
|
22
|
+
ctx = ctx.parent;
|
|
23
|
+
}
|
|
24
|
+
return locations;
|
|
25
|
+
}
|
|
26
|
+
export function walkDocument(opts) {
|
|
27
|
+
const { document, rootType, normalizedVisitors, resolvedRefMap, ctx } = opts;
|
|
28
|
+
const seenNodesPerType = {};
|
|
29
|
+
const ignoredNodes = new Set();
|
|
30
|
+
walkNode(document.parsed, rootType, new Location(document.source, '#/'), undefined, '');
|
|
31
|
+
function walkNode(node, type, location, parent, key) {
|
|
32
|
+
const resolve = (ref, from = currentLocation.source.absoluteRef) => {
|
|
33
|
+
if (!isRef(ref))
|
|
34
|
+
return { location, node: ref };
|
|
35
|
+
const refId = makeRefId(from, ref.$ref);
|
|
36
|
+
const resolvedRef = resolvedRefMap.get(refId);
|
|
37
|
+
if (!resolvedRef) {
|
|
38
|
+
return {
|
|
39
|
+
location: undefined,
|
|
40
|
+
node: undefined,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const { resolved, node, document, nodePointer, error } = resolvedRef;
|
|
44
|
+
const newLocation = resolved
|
|
45
|
+
? new Location(document.source, nodePointer)
|
|
46
|
+
: error instanceof YamlParseError
|
|
47
|
+
? new Location(error.source, '')
|
|
48
|
+
: undefined;
|
|
49
|
+
return { location: newLocation, node, error };
|
|
50
|
+
};
|
|
51
|
+
const rawLocation = location;
|
|
52
|
+
let currentLocation = location;
|
|
53
|
+
const { node: resolvedNode, location: resolvedLocation, error } = resolve(node);
|
|
54
|
+
const enteredContexts = new Set();
|
|
55
|
+
if (isRef(node)) {
|
|
56
|
+
const refEnterVisitors = normalizedVisitors.ref.enter;
|
|
57
|
+
for (const { visit: visitor, ruleId, severity, message, context } of refEnterVisitors) {
|
|
58
|
+
enteredContexts.add(context);
|
|
59
|
+
const report = reportFn.bind(undefined, ruleId, severity, message);
|
|
60
|
+
visitor(node, {
|
|
61
|
+
report,
|
|
62
|
+
resolve,
|
|
63
|
+
rawNode: node,
|
|
64
|
+
rawLocation,
|
|
65
|
+
location,
|
|
66
|
+
type,
|
|
67
|
+
parent,
|
|
68
|
+
key,
|
|
69
|
+
parentLocations: {},
|
|
70
|
+
specVersion: ctx.specVersion,
|
|
71
|
+
config: ctx.config,
|
|
72
|
+
getVisitorData: getVisitorDataFn.bind(undefined, ruleId),
|
|
73
|
+
}, { node: resolvedNode, location: resolvedLocation, error });
|
|
74
|
+
if (resolvedLocation?.source.absoluteRef && ctx.refTypes) {
|
|
75
|
+
ctx.refTypes.set(resolvedLocation?.source.absoluteRef, type);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (resolvedNode !== undefined && resolvedLocation && type.name !== 'scalar') {
|
|
80
|
+
currentLocation = resolvedLocation;
|
|
81
|
+
const isNodeSeen = seenNodesPerType[type.name]?.has?.(resolvedNode);
|
|
82
|
+
let visitedBySome = false;
|
|
83
|
+
const anyEnterVisitors = normalizedVisitors.any.enter;
|
|
84
|
+
const currentEnterVisitors = anyEnterVisitors.concat(normalizedVisitors[type.name]?.enter || []);
|
|
85
|
+
const activatedContexts = [];
|
|
86
|
+
for (const { context, visit, skip, ruleId, severity, message } of currentEnterVisitors) {
|
|
87
|
+
if (ignoredNodes.has(`${currentLocation.absolutePointer}${currentLocation.pointer}`))
|
|
88
|
+
break;
|
|
89
|
+
if (context.isSkippedLevel) {
|
|
90
|
+
if (context.parent.activatedOn &&
|
|
91
|
+
!context.parent.activatedOn.value.nextLevelTypeActivated &&
|
|
92
|
+
!context.seen.has(node)) {
|
|
93
|
+
// TODO: test for walk through duplicated $ref-ed node
|
|
94
|
+
context.seen.add(node);
|
|
95
|
+
visitedBySome = true;
|
|
96
|
+
activatedContexts.push(context);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if ((context.parent && // if nested
|
|
101
|
+
context.parent.activatedOn &&
|
|
102
|
+
context.activatedOn?.value.withParentNode !== context.parent.activatedOn.value.node &&
|
|
103
|
+
// do not enter if visited by parent children (it works thanks because deeper visitors are sorted before)
|
|
104
|
+
context.parent.activatedOn.value.nextLevelTypeActivated?.value !== type) ||
|
|
105
|
+
(!context.parent && !isNodeSeen) // if top-level visit each node just once
|
|
106
|
+
) {
|
|
107
|
+
activatedContexts.push(context);
|
|
108
|
+
const activatedOn = {
|
|
109
|
+
node: resolvedNode,
|
|
110
|
+
location: resolvedLocation,
|
|
111
|
+
nextLevelTypeActivated: null,
|
|
112
|
+
withParentNode: context.parent?.activatedOn?.value.node,
|
|
113
|
+
skipped: (context.parent?.activatedOn?.value.skipped ||
|
|
114
|
+
skip?.(resolvedNode, key, {
|
|
115
|
+
location,
|
|
116
|
+
rawLocation,
|
|
117
|
+
resolve,
|
|
118
|
+
rawNode: node,
|
|
119
|
+
})) ??
|
|
120
|
+
false,
|
|
121
|
+
};
|
|
122
|
+
context.activatedOn = pushStack(context.activatedOn, activatedOn);
|
|
123
|
+
let ctx = context.parent;
|
|
124
|
+
while (ctx) {
|
|
125
|
+
ctx.activatedOn.value.nextLevelTypeActivated = pushStack(ctx.activatedOn.value.nextLevelTypeActivated, type);
|
|
126
|
+
ctx = ctx.parent;
|
|
127
|
+
}
|
|
128
|
+
if (!activatedOn.skipped) {
|
|
129
|
+
visitedBySome = true;
|
|
130
|
+
enteredContexts.add(context);
|
|
131
|
+
visitWithContext(visit, resolvedNode, node, context, ruleId, severity, message);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (visitedBySome || !isNodeSeen) {
|
|
137
|
+
seenNodesPerType[type.name] = seenNodesPerType[type.name] || new Set();
|
|
138
|
+
seenNodesPerType[type.name].add(resolvedNode);
|
|
139
|
+
if (Array.isArray(resolvedNode)) {
|
|
140
|
+
const itemsType = type.items;
|
|
141
|
+
if (itemsType !== undefined) {
|
|
142
|
+
const isTypeAFunction = typeof itemsType === 'function';
|
|
143
|
+
for (let i = 0; i < resolvedNode.length; i++) {
|
|
144
|
+
let itemType = isTypeAFunction
|
|
145
|
+
? itemsType(resolvedNode[i], resolvedLocation.child([i]).absolutePointer)
|
|
146
|
+
: itemsType;
|
|
147
|
+
let itemValue = resolvedNode[i];
|
|
148
|
+
if (itemType?.directResolveAs) {
|
|
149
|
+
itemType = itemType.directResolveAs;
|
|
150
|
+
itemValue = { $ref: itemValue };
|
|
151
|
+
}
|
|
152
|
+
if (isNamedType(itemType)) {
|
|
153
|
+
walkNode(itemValue, itemType, resolvedLocation.child([i]), resolvedNode, i);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else if (isPlainObject(resolvedNode)) {
|
|
159
|
+
// visit in order from type-tree first
|
|
160
|
+
const props = Object.keys(type.properties);
|
|
161
|
+
if (type.additionalProperties) {
|
|
162
|
+
props.push(...Object.keys(resolvedNode).filter((k) => !props.includes(k)));
|
|
163
|
+
}
|
|
164
|
+
else if (type.extensionsPrefix) {
|
|
165
|
+
props.push(...Object.keys(resolvedNode).filter((k) => k.startsWith(type.extensionsPrefix)));
|
|
166
|
+
}
|
|
167
|
+
if (isRef(node)) {
|
|
168
|
+
props.push(...Object.keys(node).filter((k) => k !== '$ref' && !props.includes(k))); // properties on the same level as $ref
|
|
169
|
+
}
|
|
170
|
+
for (const propName of props) {
|
|
171
|
+
let value = resolvedNode[propName];
|
|
172
|
+
let loc = resolvedLocation;
|
|
173
|
+
if (value === undefined) {
|
|
174
|
+
value = node[propName];
|
|
175
|
+
loc = location; // properties on the same level as $ref should resolve against original location, not target
|
|
176
|
+
}
|
|
177
|
+
let propType = getOwn(type.properties, propName);
|
|
178
|
+
if (propType === undefined)
|
|
179
|
+
propType = type.additionalProperties;
|
|
180
|
+
if (typeof propType === 'function')
|
|
181
|
+
propType = propType(value, propName);
|
|
182
|
+
if (propType === undefined &&
|
|
183
|
+
type.extensionsPrefix &&
|
|
184
|
+
propName.startsWith(type.extensionsPrefix)) {
|
|
185
|
+
propType = SpecExtension;
|
|
186
|
+
}
|
|
187
|
+
if (!isNamedType(propType) && propType?.directResolveAs) {
|
|
188
|
+
propType = propType.directResolveAs;
|
|
189
|
+
value = { $ref: value };
|
|
190
|
+
}
|
|
191
|
+
if (propType && propType.name === undefined && propType.resolvable !== false) {
|
|
192
|
+
propType = { name: 'scalar', properties: {} };
|
|
193
|
+
}
|
|
194
|
+
if (isRef(node[propName]) && propType?.name === 'scalar') {
|
|
195
|
+
walkNode(node[propName], propType, location.child([propName]), node, propName);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (!isNamedType(propType) || (propType.name === 'scalar' && !isRef(value))) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
walkNode(value, propType, loc.child([propName]), resolvedNode, propName);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const anyLeaveVisitors = normalizedVisitors.any.leave;
|
|
206
|
+
const currentLeaveVisitors = (normalizedVisitors[type.name]?.leave || []).concat(anyLeaveVisitors);
|
|
207
|
+
for (const context of activatedContexts.reverse()) {
|
|
208
|
+
if (context.isSkippedLevel) {
|
|
209
|
+
context.seen.delete(resolvedNode);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
context.activatedOn = popStack(context.activatedOn);
|
|
213
|
+
if (context.parent) {
|
|
214
|
+
let ctx = context.parent;
|
|
215
|
+
while (ctx) {
|
|
216
|
+
ctx.activatedOn.value.nextLevelTypeActivated = popStack(ctx.activatedOn.value.nextLevelTypeActivated);
|
|
217
|
+
ctx = ctx.parent;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
for (const { context, visit, ruleId, severity, message } of currentLeaveVisitors) {
|
|
223
|
+
if (!context.isSkippedLevel && enteredContexts.has(context)) {
|
|
224
|
+
visitWithContext(visit, resolvedNode, node, context, ruleId, severity, message);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
currentLocation = location;
|
|
229
|
+
if (isRef(node)) {
|
|
230
|
+
const refLeaveVisitors = normalizedVisitors.ref.leave;
|
|
231
|
+
for (const { visit: visitor, ruleId, severity, context, message } of refLeaveVisitors) {
|
|
232
|
+
if (enteredContexts.has(context)) {
|
|
233
|
+
const report = reportFn.bind(undefined, ruleId, severity, message);
|
|
234
|
+
visitor(node, {
|
|
235
|
+
report,
|
|
236
|
+
resolve,
|
|
237
|
+
rawNode: node,
|
|
238
|
+
rawLocation,
|
|
239
|
+
location,
|
|
240
|
+
type,
|
|
241
|
+
parent,
|
|
242
|
+
key,
|
|
243
|
+
parentLocations: {},
|
|
244
|
+
specVersion: ctx.specVersion,
|
|
245
|
+
config: ctx.config,
|
|
246
|
+
getVisitorData: getVisitorDataFn.bind(undefined, ruleId),
|
|
247
|
+
}, { node: resolvedNode, location: resolvedLocation, error });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// returns true ignores all the next visitors on the specific node
|
|
252
|
+
function visitWithContext(visit, resolvedNode, node, context, ruleId, severity, customMessage) {
|
|
253
|
+
const report = reportFn.bind(undefined, ruleId, severity, customMessage);
|
|
254
|
+
visit(resolvedNode, {
|
|
255
|
+
report,
|
|
256
|
+
resolve,
|
|
257
|
+
rawNode: node,
|
|
258
|
+
location: currentLocation,
|
|
259
|
+
rawLocation,
|
|
260
|
+
type,
|
|
261
|
+
parent,
|
|
262
|
+
key,
|
|
263
|
+
parentLocations: collectParentsLocations(context),
|
|
264
|
+
specVersion: ctx.specVersion,
|
|
265
|
+
config: ctx.config,
|
|
266
|
+
ignoreNextVisitorsOnNode: () => {
|
|
267
|
+
ignoredNodes.add(`${currentLocation.absolutePointer}${currentLocation.pointer}`);
|
|
268
|
+
},
|
|
269
|
+
getVisitorData: getVisitorDataFn.bind(undefined, ruleId),
|
|
270
|
+
}, collectParents(context), context);
|
|
271
|
+
}
|
|
272
|
+
function reportFn(ruleId, severity, customMessage, opts) {
|
|
273
|
+
const normalizedLocation = opts.location
|
|
274
|
+
? Array.isArray(opts.location)
|
|
275
|
+
? opts.location
|
|
276
|
+
: [opts.location]
|
|
277
|
+
: [{ ...currentLocation, reportOnKey: false }];
|
|
278
|
+
const location = normalizedLocation.map((l) => ({
|
|
279
|
+
...currentLocation,
|
|
280
|
+
reportOnKey: false,
|
|
281
|
+
...l,
|
|
282
|
+
}));
|
|
283
|
+
const ruleSeverity = opts.forceSeverity || severity;
|
|
284
|
+
if (ruleSeverity !== 'off') {
|
|
285
|
+
ctx.problems.push({
|
|
286
|
+
ruleId: opts.ruleId || ruleId,
|
|
287
|
+
severity: ruleSeverity,
|
|
288
|
+
...opts,
|
|
289
|
+
message: customMessage
|
|
290
|
+
? customMessage.replace('{{message}}', opts.message)
|
|
291
|
+
: opts.message,
|
|
292
|
+
suggest: opts.suggest || [],
|
|
293
|
+
location,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function getVisitorDataFn(ruleId) {
|
|
298
|
+
ctx.visitorsData[ruleId] = ctx.visitorsData[ruleId] || {};
|
|
299
|
+
return ctx.visitorsData[ruleId];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=walk.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@redocly/openapi-core",
|
|
3
|
+
"version": "2.20.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./lib/index.js",
|
|
10
|
+
"require": "./lib/index.js",
|
|
11
|
+
"types": "./lib/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./lib/bundle-oas": {
|
|
14
|
+
"import": "./lib/bundle/bundle-oas.js",
|
|
15
|
+
"require": "./lib/bundle/bundle-oas.js",
|
|
16
|
+
"types": "./lib/bundle/bundle-oas.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22.12.0 || >=20.19.0 <21.0.0",
|
|
21
|
+
"npm": ">=10"
|
|
22
|
+
},
|
|
23
|
+
"engineStrict": true,
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/Redocly/redocly-cli.git"
|
|
28
|
+
},
|
|
29
|
+
"browser": {
|
|
30
|
+
"fs": false,
|
|
31
|
+
"path": "path-browserify",
|
|
32
|
+
"os": false,
|
|
33
|
+
"node:fs": false,
|
|
34
|
+
"node:path": "path-browserify",
|
|
35
|
+
"node:os": false,
|
|
36
|
+
"node:url": false,
|
|
37
|
+
"node:module": false,
|
|
38
|
+
"colorette": false
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/Redocly/redocly-cli",
|
|
41
|
+
"keywords": [
|
|
42
|
+
"linter",
|
|
43
|
+
"OpenAPI",
|
|
44
|
+
"Swagger",
|
|
45
|
+
"OpenAPI linter",
|
|
46
|
+
"Swagger linter",
|
|
47
|
+
"AsyncAPI linter",
|
|
48
|
+
"Arazzo linter",
|
|
49
|
+
"oas"
|
|
50
|
+
],
|
|
51
|
+
"contributors": [
|
|
52
|
+
"Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@redocly/ajv": "^8.18.0",
|
|
56
|
+
"@redocly/config": "^0.44.0",
|
|
57
|
+
"ajv": "npm:@redocly/ajv@8.18.0",
|
|
58
|
+
"ajv-formats": "^3.0.1",
|
|
59
|
+
"colorette": "^1.2.0",
|
|
60
|
+
"js-levenshtein": "^1.1.6",
|
|
61
|
+
"js-yaml": "^4.1.0",
|
|
62
|
+
"picomatch": "^4.0.3",
|
|
63
|
+
"pluralize": "^8.0.0",
|
|
64
|
+
"yaml-ast-parser": "0.0.43"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/js-levenshtein": "^1.1.0",
|
|
68
|
+
"@types/js-yaml": "^4.0.3",
|
|
69
|
+
"@types/picomatch": "^4.0.2",
|
|
70
|
+
"@types/pluralize": "^0.0.29",
|
|
71
|
+
"json-schema-to-ts": "^3.1.0",
|
|
72
|
+
"typescript": "5.9.3"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
|
|
4
|
+
function fmtDef(validate, compare) {
|
|
5
|
+
return { validate, compare };
|
|
6
|
+
}
|
|
7
|
+
exports.fullFormats = {
|
|
8
|
+
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
9
|
+
date: fmtDef(date, compareDate),
|
|
10
|
+
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
11
|
+
time: fmtDef(getTime(true), compareTime),
|
|
12
|
+
"date-time": fmtDef(getDateTime(true), compareDateTime),
|
|
13
|
+
"iso-time": fmtDef(getTime(), compareIsoTime),
|
|
14
|
+
"iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
|
|
15
|
+
// duration: https://tools.ietf.org/html/rfc3339#appendix-A
|
|
16
|
+
duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
|
|
17
|
+
uri,
|
|
18
|
+
"uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
19
|
+
// uri-template: https://tools.ietf.org/html/rfc6570
|
|
20
|
+
"uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
|
|
21
|
+
// For the source: https://gist.github.com/dperini/729294
|
|
22
|
+
// For test cases: https://mathiasbynens.be/demo/url-regex
|
|
23
|
+
url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
|
|
24
|
+
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
25
|
+
hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
|
|
26
|
+
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
|
|
27
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
|
|
28
|
+
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
29
|
+
regex,
|
|
30
|
+
// uuid: http://tools.ietf.org/html/rfc4122
|
|
31
|
+
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
32
|
+
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
33
|
+
// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
|
|
34
|
+
"json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
|
|
35
|
+
"json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
|
|
36
|
+
// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
|
|
37
|
+
"relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
|
|
38
|
+
// the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
|
|
39
|
+
// byte: https://github.com/miguelmota/is-base64
|
|
40
|
+
byte,
|
|
41
|
+
// signed 32 bit integer
|
|
42
|
+
int32: { type: "number", validate: validateInt32 },
|
|
43
|
+
// signed 64 bit integer
|
|
44
|
+
int64: { type: "number", validate: validateInt64 },
|
|
45
|
+
// C-type float
|
|
46
|
+
float: { type: "number", validate: validateNumber },
|
|
47
|
+
// C-type double
|
|
48
|
+
double: { type: "number", validate: validateNumber },
|
|
49
|
+
// hint to the UI to hide input strings
|
|
50
|
+
password: true,
|
|
51
|
+
// unchecked string payload
|
|
52
|
+
binary: true,
|
|
53
|
+
};
|
|
54
|
+
exports.fastFormats = {
|
|
55
|
+
...exports.fullFormats,
|
|
56
|
+
date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
|
|
57
|
+
time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
|
|
58
|
+
"date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
|
|
59
|
+
"iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
|
|
60
|
+
"iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
|
|
61
|
+
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
|
62
|
+
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
63
|
+
"uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
64
|
+
// email (sources from jsen validator):
|
|
65
|
+
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
|
|
66
|
+
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
|
|
67
|
+
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
|
|
68
|
+
};
|
|
69
|
+
exports.formatNames = Object.keys(exports.fullFormats);
|
|
70
|
+
function isLeapYear(year) {
|
|
71
|
+
// https://tools.ietf.org/html/rfc3339#appendix-C
|
|
72
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
73
|
+
}
|
|
74
|
+
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
75
|
+
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
76
|
+
function date(str) {
|
|
77
|
+
// full-date from http://tools.ietf.org/html/rfc3339#section-5.6
|
|
78
|
+
const matches = DATE.exec(str);
|
|
79
|
+
if (!matches)
|
|
80
|
+
return false;
|
|
81
|
+
const year = +matches[1];
|
|
82
|
+
const month = +matches[2];
|
|
83
|
+
const day = +matches[3];
|
|
84
|
+
return (month >= 1 &&
|
|
85
|
+
month <= 12 &&
|
|
86
|
+
day >= 1 &&
|
|
87
|
+
day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]));
|
|
88
|
+
}
|
|
89
|
+
function compareDate(d1, d2) {
|
|
90
|
+
if (!(d1 && d2))
|
|
91
|
+
return undefined;
|
|
92
|
+
if (d1 > d2)
|
|
93
|
+
return 1;
|
|
94
|
+
if (d1 < d2)
|
|
95
|
+
return -1;
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
99
|
+
function getTime(strictTimeZone) {
|
|
100
|
+
return function time(str) {
|
|
101
|
+
const matches = TIME.exec(str);
|
|
102
|
+
if (!matches)
|
|
103
|
+
return false;
|
|
104
|
+
const hr = +matches[1];
|
|
105
|
+
const min = +matches[2];
|
|
106
|
+
const sec = +matches[3];
|
|
107
|
+
const tz = matches[4];
|
|
108
|
+
const tzSign = matches[5] === "-" ? -1 : 1;
|
|
109
|
+
const tzH = +(matches[6] || 0);
|
|
110
|
+
const tzM = +(matches[7] || 0);
|
|
111
|
+
if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz))
|
|
112
|
+
return false;
|
|
113
|
+
if (hr <= 23 && min <= 59 && sec < 60)
|
|
114
|
+
return true;
|
|
115
|
+
// leap second
|
|
116
|
+
const utcMin = min - tzM * tzSign;
|
|
117
|
+
const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
|
|
118
|
+
return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function compareTime(s1, s2) {
|
|
122
|
+
if (!(s1 && s2))
|
|
123
|
+
return undefined;
|
|
124
|
+
const t1 = new Date("2020-01-01T" + s1).valueOf();
|
|
125
|
+
const t2 = new Date("2020-01-01T" + s2).valueOf();
|
|
126
|
+
if (!(t1 && t2))
|
|
127
|
+
return undefined;
|
|
128
|
+
return t1 - t2;
|
|
129
|
+
}
|
|
130
|
+
function compareIsoTime(t1, t2) {
|
|
131
|
+
if (!(t1 && t2))
|
|
132
|
+
return undefined;
|
|
133
|
+
const a1 = TIME.exec(t1);
|
|
134
|
+
const a2 = TIME.exec(t2);
|
|
135
|
+
if (!(a1 && a2))
|
|
136
|
+
return undefined;
|
|
137
|
+
t1 = a1[1] + a1[2] + a1[3];
|
|
138
|
+
t2 = a2[1] + a2[2] + a2[3];
|
|
139
|
+
if (t1 > t2)
|
|
140
|
+
return 1;
|
|
141
|
+
if (t1 < t2)
|
|
142
|
+
return -1;
|
|
143
|
+
return 0;
|
|
144
|
+
}
|
|
145
|
+
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
146
|
+
function getDateTime(strictTimeZone) {
|
|
147
|
+
const time = getTime(strictTimeZone);
|
|
148
|
+
return function date_time(str) {
|
|
149
|
+
// http://tools.ietf.org/html/rfc3339#section-5.6
|
|
150
|
+
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
151
|
+
return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function compareDateTime(dt1, dt2) {
|
|
155
|
+
if (!(dt1 && dt2))
|
|
156
|
+
return undefined;
|
|
157
|
+
const d1 = new Date(dt1).valueOf();
|
|
158
|
+
const d2 = new Date(dt2).valueOf();
|
|
159
|
+
if (!(d1 && d2))
|
|
160
|
+
return undefined;
|
|
161
|
+
return d1 - d2;
|
|
162
|
+
}
|
|
163
|
+
function compareIsoDateTime(dt1, dt2) {
|
|
164
|
+
if (!(dt1 && dt2))
|
|
165
|
+
return undefined;
|
|
166
|
+
const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
|
|
167
|
+
const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
|
|
168
|
+
const res = compareDate(d1, d2);
|
|
169
|
+
if (res === undefined)
|
|
170
|
+
return undefined;
|
|
171
|
+
return res || compareTime(t1, t2);
|
|
172
|
+
}
|
|
173
|
+
const NOT_URI_FRAGMENT = /\/|:/;
|
|
174
|
+
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
175
|
+
function uri(str) {
|
|
176
|
+
// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
|
|
177
|
+
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
178
|
+
}
|
|
179
|
+
const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
180
|
+
function byte(str) {
|
|
181
|
+
BYTE.lastIndex = 0;
|
|
182
|
+
return BYTE.test(str);
|
|
183
|
+
}
|
|
184
|
+
const MIN_INT32 = -(2 ** 31);
|
|
185
|
+
const MAX_INT32 = 2 ** 31 - 1;
|
|
186
|
+
function validateInt32(value) {
|
|
187
|
+
return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
|
|
188
|
+
}
|
|
189
|
+
function validateInt64(value) {
|
|
190
|
+
// JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64
|
|
191
|
+
return Number.isInteger(value);
|
|
192
|
+
}
|
|
193
|
+
function validateNumber() {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
const Z_ANCHOR = /[^\\]\\Z/;
|
|
197
|
+
function regex(str) {
|
|
198
|
+
if (Z_ANCHOR.test(str))
|
|
199
|
+
return false;
|
|
200
|
+
try {
|
|
201
|
+
new RegExp(str);
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
catch (e) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=formats.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const formats_1 = require("./formats");
|
|
4
|
+
const limit_1 = require("./limit");
|
|
5
|
+
const codegen_1 = require("ajv/dist/compile/codegen");
|
|
6
|
+
const fullName = new codegen_1.Name("fullFormats");
|
|
7
|
+
const fastName = new codegen_1.Name("fastFormats");
|
|
8
|
+
const formatsPlugin = (ajv, opts = { keywords: true }) => {
|
|
9
|
+
if (Array.isArray(opts)) {
|
|
10
|
+
addFormats(ajv, opts, formats_1.fullFormats, fullName);
|
|
11
|
+
return ajv;
|
|
12
|
+
}
|
|
13
|
+
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
14
|
+
const list = opts.formats || formats_1.formatNames;
|
|
15
|
+
addFormats(ajv, list, formats, exportName);
|
|
16
|
+
if (opts.keywords)
|
|
17
|
+
(0, limit_1.default)(ajv);
|
|
18
|
+
return ajv;
|
|
19
|
+
};
|
|
20
|
+
formatsPlugin.get = (name, mode = "full") => {
|
|
21
|
+
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
|
|
22
|
+
const f = formats[name];
|
|
23
|
+
if (!f)
|
|
24
|
+
throw new Error(`Unknown format "${name}"`);
|
|
25
|
+
return f;
|
|
26
|
+
};
|
|
27
|
+
function addFormats(ajv, list, fs, exportName) {
|
|
28
|
+
var _a;
|
|
29
|
+
var _b;
|
|
30
|
+
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = (0, codegen_1._) `require("ajv-formats/dist/formats").${exportName}`);
|
|
31
|
+
for (const f of list)
|
|
32
|
+
ajv.addFormat(f, fs[f]);
|
|
33
|
+
}
|
|
34
|
+
module.exports = exports = formatsPlugin;
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = formatsPlugin;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|