@depup/redocly__openapi-core 2.26.0-depup.2 → 2.41.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 +7 -6
- package/changes.json +13 -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 +35 -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 +35 -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 +35 -1
- package/lib/config/recommended-strict.js.map +1 -1
- package/lib/config/recommended.d.ts.map +1 -1
- package/lib/config/recommended.js +35 -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 +35 -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/index.d.ts.map +1 -1
- package/lib/rules/async2/index.js +2 -0
- package/lib/rules/async2/index.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/index.d.ts.map +1 -1
- package/lib/rules/async3/index.js +2 -0
- package/lib/rules/async3/index.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/async3/security-scopes-defined.d.ts +3 -0
- package/lib/rules/async3/security-scopes-defined.d.ts.map +1 -0
- package/lib/rules/async3/security-scopes-defined.js +70 -0
- package/lib/rules/async3/security-scopes-defined.js.map +1 -0
- 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/security-scopes-defined.d.ts +3 -0
- package/lib/rules/common/security-scopes-defined.d.ts.map +1 -0
- package/lib/rules/common/security-scopes-defined.js +71 -0
- package/lib/rules/common/security-scopes-defined.js.map +1 -0
- 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.d.ts.map +1 -1
- package/lib/rules/oas2/index.js +2 -0
- 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.d.ts.map +1 -1
- package/lib/rules/oas3/index.js +2 -0
- 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 +11 -5
- package/lib/types/redocly-yaml.d.ts.map +1 -1
- package/lib/types/redocly-yaml.js +141 -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 +67 -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 +25 -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
|
@@ -1,54 +1,63 @@
|
|
|
1
|
+
import { parseRef } from '../../ref-utils.js';
|
|
1
2
|
import { isEmptyObject } from '../../utils/is-empty-object.js';
|
|
3
|
+
const OAS2_COMPONENT_TYPES = [
|
|
4
|
+
'definitions',
|
|
5
|
+
'parameters',
|
|
6
|
+
'responses',
|
|
7
|
+
'securityDefinitions',
|
|
8
|
+
];
|
|
2
9
|
export const RemoveUnusedComponents = () => {
|
|
3
10
|
const components = new Map();
|
|
4
|
-
function registerComponent(
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
function registerComponent(componentType, name) {
|
|
12
|
+
const key = `${componentType}/${name}`;
|
|
13
|
+
components.set(key, {
|
|
14
|
+
usedIn: components.get(key)?.usedIn ?? [],
|
|
7
15
|
componentType,
|
|
8
16
|
name,
|
|
9
17
|
});
|
|
10
18
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
function getComponentKey(pointer) {
|
|
20
|
+
if (!pointer.startsWith('#/'))
|
|
21
|
+
return;
|
|
22
|
+
const [type, name] = parseRef(pointer).pointer;
|
|
23
|
+
if (!type || !name)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (!OAS2_COMPONENT_TYPES.includes(type))
|
|
26
|
+
return undefined;
|
|
27
|
+
return `${type}/${name}`;
|
|
28
|
+
}
|
|
29
|
+
function removeUnusedComponents(root, removedKeys = new Set()) {
|
|
30
|
+
const removedCountBefore = removedKeys.size;
|
|
31
|
+
for (const [key, { usedIn, name, componentType }] of components) {
|
|
32
|
+
const used = usedIn.some((sourceKey) => sourceKey !== key && !removedKeys.has(sourceKey));
|
|
20
33
|
if (!used && componentType) {
|
|
21
|
-
|
|
34
|
+
removedKeys.add(key);
|
|
22
35
|
delete root[componentType][name];
|
|
23
|
-
components.delete(
|
|
36
|
+
components.delete(key);
|
|
24
37
|
if (isEmptyObject(root[componentType])) {
|
|
25
38
|
delete root[componentType];
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
}
|
|
29
|
-
return
|
|
30
|
-
? removeUnusedComponents(root,
|
|
31
|
-
:
|
|
42
|
+
return removedKeys.size > removedCountBefore
|
|
43
|
+
? removeUnusedComponents(root, removedKeys)
|
|
44
|
+
: removedKeys.size;
|
|
32
45
|
}
|
|
33
46
|
return {
|
|
34
47
|
ref: {
|
|
35
|
-
leave(ref, { location, type,
|
|
48
|
+
leave(ref, { location, type, key }) {
|
|
36
49
|
if (['Schema', 'Parameter', 'Response', 'SecurityScheme'].includes(type.name)) {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
return;
|
|
40
|
-
const [fileLocation, localPointer] = resolvedRef.location.absolutePointer.split('#', 2);
|
|
41
|
-
if (!localPointer)
|
|
50
|
+
const targetPointer = getComponentKey(ref.$ref);
|
|
51
|
+
if (!targetPointer)
|
|
42
52
|
return;
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const registered = components.get(pointer);
|
|
53
|
+
const sourcePointer = getComponentKey(location.pointer) ?? location.pointer;
|
|
54
|
+
const registered = components.get(targetPointer);
|
|
46
55
|
if (registered) {
|
|
47
|
-
registered.usedIn.push(
|
|
56
|
+
registered.usedIn.push(sourcePointer);
|
|
48
57
|
}
|
|
49
58
|
else {
|
|
50
|
-
components.set(
|
|
51
|
-
usedIn: [
|
|
59
|
+
components.set(targetPointer, {
|
|
60
|
+
usedIn: [sourcePointer],
|
|
52
61
|
name: key.toString(),
|
|
53
62
|
});
|
|
54
63
|
}
|
|
@@ -58,31 +67,47 @@ export const RemoveUnusedComponents = () => {
|
|
|
58
67
|
Root: {
|
|
59
68
|
leave(root, ctx) {
|
|
60
69
|
const data = ctx.getVisitorData();
|
|
61
|
-
data.removedCount = removeUnusedComponents(root
|
|
70
|
+
data.removedCount = removeUnusedComponents(root);
|
|
62
71
|
},
|
|
63
72
|
},
|
|
64
73
|
NamedSchemas: {
|
|
65
|
-
Schema(schema, {
|
|
74
|
+
Schema(schema, { key }) {
|
|
66
75
|
if (!schema.allOf) {
|
|
67
|
-
registerComponent(
|
|
76
|
+
registerComponent('definitions', key.toString());
|
|
68
77
|
}
|
|
69
78
|
},
|
|
70
79
|
},
|
|
71
80
|
NamedParameters: {
|
|
72
|
-
Parameter(_parameter, {
|
|
73
|
-
registerComponent(
|
|
81
|
+
Parameter(_parameter, { key }) {
|
|
82
|
+
registerComponent('parameters', key.toString());
|
|
74
83
|
},
|
|
75
84
|
},
|
|
76
85
|
NamedResponses: {
|
|
77
|
-
Response(_response, {
|
|
78
|
-
registerComponent(
|
|
86
|
+
Response(_response, { key }) {
|
|
87
|
+
registerComponent('responses', key.toString());
|
|
79
88
|
},
|
|
80
89
|
},
|
|
81
90
|
NamedSecuritySchemes: {
|
|
82
|
-
SecurityScheme(_securityScheme, {
|
|
83
|
-
registerComponent(
|
|
91
|
+
SecurityScheme(_securityScheme, { key }) {
|
|
92
|
+
registerComponent('securityDefinitions', key.toString());
|
|
84
93
|
},
|
|
85
94
|
},
|
|
95
|
+
SecurityRequirement(requirements) {
|
|
96
|
+
for (const schemeName of Object.keys(requirements)) {
|
|
97
|
+
// Security requirements reference schemes by name, so we know that this security definition is used in a SecurityRequirement.
|
|
98
|
+
const key = `securityDefinitions/${schemeName}`;
|
|
99
|
+
const registered = components.get(key);
|
|
100
|
+
if (registered) {
|
|
101
|
+
registered.usedIn.push('SecurityRequirement');
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
components.set(key, {
|
|
105
|
+
usedIn: ['SecurityRequirement'],
|
|
106
|
+
name: schemeName,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
86
111
|
};
|
|
87
112
|
};
|
|
88
113
|
//# sourceMappingURL=remove-unused-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-unused-components.js","sourceRoot":"","sources":["../../../src/decorators/oas2/remove-unused-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-unused-components.js","sourceRoot":"","sources":["../../../src/decorators/oas2/remove-unused-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,oBAAoB,GAA6B;IACrD,aAAa;IACb,YAAY;IACZ,WAAW;IACX,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAkB,GAAG,EAAE;IACxD,MAAM,UAAU,GAAG,IAAI,GAAG,EAGvB,CAAC;IAEJ,SAAS,iBAAiB,CAAC,aAAmC,EAAE,IAAY;QAC1E,MAAM,GAAG,GAAG,GAAG,aAAa,IAAI,IAAI,EAAE,CAAC;QACvC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,EAAE;YACzC,aAAa;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,SAAS,eAAe,CAAC,OAAe;QACtC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO;QACtC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QACrC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAA4B,CAAC;YAAE,OAAO,SAAS,CAAC;QACnF,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,SAAS,sBAAsB,CAC7B,IAAoB,EACpB,cAA2B,IAAI,GAAG,EAAE;QAEpC,MAAM,kBAA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YAC3D,CAAC;SACF;QACD,mBAAmB,CAAC,YAAY;YAC9B,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;gBACnD,8HAA8H;gBAC9H,MAAM,GAAG,GAAG,uBAAuB,UAAU,EAAE,CAAC;gBAChD,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACvC,IAAI,UAAU,EAAE,CAAC;oBACf,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBAChD,CAAC;qBAAM,CAAC;oBACN,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE;wBAClB,MAAM,EAAE,CAAC,qBAAqB,CAAC;wBAC/B,IAAI,EAAE,UAAU;qBACjB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const decorators:
|
|
3
|
-
'operation-description-override': Oas3Decorator;
|
|
4
|
-
'tag-description-override': Oas3Decorator;
|
|
5
|
-
'info-description-override': Oas3Decorator;
|
|
6
|
-
'info-override': Oas3Decorator;
|
|
7
|
-
'remove-x-internal': Oas3Decorator;
|
|
8
|
-
'filter-in': Oas3Decorator;
|
|
9
|
-
'filter-out': Oas3Decorator;
|
|
10
|
-
'media-type-examples-override': Oas3Decorator;
|
|
11
|
-
'remove-unused-components': Oas3Decorator;
|
|
12
|
-
};
|
|
1
|
+
import { type Oas3DecoratorsSet } from '../../oas-types.js';
|
|
2
|
+
export declare const decorators: Oas3DecoratorsSet<'built-in'>;
|
|
13
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/oas3/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/oas3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAY5D,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAUpD,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { FilterIn } from '../common/filters/filter-in.js';
|
|
|
2
2
|
import { FilterOut } from '../common/filters/filter-out.js';
|
|
3
3
|
import { InfoDescriptionOverride } from '../common/info-description-override.js';
|
|
4
4
|
import { InfoOverride } from '../common/info-override.js';
|
|
5
|
-
import { MediaTypeExamplesOverride } from '../common/media-type-examples-override.js';
|
|
6
5
|
import { OperationDescriptionOverride } from '../common/operation-description-override.js';
|
|
7
6
|
import { RemoveXInternal } from '../common/remove-x-internal.js';
|
|
8
7
|
import { TagDescriptionOverride } from '../common/tag-description-override.js';
|
|
8
|
+
import { MediaTypeExamplesOverride } from './media-type-examples-override.js';
|
|
9
9
|
import { RemoveUnusedComponents } from './remove-unused-components.js';
|
|
10
10
|
export const decorators = {
|
|
11
11
|
'operation-description-override': OperationDescriptionOverride,
|
|
@@ -16,6 +16,6 @@ export const decorators = {
|
|
|
16
16
|
'filter-in': FilterIn,
|
|
17
17
|
'filter-out': FilterOut,
|
|
18
18
|
'media-type-examples-override': MediaTypeExamplesOverride,
|
|
19
|
-
'remove-unused-components': RemoveUnusedComponents,
|
|
19
|
+
'remove-unused-components': RemoveUnusedComponents,
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/oas3/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/oas3/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,MAAM,CAAC,MAAM,UAAU,GAAkC;IACvD,gCAAgC,EAAE,4BAA6C;IAC/E,0BAA0B,EAAE,sBAAuC;IACnE,2BAA2B,EAAE,uBAAwC;IACrE,eAAe,EAAE,YAA6B;IAC9C,mBAAmB,EAAE,eAAgC;IACrD,WAAW,EAAE,QAAyB;IACtC,YAAY,EAAE,SAA0B;IACxC,8BAA8B,EAAE,yBAAyB;IACzD,0BAA0B,EAAE,sBAAsB;CACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-type-examples-override.d.ts","sourceRoot":"","sources":["../../../src/decorators/oas3/media-type-examples-override.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,eAAO,MAAM,yBAAyB,EAAE,aAqEvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-type-examples-override.js","sourceRoot":"","sources":["../../../src/decorators/oas3/media-type-examples-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,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAI,IAAI,CAAC,CAAC;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-unused-components.d.ts","sourceRoot":"","sources":["../../../src/decorators/oas3/remove-unused-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-unused-components.d.ts","sourceRoot":"","sources":["../../../src/decorators/oas3/remove-unused-components.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAkBvD,eAAO,MAAM,sBAAsB,EAAE,aAsJpC,CAAC"}
|
|
@@ -1,40 +1,50 @@
|
|
|
1
|
+
import { isRef, parseRef } from '../../ref-utils.js';
|
|
1
2
|
import { isEmptyObject } from '../../utils/is-empty-object.js';
|
|
2
3
|
import { hasComponent } from '../../utils/oas-has-component.js';
|
|
4
|
+
function getComponentKey(pointer) {
|
|
5
|
+
if (!pointer.startsWith('#/components/'))
|
|
6
|
+
return;
|
|
7
|
+
const [_component, type, name] = parseRef(pointer).pointer;
|
|
8
|
+
if (!type || !name)
|
|
9
|
+
return;
|
|
10
|
+
return `${type}/${name}`;
|
|
11
|
+
}
|
|
3
12
|
export const RemoveUnusedComponents = () => {
|
|
4
13
|
const components = new Map();
|
|
5
|
-
function registerComponent(
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
function registerComponent(componentType, name, referencesDiscriminator = false) {
|
|
15
|
+
const key = `${componentType}/${name}`;
|
|
16
|
+
components.set(key, {
|
|
17
|
+
usedIn: components.get(key)?.usedIn ?? [],
|
|
8
18
|
componentType,
|
|
9
19
|
name,
|
|
20
|
+
referencesDiscriminator,
|
|
10
21
|
});
|
|
11
22
|
}
|
|
12
|
-
function removeUnusedComponents(root,
|
|
13
|
-
const
|
|
14
|
-
for (const [
|
|
15
|
-
const used = usedIn.some((
|
|
16
|
-
|
|
17
|
-
location.absolutePointer[removed.length] === '/')));
|
|
23
|
+
function removeUnusedComponents(root, removedKeys = new Set()) {
|
|
24
|
+
const removedCountBefore = removedKeys.size;
|
|
25
|
+
for (const [key, { usedIn, name, componentType, referencesDiscriminator }] of components) {
|
|
26
|
+
const used = usedIn.some((sourceKey) => sourceKey !== key && !removedKeys.has(sourceKey)) ||
|
|
27
|
+
referencesDiscriminator;
|
|
18
28
|
if (!used &&
|
|
19
29
|
componentType &&
|
|
20
30
|
root.components &&
|
|
21
31
|
hasComponent(root.components, componentType)) {
|
|
22
|
-
|
|
32
|
+
removedKeys.add(key);
|
|
23
33
|
const componentChild = root.components[componentType];
|
|
24
34
|
delete componentChild[name];
|
|
25
|
-
components.delete(
|
|
35
|
+
components.delete(key);
|
|
26
36
|
if (isEmptyObject(componentChild)) {
|
|
27
37
|
delete root.components[componentType];
|
|
28
38
|
}
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
|
-
return
|
|
32
|
-
? removeUnusedComponents(root,
|
|
33
|
-
:
|
|
41
|
+
return removedKeys.size > removedCountBefore
|
|
42
|
+
? removeUnusedComponents(root, removedKeys)
|
|
43
|
+
: removedKeys.size;
|
|
34
44
|
}
|
|
35
45
|
return {
|
|
36
46
|
ref: {
|
|
37
|
-
leave(ref, { location, type,
|
|
47
|
+
leave(ref, { location, type, key }) {
|
|
38
48
|
if ([
|
|
39
49
|
'Schema',
|
|
40
50
|
'Header',
|
|
@@ -43,22 +53,19 @@ export const RemoveUnusedComponents = () => {
|
|
|
43
53
|
'Example',
|
|
44
54
|
'RequestBody',
|
|
45
55
|
'MediaTypesMap',
|
|
56
|
+
'SecurityScheme',
|
|
46
57
|
].includes(type.name)) {
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
58
|
+
const targetPointer = getComponentKey(ref.$ref);
|
|
59
|
+
if (!targetPointer)
|
|
49
60
|
return;
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
return;
|
|
53
|
-
const componentLevelLocalPointer = localPointer.split('/').slice(0, 4).join('/');
|
|
54
|
-
const pointer = `${fileLocation}#${componentLevelLocalPointer}`;
|
|
55
|
-
const registered = components.get(pointer);
|
|
61
|
+
const sourcePointer = getComponentKey(location.pointer) ?? location.pointer;
|
|
62
|
+
const registered = components.get(targetPointer);
|
|
56
63
|
if (registered) {
|
|
57
|
-
registered.usedIn.push(
|
|
64
|
+
registered.usedIn.push(sourcePointer);
|
|
58
65
|
}
|
|
59
66
|
else {
|
|
60
|
-
components.set(
|
|
61
|
-
usedIn: [
|
|
67
|
+
components.set(targetPointer, {
|
|
68
|
+
usedIn: [sourcePointer],
|
|
62
69
|
name: key.toString(),
|
|
63
70
|
});
|
|
64
71
|
}
|
|
@@ -68,49 +75,69 @@ export const RemoveUnusedComponents = () => {
|
|
|
68
75
|
Root: {
|
|
69
76
|
leave(root, ctx) {
|
|
70
77
|
const data = ctx.getVisitorData();
|
|
71
|
-
data.removedCount = removeUnusedComponents(root
|
|
78
|
+
data.removedCount = removeUnusedComponents(root);
|
|
72
79
|
if (isEmptyObject(root.components)) {
|
|
73
80
|
delete root.components;
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
83
|
},
|
|
77
84
|
NamedSchemas: {
|
|
78
|
-
Schema(schema,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
85
|
+
Schema(schema, ctx) {
|
|
86
|
+
const referencesDiscriminator = schema.allOf?.some((ref) => isRef(ref) && ctx.resolve(ref)?.node?.discriminator);
|
|
87
|
+
registerComponent('schemas', ctx.key.toString(), referencesDiscriminator);
|
|
82
88
|
},
|
|
83
89
|
},
|
|
84
90
|
NamedParameters: {
|
|
85
|
-
Parameter(_parameter, {
|
|
86
|
-
registerComponent(
|
|
91
|
+
Parameter(_parameter, { key }) {
|
|
92
|
+
registerComponent('parameters', key.toString());
|
|
87
93
|
},
|
|
88
94
|
},
|
|
89
95
|
NamedResponses: {
|
|
90
|
-
Response(_response, {
|
|
91
|
-
registerComponent(
|
|
96
|
+
Response(_response, { key }) {
|
|
97
|
+
registerComponent('responses', key.toString());
|
|
92
98
|
},
|
|
93
99
|
},
|
|
94
100
|
NamedExamples: {
|
|
95
|
-
Example(_example, {
|
|
96
|
-
registerComponent(
|
|
101
|
+
Example(_example, { key }) {
|
|
102
|
+
registerComponent('examples', key.toString());
|
|
97
103
|
},
|
|
98
104
|
},
|
|
99
105
|
NamedRequestBodies: {
|
|
100
|
-
RequestBody(_requestBody, {
|
|
101
|
-
registerComponent(
|
|
106
|
+
RequestBody(_requestBody, { key }) {
|
|
107
|
+
registerComponent('requestBodies', key.toString());
|
|
102
108
|
},
|
|
103
109
|
},
|
|
104
110
|
NamedHeaders: {
|
|
105
|
-
Header(_header, {
|
|
106
|
-
registerComponent(
|
|
111
|
+
Header(_header, { key }) {
|
|
112
|
+
registerComponent('headers', key.toString());
|
|
107
113
|
},
|
|
108
114
|
},
|
|
109
115
|
NamedMediaTypes: {
|
|
110
|
-
MediaTypesMap(_mediaTypesMap, {
|
|
111
|
-
registerComponent(
|
|
116
|
+
MediaTypesMap(_mediaTypesMap, { key }) {
|
|
117
|
+
registerComponent('mediaTypes', key.toString());
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
NamedSecuritySchemes: {
|
|
121
|
+
SecurityScheme(_securityScheme, { key }) {
|
|
122
|
+
registerComponent('securitySchemes', key.toString());
|
|
112
123
|
},
|
|
113
124
|
},
|
|
125
|
+
SecurityRequirement(requirements) {
|
|
126
|
+
for (const schemeName of Object.keys(requirements)) {
|
|
127
|
+
// Security requirements reference security schemes by name, so we know that this security scheme is used in a SecurityRequirement.
|
|
128
|
+
const key = `securitySchemes/${schemeName}`;
|
|
129
|
+
const registered = components.get(key);
|
|
130
|
+
if (registered) {
|
|
131
|
+
registered.usedIn.push('SecurityRequirement');
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
components.set(key, {
|
|
135
|
+
usedIn: ['SecurityRequirement'],
|
|
136
|
+
name: schemeName,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
114
141
|
};
|
|
115
142
|
};
|
|
116
143
|
//# sourceMappingURL=remove-unused-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-unused-components.js","sourceRoot":"","sources":["../../../src/decorators/oas3/remove-unused-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-unused-components.js","sourceRoot":"","sources":["../../../src/decorators/oas3/remove-unused-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAWrD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAYhE,SAAS,eAAe,CAAC,OAAe;IACtC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;QAAE,OAAO;IACjD,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAC3D,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO;IAC3B,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAkB,GAAG,EAAE;IACxD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEpD,SAAS,iBAAiB,CACxB,aAAmC,EACnC,IAAY,EACZ,0BAAmC,KAAK;QAExC,MAAM,GAAG,GAAG,GAAG,aAAa,IAAI,IAAI,EAAE,CAAC;QACvC,UAAU,CAAC,GAAG,CAAC,GAAG,EA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BACrC,iBAAiB,CAAC,iBAAiB,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,CAAC;SACF;QACD,mBAAmB,CAAC,YAAY;YAC9B,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;gBACnD,mIAAmI;gBACnI,MAAM,GAAG,GAAG,mBAAmB,UAAU,EAAE,CAAC;gBAC5C,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACvC,IAAI,UAAU,EAAE,CAAC;oBACf,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBAChD,CAAC;qBAAM,CAAC;oBACN,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE;wBAClB,MAAM,EAAE,CAAC,qBAAqB,CAAC;wBAC/B,IAAI,EAAE,UAAU;qBACjB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/detect-spec.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SpecMajorVersion, SpecVersion } from './oas-types.js';
|
|
2
|
-
export declare const specVersions: readonly ["oas2", "oas3_0", "oas3_1", "oas3_2", "async2", "async3", "arazzo1", "overlay1", "openrpc1"];
|
|
3
2
|
export declare function getMajorSpecVersion(version: SpecVersion): SpecMajorVersion;
|
|
4
3
|
export declare function detectSpec(root: unknown): SpecVersion;
|
|
5
4
|
//# sourceMappingURL=detect-spec.d.ts.map
|
package/lib/detect-spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-spec.d.ts","sourceRoot":"","sources":["../src/detect-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIpE,
|
|
1
|
+
{"version":3,"file":"detect-spec.d.ts","sourceRoot":"","sources":["../src/detect-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIpE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,gBAAgB,CAoB1E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CA8DrD"}
|
package/lib/detect-spec.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { VERSION_PATTERN } from './typings/
|
|
1
|
+
import { VERSION_PATTERN } from './typings/overlay.js';
|
|
2
2
|
import { isPlainObject } from './utils/is-plain-object.js';
|
|
3
|
-
export const specVersions = [
|
|
4
|
-
'oas2',
|
|
5
|
-
'oas3_0',
|
|
6
|
-
'oas3_1',
|
|
7
|
-
'oas3_2',
|
|
8
|
-
'async2',
|
|
9
|
-
'async3',
|
|
10
|
-
'arazzo1',
|
|
11
|
-
'overlay1',
|
|
12
|
-
'openrpc1',
|
|
13
|
-
];
|
|
14
3
|
export function getMajorSpecVersion(version) {
|
|
15
|
-
if (version
|
|
4
|
+
if (version.startsWith('oas3')) {
|
|
5
|
+
return 'oas3';
|
|
6
|
+
}
|
|
7
|
+
else if (version === 'oas2') {
|
|
16
8
|
return 'oas2';
|
|
17
9
|
}
|
|
18
10
|
else if (version === 'async2') {
|
|
@@ -21,7 +13,7 @@ export function getMajorSpecVersion(version) {
|
|
|
21
13
|
else if (version === 'async3') {
|
|
22
14
|
return 'async3';
|
|
23
15
|
}
|
|
24
|
-
else if (version === 'arazzo1') {
|
|
16
|
+
else if (version === 'arazzo1' || version === 'arazzo1_1') {
|
|
25
17
|
return 'arazzo1';
|
|
26
18
|
}
|
|
27
19
|
else if (version === 'overlay1') {
|
|
@@ -30,6 +22,9 @@ export function getMajorSpecVersion(version) {
|
|
|
30
22
|
else if (version === 'openrpc1') {
|
|
31
23
|
return 'openrpc1';
|
|
32
24
|
}
|
|
25
|
+
else if (version === 'graphql') {
|
|
26
|
+
return 'graphql';
|
|
27
|
+
}
|
|
33
28
|
else {
|
|
34
29
|
return 'oas3';
|
|
35
30
|
}
|
|
@@ -68,9 +63,15 @@ export function detectSpec(root) {
|
|
|
68
63
|
if (root.asyncapi) {
|
|
69
64
|
throw new Error(`Unsupported AsyncAPI version: ${root.asyncapi}`);
|
|
70
65
|
}
|
|
71
|
-
if (typeof root.arazzo === 'string' &&
|
|
66
|
+
if (typeof root.arazzo === 'string' && root.arazzo.startsWith('1.0.')) {
|
|
72
67
|
return 'arazzo1';
|
|
73
68
|
}
|
|
69
|
+
if (typeof root.arazzo === 'string' && root.arazzo.startsWith('1.1.')) {
|
|
70
|
+
return 'arazzo1_1';
|
|
71
|
+
}
|
|
72
|
+
if (root.arazzo) {
|
|
73
|
+
throw new Error(`Unsupported Arazzo version: ${root.arazzo}`);
|
|
74
|
+
}
|
|
74
75
|
if (typeof root.overlay === 'string' && VERSION_PATTERN.test(root.overlay)) {
|
|
75
76
|
return 'overlay1';
|
|
76
77
|
}
|
package/lib/detect-spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-spec.js","sourceRoot":"","sources":["../src/detect-spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"detect-spec.js","sourceRoot":"","sources":["../src/detect-spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CAAC,OAAoB;IACtD,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,OAAO,KAAK,QAAQ,EAAE,C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ACtE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3E,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
package/lib/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAGuB,CAAC;AAC9C,eAAO,MAAM,GAAG,mBAAqC,CAAC"}
|
package/lib/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GACpB,OAAO,MAAM,KAAK,WAAW;IAC7B,OAAO,OAAO,KAAK,WAAW;IAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GACpB,OAAO,MAAM,KAAK,WAAW;IAC7B,OAAO,OAAO,KAAK,WAAW;IAC7B,OAAO,EAAE,QAAmB,KAAK,SAAS,CAAC,CAAC,yBAAyB;AACxE,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-parse-error.d.ts","sourceRoot":"","sources":["../../src/errors/yaml-parse-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"yaml-parse-error.d.ts","sourceRoot":"","sources":["../../src/errors/yaml-parse-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5C,qBAAa,cAAe,SAAQ,KAAK;IAK9B,aAAa,EAAE,KAAK;IACpB,MAAM,EAAE,MAAM;IALvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;gBAGJ,aAAa,EAAE,KAAK,EACpB,MAAM,EAAE,MAAM;CAUxB"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const jsYamlErrorLineColRegexp = /\((\d+):(\d+)\)$/;
|
|
2
2
|
export class YamlParseError extends Error {
|
|
3
|
+
originalError;
|
|
4
|
+
source;
|
|
5
|
+
col;
|
|
6
|
+
line;
|
|
3
7
|
constructor(originalError, source) {
|
|
4
8
|
super(originalError.message.split('\n')[0]);
|
|
5
9
|
this.originalError = originalError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-parse-error.js","sourceRoot":"","sources":["../../src/errors/yaml-parse-error.ts"],"names":[],"mappings":"AAEA,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAEpD,MAAM,OAAO,cAAe,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"yaml-parse-error.js","sourceRoot":"","sources":["../../src/errors/yaml-parse-error.ts"],"names":[],"mappings":"AAEA,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAEpD,MAAM,OAAO,cAAe,SAAQ,KAAK;IAK9B;IACA;IALT,GAAG,CAAS;IACZ,IAAI,CAAS;IAEb,YACS,aAAoB,EACpB,MAAc;QAErB,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAHrC,kBAAa,GAAb,aAAa,CAAO;QACpB,WAAM,GAAN,MAAM,CAAQ;QAGrB,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC;QACzE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
package/lib/format/format.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type Totals = {
|
|
|
4
4
|
warnings: number;
|
|
5
5
|
ignored: number;
|
|
6
6
|
};
|
|
7
|
-
export type OutputFormat = 'codeframe' | 'stylish' | 'json' | 'checkstyle' | 'codeclimate' | 'summary' | 'github-actions' | 'markdown';
|
|
7
|
+
export type OutputFormat = 'codeframe' | 'stylish' | 'json' | 'checkstyle' | 'codeclimate' | 'summary' | 'github-actions' | 'markdown' | 'junit';
|
|
8
8
|
export declare function getTotals(problems: (NormalizedProblem & {
|
|
9
9
|
ignored?: boolean;
|
|
10
10
|
})[]): Totals;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/format/format.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAgCF,MAAM,MAAM,YAA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