@depup/redocly__openapi-core 2.26.0-depup.1 → 2.40.0-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 +5 -5
- package/changes.json +9 -9
- package/lib/bundle/bundle-document.d.ts +3 -0
- package/lib/bundle/bundle-document.d.ts.map +1 -1
- package/lib/bundle/bundle-document.js +27 -11
- package/lib/bundle/bundle-document.js.map +1 -1
- package/lib/bundle/bundle-visitor.d.ts +4 -2
- package/lib/bundle/bundle-visitor.d.ts.map +1 -1
- package/lib/bundle/bundle-visitor.js +91 -35
- package/lib/bundle/bundle-visitor.js.map +1 -1
- package/lib/bundle/bundle.js +2 -2
- package/lib/bundle/bundle.js.map +1 -1
- package/lib/config/all.d.ts.map +1 -1
- package/lib/config/all.js +29 -1
- package/lib/config/all.js.map +1 -1
- package/lib/config/builtIn.d.ts.map +1 -1
- package/lib/config/builtIn.js +2 -0
- package/lib/config/builtIn.js.map +1 -1
- package/lib/config/config-resolvers.d.ts.map +1 -1
- package/lib/config/config-resolvers.js +12 -19
- package/lib/config/config-resolvers.js.map +1 -1
- package/lib/config/config.d.ts +3 -2
- package/lib/config/config.d.ts.map +1 -1
- package/lib/config/config.js +65 -19
- package/lib/config/config.js.map +1 -1
- package/lib/config/group-assertion-rules.d.ts +1 -1
- package/lib/config/group-assertion-rules.d.ts.map +1 -1
- package/lib/config/group-assertion-rules.js +1 -1
- package/lib/config/group-assertion-rules.js.map +1 -1
- package/lib/config/index.d.ts +1 -0
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +1 -0
- package/lib/config/index.js.map +1 -1
- package/lib/config/minimal.d.ts.map +1 -1
- package/lib/config/minimal.js +29 -1
- package/lib/config/minimal.js.map +1 -1
- package/lib/config/plugins-cache.d.ts +8 -0
- package/lib/config/plugins-cache.d.ts.map +1 -0
- package/lib/config/plugins-cache.js +100 -0
- package/lib/config/plugins-cache.js.map +1 -0
- package/lib/config/recommended-strict.d.ts.map +1 -1
- package/lib/config/recommended-strict.js +29 -1
- package/lib/config/recommended-strict.js.map +1 -1
- package/lib/config/recommended.d.ts.map +1 -1
- package/lib/config/recommended.js +29 -1
- package/lib/config/recommended.js.map +1 -1
- package/lib/config/rules.d.ts +3 -4
- package/lib/config/rules.d.ts.map +1 -1
- package/lib/config/rules.js +4 -4
- package/lib/config/rules.js.map +1 -1
- package/lib/config/spec.d.ts.map +1 -1
- package/lib/config/spec.js +29 -1
- package/lib/config/spec.js.map +1 -1
- package/lib/config/types.d.ts +26 -18
- package/lib/config/types.d.ts.map +1 -1
- package/lib/config/utils.d.ts +2 -2
- package/lib/config/utils.d.ts.map +1 -1
- package/lib/config/utils.js +12 -0
- package/lib/config/utils.js.map +1 -1
- package/lib/config/visitors.d.ts +0 -6
- package/lib/config/visitors.d.ts.map +1 -1
- package/lib/config/visitors.js +3 -13
- package/lib/config/visitors.js.map +1 -1
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +1 -1
- package/lib/decorators/common/filters/filter-helper.js +0 -1
- package/lib/decorators/common/filters/filter-helper.js.map +1 -1
- package/lib/decorators/common/info-override.d.ts.map +1 -1
- package/lib/decorators/common/info-override.js +2 -1
- package/lib/decorators/common/info-override.js.map +1 -1
- package/lib/decorators/oas2/index.d.ts +2 -11
- package/lib/decorators/oas2/index.d.ts.map +1 -1
- package/lib/decorators/oas2/index.js +1 -1
- package/lib/decorators/oas2/index.js.map +1 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +1 -1
- package/lib/decorators/oas2/remove-unused-components.js +63 -38
- package/lib/decorators/oas2/remove-unused-components.js.map +1 -1
- package/lib/decorators/oas3/index.d.ts +2 -12
- package/lib/decorators/oas3/index.d.ts.map +1 -1
- package/lib/decorators/oas3/index.js +2 -2
- package/lib/decorators/oas3/index.js.map +1 -1
- package/lib/decorators/oas3/media-type-examples-override.d.ts.map +1 -0
- package/lib/decorators/oas3/media-type-examples-override.js.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +1 -1
- package/lib/decorators/oas3/remove-unused-components.js +70 -43
- package/lib/decorators/oas3/remove-unused-components.js.map +1 -1
- package/lib/detect-spec.d.ts +0 -1
- package/lib/detect-spec.d.ts.map +1 -1
- package/lib/detect-spec.js +16 -15
- package/lib/detect-spec.js.map +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js.map +1 -1
- package/lib/errors/yaml-parse-error.d.ts +1 -1
- package/lib/errors/yaml-parse-error.d.ts.map +1 -1
- package/lib/errors/yaml-parse-error.js +4 -0
- package/lib/errors/yaml-parse-error.js.map +1 -1
- package/lib/format/format.d.ts +1 -1
- package/lib/format/format.d.ts.map +1 -1
- package/lib/format/format.js +50 -3
- package/lib/format/format.js.map +1 -1
- package/lib/graphql/assertions.d.ts +3 -0
- package/lib/graphql/assertions.d.ts.map +1 -0
- package/lib/graphql/assertions.js +141 -0
- package/lib/graphql/assertions.js.map +1 -0
- package/lib/graphql/detect-graphql.d.ts +3 -0
- package/lib/graphql/detect-graphql.d.ts.map +1 -0
- package/lib/graphql/detect-graphql.js +6 -0
- package/lib/graphql/detect-graphql.js.map +1 -0
- package/lib/graphql/lint-graphql.d.ts +8 -0
- package/lib/graphql/lint-graphql.d.ts.map +1 -0
- package/lib/graphql/lint-graphql.js +58 -0
- package/lib/graphql/lint-graphql.js.map +1 -0
- package/lib/graphql/node-kinds.d.ts +4 -0
- package/lib/graphql/node-kinds.d.ts.map +1 -0
- package/lib/graphql/node-kinds.js +52 -0
- package/lib/graphql/node-kinds.js.map +1 -0
- package/lib/graphql/visitor.d.ts +50 -0
- package/lib/graphql/visitor.d.ts.map +1 -0
- package/lib/graphql/visitor.js +58 -0
- package/lib/graphql/visitor.js.map +1 -0
- package/lib/index.d.ts +13 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/js-yaml/index.d.ts.map +1 -1
- package/lib/js-yaml/index.js +12 -9
- package/lib/js-yaml/index.js.map +1 -1
- package/lib/lint-entity.d.ts +1 -1
- package/lib/lint-entity.d.ts.map +1 -1
- package/lib/lint-entity.js +5 -5
- package/lib/lint-entity.js.map +1 -1
- package/lib/lint.d.ts.map +1 -1
- package/lib/lint.js +8 -5
- package/lib/lint.js.map +1 -1
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +1 -0
- package/lib/logger.js.map +1 -1
- package/lib/oas-types.d.ts +17 -867
- package/lib/oas-types.d.ts.map +1 -1
- package/lib/oas-types.js +8 -0
- package/lib/oas-types.js.map +1 -1
- package/lib/ref-utils.d.ts +4 -2
- package/lib/ref-utils.d.ts.map +1 -1
- package/lib/ref-utils.js +5 -3
- package/lib/ref-utils.js.map +1 -1
- package/lib/resolve.d.ts +1 -2
- package/lib/resolve.d.ts.map +1 -1
- package/lib/resolve.js +52 -29
- package/lib/resolve.js.map +1 -1
- package/lib/rules/ajv.d.ts +19 -16
- package/lib/rules/ajv.d.ts.map +1 -1
- package/lib/rules/ajv.js +86 -87
- package/lib/rules/ajv.js.map +1 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/criteria-unique.js +3 -0
- package/lib/rules/arazzo/criteria-unique.js.map +1 -1
- package/lib/rules/arazzo/index.js +2 -2
- package/lib/rules/arazzo/index.js.map +1 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.js +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +1 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +1 -1
- package/lib/rules/arazzo/sourceDescription-type.js +7 -3
- package/lib/rules/arazzo/sourceDescription-type.js.map +1 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +1 -1
- package/lib/rules/arazzo/spec-step-mutually-exclusive-fields.d.ts +3 -0
- package/lib/rules/arazzo/spec-step-mutually-exclusive-fields.d.ts.map +1 -0
- package/lib/rules/arazzo/spec-step-mutually-exclusive-fields.js +26 -0
- package/lib/rules/arazzo/spec-step-mutually-exclusive-fields.js.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/step-onFailure-unique.js +2 -0
- package/lib/rules/arazzo/step-onFailure-unique.js.map +1 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/step-onSuccess-unique.js +2 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +1 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/stepId-unique.js +1 -0
- package/lib/rules/arazzo/stepId-unique.js.map +1 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +1 -1
- package/lib/rules/arazzo/workflow-dependsOn.js +3 -0
- package/lib/rules/arazzo/workflow-dependsOn.js.map +1 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +1 -1
- package/lib/rules/arazzo/workflowId-unique.js +1 -0
- package/lib/rules/arazzo/workflowId-unique.js.map +1 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +1 -1
- package/lib/rules/async2/channels-kebab-case.js +1 -0
- package/lib/rules/async2/channels-kebab-case.js.map +1 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +1 -1
- package/lib/rules/async2/no-channel-trailing-slash.js +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.js.map +1 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +1 -1
- package/lib/rules/async3/channels-kebab-case.js +1 -0
- package/lib/rules/async3/channels-kebab-case.js.map +1 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +1 -1
- package/lib/rules/async3/no-channel-trailing-slash.js +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.js.map +1 -1
- package/lib/rules/catalog-entity/entity-key-valid.js.map +1 -1
- package/lib/rules/common/assertions/asserts.d.ts +1 -0
- package/lib/rules/common/assertions/asserts.d.ts.map +1 -1
- package/lib/rules/common/assertions/asserts.js +12 -0
- package/lib/rules/common/assertions/asserts.js.map +1 -1
- package/lib/rules/common/assertions/index.d.ts +1 -0
- package/lib/rules/common/assertions/index.d.ts.map +1 -1
- package/lib/rules/common/assertions/index.js.map +1 -1
- package/lib/rules/common/assertions/utils.d.ts +13 -0
- package/lib/rules/common/assertions/utils.d.ts.map +1 -1
- package/lib/rules/common/assertions/utils.js +4 -3
- package/lib/rules/common/assertions/utils.js.map +1 -1
- package/lib/rules/common/info-contact.d.ts.map +1 -1
- package/lib/rules/common/info-contact.js +1 -0
- package/lib/rules/common/info-contact.js.map +1 -1
- package/lib/rules/common/info-license-strict.d.ts.map +1 -1
- package/lib/rules/common/info-license-strict.js +12 -2
- package/lib/rules/common/info-license-strict.js.map +1 -1
- package/lib/rules/common/info-license.d.ts.map +1 -1
- package/lib/rules/common/info-license.js +1 -0
- package/lib/rules/common/info-license.js.map +1 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +1 -1
- package/lib/rules/common/no-ambiguous-paths.js +1 -0
- package/lib/rules/common/no-ambiguous-paths.js.map +1 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +1 -1
- package/lib/rules/common/no-enum-type-mismatch.js +2 -0
- package/lib/rules/common/no-enum-type-mismatch.js.map +1 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +1 -1
- package/lib/rules/common/no-http-verbs-in-paths.js +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.js.map +1 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +1 -1
- package/lib/rules/common/no-identical-paths.js +1 -0
- package/lib/rules/common/no-identical-paths.js.map +1 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +2 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -1
- package/lib/rules/common/no-invalid-parameter-examples.js +27 -12
- package/lib/rules/common/no-invalid-parameter-examples.js.map +1 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +1 -1
- package/lib/rules/common/no-invalid-schema-examples.js +22 -8
- package/lib/rules/common/no-invalid-schema-examples.js.map +1 -1
- package/lib/rules/common/no-mixed-number-range-constraints.d.ts.map +1 -1
- package/lib/rules/common/no-mixed-number-range-constraints.js +2 -0
- package/lib/rules/common/no-mixed-number-range-constraints.js.map +1 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +1 -1
- package/lib/rules/common/no-path-trailing-slash.js +1 -0
- package/lib/rules/common/no-path-trailing-slash.js.map +1 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +1 -1
- package/lib/rules/common/no-required-schema-properties-undefined.js +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +1 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +1 -1
- package/lib/rules/common/no-schema-type-mismatch.js +2 -0
- package/lib/rules/common/no-schema-type-mismatch.js.map +1 -1
- package/lib/rules/common/no-unresolved-refs.d.ts.map +1 -1
- package/lib/rules/common/no-unresolved-refs.js +1 -0
- package/lib/rules/common/no-unresolved-refs.js.map +1 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +1 -1
- package/lib/rules/common/operation-2xx-response.js +12 -2
- package/lib/rules/common/operation-2xx-response.js.map +1 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +1 -1
- package/lib/rules/common/operation-4xx-response.js +12 -2
- package/lib/rules/common/operation-4xx-response.js.map +1 -1
- package/lib/rules/common/operation-description.d.ts.map +1 -1
- package/lib/rules/common/operation-description.js +6 -1
- package/lib/rules/common/operation-description.js.map +1 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +1 -1
- package/lib/rules/common/operation-operationId-unique.js +1 -0
- package/lib/rules/common/operation-operationId-unique.js.map +1 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +1 -1
- package/lib/rules/common/operation-operationId-url-safe.js +1 -0
- package/lib/rules/common/operation-operationId-url-safe.js.map +1 -1
- package/lib/rules/common/operation-operationId.d.ts.map +1 -1
- package/lib/rules/common/operation-operationId.js +6 -1
- package/lib/rules/common/operation-operationId.js.map +1 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +1 -1
- package/lib/rules/common/operation-parameters-unique.js +2 -0
- package/lib/rules/common/operation-parameters-unique.js.map +1 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +1 -1
- package/lib/rules/common/operation-singular-tag.js +1 -0
- package/lib/rules/common/operation-singular-tag.js.map +1 -1
- package/lib/rules/common/operation-summary.d.ts.map +1 -1
- package/lib/rules/common/operation-summary.js +6 -1
- package/lib/rules/common/operation-summary.js.map +1 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +1 -1
- package/lib/rules/common/operation-tag-defined.js +2 -0
- package/lib/rules/common/operation-tag-defined.js.map +1 -1
- package/lib/rules/common/parameter-description.d.ts.map +1 -1
- package/lib/rules/common/parameter-description.js +2 -0
- package/lib/rules/common/parameter-description.js.map +1 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +1 -1
- package/lib/rules/common/path-declaration-must-exist.js +1 -0
- package/lib/rules/common/path-declaration-must-exist.js.map +1 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +1 -1
- package/lib/rules/common/path-http-verbs-order.js +1 -0
- package/lib/rules/common/path-http-verbs-order.js.map +1 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +1 -1
- package/lib/rules/common/path-not-include-query.js +1 -0
- package/lib/rules/common/path-not-include-query.js.map +1 -1
- package/lib/rules/common/path-params-defined.js +8 -1
- package/lib/rules/common/path-params-defined.js.map +1 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +1 -1
- package/lib/rules/common/path-segment-plural.js +1 -0
- package/lib/rules/common/path-segment-plural.js.map +1 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +1 -1
- package/lib/rules/common/paths-kebab-case.js +1 -0
- package/lib/rules/common/paths-kebab-case.js.map +1 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +1 -1
- package/lib/rules/common/required-string-property-missing-min-length.js +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.js.map +1 -1
- package/lib/rules/common/response-contains-header.d.ts.map +1 -1
- package/lib/rules/common/response-contains-header.js +1 -0
- package/lib/rules/common/response-contains-header.js.map +1 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +1 -1
- package/lib/rules/common/scalar-property-missing-example.js +1 -0
- package/lib/rules/common/scalar-property-missing-example.js.map +1 -1
- package/lib/rules/common/security-defined.d.ts.map +1 -1
- package/lib/rules/common/security-defined.js +2 -0
- package/lib/rules/common/security-defined.js.map +1 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +1 -1
- package/lib/rules/common/spec-strict-refs.js +1 -0
- package/lib/rules/common/spec-strict-refs.js.map +1 -1
- package/lib/rules/common/struct.d.ts +2 -2
- package/lib/rules/common/struct.d.ts.map +1 -1
- package/lib/rules/common/struct.js +2 -2
- package/lib/rules/common/struct.js.map +1 -1
- package/lib/rules/common/tag-description.d.ts.map +1 -1
- package/lib/rules/common/tag-description.js +6 -1
- package/lib/rules/common/tag-description.js.map +1 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +1 -1
- package/lib/rules/common/tags-alphabetical.js +1 -0
- package/lib/rules/common/tags-alphabetical.js.map +1 -1
- package/lib/rules/graphql/index.d.ts +3 -0
- package/lib/rules/graphql/index.d.ts.map +1 -0
- package/lib/rules/graphql/index.js +11 -0
- package/lib/rules/graphql/index.js.map +1 -0
- package/lib/rules/graphql/no-unused-types.d.ts +3 -0
- package/lib/rules/graphql/no-unused-types.d.ts.map +1 -0
- package/lib/rules/graphql/no-unused-types.js +101 -0
- package/lib/rules/graphql/no-unused-types.js.map +1 -0
- package/lib/rules/graphql/struct.d.ts +3 -0
- package/lib/rules/graphql/struct.d.ts.map +1 -0
- package/lib/rules/graphql/struct.js +41 -0
- package/lib/rules/graphql/struct.js.map +1 -0
- package/lib/rules/graphql/type-description.d.ts +3 -0
- package/lib/rules/graphql/type-description.d.ts.map +1 -0
- package/lib/rules/graphql/type-description.js +19 -0
- package/lib/rules/graphql/type-description.js.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +1 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.js +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +1 -1
- package/lib/rules/oas2/index.js.map +1 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +1 -1
- package/lib/rules/oas2/request-mime-type.js +15 -3
- package/lib/rules/oas2/request-mime-type.js.map +1 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +1 -1
- package/lib/rules/oas2/response-contains-property.js +1 -0
- package/lib/rules/oas2/response-contains-property.js.map +1 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +1 -1
- package/lib/rules/oas2/response-mime-type.js +15 -3
- package/lib/rules/oas2/response-mime-type.js.map +1 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +1 -1
- package/lib/rules/oas3/array-parameter-serialization.js +1 -0
- package/lib/rules/oas3/array-parameter-serialization.js.map +1 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +1 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.js +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +1 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +1 -1
- package/lib/rules/oas3/component-name-unique.js +3 -3
- package/lib/rules/oas3/component-name-unique.js.map +1 -1
- package/lib/rules/oas3/index.js.map +1 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +1 -1
- package/lib/rules/oas3/no-empty-servers.js +2 -0
- package/lib/rules/oas3/no-empty-servers.js.map +1 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +1 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.js +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +1 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +1 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js +23 -10
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +1 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +1 -1
- package/lib/rules/oas3/no-server-example.com.js +1 -0
- package/lib/rules/oas3/no-server-example.com.js.map +1 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +1 -1
- package/lib/rules/oas3/no-server-trailing-slash.js +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.js.map +1 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +1 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.js +2 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +1 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +1 -1
- package/lib/rules/oas3/no-undefined-server-variable.js +2 -0
- package/lib/rules/oas3/no-undefined-server-variable.js.map +1 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +1 -1
- package/lib/rules/oas3/no-unused-components.js +29 -7
- package/lib/rules/oas3/no-unused-components.js.map +1 -1
- package/lib/rules/oas3/nullable-type-sibling.d.ts.map +1 -1
- package/lib/rules/oas3/nullable-type-sibling.js +1 -0
- package/lib/rules/oas3/nullable-type-sibling.js.map +1 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +1 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +19 -3
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +1 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +1 -1
- package/lib/rules/oas3/request-mime-type.js +21 -3
- package/lib/rules/oas3/request-mime-type.js.map +1 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +1 -1
- package/lib/rules/oas3/response-contains-property.js +1 -0
- package/lib/rules/oas3/response-contains-property.js.map +1 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +1 -1
- package/lib/rules/oas3/response-mime-type.js +21 -3
- package/lib/rules/oas3/response-mime-type.js.map +1 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +1 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -3
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +1 -1
- package/lib/rules/oas3/spec-discriminator-defaultMapping.d.ts.map +1 -1
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js +2 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js.map +1 -1
- package/lib/rules/oas3/spec-example-values.d.ts.map +1 -1
- package/lib/rules/oas3/spec-example-values.js +4 -0
- package/lib/rules/oas3/spec-example-values.js.map +1 -1
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.d.ts.map +1 -1
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +1 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js.map +1 -1
- package/lib/rules/oas3/spec-no-invalid-tag-parents.d.ts.map +1 -1
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js +2 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js.map +1 -1
- package/lib/rules/oas3/spec-querystring-parameters.d.ts.map +1 -1
- package/lib/rules/oas3/spec-querystring-parameters.js +3 -0
- package/lib/rules/oas3/spec-querystring-parameters.js.map +1 -1
- package/lib/rules/openrpc/no-unused-components.d.ts.map +1 -1
- package/lib/rules/openrpc/no-unused-components.js +2 -3
- package/lib/rules/openrpc/no-unused-components.js.map +1 -1
- package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts.map +1 -1
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js +1 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js.map +1 -1
- package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts.map +1 -1
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js +1 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js.map +1 -1
- package/lib/rules/other/stats.d.ts +6 -6
- package/lib/rules/other/stats.d.ts.map +1 -1
- package/lib/rules/other/stats.js.map +1 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +1 -1
- package/lib/rules/respect/no-criteria-xpath.js +1 -0
- package/lib/rules/respect/no-criteria-xpath.js.map +1 -1
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.d.ts.map +1 -1
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +1 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js.map +1 -1
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts.map +1 -1
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js.map +1 -1
- package/lib/rules/respect/x-security-scheme-name-reference.d.ts.map +1 -1
- package/lib/rules/respect/x-security-scheme-name-reference.js +1 -0
- package/lib/rules/respect/x-security-scheme-name-reference.js.map +1 -1
- package/lib/rules/respect/x-security-scheme-required-values.d.ts.map +1 -1
- package/lib/rules/respect/x-security-scheme-required-values.js +2 -0
- package/lib/rules/respect/x-security-scheme-required-values.js.map +1 -1
- package/lib/rules/utils.d.ts +35 -9
- package/lib/rules/utils.d.ts.map +1 -1
- package/lib/rules/utils.js +31 -11
- package/lib/rules/utils.js.map +1 -1
- package/lib/types/arazzo1_1.d.ts +3 -0
- package/lib/types/arazzo1_1.d.ts.map +1 -0
- package/lib/types/arazzo1_1.js +226 -0
- package/lib/types/arazzo1_1.js.map +1 -0
- package/lib/types/asyncapi-bindings.d.ts +8 -0
- package/lib/types/asyncapi-bindings.d.ts.map +1 -0
- package/lib/types/asyncapi-bindings.js +949 -0
- package/lib/types/asyncapi-bindings.js.map +1 -0
- package/lib/types/asyncapi2.d.ts +0 -1
- package/lib/types/asyncapi2.d.ts.map +1 -1
- package/lib/types/asyncapi2.js +2 -605
- package/lib/types/asyncapi2.js.map +1 -1
- package/lib/types/asyncapi3.d.ts.map +1 -1
- package/lib/types/asyncapi3.js +36 -4
- package/lib/types/asyncapi3.js.map +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +4 -6
- package/lib/types/index.js.map +1 -1
- package/lib/types/json-schema-adapter.js.map +1 -1
- package/lib/types/oas2.d.ts.map +1 -1
- package/lib/types/oas2.js +2 -1
- package/lib/types/oas2.js.map +1 -1
- package/lib/types/redocly-yaml.d.ts +8 -2
- package/lib/types/redocly-yaml.d.ts.map +1 -1
- package/lib/types/redocly-yaml.js +137 -15
- package/lib/types/redocly-yaml.js.map +1 -1
- package/lib/typings/arazzo.d.ts +36 -9
- package/lib/typings/arazzo.d.ts.map +1 -1
- package/lib/typings/arazzo.js +1 -2
- package/lib/typings/arazzo.js.map +1 -1
- package/lib/typings/asyncapi3.d.ts +45 -6
- package/lib/typings/asyncapi3.d.ts.map +1 -1
- package/lib/typings/openapi.d.ts +5 -13
- package/lib/typings/openapi.d.ts.map +1 -1
- package/lib/typings/swagger.d.ts +1 -1
- package/lib/typings/swagger.d.ts.map +1 -1
- package/lib/utils/dequal.js +1 -0
- package/lib/utils/dequal.js.map +1 -1
- package/lib/utils/is-not-empty-array.js +1 -1
- package/lib/utils/is-not-empty-array.js.map +1 -1
- package/lib/utils/is-plain-object.d.ts.map +1 -1
- package/lib/utils/is-plain-object.js +1 -0
- package/lib/utils/is-plain-object.js.map +1 -1
- package/lib/utils/is-supported-extension.d.ts +2 -0
- package/lib/utils/is-supported-extension.d.ts.map +1 -0
- package/lib/utils/is-supported-extension.js +4 -0
- package/lib/utils/is-supported-extension.js.map +1 -0
- package/lib/utils/oas-has-component.d.ts +1 -1
- package/lib/utils/oas-has-component.d.ts.map +1 -1
- package/lib/utils/read-file-from-url.d.ts +1 -1
- package/lib/utils/read-file-from-url.d.ts.map +1 -1
- package/lib/utils/scorecards.js +3 -3
- package/lib/utils/scorecards.js.map +1 -1
- package/lib/utils/to-pascal-case.d.ts +2 -0
- package/lib/utils/to-pascal-case.d.ts.map +1 -0
- package/lib/utils/to-pascal-case.js +8 -0
- package/lib/utils/to-pascal-case.js.map +1 -0
- package/lib/utils/validate-mime-type.d.ts +10 -2
- package/lib/utils/validate-mime-type.d.ts.map +1 -1
- package/lib/utils/validate-mime-type.js +6 -2
- package/lib/utils/validate-mime-type.js.map +1 -1
- package/lib/visitors.d.ts +13 -9
- package/lib/visitors.d.ts.map +1 -1
- package/lib/visitors.js.map +1 -1
- package/lib/walk.d.ts +6 -2
- package/lib/walk.d.ts.map +1 -1
- package/lib/walk.js +28 -16
- package/lib/walk.js.map +1 -1
- package/package.json +21 -21
- package/lib/decorators/common/media-type-examples-override.d.ts.map +0 -1
- package/lib/decorators/common/media-type-examples-override.js.map +0 -1
- package/lib/rules/respect/respect-supported-versions.d.ts +0 -3
- package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
- package/lib/rules/respect/respect-supported-versions.js +0 -18
- package/lib/rules/respect/respect-supported-versions.js.map +0 -1
- /package/lib/decorators/{common → oas3}/media-type-examples-override.d.ts +0 -0
- /package/lib/decorators/{common → oas3}/media-type-examples-override.js +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { colorize } from '../logger.js';
|
|
2
|
+
import { Location } from '../ref-utils.js';
|
|
3
|
+
import { asserts, runOnKeysSet, runOnValuesSet, } from '../rules/common/assertions/asserts.js';
|
|
4
|
+
import { getFilenameFromPath, getProblemsMessage, interpolateMessagePlaceholders, } from '../rules/common/assertions/utils.js';
|
|
5
|
+
import { isPlainObject } from '../utils/is-plain-object.js';
|
|
6
|
+
import { isString } from '../utils/is-string.js';
|
|
7
|
+
import { keysOf } from '../utils/keys-of.js';
|
|
8
|
+
// Duplicates the core of getAssertsToApply from rules/common/assertions/utils.ts.
|
|
9
|
+
// Skips the OAS key/value guards, because keys-only asserts like required/disallowed legitimately run against a property here
|
|
10
|
+
function getGraphqlAssertsToApply(assertion) {
|
|
11
|
+
return keysOf(asserts)
|
|
12
|
+
.filter((assertName) => assertion.assertions[assertName] !== undefined)
|
|
13
|
+
.map((assertName) => ({
|
|
14
|
+
name: assertName,
|
|
15
|
+
conditions: assertion.assertions[assertName],
|
|
16
|
+
runsOnKeys: runOnKeysSet.has(assertName),
|
|
17
|
+
runsOnValues: runOnValuesSet.has(assertName),
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
export const GraphqlAssertions = (configurableRulesObject) => {
|
|
21
|
+
const assertions = Object.values(configurableRulesObject).filter((isPlainObject));
|
|
22
|
+
const visitors = [];
|
|
23
|
+
for (const assertion of assertions) {
|
|
24
|
+
if (assertion.severity === 'off')
|
|
25
|
+
continue;
|
|
26
|
+
const kind = assertion.subject?.type;
|
|
27
|
+
if (!kind)
|
|
28
|
+
continue;
|
|
29
|
+
const assertsToApply = getGraphqlAssertsToApply(assertion);
|
|
30
|
+
const whereMatchers = buildWhereMatchers(assertion);
|
|
31
|
+
visitors.push({
|
|
32
|
+
[kind]: (node, ctx) => {
|
|
33
|
+
if (!matchesWhere(node, ctx, whereMatchers))
|
|
34
|
+
return;
|
|
35
|
+
runGraphqlAssertion(node, ctx, assertion, assertsToApply);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return visitors;
|
|
40
|
+
};
|
|
41
|
+
function buildWhereMatchers(assertion) {
|
|
42
|
+
if (!Array.isArray(assertion.where))
|
|
43
|
+
return [];
|
|
44
|
+
return assertion.where.map((definition, index) => {
|
|
45
|
+
if (!isString(definition.subject?.type)) {
|
|
46
|
+
throw new Error(`${assertion.assertionId} -> where -> [${index}]: 'type' (String) is required`);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
kind: definition.subject.type,
|
|
50
|
+
definition,
|
|
51
|
+
assertsToApply: getGraphqlAssertsToApply(definition),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function matchesWhere(node, ctx, matchers) {
|
|
56
|
+
let ancestorMatchers = matchers;
|
|
57
|
+
// A trailing `where` entry of the subject's own type constrains the node itself, not an ancestor.
|
|
58
|
+
const lastMatcher = matchers.at(-1);
|
|
59
|
+
if (lastMatcher && lastMatcher.kind === node.kind) {
|
|
60
|
+
if (!passesAsserts(node, lastMatcher, ctx))
|
|
61
|
+
return false;
|
|
62
|
+
ancestorMatchers = matchers.slice(0, -1);
|
|
63
|
+
}
|
|
64
|
+
let ancestorIndex = 0;
|
|
65
|
+
for (const matcher of ancestorMatchers) {
|
|
66
|
+
let matched = false;
|
|
67
|
+
while (ancestorIndex < ctx.ancestors.length) {
|
|
68
|
+
const ancestor = ctx.ancestors[ancestorIndex++];
|
|
69
|
+
if (ancestor.kind === matcher.kind && passesAsserts(ancestor, matcher, ctx)) {
|
|
70
|
+
matched = true;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!matched)
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
function passesAsserts(node, matcher, ctx) {
|
|
80
|
+
const { value } = resolveSubject(node, matcher.definition.subject.property);
|
|
81
|
+
const baseLocation = new Location(ctx.source, '#/');
|
|
82
|
+
return matcher.assertsToApply.every((assert) => asserts[assert.name](value, assert.conditions, {
|
|
83
|
+
baseLocation,
|
|
84
|
+
rawValue: value,
|
|
85
|
+
}).length === 0);
|
|
86
|
+
}
|
|
87
|
+
function runGraphqlAssertion(node, ctx, assertion, assertsToApply) {
|
|
88
|
+
const property = singleProperty(assertion.subject.property);
|
|
89
|
+
const { value, locNode } = resolveSubject(node, assertion.subject.property);
|
|
90
|
+
const baseLocation = new Location(ctx.source, '#/');
|
|
91
|
+
const problems = assertsToApply.flatMap((assert) => asserts[assert.name](value, assert.conditions, {
|
|
92
|
+
baseLocation,
|
|
93
|
+
rawValue: value,
|
|
94
|
+
}));
|
|
95
|
+
if (!problems.length)
|
|
96
|
+
return;
|
|
97
|
+
// {{pointer}} and {{key}} stay empty - SDL has no JSON pointers or parent keys.
|
|
98
|
+
const defaultMessage = `${colorize.blue(assertion.assertionId)} failed because the ${colorize.blue(assertion.subject.type)} ${colorize.blue(property ?? '')} didn't meet the assertions: {{problems}}`.replace(/ +/g, ' ');
|
|
99
|
+
ctx.report({
|
|
100
|
+
message: interpolateMessagePlaceholders(assertion.message ?? defaultMessage, {
|
|
101
|
+
problems: getProblemsMessage(problems),
|
|
102
|
+
assertionName: assertion.assertionId,
|
|
103
|
+
nodeType: assertion.subject.type,
|
|
104
|
+
property: property ?? '',
|
|
105
|
+
key: '',
|
|
106
|
+
pointer: '',
|
|
107
|
+
file: getFilenameFromPath(ctx.source.absoluteRef),
|
|
108
|
+
}),
|
|
109
|
+
node: locNode,
|
|
110
|
+
suggest: assertion.suggest,
|
|
111
|
+
ruleId: assertion.assertionId,
|
|
112
|
+
severity: assertion.severity,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function unwrapNode(node) {
|
|
116
|
+
if (node?.name?.value !== undefined)
|
|
117
|
+
return { value: node.name.value, locNode: node.name };
|
|
118
|
+
if (node?.value !== undefined)
|
|
119
|
+
return { value: node.value, locNode: node };
|
|
120
|
+
return { value: node, locNode: node };
|
|
121
|
+
}
|
|
122
|
+
function resolveSubject(node, property) {
|
|
123
|
+
const propertyName = singleProperty(property);
|
|
124
|
+
if (propertyName === undefined)
|
|
125
|
+
return unwrapNode(node);
|
|
126
|
+
const target = node[propertyName];
|
|
127
|
+
if (Array.isArray(target)) {
|
|
128
|
+
return { value: target.map((item) => unwrapNode(item).value), locNode: node };
|
|
129
|
+
}
|
|
130
|
+
const resolved = unwrapNode(target);
|
|
131
|
+
// A non-AST property value has no location of its own - report the parent node.
|
|
132
|
+
return { value: resolved.value, locNode: isAstNode(resolved.locNode) ? resolved.locNode : node };
|
|
133
|
+
}
|
|
134
|
+
function isAstNode(target) {
|
|
135
|
+
return isPlainObject(target) && 'kind' in target;
|
|
136
|
+
}
|
|
137
|
+
// GraphQL subjects target a single property. Arrays are accepted only for config-shape parity with OAS; the first entry is used.
|
|
138
|
+
function singleProperty(property) {
|
|
139
|
+
return Array.isArray(property) ? property[0] : property;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=assertions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../src/graphql/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,YAAY,EACZ,cAAc,GAEf,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,8BAA8B,GAE/B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW7C,kFAAkF;AAClF,8HAA8H;AAC9H,SAAS,wBAAwB,CAAC,SAA8B;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC;SACnB,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC;SACtE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC;QAC5C,UAAU,EAAE,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC;QACxC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;KAC7C,CAAC,CAAC,CAAC;AACR,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAgB,CAC5C,uBAAgD,EAC9B,EAAE;IACpB,MAAM,UAAU,GAAG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Y,CAAC,CAAC;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAChF,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACpC,gFAAgF;IAChF,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACnG,CAAC;AAED,SAAS,SAAS,CAAC,MAAe;IAChC,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,MAAM,CAAC;AACnD,CAAC;AAED,iIAAiI;AACjI,SAAS,cAAc,CAAC,QAA0C;IAChE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-graphql.d.ts","sourceRoot":"","sources":["../../src/graphql/detect-graphql.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,UAAuB,CAAC;AAEvD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-graphql.js","sourceRoot":"","sources":["../../src/graphql/detect-graphql.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAEvD,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,aAAa,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { Document } from '../resolve.js';
|
|
3
|
+
import type { NormalizedProblem } from '../walk.js';
|
|
4
|
+
export declare function lintGraphqlDocument(opts: {
|
|
5
|
+
document: Document;
|
|
6
|
+
config: Config;
|
|
7
|
+
}): NormalizedProblem[];
|
|
8
|
+
//# sourceMappingURL=lint-graphql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-graphql.d.ts","sourceRoot":"","sources":["../../src/graphql/lint-graphql.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAmB,MAAM,oBAAoB,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,iBAAiB,EAAE,CA6BtB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { GraphQLError, parse, Source as GraphqlSource, visitInParallel, visit, } from 'graphql';
|
|
2
|
+
import { initRules } from '../config/rules.js';
|
|
3
|
+
import { toAstVisitor } from './visitor.js';
|
|
4
|
+
export function lintGraphqlDocument(opts) {
|
|
5
|
+
const { document, config } = opts;
|
|
6
|
+
const source = document.source;
|
|
7
|
+
if (source.body.trim() === '') {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
ruleId: 'struct',
|
|
11
|
+
severity: 'error',
|
|
12
|
+
message: 'The GraphQL document is empty. Expected at least one type definition.',
|
|
13
|
+
suggest: [],
|
|
14
|
+
location: [{ source, pointer: undefined, start: { line: 1, col: 1 } }],
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
let ast;
|
|
19
|
+
try {
|
|
20
|
+
ast = parse(new GraphqlSource(source.body, source.absoluteRef));
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
if (e instanceof GraphQLError) {
|
|
24
|
+
return [syntaxErrorToProblem(e, source)];
|
|
25
|
+
}
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
const ruleSets = (config.getRulesForSpecVersion('graphql') ?? []);
|
|
29
|
+
const rules = initRules(ruleSets, config, 'rules', 'graphql');
|
|
30
|
+
const problems = runGraphqlRules({ ast, source, config, rules });
|
|
31
|
+
return problems.map((problem) => config.addProblemToIgnore(problem));
|
|
32
|
+
}
|
|
33
|
+
function syntaxErrorToProblem(error, source) {
|
|
34
|
+
const loc = error.locations?.[0];
|
|
35
|
+
return {
|
|
36
|
+
ruleId: 'struct',
|
|
37
|
+
severity: 'error',
|
|
38
|
+
message: error.message,
|
|
39
|
+
suggest: [],
|
|
40
|
+
location: [
|
|
41
|
+
{
|
|
42
|
+
source,
|
|
43
|
+
pointer: undefined,
|
|
44
|
+
start: loc ? { line: loc.line, col: loc.column } : { line: 1, col: 1 },
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function runGraphqlRules(opts) {
|
|
50
|
+
const { ast, source, config, rules } = opts;
|
|
51
|
+
const problems = [];
|
|
52
|
+
const astVisitors = rules.map(({ ruleId, severity, message, visitor }) => toAstVisitor(visitor, { ruleId, severity, message, source, config, problems }));
|
|
53
|
+
if (astVisitors.length > 0) {
|
|
54
|
+
visit(ast, visitInParallel(astVisitors));
|
|
55
|
+
}
|
|
56
|
+
return problems;
|
|
57
|
+
}
|
|
58
|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O,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAC/E,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,GAAG,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-kinds.d.ts","sourceRoot":"","sources":["../../src/graphql/node-kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG,GAAG,IAAI,EAAE,CAAC;AAExC,eAAO,MAAM,gBAAgB,EAAE,eAAe,EAkD7C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const graphqlNodeKinds = [
|
|
2
|
+
'Name',
|
|
3
|
+
'Document',
|
|
4
|
+
'OperationDefinition',
|
|
5
|
+
'VariableDefinition',
|
|
6
|
+
'SelectionSet',
|
|
7
|
+
'Field',
|
|
8
|
+
'Argument',
|
|
9
|
+
'FragmentSpread',
|
|
10
|
+
'InlineFragment',
|
|
11
|
+
'FragmentDefinition',
|
|
12
|
+
'Variable',
|
|
13
|
+
'IntValue',
|
|
14
|
+
'FloatValue',
|
|
15
|
+
'StringValue',
|
|
16
|
+
'BooleanValue',
|
|
17
|
+
'NullValue',
|
|
18
|
+
'EnumValue',
|
|
19
|
+
'ListValue',
|
|
20
|
+
'ObjectValue',
|
|
21
|
+
'ObjectField',
|
|
22
|
+
'Directive',
|
|
23
|
+
'NamedType',
|
|
24
|
+
'ListType',
|
|
25
|
+
'NonNullType',
|
|
26
|
+
'SchemaDefinition',
|
|
27
|
+
'OperationTypeDefinition',
|
|
28
|
+
'ScalarTypeDefinition',
|
|
29
|
+
'ObjectTypeDefinition',
|
|
30
|
+
'FieldDefinition',
|
|
31
|
+
'InputValueDefinition',
|
|
32
|
+
'InterfaceTypeDefinition',
|
|
33
|
+
'UnionTypeDefinition',
|
|
34
|
+
'EnumTypeDefinition',
|
|
35
|
+
'EnumValueDefinition',
|
|
36
|
+
'InputObjectTypeDefinition',
|
|
37
|
+
'DirectiveDefinition',
|
|
38
|
+
'SchemaExtension',
|
|
39
|
+
'DirectiveExtension',
|
|
40
|
+
'ScalarTypeExtension',
|
|
41
|
+
'ObjectTypeExtension',
|
|
42
|
+
'InterfaceTypeExtension',
|
|
43
|
+
'UnionTypeExtension',
|
|
44
|
+
'EnumTypeExtension',
|
|
45
|
+
'InputObjectTypeExtension',
|
|
46
|
+
'TypeCoordinate',
|
|
47
|
+
'MemberCoordinate',
|
|
48
|
+
'ArgumentCoordinate',
|
|
49
|
+
'DirectiveCoordinate',
|
|
50
|
+
'DirectiveArgumentCoordinate',
|
|
51
|
+
];
|
|
52
|
+
//# sourceMappingURL=node-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-kinds.js","sourceRoot":"","sources":["../../src/graphql/node-kinds.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,MAAM;IACN,UAAU;IACV,qBAAqB;IACrB,oBAAoB;IACpB,cAAc;IACd,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,UAAU;IACV,UAAU;IACV,YAAY;IACZ,aAAa;IACb,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,UAAU;IACV,aAAa;IACb,kBAAkB;IAClB,yBAAyB;IACzB,sBAAsB;IACtB,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;IACtB,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,2BAA2B;IAC3B,qBAAqB;IACrB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,wBAAwB;IACxB,oBAAoB;IACpB,mBAAmB;IACnB,0BAA0B;IAC1B,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,6BAA6B;CAC9B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ASTNode, type ASTVisitor } from 'graphql';
|
|
2
|
+
import type { Config } from '../config/index.js';
|
|
3
|
+
import type { Source } from '../resolve.js';
|
|
4
|
+
import type { NormalizedProblem, ProblemSeverity, Loc } from '../walk.js';
|
|
5
|
+
import type { GraphqlNodeKind } from './node-kinds.js';
|
|
6
|
+
export type GraphqlProblem = {
|
|
7
|
+
message: string;
|
|
8
|
+
node?: ASTNode;
|
|
9
|
+
loc?: {
|
|
10
|
+
start: Loc;
|
|
11
|
+
end?: Loc;
|
|
12
|
+
};
|
|
13
|
+
suggest?: string[];
|
|
14
|
+
ruleId?: string;
|
|
15
|
+
severity?: ProblemSeverity;
|
|
16
|
+
};
|
|
17
|
+
export type GraphqlUserContext = {
|
|
18
|
+
report(problem: GraphqlProblem): void;
|
|
19
|
+
source: Source;
|
|
20
|
+
config?: Config;
|
|
21
|
+
ancestors: ASTNode[];
|
|
22
|
+
};
|
|
23
|
+
export type GraphqlVisitFunction = (node: any, ctx: GraphqlUserContext) => void;
|
|
24
|
+
export type GraphqlVisitorNode = GraphqlVisitFunction | {
|
|
25
|
+
enter?: GraphqlVisitFunction;
|
|
26
|
+
leave?: GraphqlVisitFunction;
|
|
27
|
+
};
|
|
28
|
+
export type GraphqlVisitor = Partial<Record<GraphqlNodeKind, GraphqlVisitorNode>>;
|
|
29
|
+
export type GraphqlRule = (options: Record<string, any>) => GraphqlVisitor | GraphqlVisitor[];
|
|
30
|
+
type ContextOptions = {
|
|
31
|
+
ruleId: string;
|
|
32
|
+
severity: ProblemSeverity;
|
|
33
|
+
message?: string;
|
|
34
|
+
source: Source;
|
|
35
|
+
config?: Config;
|
|
36
|
+
problems: NormalizedProblem[];
|
|
37
|
+
};
|
|
38
|
+
export declare function toAstVisitor(visitor: GraphqlVisitor, opts: ContextOptions): ASTVisitor;
|
|
39
|
+
export declare function nodeToLoc(node?: ASTNode): {
|
|
40
|
+
start: {
|
|
41
|
+
line: number;
|
|
42
|
+
col: number;
|
|
43
|
+
};
|
|
44
|
+
end: {
|
|
45
|
+
line: number;
|
|
46
|
+
col: number;
|
|
47
|
+
};
|
|
48
|
+
} | undefined;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=visitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/graphql/visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAErE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAyB,iBAAiB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB;IAAE,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAAC,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAGnE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAElF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,cAAc,GAAG,cAAc,EAAE,CAAC;AAE9F,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAatF;AA+CD,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO;;;;;;;;;cAQvC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getLocation } from 'graphql';
|
|
2
|
+
export function toAstVisitor(visitor, opts) {
|
|
3
|
+
const astVisitor = {};
|
|
4
|
+
for (const kind of Object.keys(visitor)) {
|
|
5
|
+
const handler = visitor[kind];
|
|
6
|
+
if (!handler)
|
|
7
|
+
continue;
|
|
8
|
+
const enter = typeof handler === 'function' ? handler : handler.enter;
|
|
9
|
+
const leave = typeof handler === 'function' ? undefined : handler.leave;
|
|
10
|
+
astVisitor[kind] = {
|
|
11
|
+
...(enter ? { enter: wrap(enter, opts) } : {}),
|
|
12
|
+
...(leave ? { leave: wrap(leave, opts) } : {}),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return astVisitor;
|
|
16
|
+
}
|
|
17
|
+
function wrap(fn, opts) {
|
|
18
|
+
return (node, _key, _parent, _path, ancestors) => {
|
|
19
|
+
fn(node, makeContext(node, opts, ancestors));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function makeContext(currentNode, opts, rawAncestors = []) {
|
|
23
|
+
const { ruleId, severity, message, source, config, problems } = opts;
|
|
24
|
+
const ancestors = rawAncestors.filter((ancestor) => !Array.isArray(ancestor));
|
|
25
|
+
return {
|
|
26
|
+
source,
|
|
27
|
+
config,
|
|
28
|
+
ancestors,
|
|
29
|
+
report(problem) {
|
|
30
|
+
const node = problem.node ?? currentNode;
|
|
31
|
+
const loc = problem.loc ?? nodeToLoc(node);
|
|
32
|
+
const location = {
|
|
33
|
+
source,
|
|
34
|
+
pointer: undefined,
|
|
35
|
+
start: loc?.start ?? { line: 1, col: 1 },
|
|
36
|
+
end: loc?.end,
|
|
37
|
+
};
|
|
38
|
+
problems.push({
|
|
39
|
+
ruleId: problem.ruleId ?? ruleId,
|
|
40
|
+
severity: problem.severity ?? severity,
|
|
41
|
+
message: message ? message.replace('{{message}}', problem.message) : problem.message,
|
|
42
|
+
suggest: problem.suggest ?? [],
|
|
43
|
+
location: [location],
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function nodeToLoc(node) {
|
|
49
|
+
if (!node?.loc)
|
|
50
|
+
return undefined;
|
|
51
|
+
const start = getLocation(node.loc.source, node.loc.start);
|
|
52
|
+
const end = getLocation(node.loc.source, node.loc.end);
|
|
53
|
+
return {
|
|
54
|
+
start: { line: start.line, col: start.column },
|
|
55
|
+
end: { line: end.line, col: end.column },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=visitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../src/graphql/visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiC,MAAM,SAAS,CAAC;AA8CrE,MAAM,UAAU,YAAY,CAAC,OAAuB,EAAE,IAAoB;IACxE,MAAM,UAAU,GAA4B,EAAE,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAgC,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QACtE,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QACxE,UAAU,CAAC,IAAI,CAAC,GAAG;YACjB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/C,CAAC;IACJ,CAAC;IACD,OAAO,UAAwB,CAAC;AAClC,CAAC;AAED,SAAS,IAAI,CAAC,EAAwB,EAAE,IAAoB;IAC1D,OAAO,CACL,IAAa,EACb,IAAa,EACb,OAAgB,EAChB,KAAc,EACd,SAAkC,EAClC,EAAE;QACF,EAAE,CAAC,IAAI,EAA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AAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,IAAI,CAAC,IAAI,EAAE,GAAG;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE;QAC9C,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -19,41 +19,43 @@ export { Oas3_2Types } from './types/oas3_2.js';
|
|
|
19
19
|
export { AsyncApi2Types } from './types/asyncapi2.js';
|
|
20
20
|
export { AsyncApi3Types } from './types/asyncapi3.js';
|
|
21
21
|
export { Arazzo1Types } from './types/arazzo.js';
|
|
22
|
+
export { Arazzo1_1Types } from './types/arazzo1_1.js';
|
|
22
23
|
export { Overlay1Types } from './types/overlay.js';
|
|
23
24
|
export { OpenRpcTypes } from './types/openrpc.js';
|
|
24
25
|
export { ConfigTypes, createConfigTypes } from './types/redocly-yaml.js';
|
|
25
26
|
export { createEntityTypes } from './types/entity.js';
|
|
26
27
|
export { normalizeTypes, type NormalizedNodeType, type NodeType } from './types/index.js';
|
|
27
28
|
export { StatsOAS, StatsAsync2, StatsAsync3 } from './rules/other/stats.js';
|
|
28
|
-
export { loadConfig, loadIgnoreConfig, createConfig, findConfig, resolvePlugins, ConfigValidationError, Config, // FIXME: export it as a type
|
|
29
|
-
type RawUniversalConfig, type RawUniversalApiConfig, type ResolvedConfig, type ResolvedApiConfig, type Plugin, type RuleConfig, type RuleSeverity, type IgnoreConfig, } from './config/index.js';
|
|
29
|
+
export { loadConfig, loadIgnoreConfig, createConfig, findConfig, resolvePlugins, clearPluginsCache, getPluginCacheVersion, ConfigValidationError, Config, // FIXME: export it as a type
|
|
30
|
+
type RawUniversalConfig, type RawUniversalApiConfig, type ResolvedConfig, type ResolvedApiConfig, type Plugin, type RuleConfig, type RuleSeverity, type IgnoreConfig, type ResolveConfig, } from './config/index.js';
|
|
30
31
|
export * from './config/constants.js';
|
|
31
32
|
export { Source, BaseResolver, Document, ResolveError, resolveDocument, makeDocumentFromString, type ResolvedRefMap, } from './resolve.js';
|
|
32
33
|
export { YamlParseError } from './errors/yaml-parse-error.js';
|
|
33
34
|
export { parseYaml, stringifyYaml } from './js-yaml/index.js';
|
|
34
|
-
export { unescapePointerFragment, isRef, isAbsoluteUrl, getDir, resolvePath, escapePointerFragment, type Location, } from './ref-utils.js';
|
|
35
|
+
export { unescapePointerFragment, isRef, isMappingRef, isAbsoluteUrl, getDir, resolvePath, escapePointerFragment, type Location, } from './ref-utils.js';
|
|
35
36
|
export { detectSpec } from './detect-spec.js';
|
|
36
37
|
export { getTypes, type SpecVersion, type SpecMajorVersion } from './oas-types.js';
|
|
37
38
|
export { getMajorSpecVersion } from './detect-spec.js';
|
|
38
|
-
export { normalizeVisitors, type Oas3Visitor, type Oas2Visitor, type Async2Visitor, type Async3Visitor, type Arazzo1Visitor, type Overlay1Visitor, type OpenRpc1Visitor, type Oas3Rule, type Oas2Rule, type Async2Rule, type Async3Rule, type Arazzo1Rule, type Overlay1Rule, type OpenRpc1Rule, type Oas3Decorator, type Oas2Decorator, type Async2Decorator, type Async3Decorator, type Arazzo1Decorator, type Overlay1Decorator, type OpenRpc1Decorator, type Oas3Preprocessor, type Oas2Preprocessor, type Async2Preprocessor, type Async3Preprocessor, type Arazzo1Preprocessor, type Overlay1Preprocessor, type OpenRpc1Preprocessor, } from './visitors.js';
|
|
39
|
+
export { normalizeVisitors, type Oas3Visitor, type Oas2Visitor, type Async2Visitor, type Async3Visitor, type Arazzo1Visitor, type Overlay1Visitor, type OpenRpc1Visitor, type Oas3Rule, type Oas2Rule, type Async2Rule, type Async3Rule, type Arazzo1Rule, type Overlay1Rule, type OpenRpc1Rule, type Oas3Decorator, type Oas2Decorator, type Async2Decorator, type Async3Decorator, type Arazzo1Decorator, type Overlay1Decorator, type OpenRpc1Decorator, type Oas3Decorator as Oas3Preprocessor, type Oas2Decorator as Oas2Preprocessor, type Async2Decorator as Async2Preprocessor, type Async3Decorator as Async3Preprocessor, type Arazzo1Decorator as Arazzo1Preprocessor, type Overlay1Decorator as Overlay1Preprocessor, type OpenRpc1Decorator as OpenRpc1Preprocessor, } from './visitors.js';
|
|
39
40
|
export { WalkContext, NormalizedProblem, ProblemSeverity, LineColLocationObject, LocationObject, Loc, walkDocument, type UserContext, } from './walk.js';
|
|
40
41
|
export { getAstNodeByPointer, getLineColLocation, getCodeframe } from './format/codeframes.js';
|
|
41
42
|
export { formatProblems, getTotals, xmlEscape, type OutputFormat, type Totals, } from './format/format.js';
|
|
42
43
|
export { lint, lint as validate, lintDocument, lintFromString, lintConfig } from './lint.js';
|
|
43
44
|
export { lintEntityFile, lintEntityWithScorecardLevel, lintSchema } from './lint-entity.js';
|
|
44
45
|
export { bundle, bundleFromString, type BundleResult } from './bundle/bundle.js';
|
|
45
|
-
export { bundleDocument } from './bundle/bundle-document.js';
|
|
46
|
+
export { bundleDocument, type ComponentNamesStrategy } from './bundle/bundle-document.js';
|
|
46
47
|
export { mapTypeToComponent } from './bundle/bundle-visitor.js';
|
|
47
48
|
export { type Assertions, type Assertion } from './rules/common/assertions/index.js';
|
|
48
49
|
export { logger, type LoggerInterface } from './logger.js';
|
|
49
50
|
export { HandledError } from './utils/error.js';
|
|
51
|
+
export { isSupportedExtension } from './utils/is-supported-extension.js';
|
|
50
52
|
export { isBrowser } from './env.js';
|
|
51
53
|
export type { CollectFn, Exact } from './utils/types.js';
|
|
52
|
-
export type
|
|
53
|
-
export type
|
|
54
|
-
export type
|
|
55
|
-
export type
|
|
56
|
-
export type
|
|
57
|
-
export type
|
|
54
|
+
export type * from './typings/openapi.js';
|
|
55
|
+
export type * from './typings/swagger.js';
|
|
56
|
+
export type * from './typings/asyncapi3.js';
|
|
57
|
+
export type * from './typings/asyncapi.js';
|
|
58
|
+
export type * from './typings/openrpc.js';
|
|
59
|
+
export type * from './typings/arazzo.js';
|
|
58
60
|
export type { StatsAccumulator, OASStatsAccumulator, AsyncAPIStatsAccumulator, StatsName, } from './typings/common.js';
|
|
59
61
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC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AAChE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzD,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,qBAAqB,CAAC;AACzC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,GACV,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -19,19 +19,20 @@ export { Oas3_2Types } from './types/oas3_2.js';
|
|
|
19
19
|
export { AsyncApi2Types } from './types/asyncapi2.js';
|
|
20
20
|
export { AsyncApi3Types } from './types/asyncapi3.js';
|
|
21
21
|
export { Arazzo1Types } from './types/arazzo.js';
|
|
22
|
+
export { Arazzo1_1Types } from './types/arazzo1_1.js';
|
|
22
23
|
export { Overlay1Types } from './types/overlay.js';
|
|
23
24
|
export { OpenRpcTypes } from './types/openrpc.js';
|
|
24
25
|
export { ConfigTypes, createConfigTypes } from './types/redocly-yaml.js';
|
|
25
26
|
export { createEntityTypes } from './types/entity.js';
|
|
26
27
|
export { normalizeTypes } from './types/index.js';
|
|
27
28
|
export { StatsOAS, StatsAsync2, StatsAsync3 } from './rules/other/stats.js';
|
|
28
|
-
export { loadConfig, loadIgnoreConfig, createConfig, findConfig, resolvePlugins, ConfigValidationError, Config, // FIXME: export it as a type
|
|
29
|
+
export { loadConfig, loadIgnoreConfig, createConfig, findConfig, resolvePlugins, clearPluginsCache, getPluginCacheVersion, ConfigValidationError, Config, // FIXME: export it as a type
|
|
29
30
|
} from './config/index.js';
|
|
30
31
|
export * from './config/constants.js';
|
|
31
32
|
export { Source, BaseResolver, ResolveError, resolveDocument, makeDocumentFromString, } from './resolve.js';
|
|
32
33
|
export { YamlParseError } from './errors/yaml-parse-error.js';
|
|
33
34
|
export { parseYaml, stringifyYaml } from './js-yaml/index.js';
|
|
34
|
-
export { unescapePointerFragment, isRef, isAbsoluteUrl, getDir, resolvePath, escapePointerFragment, } from './ref-utils.js';
|
|
35
|
+
export { unescapePointerFragment, isRef, isMappingRef, isAbsoluteUrl, getDir, resolvePath, escapePointerFragment, } from './ref-utils.js';
|
|
35
36
|
export { detectSpec } from './detect-spec.js';
|
|
36
37
|
export { getTypes } from './oas-types.js';
|
|
37
38
|
export { getMajorSpecVersion } from './detect-spec.js';
|
|
@@ -46,5 +47,6 @@ export { bundleDocument } from './bundle/bundle-document.js';
|
|
|
46
47
|
export { mapTypeToComponent } from './bundle/bundle-visitor.js';
|
|
47
48
|
export { logger } from './logger.js';
|
|
48
49
|
export { HandledError } from './utils/error.js';
|
|
50
|
+
export { isSupportedExtension } from './utils/is-supported-extension.js';
|
|
49
51
|
export { isBrowser } from './env.js';
|
|
50
52
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,O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EACL,cAAc,EACd,SAAS,EACT,SAAS,GAGV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAqB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,cAAc,EAA+B,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAwB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAUjB,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,OAAO,WAAW,KAAG,OAS3D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,GAAG,EAAE,OAAO,WAAW,KAAG,MAAyB,CAAC"}
|
package/lib/js-yaml/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { CORE_SCHEMA, mergeTag, binaryTag, omapTag, pairsTag, setTag, loadAll, dump, YAMLException, } from 'js-yaml';
|
|
2
|
+
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = CORE_SCHEMA.withTags(mergeTag, binaryTag, omapTag, pairsTag, setTag);
|
|
3
|
+
export const parseYaml = (str, opts) => {
|
|
4
|
+
const documents = loadAll(str, { schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts });
|
|
5
|
+
if (documents.length === 0) {
|
|
6
|
+
return str.trim() === '' ? undefined : null;
|
|
7
|
+
}
|
|
8
|
+
if (documents.length > 1) {
|
|
9
|
+
throw new YAMLException('expected a single document in the stream, but found more');
|
|
10
|
+
}
|
|
11
|
+
return documents[0];
|
|
12
|
+
};
|
|
10
13
|
export const stringifyYaml = (obj, opts) => dump(obj, opts);
|
|
11
14
|
//# sourceMappingURL=index.js.map
|
package/lib/js-yaml/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,aAAa,GAGd,MAAM,SAAS,CAAC;AAEjB,MAAM,gCAAgC,GAAG,WAAW,CAAC,QAAQ,CAC3D,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,IAAkB,EAAW,EAAE;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,gCAAgC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACtF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,aAAa,CAAC,0DAA0D,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,IAAkB,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC"}
|
package/lib/lint-entity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EntityFileSchema, type EntityBaseFileSchema, type ScorecardConfig } from '@redocly/config';
|
|
2
2
|
import type { JSONSchema } from 'json-schema-to-ts';
|
|
3
3
|
import { type Config } from './config/index.js';
|
|
4
4
|
import { BaseResolver, type Document } from './resolve.js';
|