@depup/redocly__openapi-core 2.22.1-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/changes.json +14 -0
- package/lib/bundle/bundle-document.d.ts +33 -0
- package/lib/bundle/bundle-document.d.ts.map +1 -0
- package/lib/bundle/bundle-document.js +85 -0
- package/lib/bundle/bundle-document.js.map +1 -0
- package/lib/bundle/bundle-oas.d.ts +15 -0
- package/lib/bundle/bundle-oas.d.ts.map +1 -0
- package/lib/bundle/bundle-oas.js +55 -0
- package/lib/bundle/bundle-oas.js.map +1 -0
- package/lib/bundle/bundle-visitor.d.ts +15 -0
- package/lib/bundle/bundle-visitor.d.ts.map +1 -0
- package/lib/bundle/bundle-visitor.js +257 -0
- package/lib/bundle/bundle-visitor.js.map +1 -0
- package/lib/bundle/bundle.d.ts +26 -0
- package/lib/bundle/bundle.d.ts.map +1 -0
- package/lib/bundle/bundle.js +74 -0
- package/lib/bundle/bundle.js.map +1 -0
- package/lib/config/all.d.ts +4 -0
- package/lib/config/all.d.ts.map +1 -0
- package/lib/config/all.js +310 -0
- package/lib/config/all.js.map +1 -0
- package/lib/config/builtIn.d.ts +4 -0
- package/lib/config/builtIn.d.ts.map +1 -0
- package/lib/config/builtIn.js +58 -0
- package/lib/config/builtIn.js.map +1 -0
- package/lib/config/bundle-extends.d.ts +8 -0
- package/lib/config/bundle-extends.d.ts.map +1 -0
- package/lib/config/bundle-extends.js +27 -0
- package/lib/config/bundle-extends.js.map +1 -0
- package/lib/config/config-resolvers.d.ts +23 -0
- package/lib/config/config-resolvers.d.ts.map +1 -0
- package/lib/config/config-resolvers.js +335 -0
- package/lib/config/config-resolvers.js.map +1 -0
- package/lib/config/config.d.ts +47 -0
- package/lib/config/config.d.ts.map +1 -0
- package/lib/config/config.js +338 -0
- package/lib/config/config.js.map +1 -0
- package/lib/config/constants.d.ts +10 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +13 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/get-resolve-config.d.ts +3 -0
- package/lib/config/get-resolve-config.d.ts.map +1 -0
- package/lib/config/get-resolve-config.js +9 -0
- package/lib/config/get-resolve-config.js.map +1 -0
- package/lib/config/group-assertion-rules.d.ts +3 -0
- package/lib/config/group-assertion-rules.d.ts.map +1 -0
- package/lib/config/group-assertion-rules.js +51 -0
- package/lib/config/group-assertion-rules.js.map +1 -0
- package/lib/config/index.d.ts +8 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/index.js +8 -0
- package/lib/config/index.js.map +1 -0
- package/lib/config/load.d.ts +19 -0
- package/lib/config/load.d.ts.map +1 -0
- package/lib/config/load.js +98 -0
- package/lib/config/load.js.map +1 -0
- package/lib/config/minimal.d.ts +4 -0
- package/lib/config/minimal.d.ts.map +1 -0
- package/lib/config/minimal.js +289 -0
- package/lib/config/minimal.js.map +1 -0
- package/lib/config/recommended-strict.d.ts +4 -0
- package/lib/config/recommended-strict.d.ts.map +1 -0
- package/lib/config/recommended-strict.js +289 -0
- package/lib/config/recommended-strict.js.map +1 -0
- package/lib/config/recommended.d.ts +4 -0
- package/lib/config/recommended.d.ts.map +1 -0
- package/lib/config/recommended.js +289 -0
- package/lib/config/recommended.js.map +1 -0
- package/lib/config/rules.d.ts +11 -0
- package/lib/config/rules.d.ts.map +1 -0
- package/lib/config/rules.js +35 -0
- package/lib/config/rules.js.map +1 -0
- package/lib/config/spec.d.ts +4 -0
- package/lib/config/spec.d.ts.map +1 -0
- package/lib/config/spec.js +289 -0
- package/lib/config/spec.js.map +1 -0
- package/lib/config/types.d.ts +158 -0
- package/lib/config/types.d.ts.map +1 -0
- package/lib/config/types.js +2 -0
- package/lib/config/types.js.map +1 -0
- package/lib/config/utils.d.ts +14 -0
- package/lib/config/utils.d.ts.map +1 -0
- package/lib/config/utils.js +129 -0
- package/lib/config/utils.js.map +1 -0
- package/lib/config/visitors.d.ts +50 -0
- package/lib/config/visitors.d.ts.map +1 -0
- package/lib/config/visitors.js +99 -0
- package/lib/config/visitors.js.map +1 -0
- package/lib/decorators/arazzo/index.d.ts +2 -0
- package/lib/decorators/arazzo/index.d.ts.map +1 -0
- package/lib/decorators/arazzo/index.js +2 -0
- package/lib/decorators/arazzo/index.js.map +1 -0
- package/lib/decorators/async2/index.d.ts +2 -0
- package/lib/decorators/async2/index.d.ts.map +1 -0
- package/lib/decorators/async2/index.js +2 -0
- package/lib/decorators/async2/index.js.map +1 -0
- package/lib/decorators/async3/index.d.ts +2 -0
- package/lib/decorators/async3/index.d.ts.map +1 -0
- package/lib/decorators/async3/index.js +2 -0
- package/lib/decorators/async3/index.js.map +1 -0
- package/lib/decorators/common/filters/filter-helper.d.ts +4 -0
- package/lib/decorators/common/filters/filter-helper.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-helper.js +65 -0
- package/lib/decorators/common/filters/filter-helper.js.map +1 -0
- package/lib/decorators/common/filters/filter-in.d.ts +3 -0
- package/lib/decorators/common/filters/filter-in.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-in.js +67 -0
- package/lib/decorators/common/filters/filter-in.js.map +1 -0
- package/lib/decorators/common/filters/filter-out.d.ts +3 -0
- package/lib/decorators/common/filters/filter-out.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-out.js +67 -0
- package/lib/decorators/common/filters/filter-out.js.map +1 -0
- package/lib/decorators/common/info-description-override.d.ts +3 -0
- package/lib/decorators/common/info-description-override.d.ts.map +1 -0
- package/lib/decorators/common/info-description-override.js +21 -0
- package/lib/decorators/common/info-description-override.js.map +1 -0
- package/lib/decorators/common/info-override.d.ts +3 -0
- package/lib/decorators/common/info-override.d.ts.map +1 -0
- package/lib/decorators/common/info-override.js +14 -0
- package/lib/decorators/common/info-override.js.map +1 -0
- package/lib/decorators/common/media-type-examples-override.d.ts +3 -0
- package/lib/decorators/common/media-type-examples-override.d.ts.map +1 -0
- package/lib/decorators/common/media-type-examples-override.js +58 -0
- package/lib/decorators/common/media-type-examples-override.js.map +1 -0
- package/lib/decorators/common/operation-description-override.d.ts +3 -0
- package/lib/decorators/common/operation-description-override.d.ts.map +1 -0
- package/lib/decorators/common/operation-description-override.js +27 -0
- package/lib/decorators/common/operation-description-override.js.map +1 -0
- package/lib/decorators/common/remove-x-internal.d.ts +3 -0
- package/lib/decorators/common/remove-x-internal.d.ts.map +1 -0
- package/lib/decorators/common/remove-x-internal.js +68 -0
- package/lib/decorators/common/remove-x-internal.js.map +1 -0
- package/lib/decorators/common/tag-description-override.d.ts +3 -0
- package/lib/decorators/common/tag-description-override.d.ts.map +1 -0
- package/lib/decorators/common/tag-description-override.js +23 -0
- package/lib/decorators/common/tag-description-override.js.map +1 -0
- package/lib/decorators/oas2/index.d.ts +12 -0
- package/lib/decorators/oas2/index.d.ts.map +1 -0
- package/lib/decorators/oas2/index.js +19 -0
- package/lib/decorators/oas2/index.js.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.d.ts +3 -0
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.js +88 -0
- package/lib/decorators/oas2/remove-unused-components.js.map +1 -0
- package/lib/decorators/oas3/index.d.ts +13 -0
- package/lib/decorators/oas3/index.d.ts.map +1 -0
- package/lib/decorators/oas3/index.js +21 -0
- package/lib/decorators/oas3/index.js.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts +3 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.js +116 -0
- package/lib/decorators/oas3/remove-unused-components.js.map +1 -0
- package/lib/decorators/openrpc/index.d.ts +2 -0
- package/lib/decorators/openrpc/index.d.ts.map +1 -0
- package/lib/decorators/openrpc/index.js +2 -0
- package/lib/decorators/openrpc/index.js.map +1 -0
- package/lib/decorators/overlay1/index.d.ts +2 -0
- package/lib/decorators/overlay1/index.d.ts.map +1 -0
- package/lib/decorators/overlay1/index.js +2 -0
- package/lib/decorators/overlay1/index.js.map +1 -0
- package/lib/detect-spec.d.ts +5 -0
- package/lib/detect-spec.d.ts.map +1 -0
- package/lib/detect-spec.js +79 -0
- package/lib/detect-spec.js.map +1 -0
- package/lib/env.d.ts +3 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +5 -0
- package/lib/env.js.map +1 -0
- package/lib/errors/yaml-parse-error.d.ts +9 -0
- package/lib/errors/yaml-parse-error.d.ts.map +1 -0
- package/lib/errors/yaml-parse-error.js +14 -0
- package/lib/errors/yaml-parse-error.js.map +1 -0
- package/lib/format/codeframes.d.ts +23 -0
- package/lib/format/codeframes.d.ts.map +1 -0
- package/lib/format/codeframes.js +177 -0
- package/lib/format/codeframes.js.map +1 -0
- package/lib/format/format.d.ts +23 -0
- package/lib/format/format.d.ts.map +1 -0
- package/lib/format/format.js +365 -0
- package/lib/format/format.js.map +1 -0
- package/lib/index.d.ts +58 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +49 -0
- package/lib/index.js.map +1 -0
- package/lib/js-yaml/index.d.ts +4 -0
- package/lib/js-yaml/index.d.ts.map +1 -0
- package/lib/js-yaml/index.js +11 -0
- package/lib/js-yaml/index.js.map +1 -0
- package/lib/lint-entity.d.ts +24 -0
- package/lib/lint-entity.d.ts.map +1 -0
- package/lib/lint-entity.js +171 -0
- package/lib/lint-entity.js.map +1 -0
- package/lib/lint.d.ts +31 -0
- package/lib/lint.d.ts.map +1 -0
- package/lib/lint.js +123 -0
- package/lib/lint.js.map +1 -0
- package/lib/logger.d.ts +26 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +56 -0
- package/lib/logger.js.map +1 -0
- package/lib/oas-types.d.ts +877 -0
- package/lib/oas-types.d.ts.map +1 -0
- package/lib/oas-types.js +35 -0
- package/lib/oas-types.js.map +1 -0
- package/lib/ref-utils.d.ts +32 -0
- package/lib/ref-utils.d.ts.map +1 -0
- package/lib/ref-utils.js +109 -0
- package/lib/ref-utils.js.map +1 -0
- package/lib/resolve.d.ts +57 -0
- package/lib/resolve.d.ts.map +1 -0
- package/lib/resolve.js +326 -0
- package/lib/resolve.js.map +1 -0
- package/lib/rules/ajv.d.ts +20 -0
- package/lib/rules/ajv.d.ts.map +1 -0
- package/lib/rules/ajv.js +106 -0
- package/lib/rules/ajv.js.map +1 -0
- package/lib/rules/arazzo/criteria-unique.d.ts +3 -0
- package/lib/rules/arazzo/criteria-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/criteria-unique.js +68 -0
- package/lib/rules/arazzo/criteria-unique.js.map +1 -0
- package/lib/rules/arazzo/index.d.ts +4 -0
- package/lib/rules/arazzo/index.d.ts.map +1 -0
- package/lib/rules/arazzo/index.js +52 -0
- package/lib/rules/arazzo/index.js.map +1 -0
- package/lib/rules/arazzo/outputs-defined.d.ts +3 -0
- package/lib/rules/arazzo/outputs-defined.d.ts.map +1 -0
- package/lib/rules/arazzo/outputs-defined.js +139 -0
- package/lib/rules/arazzo/outputs-defined.js.map +1 -0
- package/lib/rules/arazzo/parameters-unique.d.ts +3 -0
- package/lib/rules/arazzo/parameters-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/parameters-unique.js +27 -0
- package/lib/rules/arazzo/parameters-unique.js.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +3 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js +30 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.d.ts +3 -0
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.js +19 -0
- package/lib/rules/arazzo/sourceDescription-type.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +3 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +21 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +3 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +15 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +3 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.js +27 -0
- package/lib/rules/arazzo/step-onFailure-unique.js.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +3 -0
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js +27 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +1 -0
- package/lib/rules/arazzo/stepId-unique.d.ts +3 -0
- package/lib/rules/arazzo/stepId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/stepId-unique.js +23 -0
- package/lib/rules/arazzo/stepId-unique.js.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +3 -0
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.js +53 -0
- package/lib/rules/arazzo/workflow-dependsOn.js.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.d.ts +3 -0
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.js +19 -0
- package/lib/rules/arazzo/workflowId-unique.js.map +1 -0
- package/lib/rules/async2/channels-kebab-case.d.ts +3 -0
- package/lib/rules/async2/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async2/channels-kebab-case.js +16 -0
- package/lib/rules/async2/channels-kebab-case.js.map +1 -0
- package/lib/rules/async2/index.d.ts +4 -0
- package/lib/rules/async2/index.d.ts.map +1 -0
- package/lib/rules/async2/index.js +32 -0
- package/lib/rules/async2/index.js.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +3 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.js +13 -0
- package/lib/rules/async2/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/async3/channels-kebab-case.d.ts +3 -0
- package/lib/rules/async3/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async3/channels-kebab-case.js +16 -0
- package/lib/rules/async3/channels-kebab-case.js.map +1 -0
- package/lib/rules/async3/index.d.ts +4 -0
- package/lib/rules/async3/index.d.ts.map +1 -0
- package/lib/rules/async3/index.js +32 -0
- package/lib/rules/async3/index.js.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +3 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.js +13 -0
- package/lib/rules/async3/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/catalog-entity/entity-key-valid.d.ts +3 -0
- package/lib/rules/catalog-entity/entity-key-valid.d.ts.map +1 -0
- package/lib/rules/catalog-entity/entity-key-valid.js +39 -0
- package/lib/rules/catalog-entity/entity-key-valid.js.map +1 -0
- package/lib/rules/common/assertions/asserts.d.ts +30 -0
- package/lib/rules/common/assertions/asserts.d.ts.map +1 -0
- package/lib/rules/common/assertions/asserts.js +272 -0
- package/lib/rules/common/assertions/asserts.js.map +1 -0
- package/lib/rules/common/assertions/index.d.ts +28 -0
- package/lib/rules/common/assertions/index.d.ts.map +1 -0
- package/lib/rules/common/assertions/index.js +22 -0
- package/lib/rules/common/assertions/index.js.map +1 -0
- package/lib/rules/common/assertions/utils.d.ts +21 -0
- package/lib/rules/common/assertions/utils.d.ts.map +1 -0
- package/lib/rules/common/assertions/utils.js +215 -0
- package/lib/rules/common/assertions/utils.js.map +1 -0
- package/lib/rules/common/info-contact.d.ts +3 -0
- package/lib/rules/common/info-contact.d.ts.map +1 -0
- package/lib/rules/common/info-contact.js +14 -0
- package/lib/rules/common/info-contact.js.map +1 -0
- package/lib/rules/common/info-license-strict.d.ts +3 -0
- package/lib/rules/common/info-license-strict.d.ts.map +1 -0
- package/lib/rules/common/info-license-strict.js +23 -0
- package/lib/rules/common/info-license-strict.js.map +1 -0
- package/lib/rules/common/info-license.d.ts +3 -0
- package/lib/rules/common/info-license.d.ts.map +1 -0
- package/lib/rules/common/info-license.js +14 -0
- package/lib/rules/common/info-license.js.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.d.ts +3 -0
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.js +42 -0
- package/lib/rules/common/no-ambiguous-paths.js.map +1 -0
- package/lib/rules/common/no-duplicated-tag-names.d.ts +3 -0
- package/lib/rules/common/no-duplicated-tag-names.d.ts.map +1 -0
- package/lib/rules/common/no-duplicated-tag-names.js +21 -0
- package/lib/rules/common/no-duplicated-tag-names.js.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.d.ts +3 -0
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.js +38 -0
- package/lib/rules/common/no-enum-type-mismatch.js.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +3 -0
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.js +31 -0
- package/lib/rules/common/no-http-verbs-in-paths.js.map +1 -0
- package/lib/rules/common/no-identical-paths.d.ts +3 -0
- package/lib/rules/common/no-identical-paths.d.ts.map +1 -0
- package/lib/rules/common/no-identical-paths.js +21 -0
- package/lib/rules/common/no-identical-paths.js.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +2 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.js +32 -0
- package/lib/rules/common/no-invalid-parameter-examples.js.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.d.ts +3 -0
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.js +34 -0
- package/lib/rules/common/no-invalid-schema-examples.js.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.d.ts +3 -0
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.js +13 -0
- package/lib/rules/common/no-path-trailing-slash.js.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +3 -0
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js +78 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts +3 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.js +19 -0
- package/lib/rules/common/no-schema-type-mismatch.js.map +1 -0
- package/lib/rules/common/no-unresolved-refs.d.ts +6 -0
- package/lib/rules/common/no-unresolved-refs.d.ts.map +1 -0
- package/lib/rules/common/no-unresolved-refs.js +42 -0
- package/lib/rules/common/no-unresolved-refs.js.map +1 -0
- package/lib/rules/common/operation-2xx-response.d.ts +3 -0
- package/lib/rules/common/operation-2xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-2xx-response.js +20 -0
- package/lib/rules/common/operation-2xx-response.js.map +1 -0
- package/lib/rules/common/operation-4xx-response.d.ts +3 -0
- package/lib/rules/common/operation-4xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-4xx-response.js +20 -0
- package/lib/rules/common/operation-4xx-response.js.map +1 -0
- package/lib/rules/common/operation-description.d.ts +3 -0
- package/lib/rules/common/operation-description.d.ts.map +1 -0
- package/lib/rules/common/operation-description.js +9 -0
- package/lib/rules/common/operation-description.js.map +1 -0
- package/lib/rules/common/operation-operationId-unique.d.ts +3 -0
- package/lib/rules/common/operation-operationId-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-unique.js +17 -0
- package/lib/rules/common/operation-operationId-unique.js.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.d.ts +3 -0
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.js +15 -0
- package/lib/rules/common/operation-operationId-url-safe.js.map +1 -0
- package/lib/rules/common/operation-operationId.d.ts +3 -0
- package/lib/rules/common/operation-operationId.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId.js +13 -0
- package/lib/rules/common/operation-operationId.js.map +1 -0
- package/lib/rules/common/operation-parameters-unique.d.ts +3 -0
- package/lib/rules/common/operation-parameters-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-parameters-unique.js +37 -0
- package/lib/rules/common/operation-parameters-unique.js.map +1 -0
- package/lib/rules/common/operation-singular-tag.d.ts +3 -0
- package/lib/rules/common/operation-singular-tag.d.ts.map +1 -0
- package/lib/rules/common/operation-singular-tag.js +13 -0
- package/lib/rules/common/operation-singular-tag.js.map +1 -0
- package/lib/rules/common/operation-summary.d.ts +3 -0
- package/lib/rules/common/operation-summary.d.ts.map +1 -0
- package/lib/rules/common/operation-summary.js +9 -0
- package/lib/rules/common/operation-summary.js.map +1 -0
- package/lib/rules/common/operation-tag-defined.d.ts +3 -0
- package/lib/rules/common/operation-tag-defined.d.ts.map +1 -0
- package/lib/rules/common/operation-tag-defined.js +27 -0
- package/lib/rules/common/operation-tag-defined.js.map +1 -0
- package/lib/rules/common/parameter-description.d.ts +3 -0
- package/lib/rules/common/parameter-description.d.ts.map +1 -0
- package/lib/rules/common/parameter-description.js +19 -0
- package/lib/rules/common/parameter-description.js.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.d.ts +3 -0
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.js +13 -0
- package/lib/rules/common/path-declaration-must-exist.js.map +1 -0
- package/lib/rules/common/path-http-verbs-order.d.ts +3 -0
- package/lib/rules/common/path-http-verbs-order.d.ts.map +1 -0
- package/lib/rules/common/path-http-verbs-order.js +23 -0
- package/lib/rules/common/path-http-verbs-order.js.map +1 -0
- package/lib/rules/common/path-not-include-query.d.ts +3 -0
- package/lib/rules/common/path-not-include-query.d.ts.map +1 -0
- package/lib/rules/common/path-not-include-query.js +15 -0
- package/lib/rules/common/path-not-include-query.js.map +1 -0
- package/lib/rules/common/path-params-defined.d.ts +3 -0
- package/lib/rules/common/path-params-defined.d.ts.map +1 -0
- package/lib/rules/common/path-params-defined.js +145 -0
- package/lib/rules/common/path-params-defined.js.map +1 -0
- package/lib/rules/common/path-segment-plural.d.ts +3 -0
- package/lib/rules/common/path-segment-plural.d.ts.map +1 -0
- package/lib/rules/common/path-segment-plural.js +30 -0
- package/lib/rules/common/path-segment-plural.js.map +1 -0
- package/lib/rules/common/paths-kebab-case.d.ts +3 -0
- package/lib/rules/common/paths-kebab-case.d.ts.map +1 -0
- package/lib/rules/common/paths-kebab-case.js +17 -0
- package/lib/rules/common/paths-kebab-case.js.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +3 -0
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.js +34 -0
- package/lib/rules/common/required-string-property-missing-min-length.js.map +1 -0
- package/lib/rules/common/response-contains-header.d.ts +3 -0
- package/lib/rules/common/response-contains-header.d.ts.map +1 -0
- package/lib/rules/common/response-contains-header.js +26 -0
- package/lib/rules/common/response-contains-header.js.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.d.ts +3 -0
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.js +39 -0
- package/lib/rules/common/scalar-property-missing-example.js.map +1 -0
- package/lib/rules/common/security-defined.d.ts +3 -0
- package/lib/rules/common/security-defined.d.ts.map +1 -0
- package/lib/rules/common/security-defined.js +62 -0
- package/lib/rules/common/security-defined.js.map +1 -0
- package/lib/rules/common/spec-strict-refs.d.ts +3 -0
- package/lib/rules/common/spec-strict-refs.d.ts.map +1 -0
- package/lib/rules/common/spec-strict-refs.js +27 -0
- package/lib/rules/common/spec-strict-refs.js.map +1 -0
- package/lib/rules/common/struct.d.ts +3 -0
- package/lib/rules/common/struct.d.ts.map +1 -0
- package/lib/rules/common/struct.js +150 -0
- package/lib/rules/common/struct.js.map +1 -0
- package/lib/rules/common/tag-description.d.ts +3 -0
- package/lib/rules/common/tag-description.d.ts.map +1 -0
- package/lib/rules/common/tag-description.js +9 -0
- package/lib/rules/common/tag-description.js.map +1 -0
- package/lib/rules/common/tags-alphabetical.d.ts +3 -0
- package/lib/rules/common/tags-alphabetical.d.ts.map +1 -0
- package/lib/rules/common/tags-alphabetical.js +18 -0
- package/lib/rules/common/tags-alphabetical.js.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +6 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js +19 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas2/index.d.ts +4 -0
- package/lib/rules/oas2/index.d.ts.map +1 -0
- package/lib/rules/oas2/index.js +93 -0
- package/lib/rules/oas2/index.js.map +1 -0
- package/lib/rules/oas2/request-mime-type.d.ts +3 -0
- package/lib/rules/oas2/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/request-mime-type.js +14 -0
- package/lib/rules/oas2/request-mime-type.js.map +1 -0
- package/lib/rules/oas2/response-contains-property.d.ts +3 -0
- package/lib/rules/oas2/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas2/response-contains-property.js +34 -0
- package/lib/rules/oas2/response-contains-property.js.map +1 -0
- package/lib/rules/oas2/response-mime-type.d.ts +3 -0
- package/lib/rules/oas2/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/response-mime-type.js +14 -0
- package/lib/rules/oas2/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.d.ts +6 -0
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.js +26 -0
- package/lib/rules/oas3/array-parameter-serialization.js.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +6 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js +21 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas3/component-name-unique.d.ts +3 -0
- package/lib/rules/oas3/component-name-unique.d.ts.map +1 -0
- package/lib/rules/oas3/component-name-unique.js +130 -0
- package/lib/rules/oas3/component-name-unique.js.map +1 -0
- package/lib/rules/oas3/index.d.ts +4 -0
- package/lib/rules/oas3/index.d.ts.map +1 -0
- package/lib/rules/oas3/index.js +129 -0
- package/lib/rules/oas3/index.js.map +1 -0
- package/lib/rules/oas3/no-empty-servers.d.ts +3 -0
- package/lib/rules/oas3/no-empty-servers.d.ts.map +1 -0
- package/lib/rules/oas3/no-empty-servers.js +20 -0
- package/lib/rules/oas3/no-empty-servers.js.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +3 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js +13 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +3 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js +59 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +1 -0
- package/lib/rules/oas3/no-server-example.com.d.ts +3 -0
- package/lib/rules/oas3/no-server-example.com.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-example.com.js +15 -0
- package/lib/rules/oas3/no-server-example.com.js.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +3 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.js +15 -0
- package/lib/rules/oas3/no-server-trailing-slash.js.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +3 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js +58 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +3 -0
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.js +28 -0
- package/lib/rules/oas3/no-undefined-server-variable.js.map +1 -0
- package/lib/rules/oas3/no-unused-components.d.ts +3 -0
- package/lib/rules/oas3/no-unused-components.d.ts.map +1 -0
- package/lib/rules/oas3/no-unused-components.js +83 -0
- package/lib/rules/oas3/no-unused-components.js.map +1 -0
- package/lib/rules/oas3/nullable-type-sibling.d.ts +3 -0
- package/lib/rules/oas3/nullable-type-sibling.d.ts.map +1 -0
- package/lib/rules/oas3/nullable-type-sibling.js +15 -0
- package/lib/rules/oas3/nullable-type-sibling.js.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +6 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +33 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +1 -0
- package/lib/rules/oas3/request-mime-type.d.ts +3 -0
- package/lib/rules/oas3/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/request-mime-type.js +28 -0
- package/lib/rules/oas3/request-mime-type.js.map +1 -0
- package/lib/rules/oas3/response-contains-property.d.ts +3 -0
- package/lib/rules/oas3/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas3/response-contains-property.js +36 -0
- package/lib/rules/oas3/response-contains-property.js.map +1 -0
- package/lib/rules/oas3/response-mime-type.d.ts +3 -0
- package/lib/rules/oas3/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/response-mime-type.js +28 -0
- package/lib/rules/oas3/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +3 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.js +59 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +1 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.d.ts +3 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.d.ts.map +1 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js +32 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js.map +1 -0
- package/lib/rules/oas3/spec-example-values.d.ts +3 -0
- package/lib/rules/oas3/spec-example-values.d.ts.map +1 -0
- package/lib/rules/oas3/spec-example-values.js +31 -0
- package/lib/rules/oas3/spec-example-values.js.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.d.ts +3 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.d.ts.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.d.ts +3 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.d.ts.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js.map +1 -0
- package/lib/rules/oas3/spec-querystring-parameters.d.ts +3 -0
- package/lib/rules/oas3/spec-querystring-parameters.d.ts.map +1 -0
- package/lib/rules/oas3/spec-querystring-parameters.js +65 -0
- package/lib/rules/oas3/spec-querystring-parameters.js.map +1 -0
- package/lib/rules/openrpc/index.d.ts +4 -0
- package/lib/rules/openrpc/index.d.ts.map +1 -0
- package/lib/rules/openrpc/index.js +20 -0
- package/lib/rules/openrpc/index.js.map +1 -0
- package/lib/rules/openrpc/no-unused-components.d.ts +3 -0
- package/lib/rules/openrpc/no-unused-components.d.ts.map +1 -0
- package/lib/rules/openrpc/no-unused-components.js +82 -0
- package/lib/rules/openrpc/no-unused-components.js.map +1 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts +3 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts.map +1 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js.map +1 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts +3 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts.map +1 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js.map +1 -0
- package/lib/rules/other/stats.d.ts +104 -0
- package/lib/rules/other/stats.d.ts.map +1 -0
- package/lib/rules/other/stats.js +190 -0
- package/lib/rules/other/stats.js.map +1 -0
- package/lib/rules/overlay1/index.d.ts +4 -0
- package/lib/rules/overlay1/index.d.ts.map +1 -0
- package/lib/rules/overlay1/index.js +12 -0
- package/lib/rules/overlay1/index.js.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.d.ts +3 -0
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.js +20 -0
- package/lib/rules/respect/no-criteria-xpath.js.map +1 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.d.ts +3 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts +3 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js.map +1 -0
- package/lib/rules/respect/respect-supported-versions.d.ts +3 -0
- package/lib/rules/respect/respect-supported-versions.d.ts.map +1 -0
- package/lib/rules/respect/respect-supported-versions.js +18 -0
- package/lib/rules/respect/respect-supported-versions.js.map +1 -0
- package/lib/rules/respect/x-security-scheme-name-reference.d.ts +3 -0
- package/lib/rules/respect/x-security-scheme-name-reference.d.ts.map +1 -0
- package/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
- package/lib/rules/respect/x-security-scheme-name-reference.js.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts +3 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/lib/rules/respect/x-security-scheme-required-values.js.map +1 -0
- package/lib/rules/utils.d.ts +30 -0
- package/lib/rules/utils.d.ts.map +1 -0
- package/lib/rules/utils.js +172 -0
- package/lib/rules/utils.js.map +1 -0
- package/lib/types/arazzo.d.ts +3 -0
- package/lib/types/arazzo.d.ts.map +1 -0
- package/lib/types/arazzo.js +482 -0
- package/lib/types/arazzo.js.map +1 -0
- package/lib/types/asyncapi2.d.ts +13 -0
- package/lib/types/asyncapi2.d.ts.map +1 -0
- package/lib/types/asyncapi2.js +1157 -0
- package/lib/types/asyncapi2.js.map +1 -0
- package/lib/types/asyncapi3.d.ts +3 -0
- package/lib/types/asyncapi3.d.ts.map +1 -0
- package/lib/types/asyncapi3.js +511 -0
- package/lib/types/asyncapi3.js.map +1 -0
- package/lib/types/entity.d.ts +9 -0
- package/lib/types/entity.d.ts.map +1 -0
- package/lib/types/entity.js +32 -0
- package/lib/types/entity.js.map +1 -0
- package/lib/types/index.d.ts +78 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +90 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/json-schema-adapter.d.ts +12 -0
- package/lib/types/json-schema-adapter.d.ts.map +1 -0
- package/lib/types/json-schema-adapter.js +181 -0
- package/lib/types/json-schema-adapter.js.map +1 -0
- package/lib/types/json-schema-draft7.shared.d.ts +7 -0
- package/lib/types/json-schema-draft7.shared.d.ts.map +1 -0
- package/lib/types/json-schema-draft7.shared.js +101 -0
- package/lib/types/json-schema-draft7.shared.js.map +1 -0
- package/lib/types/oas2.d.ts +107 -0
- package/lib/types/oas2.d.ts.map +1 -0
- package/lib/types/oas2.js +454 -0
- package/lib/types/oas2.js.map +1 -0
- package/lib/types/oas3.d.ts +198 -0
- package/lib/types/oas3.d.ts.map +1 -0
- package/lib/types/oas3.js +828 -0
- package/lib/types/oas3.js.map +1 -0
- package/lib/types/oas3_1.d.ts +207 -0
- package/lib/types/oas3_1.d.ts.map +1 -0
- package/lib/types/oas3_1.js +292 -0
- package/lib/types/oas3_1.js.map +1 -0
- package/lib/types/oas3_2.d.ts +215 -0
- package/lib/types/oas3_2.d.ts.map +1 -0
- package/lib/types/oas3_2.js +306 -0
- package/lib/types/oas3_2.js.map +1 -0
- package/lib/types/openrpc.d.ts +136 -0
- package/lib/types/openrpc.d.ts.map +1 -0
- package/lib/types/openrpc.js +360 -0
- package/lib/types/openrpc.js.map +1 -0
- package/lib/types/overlay.d.ts +3 -0
- package/lib/types/overlay.d.ts.map +1 -0
- package/lib/types/overlay.js +61 -0
- package/lib/types/overlay.js.map +1 -0
- package/lib/types/redocly-yaml.d.ts +29 -0
- package/lib/types/redocly-yaml.d.ts.map +1 -0
- package/lib/types/redocly-yaml.js +573 -0
- package/lib/types/redocly-yaml.js.map +1 -0
- package/lib/typings/arazzo.d.ts +172 -0
- package/lib/typings/arazzo.d.ts.map +1 -0
- package/lib/typings/arazzo.js +3 -0
- package/lib/typings/arazzo.js.map +1 -0
- package/lib/typings/asyncapi.d.ts +22 -0
- package/lib/typings/asyncapi.d.ts.map +1 -0
- package/lib/typings/asyncapi.js +2 -0
- package/lib/typings/asyncapi.js.map +1 -0
- package/lib/typings/asyncapi3.d.ts +54 -0
- package/lib/typings/asyncapi3.d.ts.map +1 -0
- package/lib/typings/asyncapi3.js +2 -0
- package/lib/typings/asyncapi3.js.map +1 -0
- package/lib/typings/common.d.ts +13 -0
- package/lib/typings/common.d.ts.map +1 -0
- package/lib/typings/common.js +2 -0
- package/lib/typings/common.js.map +1 -0
- package/lib/typings/openapi.d.ts +420 -0
- package/lib/typings/openapi.d.ts.map +1 -0
- package/lib/typings/openapi.js +2 -0
- package/lib/typings/openapi.js.map +1 -0
- package/lib/typings/openrpc.d.ts +110 -0
- package/lib/typings/openrpc.d.ts.map +1 -0
- package/lib/typings/openrpc.js +2 -0
- package/lib/typings/openrpc.js.map +1 -0
- package/lib/typings/overlay.d.ts +18 -0
- package/lib/typings/overlay.d.ts.map +1 -0
- package/lib/typings/overlay.js +2 -0
- package/lib/typings/overlay.js.map +1 -0
- package/lib/typings/swagger.d.ts +218 -0
- package/lib/typings/swagger.d.ts.map +1 -0
- package/lib/typings/swagger.js +2 -0
- package/lib/typings/swagger.js.map +1 -0
- package/lib/utils/assign-config.d.ts +7 -0
- package/lib/utils/assign-config.d.ts.map +1 -0
- package/lib/utils/assign-config.js +28 -0
- package/lib/utils/assign-config.js.map +1 -0
- package/lib/utils/dequal.d.ts +6 -0
- package/lib/utils/dequal.d.ts.map +1 -0
- package/lib/utils/dequal.js +36 -0
- package/lib/utils/dequal.js.map +1 -0
- package/lib/utils/does-yaml-file-exist.d.ts +2 -0
- package/lib/utils/does-yaml-file-exist.d.ts.map +1 -0
- package/lib/utils/does-yaml-file-exist.js +7 -0
- package/lib/utils/does-yaml-file-exist.js.map +1 -0
- package/lib/utils/error.d.ts +3 -0
- package/lib/utils/error.d.ts.map +1 -0
- package/lib/utils/error.js +3 -0
- package/lib/utils/error.js.map +1 -0
- package/lib/utils/get-intersection-length.d.ts +2 -0
- package/lib/utils/get-intersection-length.d.ts.map +1 -0
- package/lib/utils/get-intersection-length.js +11 -0
- package/lib/utils/get-intersection-length.js.map +1 -0
- package/lib/utils/get-matching-status-code-range.d.ts +2 -0
- package/lib/utils/get-matching-status-code-range.d.ts.map +1 -0
- package/lib/utils/get-matching-status-code-range.js +4 -0
- package/lib/utils/get-matching-status-code-range.js.map +1 -0
- package/lib/utils/get-own.d.ts +2 -0
- package/lib/utils/get-own.d.ts.map +1 -0
- package/lib/utils/get-own.js +4 -0
- package/lib/utils/get-own.js.map +1 -0
- package/lib/utils/identity.d.ts +2 -0
- package/lib/utils/identity.d.ts.map +1 -0
- package/lib/utils/identity.js +4 -0
- package/lib/utils/identity.js.map +1 -0
- package/lib/utils/is-custom-rule-id.d.ts +2 -0
- package/lib/utils/is-custom-rule-id.d.ts.map +1 -0
- package/lib/utils/is-custom-rule-id.js +4 -0
- package/lib/utils/is-custom-rule-id.js.map +1 -0
- package/lib/utils/is-defined.d.ts +2 -0
- package/lib/utils/is-defined.d.ts.map +1 -0
- package/lib/utils/is-defined.js +4 -0
- package/lib/utils/is-defined.js.map +1 -0
- package/lib/utils/is-empty-array.d.ts +2 -0
- package/lib/utils/is-empty-array.d.ts.map +1 -0
- package/lib/utils/is-empty-array.js +4 -0
- package/lib/utils/is-empty-array.js.map +1 -0
- package/lib/utils/is-empty-object.d.ts +2 -0
- package/lib/utils/is-empty-object.d.ts.map +1 -0
- package/lib/utils/is-empty-object.js +5 -0
- package/lib/utils/is-empty-object.js.map +1 -0
- package/lib/utils/is-not-empty-array.d.ts +2 -0
- package/lib/utils/is-not-empty-array.d.ts.map +1 -0
- package/lib/utils/is-not-empty-array.js +4 -0
- package/lib/utils/is-not-empty-array.js.map +1 -0
- package/lib/utils/is-not-empty-object.d.ts +2 -0
- package/lib/utils/is-not-empty-object.d.ts.map +1 -0
- package/lib/utils/is-not-empty-object.js +6 -0
- package/lib/utils/is-not-empty-object.js.map +1 -0
- package/lib/utils/is-not-string.d.ts +2 -0
- package/lib/utils/is-not-string.d.ts.map +1 -0
- package/lib/utils/is-not-string.js +5 -0
- package/lib/utils/is-not-string.js.map +1 -0
- package/lib/utils/is-ordered.d.ts +7 -0
- package/lib/utils/is-ordered.d.ts.map +1 -0
- package/lib/utils/is-ordered.js +27 -0
- package/lib/utils/is-ordered.js.map +1 -0
- package/lib/utils/is-path-parameter.d.ts +2 -0
- package/lib/utils/is-path-parameter.d.ts.map +1 -0
- package/lib/utils/is-path-parameter.js +4 -0
- package/lib/utils/is-path-parameter.js.map +1 -0
- package/lib/utils/is-plain-object.d.ts +2 -0
- package/lib/utils/is-plain-object.d.ts.map +1 -0
- package/lib/utils/is-plain-object.js +4 -0
- package/lib/utils/is-plain-object.js.map +1 -0
- package/lib/utils/is-string.d.ts +2 -0
- package/lib/utils/is-string.d.ts.map +1 -0
- package/lib/utils/is-string.js +4 -0
- package/lib/utils/is-string.js.map +1 -0
- package/lib/utils/is-truthy.d.ts +3 -0
- package/lib/utils/is-truthy.d.ts.map +1 -0
- package/lib/utils/is-truthy.js +4 -0
- package/lib/utils/is-truthy.js.map +1 -0
- package/lib/utils/keys-of.d.ts +2 -0
- package/lib/utils/keys-of.d.ts.map +1 -0
- package/lib/utils/keys-of.js +6 -0
- package/lib/utils/keys-of.js.map +1 -0
- package/lib/utils/make-ref-id.d.ts +2 -0
- package/lib/utils/make-ref-id.d.ts.map +1 -0
- package/lib/utils/make-ref-id.js +4 -0
- package/lib/utils/make-ref-id.js.map +1 -0
- package/lib/utils/next-tick.d.ts +2 -0
- package/lib/utils/next-tick.d.ts.map +1 -0
- package/lib/utils/next-tick.js +6 -0
- package/lib/utils/next-tick.js.map +1 -0
- package/lib/utils/oas-has-component.d.ts +3 -0
- package/lib/utils/oas-has-component.d.ts.map +1 -0
- package/lib/utils/oas-has-component.js +4 -0
- package/lib/utils/oas-has-component.js.map +1 -0
- package/lib/utils/omit.d.ts +2 -0
- package/lib/utils/omit.d.ts.map +1 -0
- package/lib/utils/omit.js +8 -0
- package/lib/utils/omit.js.map +1 -0
- package/lib/utils/pause.d.ts +2 -0
- package/lib/utils/pause.d.ts.map +1 -0
- package/lib/utils/pause.js +4 -0
- package/lib/utils/pause.js.map +1 -0
- package/lib/utils/pluralize.d.ts +2 -0
- package/lib/utils/pluralize.d.ts.map +1 -0
- package/lib/utils/pluralize.js +8 -0
- package/lib/utils/pluralize.js.map +1 -0
- package/lib/utils/read-file-from-url.d.ts +6 -0
- package/lib/utils/read-file-from-url.d.ts.map +1 -0
- package/lib/utils/read-file-from-url.js +26 -0
- package/lib/utils/read-file-from-url.js.map +1 -0
- package/lib/utils/regex-from-string.d.ts +2 -0
- package/lib/utils/regex-from-string.d.ts.map +1 -0
- package/lib/utils/regex-from-string.js +5 -0
- package/lib/utils/regex-from-string.js.map +1 -0
- package/lib/utils/scorecards.d.ts +13 -0
- package/lib/utils/scorecards.d.ts.map +1 -0
- package/lib/utils/scorecards.js +99 -0
- package/lib/utils/scorecards.js.map +1 -0
- package/lib/utils/slash.d.ts +5 -0
- package/lib/utils/slash.d.ts.map +1 -0
- package/lib/utils/slash.js +11 -0
- package/lib/utils/slash.js.map +1 -0
- package/lib/utils/split-camel-case-into-words.d.ts +2 -0
- package/lib/utils/split-camel-case-into-words.d.ts.map +1 -0
- package/lib/utils/split-camel-case-into-words.js +13 -0
- package/lib/utils/split-camel-case-into-words.js.map +1 -0
- package/lib/utils/stack.d.ts +12 -0
- package/lib/utils/stack.d.ts.map +1 -0
- package/lib/utils/stack.js +7 -0
- package/lib/utils/stack.js.map +1 -0
- package/lib/utils/types.d.ts +5 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +2 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/validate-mime-type.d.ts +4 -0
- package/lib/utils/validate-mime-type.d.ts.map +1 -0
- package/lib/utils/validate-mime-type.js +31 -0
- package/lib/utils/validate-mime-type.js.map +1 -0
- package/lib/utils/yaml-fs-helper.d.ts +6 -0
- package/lib/utils/yaml-fs-helper.d.ts.map +1 -0
- package/lib/utils/yaml-fs-helper.js +23 -0
- package/lib/utils/yaml-fs-helper.js.map +1 -0
- package/lib/visitors.d.ts +279 -0
- package/lib/visitors.d.ts.map +1 -0
- package/lib/visitors.js +177 -0
- package/lib/visitors.js.map +1 -0
- package/lib/walk.d.ts +81 -0
- package/lib/walk.d.ts.map +1 -0
- package/lib/walk.js +303 -0
- package/lib/walk.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { getIntersectionLength } from '../../../utils/get-intersection-length.js';
|
|
2
|
+
import { isOrdered } from '../../../utils/is-ordered.js';
|
|
3
|
+
import { isPlainObject } from '../../../utils/is-plain-object.js';
|
|
4
|
+
import { isString as runOnValue } from '../../../utils/is-string.js';
|
|
5
|
+
import { isTruthy } from '../../../utils/is-truthy.js';
|
|
6
|
+
import { regexFromString } from '../../../utils/regex-from-string.js';
|
|
7
|
+
export const runOnKeysSet = new Set([
|
|
8
|
+
'mutuallyExclusive',
|
|
9
|
+
'mutuallyRequired',
|
|
10
|
+
'enum',
|
|
11
|
+
'pattern',
|
|
12
|
+
'notPattern',
|
|
13
|
+
'minLength',
|
|
14
|
+
'maxLength',
|
|
15
|
+
'casing',
|
|
16
|
+
'sortOrder',
|
|
17
|
+
'disallowed',
|
|
18
|
+
'required',
|
|
19
|
+
'requireAny',
|
|
20
|
+
'ref',
|
|
21
|
+
'const',
|
|
22
|
+
'defined', // In case if `property` for assertions is not added
|
|
23
|
+
]);
|
|
24
|
+
export const runOnValuesSet = new Set([
|
|
25
|
+
'pattern',
|
|
26
|
+
'notPattern',
|
|
27
|
+
'enum',
|
|
28
|
+
'defined',
|
|
29
|
+
'nonEmpty',
|
|
30
|
+
'minLength',
|
|
31
|
+
'maxLength',
|
|
32
|
+
'casing',
|
|
33
|
+
'sortOrder',
|
|
34
|
+
'ref',
|
|
35
|
+
'const',
|
|
36
|
+
]);
|
|
37
|
+
export const asserts = {
|
|
38
|
+
pattern: (value, condition, { baseLocation, rawValue }) => {
|
|
39
|
+
if (typeof value === 'undefined' || isPlainObject(value))
|
|
40
|
+
return []; // property doesn't exist or is an object, no need to lint it with this assert
|
|
41
|
+
const values = Array.isArray(value) ? value : [value];
|
|
42
|
+
const regex = regexFromString(condition);
|
|
43
|
+
return values
|
|
44
|
+
.map((_val) => !regex?.test(_val) && {
|
|
45
|
+
message: `"${_val}" should match a regex ${condition}`,
|
|
46
|
+
location: runOnValue(value)
|
|
47
|
+
? baseLocation
|
|
48
|
+
: isPlainObject(rawValue)
|
|
49
|
+
? baseLocation.child(_val).key()
|
|
50
|
+
: baseLocation.key(),
|
|
51
|
+
})
|
|
52
|
+
.filter(isTruthy);
|
|
53
|
+
},
|
|
54
|
+
notPattern: (value, condition, { baseLocation, rawValue }) => {
|
|
55
|
+
if (typeof value === 'undefined' || isPlainObject(value))
|
|
56
|
+
return []; // property doesn't exist or is an object, no need to lint it with this assert
|
|
57
|
+
const values = Array.isArray(value) ? value : [value];
|
|
58
|
+
const regex = regexFromString(condition);
|
|
59
|
+
return values
|
|
60
|
+
.map((_val) => regex?.test(_val) && {
|
|
61
|
+
message: `"${_val}" should not match a regex ${condition}`,
|
|
62
|
+
location: runOnValue(value)
|
|
63
|
+
? baseLocation
|
|
64
|
+
: isPlainObject(rawValue)
|
|
65
|
+
? baseLocation.child(_val).key()
|
|
66
|
+
: baseLocation.key(),
|
|
67
|
+
})
|
|
68
|
+
.filter(isTruthy);
|
|
69
|
+
},
|
|
70
|
+
enum: (value, condition, { baseLocation }) => {
|
|
71
|
+
if (typeof value === 'undefined' || isPlainObject(value))
|
|
72
|
+
return []; // property doesn't exist or is an object, no need to lint it with this assert
|
|
73
|
+
const values = Array.isArray(value) ? value : [value];
|
|
74
|
+
return values
|
|
75
|
+
.map((_val) => !condition.includes(_val) && {
|
|
76
|
+
message: `"${_val}" should be one of the predefined values`,
|
|
77
|
+
location: runOnValue(value) ? baseLocation : baseLocation.child(_val).key(),
|
|
78
|
+
})
|
|
79
|
+
.filter(isTruthy);
|
|
80
|
+
},
|
|
81
|
+
defined: (value, condition = true, { baseLocation }) => {
|
|
82
|
+
const isDefined = typeof value !== 'undefined';
|
|
83
|
+
const isValid = condition ? isDefined : !isDefined;
|
|
84
|
+
return isValid
|
|
85
|
+
? []
|
|
86
|
+
: [
|
|
87
|
+
{
|
|
88
|
+
message: condition ? `Should be defined` : 'Should be not defined',
|
|
89
|
+
location: baseLocation,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
},
|
|
93
|
+
required: (value, keys, { baseLocation }) => {
|
|
94
|
+
return keys
|
|
95
|
+
.map((requiredKey) => !value.includes(requiredKey) && {
|
|
96
|
+
message: `${requiredKey} is required`,
|
|
97
|
+
location: baseLocation.key(),
|
|
98
|
+
})
|
|
99
|
+
.filter(isTruthy);
|
|
100
|
+
},
|
|
101
|
+
disallowed: (value, condition, { baseLocation }) => {
|
|
102
|
+
if (typeof value === 'undefined' || isPlainObject(value))
|
|
103
|
+
return []; // property doesn't exist or is an object, no need to lint it with this assert
|
|
104
|
+
const values = Array.isArray(value) ? value : [value];
|
|
105
|
+
return values
|
|
106
|
+
.map((_val) => condition.includes(_val) && {
|
|
107
|
+
message: `"${_val}" is disallowed`,
|
|
108
|
+
location: runOnValue(value) ? baseLocation : baseLocation.child(_val).key(),
|
|
109
|
+
})
|
|
110
|
+
.filter(isTruthy);
|
|
111
|
+
},
|
|
112
|
+
const: (value, condition, { baseLocation }) => {
|
|
113
|
+
if (typeof value === 'undefined')
|
|
114
|
+
return [];
|
|
115
|
+
if (Array.isArray(value)) {
|
|
116
|
+
return value
|
|
117
|
+
.map((_val) => condition !== _val && {
|
|
118
|
+
message: `"${_val}" should be equal ${condition} `,
|
|
119
|
+
location: runOnValue(value) ? baseLocation : baseLocation.child(_val).key(),
|
|
120
|
+
})
|
|
121
|
+
.filter(isTruthy);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return value !== condition
|
|
125
|
+
? [
|
|
126
|
+
{
|
|
127
|
+
message: `${value} should be equal ${condition}`,
|
|
128
|
+
location: baseLocation,
|
|
129
|
+
},
|
|
130
|
+
]
|
|
131
|
+
: [];
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
nonEmpty: (value, condition = true, { baseLocation }) => {
|
|
135
|
+
const isEmpty = typeof value === 'undefined' ||
|
|
136
|
+
value === null ||
|
|
137
|
+
value === '' ||
|
|
138
|
+
(Array.isArray(value) && value.length === 0);
|
|
139
|
+
const isValid = condition ? !isEmpty : isEmpty;
|
|
140
|
+
return isValid
|
|
141
|
+
? []
|
|
142
|
+
: [
|
|
143
|
+
{
|
|
144
|
+
message: condition ? `Should not be empty` : 'Should be empty',
|
|
145
|
+
location: baseLocation,
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
},
|
|
149
|
+
minLength: (value, condition, { baseLocation }) => {
|
|
150
|
+
if (typeof value === 'undefined' || value.length >= condition)
|
|
151
|
+
return []; // property doesn't exist, no need to lint it with this assert
|
|
152
|
+
return [
|
|
153
|
+
{
|
|
154
|
+
message: `Should have at least ${condition} characters`,
|
|
155
|
+
location: baseLocation,
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
},
|
|
159
|
+
maxLength: (value, condition, { baseLocation }) => {
|
|
160
|
+
if (typeof value === 'undefined' || value.length <= condition)
|
|
161
|
+
return []; // property doesn't exist, no need to lint it with this assert
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
message: `Should have at most ${condition} characters`,
|
|
165
|
+
location: baseLocation,
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
},
|
|
169
|
+
casing: (value, condition, { baseLocation }) => {
|
|
170
|
+
if (typeof value === 'undefined' || isPlainObject(value))
|
|
171
|
+
return []; // property doesn't exist or is an object, no need to lint it with this assert
|
|
172
|
+
const values = Array.isArray(value) ? value : [value];
|
|
173
|
+
const casingRegexes = {
|
|
174
|
+
camelCase: /^[a-z][a-zA-Z0-9]*$/g,
|
|
175
|
+
'kebab-case': /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/g,
|
|
176
|
+
snake_case: /^([a-z][a-z0-9]*)(_[a-z0-9]+)*$/g,
|
|
177
|
+
PascalCase: /^[A-Z][a-zA-Z0-9]+$/g,
|
|
178
|
+
MACRO_CASE: /^([A-Z][A-Z0-9]*)(_[A-Z0-9]+)*$/g,
|
|
179
|
+
'COBOL-CASE': /^([A-Z][A-Z0-9]*)(-[A-Z0-9]+)*$/g,
|
|
180
|
+
flatcase: /^[a-z][a-z0-9]+$/g,
|
|
181
|
+
};
|
|
182
|
+
return values
|
|
183
|
+
.map((_val) => !_val.match(casingRegexes[condition]) && {
|
|
184
|
+
message: `"${_val}" should use ${condition}`,
|
|
185
|
+
location: runOnValue(value) ? baseLocation : baseLocation.child(_val).key(),
|
|
186
|
+
})
|
|
187
|
+
.filter(isTruthy);
|
|
188
|
+
},
|
|
189
|
+
sortOrder: (value, condition, { baseLocation }) => {
|
|
190
|
+
const direction = condition.direction || condition;
|
|
191
|
+
const property = condition.property;
|
|
192
|
+
if (Array.isArray(value) && value.length > 0 && isPlainObject(value[0]) && !property) {
|
|
193
|
+
return [
|
|
194
|
+
{
|
|
195
|
+
message: `Please define a property to sort objects by`,
|
|
196
|
+
location: baseLocation,
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
if (typeof value === 'undefined' || isOrdered(value, condition))
|
|
201
|
+
return [];
|
|
202
|
+
return [
|
|
203
|
+
{
|
|
204
|
+
message: `Should be sorted in ${direction === 'asc' ? 'an ascending' : 'a descending'} order${property ? ` by property ${property}` : ''}`,
|
|
205
|
+
location: baseLocation,
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
},
|
|
209
|
+
mutuallyExclusive: (value, condition, { baseLocation }) => {
|
|
210
|
+
if (getIntersectionLength(value, condition) < 2)
|
|
211
|
+
return [];
|
|
212
|
+
return [
|
|
213
|
+
{
|
|
214
|
+
message: `${condition.join(', ')} keys should be mutually exclusive`,
|
|
215
|
+
location: baseLocation.key(),
|
|
216
|
+
},
|
|
217
|
+
];
|
|
218
|
+
},
|
|
219
|
+
mutuallyRequired: (value, condition, { baseLocation }) => {
|
|
220
|
+
const isValid = getIntersectionLength(value, condition) > 0
|
|
221
|
+
? getIntersectionLength(value, condition) === condition.length
|
|
222
|
+
: true;
|
|
223
|
+
return isValid
|
|
224
|
+
? []
|
|
225
|
+
: [
|
|
226
|
+
{
|
|
227
|
+
message: `Properties ${condition.join(', ')} are mutually required`,
|
|
228
|
+
location: baseLocation.key(),
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
},
|
|
232
|
+
requireAny: (value, condition, { baseLocation }) => {
|
|
233
|
+
return getIntersectionLength(value, condition) >= 1
|
|
234
|
+
? []
|
|
235
|
+
: [
|
|
236
|
+
{
|
|
237
|
+
message: `Should have any of ${condition.join(', ')}`,
|
|
238
|
+
location: baseLocation.key(),
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
},
|
|
242
|
+
ref: (_value, condition, { baseLocation, rawValue }) => {
|
|
243
|
+
if (typeof rawValue === 'undefined')
|
|
244
|
+
return []; // property doesn't exist, no need to lint it with this assert
|
|
245
|
+
const hasRef = rawValue.hasOwnProperty('$ref');
|
|
246
|
+
if (typeof condition === 'boolean') {
|
|
247
|
+
const isValid = condition ? hasRef : !hasRef;
|
|
248
|
+
return isValid
|
|
249
|
+
? []
|
|
250
|
+
: [
|
|
251
|
+
{
|
|
252
|
+
message: condition ? `should use $ref` : 'should not use $ref',
|
|
253
|
+
location: hasRef ? baseLocation : baseLocation.key(),
|
|
254
|
+
},
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
const regex = regexFromString(condition);
|
|
258
|
+
const isValid = hasRef && regex?.test(rawValue['$ref']);
|
|
259
|
+
return isValid
|
|
260
|
+
? []
|
|
261
|
+
: [
|
|
262
|
+
{
|
|
263
|
+
message: `$ref value should match ${condition}`,
|
|
264
|
+
location: hasRef ? baseLocation : baseLocation.key(),
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
export function buildAssertCustomFunction(fn) {
|
|
270
|
+
return (value, options, ctx) => fn.call(null, value, options, ctx);
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=asserts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asserts.js","sourceRoot":"","sources":["../../../../src/rules/common/assertions/asserts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAyBtE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAgB;IACjD,mBAAmB;IACnB,kBAAkB;IAClB,MAAM;IACN,SAAS;IACT,YAAY;IACZ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,KAAK;IACL,OAAO;IACP,SAAS,EAAE,oDAAoD;CAChE,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAgB;IACnD,SAAS;IACT,YAAY;IACZ,MAAM;IACN,SAAS;IACT,UAAU;IACV,WAAW;IACX,WAAW;IACX,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,OAAO,EAAE,CACP,KAAwB,EACxB,SAAiB,EACjB,EAAE,YAAY,EAAE,QAAQ,EAAsB,EA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M,MAAM,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7C,OAAO,OAAO;gBACZ,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE;wBACE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB;wBAC9D,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE;qBACrD;iBACF,CAAC;QACR,CAAC;QACD,MAAM,KAAK,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,MAAM,IAAI,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QACxD,OAAO,OAAO;YACZ,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE;oBACE,OAAO,EAAE,2BAA2B,SAAS,EAAE;oBAC/C,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE;iBACrD;aACF,CAAC;IACR,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,EAAkB;IAC1D,OAAO,CAAC,KAAe,EAAE,OAAY,EAAE,GAAuB,EAAE,EAAE,CAChE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RuleSeverity } from '../../../config/index.js';
|
|
2
|
+
import type { Arazzo1Visitor, Async2Visitor, Async3Visitor, Oas2Visitor, Oas3Visitor, Overlay1Visitor } from '../../../visitors.js';
|
|
3
|
+
import type { asserts, AssertionFn } from './asserts.js';
|
|
4
|
+
export type AssertionLocators = {
|
|
5
|
+
filterInParentKeys?: (string | number)[];
|
|
6
|
+
filterOutParentKeys?: (string | number)[];
|
|
7
|
+
matchParentKeys?: string;
|
|
8
|
+
};
|
|
9
|
+
export type AssertionDefinition = {
|
|
10
|
+
subject: {
|
|
11
|
+
type: string;
|
|
12
|
+
property?: string | string[];
|
|
13
|
+
} & AssertionLocators;
|
|
14
|
+
assertions: {
|
|
15
|
+
[name in keyof typeof asserts]?: AssertionFn;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type RawAssertion = AssertionDefinition & {
|
|
19
|
+
where?: AssertionDefinition[];
|
|
20
|
+
message?: string;
|
|
21
|
+
suggest?: string[];
|
|
22
|
+
severity?: RuleSeverity;
|
|
23
|
+
};
|
|
24
|
+
export type Assertion = RawAssertion & {
|
|
25
|
+
assertionId: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const Assertions: (opts: Record<string, Assertion>) => (Oas3Visitor | Oas2Visitor | Async2Visitor | Async3Visitor | Arazzo1Visitor | Overlay1Visitor)[];
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rules/common/assertions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,kBAAkB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACzC,mBAAmB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KAC9B,GAAG,iBAAiB,CAAC;IACtB,UAAU,EAAE;SAAG,IAAI,IAAI,MAAM,OAAO,OAAO,CAAC,CAAC,EAAE,WAAW;KAAE,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG;IAC/C,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,qGA4BzD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isPlainObject } from '../../../utils/is-plain-object.js';
|
|
2
|
+
import { isString } from '../../../utils/is-string.js';
|
|
3
|
+
import { buildSubjectVisitor, buildVisitorObject } from './utils.js';
|
|
4
|
+
export const Assertions = (opts) => {
|
|
5
|
+
const visitors = [];
|
|
6
|
+
// As 'Assertions' has an array of asserts,
|
|
7
|
+
// that array spreads into an 'opts' object on init rules phase here
|
|
8
|
+
// https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/config/config.ts#L311
|
|
9
|
+
// that is why we need to iterate through 'opts' values;
|
|
10
|
+
// before - filter only object 'opts' values
|
|
11
|
+
const assertions = Object.values(opts).filter((opt) => isPlainObject(opt));
|
|
12
|
+
for (const [_, assertion] of assertions.entries()) {
|
|
13
|
+
if (!isString(assertion.subject.type)) {
|
|
14
|
+
throw new Error(`${assertion.assertionId}: 'type' (String) is required`);
|
|
15
|
+
}
|
|
16
|
+
const subjectVisitor = buildSubjectVisitor(assertion.assertionId, assertion);
|
|
17
|
+
const visitorObject = buildVisitorObject(assertion, subjectVisitor);
|
|
18
|
+
visitors.push(visitorObject);
|
|
19
|
+
}
|
|
20
|
+
return visitors;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rules/common/assertions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAUvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAyBrE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAA+B,EAAE,EAAE;IAC5D,MAAM,QAAQ,GAOR,EAAE,CAAC;IAET,2CAA2C;IAC3C,oEAAoE;IACpE,2FAA2F;IAC3F,wDAAwD;IACxD,4CAA4C;IAC5C,MAAM,UAAU,GAAgB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IAExF,KAAK,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,WAAW,+BAA+B,CAAC,CAAC;QAC3E,CAAC;QAED,MAAM,cAAc,GAAG,mBAAmB,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAC7E,MAAM,aAAa,GAAG,kBAAkB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACpE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AssertionContext, AssertResult } from '../../../config/index.js';
|
|
2
|
+
import type { Oas2Visitor, Oas3Visitor, VisitFunction } from '../../../visitors.js';
|
|
3
|
+
import type { Asserts } from './asserts.js';
|
|
4
|
+
import type { Assertion, AssertionDefinition } from './index.js';
|
|
5
|
+
export type AssertToApply = {
|
|
6
|
+
name: keyof Asserts;
|
|
7
|
+
conditions: any;
|
|
8
|
+
runsOnKeys: boolean;
|
|
9
|
+
runsOnValues: boolean;
|
|
10
|
+
};
|
|
11
|
+
type RunAssertionParams = {
|
|
12
|
+
ctx: AssertionContext;
|
|
13
|
+
assert: AssertToApply;
|
|
14
|
+
assertionProperty?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function getAssertsToApply(assertion: AssertionDefinition): AssertToApply[];
|
|
17
|
+
export declare function buildVisitorObject(assertion: Assertion, subjectVisitor: VisitFunction<any>): Oas2Visitor | Oas3Visitor;
|
|
18
|
+
export declare function buildSubjectVisitor(assertId: string, assertion: Assertion): VisitFunction<any>;
|
|
19
|
+
export declare function runAssertion({ assert, ctx, assertionProperty, }: RunAssertionParams): AssertResult[];
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/rules/common/assertions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAO/E,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAEX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;AAEpF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAkCF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,GAAG,aAAa,EAAE,CAgCjF;AAwCD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,aAAa,CAAC,GAAG,CAAC,GACjC,WAAW,GAAG,WAAW,CAkE3B;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAwC9F;AAkDD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,GAAG,EACH,iBAAiB,GAClB,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAyBrC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { colorize } from '../../../logger.js';
|
|
2
|
+
import { isRef, isAbsoluteUrl } from '../../../ref-utils.js';
|
|
3
|
+
import { isString } from '../../../utils/is-string.js';
|
|
4
|
+
import { isTruthy } from '../../../utils/is-truthy.js';
|
|
5
|
+
import { keysOf } from '../../../utils/keys-of.js';
|
|
6
|
+
import { regexFromString } from '../../../utils/regex-from-string.js';
|
|
7
|
+
import { asserts, runOnKeysSet, runOnValuesSet } from './asserts.js';
|
|
8
|
+
const assertionMessageTemplates = {
|
|
9
|
+
problems: '{{problems}}',
|
|
10
|
+
assertionName: '{{assertionName}}',
|
|
11
|
+
nodeType: '{{nodeType}}',
|
|
12
|
+
key: '{{key}}',
|
|
13
|
+
property: '{{property}}',
|
|
14
|
+
file: '{{file}}',
|
|
15
|
+
pointer: '{{pointer}}',
|
|
16
|
+
};
|
|
17
|
+
function getPredicatesFromLocators(locators) {
|
|
18
|
+
const { filterInParentKeys, filterOutParentKeys, matchParentKeys } = locators;
|
|
19
|
+
const keyMatcher = matchParentKeys && regexFromString(matchParentKeys);
|
|
20
|
+
const matchKeysPredicate = keyMatcher && ((key) => keyMatcher.test(key.toString()));
|
|
21
|
+
const filterInPredicate = Array.isArray(filterInParentKeys) &&
|
|
22
|
+
((key) => filterInParentKeys.includes(key.toString()));
|
|
23
|
+
const filterOutPredicate = Array.isArray(filterOutParentKeys) &&
|
|
24
|
+
((key) => !filterOutParentKeys.includes(key.toString()));
|
|
25
|
+
return [matchKeysPredicate, filterInPredicate, filterOutPredicate].filter(isTruthy);
|
|
26
|
+
}
|
|
27
|
+
export function getAssertsToApply(assertion) {
|
|
28
|
+
const assertsToApply = keysOf(asserts)
|
|
29
|
+
.filter((assertName) => assertion.assertions[assertName] !== undefined)
|
|
30
|
+
.map((assertName) => {
|
|
31
|
+
return {
|
|
32
|
+
name: assertName,
|
|
33
|
+
conditions: assertion.assertions[assertName],
|
|
34
|
+
runsOnKeys: runOnKeysSet.has(assertName),
|
|
35
|
+
runsOnValues: runOnValuesSet.has(assertName),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const shouldRunOnKeys = assertsToApply.find((assert) => assert.runsOnKeys && !assert.runsOnValues);
|
|
39
|
+
const shouldRunOnValues = assertsToApply.find((assert) => assert.runsOnValues && !assert.runsOnKeys);
|
|
40
|
+
if (shouldRunOnValues && !assertion.subject.property) {
|
|
41
|
+
throw new Error(`The '${shouldRunOnValues.name}' assertion can't be used on all keys. Please provide a single property.`);
|
|
42
|
+
}
|
|
43
|
+
if (shouldRunOnKeys && assertion.subject.property) {
|
|
44
|
+
throw new Error(`The '${shouldRunOnKeys.name}' assertion can't be used on properties. Please remove the 'property' key.`);
|
|
45
|
+
}
|
|
46
|
+
return assertsToApply;
|
|
47
|
+
}
|
|
48
|
+
function getAssertionProperties({ subject }) {
|
|
49
|
+
return (Array.isArray(subject.property) ? subject.property : [subject?.property]).filter(Boolean);
|
|
50
|
+
}
|
|
51
|
+
function applyAssertions(assertionDefinition, asserts, ctx) {
|
|
52
|
+
const properties = getAssertionProperties(assertionDefinition);
|
|
53
|
+
const assertResults = [];
|
|
54
|
+
for (const assert of asserts) {
|
|
55
|
+
if (properties.length) {
|
|
56
|
+
for (const property of properties) {
|
|
57
|
+
assertResults.push(runAssertion({
|
|
58
|
+
assert,
|
|
59
|
+
ctx,
|
|
60
|
+
assertionProperty: property,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
assertResults.push(runAssertion({
|
|
66
|
+
assert,
|
|
67
|
+
ctx,
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return assertResults.flat();
|
|
72
|
+
}
|
|
73
|
+
export function buildVisitorObject(assertion, subjectVisitor) {
|
|
74
|
+
const targetVisitorLocatorPredicates = getPredicatesFromLocators(assertion.subject);
|
|
75
|
+
const targetVisitorSkipFunction = targetVisitorLocatorPredicates.length
|
|
76
|
+
? (_, key) => !targetVisitorLocatorPredicates.every((predicate) => predicate(key))
|
|
77
|
+
: undefined;
|
|
78
|
+
const targetVisitor = {
|
|
79
|
+
[assertion.subject.type]: {
|
|
80
|
+
enter: subjectVisitor,
|
|
81
|
+
...(targetVisitorSkipFunction && { skip: targetVisitorSkipFunction }),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
if (!Array.isArray(assertion.where)) {
|
|
85
|
+
return targetVisitor;
|
|
86
|
+
}
|
|
87
|
+
let currentVisitorLevel = {};
|
|
88
|
+
const visitor = currentVisitorLevel;
|
|
89
|
+
const context = assertion.where;
|
|
90
|
+
for (let index = 0; index < context.length; index++) {
|
|
91
|
+
const assertionDefinitionNode = context[index];
|
|
92
|
+
if (!isString(assertionDefinitionNode.subject?.type)) {
|
|
93
|
+
throw new Error(`${assertion.assertionId} -> where -> [${index}]: 'type' (String) is required`);
|
|
94
|
+
}
|
|
95
|
+
const locatorPredicates = getPredicatesFromLocators(assertionDefinitionNode.subject);
|
|
96
|
+
const assertsToApply = getAssertsToApply(assertionDefinitionNode);
|
|
97
|
+
const skipFunction = (node, key, ctx) => !locatorPredicates.every((predicate) => predicate(key)) ||
|
|
98
|
+
!!applyAssertions(assertionDefinitionNode, assertsToApply, { ...ctx, node }).length;
|
|
99
|
+
const nodeVisitor = {
|
|
100
|
+
...((locatorPredicates.length || assertsToApply.length) && { skip: skipFunction }),
|
|
101
|
+
};
|
|
102
|
+
if (assertionDefinitionNode.subject.type === assertion.subject.type &&
|
|
103
|
+
index === context.length - 1) {
|
|
104
|
+
// We have to merge the visitors if the last node inside the `where` is the same as the subject.
|
|
105
|
+
targetVisitor[assertion.subject.type] = {
|
|
106
|
+
enter: subjectVisitor,
|
|
107
|
+
...((nodeVisitor.skip && { skip: nodeVisitor.skip }) ||
|
|
108
|
+
(targetVisitorSkipFunction && {
|
|
109
|
+
skip: (node, key, ctx // We may have locators defined on assertion level and on where level for the same node type
|
|
110
|
+
) => !!(nodeVisitor.skip?.(node, key, ctx) || targetVisitorSkipFunction?.(node, key)),
|
|
111
|
+
})),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
currentVisitorLevel = currentVisitorLevel[assertionDefinitionNode.subject?.type] =
|
|
116
|
+
nodeVisitor;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
currentVisitorLevel[assertion.subject.type] = targetVisitor[assertion.subject.type];
|
|
120
|
+
return visitor;
|
|
121
|
+
}
|
|
122
|
+
export function buildSubjectVisitor(assertId, assertion) {
|
|
123
|
+
return (node, ctx) => {
|
|
124
|
+
const properties = getAssertionProperties(assertion);
|
|
125
|
+
const defaultMessage = `${colorize.blue(assertId)} failed because the ${colorize.blue(assertion.subject.type)} ${colorize.blue(properties.join(', '))} didn't meet the assertions: ${assertionMessageTemplates.problems}`.replace(/ +/g, ' ');
|
|
126
|
+
const problems = applyAssertions(assertion, getAssertsToApply(assertion), {
|
|
127
|
+
...ctx,
|
|
128
|
+
node,
|
|
129
|
+
});
|
|
130
|
+
if (problems.length) {
|
|
131
|
+
for (const problemGroup of groupProblemsByPointer(problems)) {
|
|
132
|
+
const message = assertion.message || defaultMessage;
|
|
133
|
+
const problemMessage = getProblemsMessage(problemGroup);
|
|
134
|
+
const placeholders = {
|
|
135
|
+
problems: problemMessage,
|
|
136
|
+
assertionName: assertId,
|
|
137
|
+
nodeType: assertion.subject.type,
|
|
138
|
+
property: properties.join(', '),
|
|
139
|
+
key: String(ctx.key),
|
|
140
|
+
pointer: ctx.location.pointer,
|
|
141
|
+
file: getFilenameFromPath(ctx.location.source.absoluteRef),
|
|
142
|
+
};
|
|
143
|
+
ctx.report({
|
|
144
|
+
message: interpolateMessagePlaceholders(message, placeholders),
|
|
145
|
+
location: getProblemsLocation(problemGroup) || ctx.location,
|
|
146
|
+
forceSeverity: assertion.severity || 'error',
|
|
147
|
+
suggest: assertion.suggest || [],
|
|
148
|
+
ruleId: assertId,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function groupProblemsByPointer(problems) {
|
|
155
|
+
const groups = {};
|
|
156
|
+
for (const problem of problems) {
|
|
157
|
+
if (!problem.location)
|
|
158
|
+
continue;
|
|
159
|
+
const pointer = problem.location.pointer;
|
|
160
|
+
groups[pointer] = groups[pointer] || [];
|
|
161
|
+
groups[pointer].push(problem);
|
|
162
|
+
}
|
|
163
|
+
return Object.values(groups);
|
|
164
|
+
}
|
|
165
|
+
function getProblemsLocation(problems) {
|
|
166
|
+
return problems.length ? problems[0].location : undefined;
|
|
167
|
+
}
|
|
168
|
+
function getProblemsMessage(problems) {
|
|
169
|
+
return problems.length === 1
|
|
170
|
+
? (problems[0].message ?? '')
|
|
171
|
+
: problems.map((problem) => `\n- ${problem.message ?? ''}`).join('');
|
|
172
|
+
}
|
|
173
|
+
function getFilenameFromPath(absoluteRef) {
|
|
174
|
+
if (isAbsoluteUrl(absoluteRef)) {
|
|
175
|
+
const parts = absoluteRef.split('/');
|
|
176
|
+
return parts.at(-1) || absoluteRef;
|
|
177
|
+
}
|
|
178
|
+
const parts = absoluteRef.split(/[/\\]/);
|
|
179
|
+
return parts.at(-1) || absoluteRef;
|
|
180
|
+
}
|
|
181
|
+
function interpolateMessagePlaceholders(message, placeholders) {
|
|
182
|
+
let result = message;
|
|
183
|
+
for (const key of Object.keys(assertionMessageTemplates)) {
|
|
184
|
+
const template = assertionMessageTemplates[key];
|
|
185
|
+
const value = placeholders[key];
|
|
186
|
+
if (!template)
|
|
187
|
+
continue;
|
|
188
|
+
result = result.split(template).join(value);
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
export function runAssertion({ assert, ctx, assertionProperty, }) {
|
|
193
|
+
const currentLocation = assert.name === 'ref' ? ctx.rawLocation : ctx.location;
|
|
194
|
+
if (assertionProperty) {
|
|
195
|
+
const values = isRef(ctx.node[assertionProperty])
|
|
196
|
+
? ctx.resolve(ctx.node[assertionProperty])?.node
|
|
197
|
+
: ctx.node[assertionProperty];
|
|
198
|
+
const rawValues = ctx.rawNode[assertionProperty];
|
|
199
|
+
const location = currentLocation.child(assertionProperty);
|
|
200
|
+
return asserts[assert.name](values, assert.conditions, {
|
|
201
|
+
...ctx,
|
|
202
|
+
baseLocation: location,
|
|
203
|
+
rawValue: rawValues,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const value = Array.isArray(ctx.node) ? ctx.node : Object.keys(ctx.node);
|
|
208
|
+
return asserts[assert.name](value, assert.conditions, {
|
|
209
|
+
...ctx,
|
|
210
|
+
rawValue: ctx.rawNode,
|
|
211
|
+
baseLocation: currentLocation,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/rules/common/assertions/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAQtE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAiBrE,MAAM,yBAAyB,GAAG;IAChC,QAAQ,EAAE,cAAc;IACxB,aAAa,EAAE,mBAAmB;IAClC,QAAQ,EAAE,cAAc;IACxB,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,aAAa;CACd,CAAC;AAIX,SAAS,yBAAyB,CAChC,QAA2B;IAE3B,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IAE9E,MAAM,UAAU,GAAG,eAAe,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC;IACvE,MAAM,kBAAkB,GACtB,UAAU,IAAI,CAAC,CAAC,GAAoB,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAE5E,MAAM,iBAAiB,GACrB,KAAK,CAAC,OAAO,CAAC,kBAA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
|
+
import { missingRequiredField } from '../utils.js';
|
|
2
|
+
export const InfoContact = () => {
|
|
3
|
+
return {
|
|
4
|
+
Info(info, { report, location }) {
|
|
5
|
+
if (!info.contact) {
|
|
6
|
+
report({
|
|
7
|
+
message: missingRequiredField('Info', 'contact'),
|
|
8
|
+
location: location.child('contact').key(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=info-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-contact.js","sourceRoot":"","sources":["../../../src/rules/common/info-contact.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAwB,GAAG,EAAE;IACnD,OAAO;QACL,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC;oBACL,OAAO,EAAE,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC;oBAChD,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE;iBAC1C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-license-strict.d.ts","sourceRoot":"","sources":["../../../src/rules/common/info-license-strict.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAkBlE,CAAC"}
|