@redocly/openapi-core 0.0.0-snapshot.1744188073 → 0.0.0-snapshot.1744801622
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/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +19 -17
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +19 -15
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +1 -2
- package/lib/benchmark/benches/recommended-oas3.bench.js +18 -15
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +1 -2
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +17 -14
- package/lib/benchmark/utils.d.ts +4 -5
- package/lib/benchmark/utils.js +14 -11
- package/lib/bundle.d.ts +9 -8
- package/lib/bundle.js +84 -72
- package/lib/config/all.d.ts +1 -2
- package/lib/config/all.js +3 -2
- package/lib/config/builtIn.d.ts +1 -2
- package/lib/config/builtIn.js +49 -44
- package/lib/config/config-resolvers.d.ts +5 -6
- package/lib/config/config-resolvers.js +94 -85
- package/lib/config/config.d.ts +8 -6
- package/lib/config/config.js +73 -66
- package/lib/config/index.d.ts +7 -8
- package/lib/config/index.js +23 -8
- package/lib/config/load.d.ts +8 -5
- package/lib/config/load.js +73 -28
- package/lib/config/minimal.d.ts +1 -2
- package/lib/config/minimal.js +3 -2
- package/lib/config/recommended-strict.d.ts +1 -2
- package/lib/config/recommended-strict.js +3 -2
- package/lib/config/recommended.d.ts +1 -2
- package/lib/config/recommended.js +3 -2
- package/lib/config/rules.d.ts +3 -4
- package/lib/config/rules.js +6 -4
- package/lib/config/spec.d.ts +1 -2
- package/lib/config/spec.js +3 -2
- package/lib/config/types.d.ts +13 -6
- package/lib/config/types.js +2 -2
- package/lib/config/utils.d.ts +2 -3
- package/lib/config/utils.js +89 -75
- package/lib/decorators/arazzo/index.d.ts +0 -1
- package/lib/decorators/arazzo/index.js +4 -2
- package/lib/decorators/async2/index.d.ts +0 -1
- package/lib/decorators/async2/index.js +4 -2
- package/lib/decorators/async3/index.d.ts +0 -1
- package/lib/decorators/async3/index.js +4 -2
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -2
- package/lib/decorators/common/filters/filter-helper.js +12 -9
- package/lib/decorators/common/filters/filter-in.d.ts +1 -2
- package/lib/decorators/common/filters/filter-in.js +8 -5
- package/lib/decorators/common/filters/filter-out.d.ts +1 -2
- package/lib/decorators/common/filters/filter-out.js +8 -5
- package/lib/decorators/common/info-description-override.d.ts +1 -2
- package/lib/decorators/common/info-description-override.js +7 -4
- package/lib/decorators/common/info-override.d.ts +1 -2
- package/lib/decorators/common/info-override.js +5 -2
- package/lib/decorators/common/media-type-examples-override.d.ts +1 -2
- package/lib/decorators/common/media-type-examples-override.js +10 -7
- package/lib/decorators/common/operation-description-override.d.ts +1 -2
- package/lib/decorators/common/operation-description-override.js +7 -4
- package/lib/decorators/common/registry-dependencies.d.ts +2 -0
- package/lib/decorators/common/registry-dependencies.js +24 -0
- package/lib/decorators/common/remove-x-internal.d.ts +1 -2
- package/lib/decorators/common/remove-x-internal.js +14 -11
- package/lib/decorators/common/tag-description-override.d.ts +1 -2
- package/lib/decorators/common/tag-description-override.js +7 -4
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.js +20 -16
- package/lib/decorators/oas2/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas2/remove-unused-components.js +7 -4
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.js +22 -18
- package/lib/decorators/oas3/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas3/remove-unused-components.js +8 -5
- package/lib/decorators/overlay1/index.d.ts +0 -1
- package/lib/decorators/overlay1/index.js +4 -2
- package/lib/env.d.ts +0 -1
- package/lib/env.js +5 -3
- package/lib/format/codeframes.d.ts +1 -2
- package/lib/format/codeframes.js +19 -15
- package/lib/format/format.d.ts +1 -2
- package/lib/format/format.js +62 -57
- package/lib/index.d.ts +26 -29
- package/lib/index.js +98 -24
- package/lib/js-yaml/index.d.ts +0 -1
- package/lib/js-yaml/index.js +11 -7
- package/lib/lint.d.ts +10 -11
- package/lib/lint.js +44 -39
- package/lib/logger.d.ts +1 -2
- package/lib/logger.js +17 -15
- package/lib/oas-types.d.ts +3 -4
- package/lib/oas-types.js +32 -27
- package/lib/output.d.ts +3 -0
- package/lib/output.js +9 -0
- package/lib/redocly/domains.d.ts +14 -0
- package/lib/redocly/domains.js +41 -0
- package/lib/redocly/index.d.ts +30 -0
- package/lib/redocly/index.js +131 -0
- package/lib/redocly/redocly-client-types.d.ts +8 -0
- package/lib/redocly/redocly-client-types.js +2 -0
- package/lib/redocly/registry-api-types.d.ts +29 -0
- package/lib/redocly/registry-api-types.js +2 -0
- package/lib/redocly/registry-api.d.ts +17 -0
- package/lib/redocly/registry-api.js +100 -0
- package/lib/ref-utils.d.ts +2 -3
- package/lib/ref-utils.js +33 -18
- package/lib/resolve.d.ts +2 -3
- package/lib/resolve.js +45 -36
- package/lib/rules/ajv.d.ts +3 -4
- package/lib/rules/ajv.js +10 -7
- package/lib/rules/arazzo/criteria-unique.d.ts +1 -2
- package/lib/rules/arazzo/criteria-unique.js +5 -2
- package/lib/rules/arazzo/index.d.ts +1 -2
- package/lib/rules/arazzo/index.js +35 -33
- package/lib/rules/arazzo/parameters-unique.d.ts +1 -2
- package/lib/rules/arazzo/parameters-unique.js +5 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +1 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescription-type.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +5 -2
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onFailure-unique.js +5 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onSuccess-unique.js +5 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +1 -2
- package/lib/rules/arazzo/stepId-unique.js +5 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +1 -2
- package/lib/rules/arazzo/workflow-dependsOn.js +5 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +1 -2
- package/lib/rules/arazzo/workflowId-unique.js +5 -2
- package/lib/rules/async2/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async2/channels-kebab-case.js +5 -2
- package/lib/rules/async2/index.d.ts +1 -2
- package/lib/rules/async2/index.js +24 -22
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async2/no-channel-trailing-slash.js +5 -2
- package/lib/rules/async3/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async3/channels-kebab-case.js +5 -2
- package/lib/rules/async3/index.d.ts +1 -2
- package/lib/rules/async3/index.js +24 -22
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async3/no-channel-trailing-slash.js +6 -3
- package/lib/rules/common/assertions/asserts.d.ts +2 -3
- package/lib/rules/common/assertions/asserts.js +38 -35
- package/lib/rules/common/assertions/index.d.ts +3 -4
- package/lib/rules/common/assertions/index.js +10 -7
- package/lib/rules/common/assertions/utils.d.ts +4 -5
- package/lib/rules/common/assertions/utils.js +29 -21
- package/lib/rules/common/info-contact.d.ts +1 -2
- package/lib/rules/common/info-contact.js +7 -4
- package/lib/rules/common/info-license-strict.d.ts +1 -2
- package/lib/rules/common/info-license-strict.js +10 -7
- package/lib/rules/common/info-license-url.d.ts +1 -2
- package/lib/rules/common/info-license-url.js +7 -4
- package/lib/rules/common/info-license.d.ts +1 -2
- package/lib/rules/common/info-license.js +7 -4
- package/lib/rules/common/no-ambiguous-paths.d.ts +1 -2
- package/lib/rules/common/no-ambiguous-paths.js +5 -2
- package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-enum-type-mismatch.js +9 -6
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -2
- package/lib/rules/common/no-http-verbs-in-paths.js +8 -5
- package/lib/rules/common/no-identical-paths.d.ts +1 -2
- package/lib/rules/common/no-identical-paths.js +5 -2
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js +9 -6
- package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -2
- package/lib/rules/common/no-invalid-schema-examples.js +9 -6
- package/lib/rules/common/no-path-trailing-slash.d.ts +1 -2
- package/lib/rules/common/no-path-trailing-slash.js +5 -2
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -2
- package/lib/rules/common/no-required-schema-properties-undefined.js +7 -4
- package/lib/rules/common/no-schema-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-schema-type-mismatch.js +5 -2
- package/lib/rules/common/operation-2xx-response.d.ts +1 -2
- package/lib/rules/common/operation-2xx-response.js +8 -5
- package/lib/rules/common/operation-4xx-response.d.ts +1 -2
- package/lib/rules/common/operation-4xx-response.js +8 -5
- package/lib/rules/common/operation-description.d.ts +1 -2
- package/lib/rules/common/operation-description.js +7 -4
- package/lib/rules/common/operation-operationId-unique.d.ts +1 -2
- package/lib/rules/common/operation-operationId-unique.js +5 -2
- package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -2
- package/lib/rules/common/operation-operationId-url-safe.js +5 -2
- package/lib/rules/common/operation-operationId.d.ts +1 -2
- package/lib/rules/common/operation-operationId.js +7 -4
- package/lib/rules/common/operation-parameters-unique.d.ts +1 -2
- package/lib/rules/common/operation-parameters-unique.js +5 -2
- package/lib/rules/common/operation-singular-tag.d.ts +1 -2
- package/lib/rules/common/operation-singular-tag.js +5 -2
- package/lib/rules/common/operation-summary.d.ts +1 -2
- package/lib/rules/common/operation-summary.js +7 -4
- package/lib/rules/common/operation-tag-defined.d.ts +1 -2
- package/lib/rules/common/operation-tag-defined.js +5 -2
- package/lib/rules/common/parameter-description.d.ts +1 -2
- package/lib/rules/common/parameter-description.js +5 -2
- package/lib/rules/common/path-declaration-must-exist.d.ts +1 -2
- package/lib/rules/common/path-declaration-must-exist.js +5 -2
- package/lib/rules/common/path-excludes-patterns.d.ts +1 -2
- package/lib/rules/common/path-excludes-patterns.js +5 -2
- package/lib/rules/common/path-http-verbs-order.d.ts +1 -2
- package/lib/rules/common/path-http-verbs-order.js +5 -2
- package/lib/rules/common/path-not-include-query.d.ts +1 -2
- package/lib/rules/common/path-not-include-query.js +5 -2
- package/lib/rules/common/path-params-defined.d.ts +1 -2
- package/lib/rules/common/path-params-defined.js +5 -2
- package/lib/rules/common/path-segment-plural.d.ts +1 -2
- package/lib/rules/common/path-segment-plural.js +8 -5
- package/lib/rules/common/paths-kebab-case.d.ts +1 -2
- package/lib/rules/common/paths-kebab-case.js +5 -2
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -2
- package/lib/rules/common/required-string-property-missing-min-length.js +5 -2
- package/lib/rules/common/response-contains-header.d.ts +1 -2
- package/lib/rules/common/response-contains-header.js +8 -5
- package/lib/rules/common/scalar-property-missing-example.d.ts +1 -2
- package/lib/rules/common/scalar-property-missing-example.js +7 -4
- package/lib/rules/common/security-defined.d.ts +1 -2
- package/lib/rules/common/security-defined.js +5 -2
- package/lib/rules/common/spec-strict-refs.d.ts +1 -2
- package/lib/rules/common/spec-strict-refs.js +7 -4
- package/lib/rules/common/struct.d.ts +1 -2
- package/lib/rules/common/struct.js +21 -18
- package/lib/rules/common/tag-description.d.ts +1 -2
- package/lib/rules/common/tag-description.js +7 -4
- package/lib/rules/common/tags-alphabetical.d.ts +1 -2
- package/lib/rules/common/tags-alphabetical.js +5 -2
- package/lib/rules/no-unresolved-refs.d.ts +3 -4
- package/lib/rules/no-unresolved-refs.js +9 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas2/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas2/index.d.ts +1 -2
- package/lib/rules/oas2/index.js +97 -95
- package/lib/rules/oas2/request-mime-type.d.ts +1 -2
- package/lib/rules/oas2/request-mime-type.js +8 -5
- package/lib/rules/oas2/response-contains-property.d.ts +1 -2
- package/lib/rules/oas2/response-contains-property.js +8 -5
- package/lib/rules/oas2/response-mime-type.d.ts +1 -2
- package/lib/rules/oas2/response-mime-type.js +8 -5
- package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -2
- package/lib/rules/oas3/array-parameter-serialization.js +7 -4
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas3/component-name-unique.d.ts +1 -2
- package/lib/rules/oas3/component-name-unique.js +5 -2
- package/lib/rules/oas3/index.d.ts +1 -2
- package/lib/rules/oas3/index.js +121 -119
- package/lib/rules/oas3/no-empty-servers.d.ts +1 -2
- package/lib/rules/oas3/no-empty-servers.js +5 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.js +5 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.js +10 -7
- package/lib/rules/oas3/no-server-example.com.d.ts +1 -2
- package/lib/rules/oas3/no-server-example.com.js +5 -2
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -2
- package/lib/rules/oas3/no-server-trailing-slash.js +5 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.js +5 -2
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -2
- package/lib/rules/oas3/no-undefined-server-variable.js +5 -2
- package/lib/rules/oas3/no-unused-components.d.ts +1 -2
- package/lib/rules/oas3/no-unused-components.js +5 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +1 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +9 -6
- package/lib/rules/oas3/request-mime-type.d.ts +1 -2
- package/lib/rules/oas3/request-mime-type.js +9 -6
- package/lib/rules/oas3/response-contains-property.d.ts +1 -2
- package/lib/rules/oas3/response-contains-property.js +8 -5
- package/lib/rules/oas3/response-mime-type.d.ts +1 -2
- package/lib/rules/oas3/response-mime-type.js +9 -6
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -2
- package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -2
- package/lib/rules/other/stats.d.ts +3 -4
- package/lib/rules/other/stats.js +5 -2
- package/lib/rules/overlay1/index.d.ts +1 -2
- package/lib/rules/overlay1/index.js +11 -9
- package/lib/rules/respect/no-criteria-xpath.d.ts +1 -2
- package/lib/rules/respect/no-criteria-xpath.js +5 -2
- package/lib/rules/respect/respect-supported-versions.d.ts +1 -2
- package/lib/rules/respect/respect-supported-versions.js +10 -7
- package/lib/rules/utils.d.ts +3 -4
- package/lib/rules/utils.js +36 -23
- package/lib/types/arazzo.d.ts +1 -2
- package/lib/types/arazzo.js +23 -21
- package/lib/types/asyncapi2.d.ts +1 -2
- package/lib/types/asyncapi2.js +56 -54
- package/lib/types/asyncapi3.d.ts +1 -2
- package/lib/types/asyncapi3.js +43 -41
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +13 -7
- package/lib/types/json-schema-adapter.d.ts +1 -2
- package/lib/types/json-schema-adapter.js +17 -15
- package/lib/types/oas2.d.ts +2 -3
- package/lib/types/oas2.js +19 -17
- package/lib/types/oas3.d.ts +2 -3
- package/lib/types/oas3.js +41 -39
- package/lib/types/oas3_1.d.ts +2 -3
- package/lib/types/oas3_1.js +20 -18
- package/lib/types/overlay.d.ts +1 -2
- package/lib/types/overlay.js +6 -4
- package/lib/types/redocly-yaml.d.ts +3 -4
- package/lib/types/redocly-yaml.js +48 -31
- package/lib/typings/arazzo.d.ts +0 -1
- package/lib/typings/arazzo.js +5 -3
- package/lib/typings/asyncapi.d.ts +0 -1
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi3.d.ts +0 -1
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/common.d.ts +0 -1
- package/lib/typings/common.js +2 -2
- package/lib/typings/openapi.d.ts +0 -1
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/overlay.d.ts +0 -1
- package/lib/typings/overlay.js +4 -2
- package/lib/typings/swagger.d.ts +1 -2
- package/lib/typings/swagger.js +2 -2
- package/lib/utils.d.ts +5 -4
- package/lib/utils.js +99 -53
- package/lib/visitors.d.ts +10 -11
- package/lib/visitors.js +6 -4
- package/lib/walk.d.ts +8 -9
- package/lib/walk.js +25 -23
- package/package.json +9 -30
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-many-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.js.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.js.map +0 -1
- package/lib/benchmark/utils.d.ts.map +0 -1
- package/lib/benchmark/utils.js.map +0 -1
- package/lib/bundle.d.ts.map +0 -1
- package/lib/bundle.js.map +0 -1
- package/lib/config/all.d.ts.map +0 -1
- package/lib/config/all.js.map +0 -1
- package/lib/config/builtIn.d.ts.map +0 -1
- package/lib/config/builtIn.js.map +0 -1
- package/lib/config/config-resolvers.d.ts.map +0 -1
- package/lib/config/config-resolvers.js.map +0 -1
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js.map +0 -1
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/index.js.map +0 -1
- package/lib/config/load.d.ts.map +0 -1
- package/lib/config/load.js.map +0 -1
- package/lib/config/minimal.d.ts.map +0 -1
- package/lib/config/minimal.js.map +0 -1
- package/lib/config/recommended-strict.d.ts.map +0 -1
- package/lib/config/recommended-strict.js.map +0 -1
- package/lib/config/recommended.d.ts.map +0 -1
- package/lib/config/recommended.js.map +0 -1
- package/lib/config/rules.d.ts.map +0 -1
- package/lib/config/rules.js.map +0 -1
- package/lib/config/spec.d.ts.map +0 -1
- package/lib/config/spec.js.map +0 -1
- package/lib/config/types.d.ts.map +0 -1
- package/lib/config/types.js.map +0 -1
- package/lib/config/utils.d.ts.map +0 -1
- package/lib/config/utils.js.map +0 -1
- package/lib/decorators/arazzo/index.d.ts.map +0 -1
- package/lib/decorators/arazzo/index.js.map +0 -1
- package/lib/decorators/async2/index.d.ts.map +0 -1
- package/lib/decorators/async2/index.js.map +0 -1
- package/lib/decorators/async3/index.d.ts.map +0 -1
- package/lib/decorators/async3/index.js.map +0 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-helper.js.map +0 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-in.js.map +0 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-out.js.map +0 -1
- package/lib/decorators/common/info-description-override.d.ts.map +0 -1
- package/lib/decorators/common/info-description-override.js.map +0 -1
- package/lib/decorators/common/info-override.d.ts.map +0 -1
- package/lib/decorators/common/info-override.js.map +0 -1
- 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/decorators/common/operation-description-override.d.ts.map +0 -1
- package/lib/decorators/common/operation-description-override.js.map +0 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +0 -1
- package/lib/decorators/common/remove-x-internal.js.map +0 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +0 -1
- package/lib/decorators/common/tag-description-override.js.map +0 -1
- package/lib/decorators/oas2/index.d.ts.map +0 -1
- package/lib/decorators/oas2/index.js.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.js.map +0 -1
- package/lib/decorators/oas3/index.d.ts.map +0 -1
- package/lib/decorators/oas3/index.js.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.js.map +0 -1
- package/lib/decorators/overlay1/index.d.ts.map +0 -1
- package/lib/decorators/overlay1/index.js.map +0 -1
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js.map +0 -1
- package/lib/format/codeframes.d.ts.map +0 -1
- package/lib/format/codeframes.js.map +0 -1
- package/lib/format/format.d.ts.map +0 -1
- package/lib/format/format.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/js-yaml/index.d.ts.map +0 -1
- package/lib/js-yaml/index.js.map +0 -1
- package/lib/lint.d.ts.map +0 -1
- package/lib/lint.js.map +0 -1
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js.map +0 -1
- package/lib/oas-types.d.ts.map +0 -1
- package/lib/oas-types.js.map +0 -1
- package/lib/ref-utils.d.ts.map +0 -1
- package/lib/ref-utils.js.map +0 -1
- package/lib/resolve.d.ts.map +0 -1
- package/lib/resolve.js.map +0 -1
- package/lib/rules/ajv.d.ts.map +0 -1
- package/lib/rules/ajv.js.map +0 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/criteria-unique.js.map +0 -1
- package/lib/rules/arazzo/index.d.ts.map +0 -1
- package/lib/rules/arazzo/index.js.map +0 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/parameters-unique.js.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.js.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +0 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/stepId-unique.js.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.js.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.js.map +0 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async2/channels-kebab-case.js.map +0 -1
- package/lib/rules/async2/index.d.ts.map +0 -1
- package/lib/rules/async2/index.js.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async3/channels-kebab-case.js.map +0 -1
- package/lib/rules/async3/index.d.ts.map +0 -1
- package/lib/rules/async3/index.js.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/common/assertions/asserts.d.ts.map +0 -1
- package/lib/rules/common/assertions/asserts.js.map +0 -1
- package/lib/rules/common/assertions/index.d.ts.map +0 -1
- package/lib/rules/common/assertions/index.js.map +0 -1
- package/lib/rules/common/assertions/utils.d.ts.map +0 -1
- package/lib/rules/common/assertions/utils.js.map +0 -1
- package/lib/rules/common/info-contact.d.ts.map +0 -1
- package/lib/rules/common/info-contact.js.map +0 -1
- package/lib/rules/common/info-license-strict.d.ts.map +0 -1
- package/lib/rules/common/info-license-strict.js.map +0 -1
- package/lib/rules/common/info-license-url.d.ts.map +0 -1
- package/lib/rules/common/info-license-url.js.map +0 -1
- package/lib/rules/common/info-license.d.ts.map +0 -1
- package/lib/rules/common/info-license.js.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.js.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.js.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.js.map +0 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +0 -1
- package/lib/rules/common/no-identical-paths.js.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.js.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.js.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.js.map +0 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-2xx-response.js.map +0 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-4xx-response.js.map +0 -1
- package/lib/rules/common/operation-description.d.ts.map +0 -1
- package/lib/rules/common/operation-description.js.map +0 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-unique.js.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.js.map +0 -1
- package/lib/rules/common/operation-operationId.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId.js.map +0 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-parameters-unique.js.map +0 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +0 -1
- package/lib/rules/common/operation-singular-tag.js.map +0 -1
- package/lib/rules/common/operation-summary.d.ts.map +0 -1
- package/lib/rules/common/operation-summary.js.map +0 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +0 -1
- package/lib/rules/common/operation-tag-defined.js.map +0 -1
- package/lib/rules/common/parameter-description.d.ts.map +0 -1
- package/lib/rules/common/parameter-description.js.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.js.map +0 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +0 -1
- package/lib/rules/common/path-excludes-patterns.js.map +0 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +0 -1
- package/lib/rules/common/path-http-verbs-order.js.map +0 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +0 -1
- package/lib/rules/common/path-not-include-query.js.map +0 -1
- package/lib/rules/common/path-params-defined.d.ts.map +0 -1
- package/lib/rules/common/path-params-defined.js.map +0 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +0 -1
- package/lib/rules/common/path-segment-plural.js.map +0 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +0 -1
- package/lib/rules/common/paths-kebab-case.js.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.js.map +0 -1
- package/lib/rules/common/response-contains-header.d.ts.map +0 -1
- package/lib/rules/common/response-contains-header.js.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.js.map +0 -1
- package/lib/rules/common/security-defined.d.ts.map +0 -1
- package/lib/rules/common/security-defined.js.map +0 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +0 -1
- package/lib/rules/common/spec-strict-refs.js.map +0 -1
- package/lib/rules/common/struct.d.ts.map +0 -1
- package/lib/rules/common/struct.js.map +0 -1
- package/lib/rules/common/tag-description.d.ts.map +0 -1
- package/lib/rules/common/tag-description.js.map +0 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +0 -1
- package/lib/rules/common/tags-alphabetical.js.map +0 -1
- package/lib/rules/no-unresolved-refs.d.ts.map +0 -1
- package/lib/rules/no-unresolved-refs.js.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas2/index.d.ts.map +0 -1
- package/lib/rules/oas2/index.js.map +0 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/request-mime-type.js.map +0 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas2/response-contains-property.js.map +0 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.js.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +0 -1
- package/lib/rules/oas3/component-name-unique.js.map +0 -1
- package/lib/rules/oas3/index.d.ts.map +0 -1
- package/lib/rules/oas3/index.js.map +0 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +0 -1
- package/lib/rules/oas3/no-empty-servers.js.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +0 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-example.com.js.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.js.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.js.map +0 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +0 -1
- package/lib/rules/oas3/no-unused-components.js.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +0 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/request-mime-type.js.map +0 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas3/response-contains-property.js.map +0 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +0 -1
- package/lib/rules/other/stats.d.ts.map +0 -1
- package/lib/rules/other/stats.js.map +0 -1
- package/lib/rules/overlay1/index.d.ts.map +0 -1
- package/lib/rules/overlay1/index.js.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.js.map +0 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
- package/lib/rules/respect/respect-supported-versions.js.map +0 -1
- package/lib/rules/utils.d.ts.map +0 -1
- package/lib/rules/utils.js.map +0 -1
- package/lib/types/arazzo.d.ts.map +0 -1
- package/lib/types/arazzo.js.map +0 -1
- package/lib/types/asyncapi2.d.ts.map +0 -1
- package/lib/types/asyncapi2.js.map +0 -1
- package/lib/types/asyncapi3.d.ts.map +0 -1
- package/lib/types/asyncapi3.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/json-schema-adapter.d.ts.map +0 -1
- package/lib/types/json-schema-adapter.js.map +0 -1
- package/lib/types/oas2.d.ts.map +0 -1
- package/lib/types/oas2.js.map +0 -1
- package/lib/types/oas3.d.ts.map +0 -1
- package/lib/types/oas3.js.map +0 -1
- package/lib/types/oas3_1.d.ts.map +0 -1
- package/lib/types/oas3_1.js.map +0 -1
- package/lib/types/overlay.d.ts.map +0 -1
- package/lib/types/overlay.js.map +0 -1
- package/lib/types/redocly-yaml.d.ts.map +0 -1
- package/lib/types/redocly-yaml.js.map +0 -1
- package/lib/typings/arazzo.d.ts.map +0 -1
- package/lib/typings/arazzo.js.map +0 -1
- package/lib/typings/asyncapi.d.ts.map +0 -1
- package/lib/typings/asyncapi.js.map +0 -1
- package/lib/typings/asyncapi3.d.ts.map +0 -1
- package/lib/typings/asyncapi3.js.map +0 -1
- package/lib/typings/common.d.ts.map +0 -1
- package/lib/typings/common.js.map +0 -1
- package/lib/typings/openapi.d.ts.map +0 -1
- package/lib/typings/openapi.js.map +0 -1
- package/lib/typings/overlay.d.ts.map +0 -1
- package/lib/typings/overlay.js.map +0 -1
- package/lib/typings/swagger.d.ts.map +0 -1
- package/lib/typings/swagger.js.map +0 -1
- package/lib/utils/error.d.ts +0 -3
- package/lib/utils/error.d.ts.map +0 -1
- package/lib/utils/error.js +0 -3
- package/lib/utils/error.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/visitors.d.ts.map +0 -1
- package/lib/visitors.js.map +0 -1
- package/lib/walk.d.ts.map +0 -1
- package/lib/walk.js.map +0 -1
package/lib/format/format.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTotals = getTotals;
|
|
4
|
+
exports.formatProblems = formatProblems;
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const output_1 = require("../output");
|
|
8
|
+
const codeframes_1 = require("./codeframes");
|
|
9
|
+
const env_1 = require("../env");
|
|
10
|
+
const ref_utils_1 = require("../ref-utils");
|
|
11
|
+
const coreVersion = require('../../package.json').version;
|
|
6
12
|
const ERROR_MESSAGE = {
|
|
7
13
|
INVALID_SEVERITY_LEVEL: 'Invalid severity level; accepted values: error or warn',
|
|
8
14
|
};
|
|
9
15
|
const BG_COLORS = {
|
|
10
|
-
warn: (str) => colorize.bgYellow(colorize.black(str)),
|
|
11
|
-
error: colorize.bgRed,
|
|
16
|
+
warn: (str) => logger_1.colorize.bgYellow(logger_1.colorize.black(str)),
|
|
17
|
+
error: logger_1.colorize.bgRed,
|
|
12
18
|
};
|
|
13
19
|
const COLORS = {
|
|
14
|
-
warn: colorize.yellow,
|
|
15
|
-
error: colorize.red,
|
|
20
|
+
warn: logger_1.colorize.yellow,
|
|
21
|
+
error: logger_1.colorize.red,
|
|
16
22
|
};
|
|
17
23
|
const SEVERITY_NAMES = {
|
|
18
24
|
warn: 'Warning',
|
|
@@ -26,7 +32,7 @@ const MAX_SUGGEST = 5;
|
|
|
26
32
|
function severityToNumber(severity) {
|
|
27
33
|
return severity === 'error' ? 1 : 2;
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
function getTotals(problems) {
|
|
30
36
|
let errors = 0;
|
|
31
37
|
let warnings = 0;
|
|
32
38
|
let ignored = 0;
|
|
@@ -46,9 +52,9 @@ export function getTotals(problems) {
|
|
|
46
52
|
ignored,
|
|
47
53
|
};
|
|
48
54
|
}
|
|
49
|
-
|
|
50
|
-
const { maxProblems = 100, cwd = isBrowser ? '' : process.cwd(), format = 'codeframe', color = colorOptions.enabled, totals = getTotals(problems), version =
|
|
51
|
-
colorOptions.enabled = color; // force colors if specified
|
|
55
|
+
function formatProblems(problems, opts) {
|
|
56
|
+
const { maxProblems = 100, cwd = env_1.isBrowser ? '' : process.cwd(), format = 'codeframe', color = logger_1.colorOptions.enabled, totals = getTotals(problems), version = coreVersion, } = opts;
|
|
57
|
+
logger_1.colorOptions.enabled = color; // force colors if specified
|
|
52
58
|
const totalProblems = problems.length;
|
|
53
59
|
problems = problems.filter((m) => !m.ignored);
|
|
54
60
|
const ignoredProblems = totalProblems - problems.length;
|
|
@@ -64,55 +70,55 @@ export function formatProblems(problems, opts) {
|
|
|
64
70
|
case 'codeframe':
|
|
65
71
|
for (let i = 0; i < problems.length; i++) {
|
|
66
72
|
const problem = problems[i];
|
|
67
|
-
logger.
|
|
73
|
+
logger_1.logger.info(`${formatCodeframe(problem, i)}\n`);
|
|
68
74
|
}
|
|
69
75
|
break;
|
|
70
76
|
case 'stylish': {
|
|
71
77
|
const groupedByFile = groupByFiles(problems);
|
|
72
78
|
for (const [file, { ruleIdPad, locationPad: positionPad, fileProblems }] of Object.entries(groupedByFile)) {
|
|
73
|
-
logger.
|
|
79
|
+
logger_1.logger.info(`${logger_1.colorize.blue((0, ref_utils_1.isAbsoluteUrl)(file) ? file : path.relative(cwd, file))}:\n`);
|
|
74
80
|
for (let i = 0; i < fileProblems.length; i++) {
|
|
75
81
|
const problem = fileProblems[i];
|
|
76
|
-
logger.
|
|
82
|
+
logger_1.logger.info(`${formatStylish(problem, positionPad, ruleIdPad)}\n`);
|
|
77
83
|
}
|
|
78
|
-
logger.
|
|
84
|
+
logger_1.logger.info('\n');
|
|
79
85
|
}
|
|
80
86
|
break;
|
|
81
87
|
}
|
|
82
88
|
case 'markdown': {
|
|
83
89
|
const groupedByFile = groupByFiles(problems);
|
|
84
90
|
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
output_1.output.write(`## Lint: ${(0, ref_utils_1.isAbsoluteUrl)(file) ? file : path.relative(cwd, file)}\n\n`);
|
|
92
|
+
output_1.output.write(`| Severity | Location | Problem | Message |\n`);
|
|
93
|
+
output_1.output.write(`|---|---|---|---|\n`);
|
|
88
94
|
for (let i = 0; i < fileProblems.length; i++) {
|
|
89
95
|
const problem = fileProblems[i];
|
|
90
|
-
|
|
96
|
+
output_1.output.write(`${formatMarkdown(problem)}\n`);
|
|
91
97
|
}
|
|
92
|
-
|
|
98
|
+
output_1.output.write('\n');
|
|
93
99
|
if (totals.errors > 0) {
|
|
94
|
-
|
|
100
|
+
output_1.output.write(`Validation failed\nErrors: ${totals.errors}\n`);
|
|
95
101
|
}
|
|
96
102
|
else {
|
|
97
|
-
|
|
103
|
+
output_1.output.write('Validation successful\n');
|
|
98
104
|
}
|
|
99
105
|
if (totals.warnings > 0) {
|
|
100
|
-
|
|
106
|
+
output_1.output.write(`Warnings: ${totals.warnings}\n`);
|
|
101
107
|
}
|
|
102
|
-
|
|
108
|
+
output_1.output.write('\n');
|
|
103
109
|
}
|
|
104
110
|
break;
|
|
105
111
|
}
|
|
106
112
|
case 'checkstyle': {
|
|
107
113
|
const groupedByFile = groupByFiles(problems);
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
output_1.output.write('<?xml version="1.0" encoding="UTF-8"?>\n');
|
|
115
|
+
output_1.output.write('<checkstyle version="4.3">\n');
|
|
110
116
|
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
111
|
-
|
|
117
|
+
output_1.output.write(`<file name="${xmlEscape((0, ref_utils_1.isAbsoluteUrl)(file) ? file : path.relative(cwd, file))}">\n`);
|
|
112
118
|
fileProblems.forEach(formatCheckstyle);
|
|
113
|
-
|
|
119
|
+
output_1.output.write(`</file>\n`);
|
|
114
120
|
}
|
|
115
|
-
|
|
121
|
+
output_1.output.write(`</checkstyle>\n`);
|
|
116
122
|
break;
|
|
117
123
|
}
|
|
118
124
|
case 'codeclimate':
|
|
@@ -125,16 +131,16 @@ export function formatProblems(problems, opts) {
|
|
|
125
131
|
outputForGithubActions(problems, cwd);
|
|
126
132
|
}
|
|
127
133
|
if (totalProblems - ignoredProblems > maxProblems) {
|
|
128
|
-
logger.info(`< ... ${totalProblems - maxProblems} more problems hidden > ${colorize.gray('increase with `--max-problems N`')}\n`);
|
|
134
|
+
logger_1.logger.info(`< ... ${totalProblems - maxProblems} more problems hidden > ${logger_1.colorize.gray('increase with `--max-problems N`')}\n`);
|
|
129
135
|
}
|
|
130
136
|
function outputForCodeClimate() {
|
|
131
137
|
const issues = problems.map((p) => {
|
|
132
138
|
const location = p.location[0]; // TODO: support multiple location
|
|
133
|
-
const lineCol = getLineColLocation(location);
|
|
139
|
+
const lineCol = (0, codeframes_1.getLineColLocation)(location);
|
|
134
140
|
return {
|
|
135
141
|
description: p.message,
|
|
136
142
|
location: {
|
|
137
|
-
path: isAbsoluteUrl(location.source.absoluteRef)
|
|
143
|
+
path: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
|
|
138
144
|
? location.source.absoluteRef
|
|
139
145
|
: path.relative(cwd, location.source.absoluteRef),
|
|
140
146
|
lines: {
|
|
@@ -145,7 +151,7 @@ export function formatProblems(problems, opts) {
|
|
|
145
151
|
fingerprint: `${p.ruleId}${p.location.length > 0 ? '-' + p.location[0].pointer : ''}`,
|
|
146
152
|
};
|
|
147
153
|
});
|
|
148
|
-
|
|
154
|
+
output_1.output.write(JSON.stringify(issues, null, 2));
|
|
149
155
|
}
|
|
150
156
|
function outputJSON() {
|
|
151
157
|
const resultObject = {
|
|
@@ -157,7 +163,7 @@ export function formatProblems(problems, opts) {
|
|
|
157
163
|
location: p.location.map((location) => ({
|
|
158
164
|
...location,
|
|
159
165
|
source: {
|
|
160
|
-
ref: isAbsoluteUrl(location.source.absoluteRef)
|
|
166
|
+
ref: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
|
|
161
167
|
? location.source.absoluteRef
|
|
162
168
|
: path.relative(cwd, location.source.absoluteRef),
|
|
163
169
|
},
|
|
@@ -166,22 +172,22 @@ export function formatProblems(problems, opts) {
|
|
|
166
172
|
? {
|
|
167
173
|
...p.from,
|
|
168
174
|
source: {
|
|
169
|
-
ref: isAbsoluteUrl(p.from?.source.absoluteRef)
|
|
175
|
+
ref: (0, ref_utils_1.isAbsoluteUrl)(p.from?.source.absoluteRef)
|
|
170
176
|
? p.from?.source.absoluteRef
|
|
171
177
|
: path.relative(cwd, p.from?.source.absoluteRef || cwd),
|
|
172
178
|
},
|
|
173
179
|
}
|
|
174
180
|
: undefined,
|
|
175
181
|
};
|
|
176
|
-
if (env.FORMAT_JSON_WITH_CODEFRAMES) {
|
|
182
|
+
if (env_1.env.FORMAT_JSON_WITH_CODEFRAMES) {
|
|
177
183
|
const location = p.location[0]; // TODO: support multiple locations
|
|
178
|
-
const loc = getLineColLocation(location);
|
|
179
|
-
problem.codeframe = getCodeframe(loc, color);
|
|
184
|
+
const loc = (0, codeframes_1.getLineColLocation)(location);
|
|
185
|
+
problem.codeframe = (0, codeframes_1.getCodeframe)(loc, color);
|
|
180
186
|
}
|
|
181
187
|
return problem;
|
|
182
188
|
}),
|
|
183
189
|
};
|
|
184
|
-
|
|
190
|
+
output_1.output.write(JSON.stringify(resultObject, null, 2));
|
|
185
191
|
}
|
|
186
192
|
function getBgColor(problem) {
|
|
187
193
|
const { severity } = problem;
|
|
@@ -193,19 +199,19 @@ export function formatProblems(problems, opts) {
|
|
|
193
199
|
function formatCodeframe(problem, idx) {
|
|
194
200
|
const bgColor = getBgColor(problem);
|
|
195
201
|
const location = problem.location[0]; // TODO: support multiple locations
|
|
196
|
-
const relativePath = isAbsoluteUrl(location.source.absoluteRef)
|
|
202
|
+
const relativePath = (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
|
|
197
203
|
? location.source.absoluteRef
|
|
198
204
|
: path.relative(cwd, location.source.absoluteRef);
|
|
199
|
-
const loc = getLineColLocation(location);
|
|
200
|
-
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
205
|
+
const loc = (0, codeframes_1.getLineColLocation)(location);
|
|
206
|
+
const atPointer = location.pointer ? logger_1.colorize.gray(`at ${location.pointer}`) : '';
|
|
201
207
|
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
202
208
|
return (`[${idx + 1}] ${bgColor(fileWithLoc)} ${atPointer}\n\n` +
|
|
203
209
|
`${problem.message}\n\n` +
|
|
204
210
|
formatDidYouMean(problem) +
|
|
205
|
-
getCodeframe(loc, color) +
|
|
211
|
+
(0, codeframes_1.getCodeframe)(loc, color) +
|
|
206
212
|
'\n\n' +
|
|
207
213
|
formatFrom(cwd, problem.from) +
|
|
208
|
-
`${SEVERITY_NAMES[problem.severity]} was generated by the ${colorize.blue(problem.ruleId)} rule.\n\n`);
|
|
214
|
+
`${SEVERITY_NAMES[problem.severity]} was generated by the ${logger_1.colorize.blue(problem.ruleId)} rule.\n\n`);
|
|
209
215
|
}
|
|
210
216
|
function formatStylish(problem, locationPad, ruleIdPad) {
|
|
211
217
|
const color = COLORS[problem.severity];
|
|
@@ -229,7 +235,7 @@ export function formatProblems(problems, opts) {
|
|
|
229
235
|
const severity = problem.severity == 'warn' ? 'warning' : 'error';
|
|
230
236
|
const message = xmlEscape(problem.message);
|
|
231
237
|
const source = xmlEscape(problem.ruleId);
|
|
232
|
-
|
|
238
|
+
output_1.output.write(`<error line="${line}" column="${col}" severity="${severity}" message="${message}" source="${source}" />\n`);
|
|
233
239
|
}
|
|
234
240
|
}
|
|
235
241
|
function formatSummary(problems) {
|
|
@@ -245,18 +251,18 @@ function formatSummary(problems) {
|
|
|
245
251
|
for (const [ruleId, info] of sorted) {
|
|
246
252
|
const color = COLORS[info.severity];
|
|
247
253
|
const severityName = color(SEVERITY_NAMES[info.severity].toLowerCase().padEnd(7));
|
|
248
|
-
logger.
|
|
254
|
+
logger_1.logger.info(`${severityName} ${ruleId}: ${info.count}\n`);
|
|
249
255
|
}
|
|
250
|
-
logger.
|
|
256
|
+
logger_1.logger.info('\n');
|
|
251
257
|
}
|
|
252
258
|
function formatFrom(cwd, location) {
|
|
253
259
|
if (!location)
|
|
254
260
|
return '';
|
|
255
261
|
const relativePath = path.relative(cwd, location.source.absoluteRef);
|
|
256
|
-
const loc = getLineColLocation(location);
|
|
262
|
+
const loc = (0, codeframes_1.getLineColLocation)(location);
|
|
257
263
|
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
258
|
-
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
259
|
-
return `referenced from ${colorize.blue(fileWithLoc)} ${atPointer} \n\n`;
|
|
264
|
+
const atPointer = location.pointer ? logger_1.colorize.gray(`at ${location.pointer}`) : '';
|
|
265
|
+
return `referenced from ${logger_1.colorize.blue(fileWithLoc)} ${atPointer} \n\n`;
|
|
260
266
|
}
|
|
261
267
|
function formatDidYouMean(problem) {
|
|
262
268
|
if (problem.suggest.length === 0)
|
|
@@ -277,7 +283,7 @@ const groupByFiles = (problems) => {
|
|
|
277
283
|
ruleIdPad: 0,
|
|
278
284
|
locationPad: 0,
|
|
279
285
|
};
|
|
280
|
-
const mappedProblem = { ...problem, location: problem.location.map(getLineColLocation) };
|
|
286
|
+
const mappedProblem = { ...problem, location: problem.location.map(codeframes_1.getLineColLocation) };
|
|
281
287
|
fileGroups[absoluteRef].fileProblems.push(mappedProblem);
|
|
282
288
|
fileGroups[absoluteRef].ruleIdPad = Math.max(problem.ruleId.length, fileGroups[absoluteRef].ruleIdPad);
|
|
283
289
|
fileGroups[absoluteRef].locationPad = Math.max(Math.max(...mappedProblem.location.map((loc) => `${loc.start.line}:${loc.start.col}`.length)), fileGroups[absoluteRef].locationPad);
|
|
@@ -305,7 +311,7 @@ function xmlEscape(s) {
|
|
|
305
311
|
}
|
|
306
312
|
function outputForGithubActions(problems, cwd) {
|
|
307
313
|
for (const problem of problems) {
|
|
308
|
-
for (const location of problem.location.map(getLineColLocation)) {
|
|
314
|
+
for (const location of problem.location.map(codeframes_1.getLineColLocation)) {
|
|
309
315
|
let command;
|
|
310
316
|
switch (problem.severity) {
|
|
311
317
|
case 'error':
|
|
@@ -319,7 +325,7 @@ function outputForGithubActions(problems, cwd) {
|
|
|
319
325
|
const message = suggest !== '' ? problem.message + '\n\n' + suggest : problem.message;
|
|
320
326
|
const properties = {
|
|
321
327
|
title: problem.ruleId,
|
|
322
|
-
file: isAbsoluteUrl(location.source.absoluteRef)
|
|
328
|
+
file: (0, ref_utils_1.isAbsoluteUrl)(location.source.absoluteRef)
|
|
323
329
|
? location.source.absoluteRef
|
|
324
330
|
: path.relative(cwd, location.source.absoluteRef),
|
|
325
331
|
line: location.start.line,
|
|
@@ -327,7 +333,7 @@ function outputForGithubActions(problems, cwd) {
|
|
|
327
333
|
endLine: location.end?.line,
|
|
328
334
|
endColumn: location.end?.col,
|
|
329
335
|
};
|
|
330
|
-
|
|
336
|
+
output_1.output.write(`::${command} ${formatProperties(properties)}::${escapeMessage(message)}\n`);
|
|
331
337
|
}
|
|
332
338
|
}
|
|
333
339
|
function formatProperties(props) {
|
|
@@ -357,4 +363,3 @@ function outputForGithubActions(problems, cwd) {
|
|
|
357
363
|
.replace(/,/g, '%2C');
|
|
358
364
|
}
|
|
359
365
|
}
|
|
360
|
-
//# sourceMappingURL=format.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { Oas3_1Types } from './types/oas3_1
|
|
3
|
-
export { Arazzo1Types } from './types/arazzo
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export { logger } from './logger.js';
|
|
28
|
-
export { HandledError } from './utils/error.js';
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { BundleOutputFormat, readFileFromUrl, slash, doesYamlFileExist, isTruthy, getProxyAgent, pause, } from './utils';
|
|
2
|
+
export { Oas3_1Types } from './types/oas3_1';
|
|
3
|
+
export { Arazzo1Types } from './types/arazzo';
|
|
4
|
+
export { Oas3Types } from './types/oas3';
|
|
5
|
+
export { Oas2Types } from './types/oas2';
|
|
6
|
+
export { AsyncApi2Types } from './types/asyncapi2';
|
|
7
|
+
export { AsyncApi3Types } from './types/asyncapi3';
|
|
8
|
+
export { ConfigTypes } from './types/redocly-yaml';
|
|
9
|
+
export type { Oas3Definition, Oas3_1Definition, Oas3Components, Oas3_1Components, Oas3PathItem, Oas3Paths, Oas3ComponentName, Oas3Schema, Oas3_1Schema, Oas3Tag, Referenced, OasRef, } from './typings/openapi';
|
|
10
|
+
export type { Oas2Definition } from './typings/swagger';
|
|
11
|
+
export type { StatsAccumulator, StatsName } from './typings/common';
|
|
12
|
+
export { normalizeTypes } from './types';
|
|
13
|
+
export { Stats } from './rules/other/stats';
|
|
14
|
+
export { Config, StyleguideConfig, RawConfig, RawUniversalConfig, IGNORE_FILE, Region, getMergedConfig, transformConfig, loadConfig, getConfig, findConfig, CONFIG_FILE_NAMES, RuleSeverity, createConfig, ResolvedApi, } from './config';
|
|
15
|
+
export { RedoclyClient } from './redocly';
|
|
16
|
+
export * from './redocly/domains';
|
|
17
|
+
export { Source, BaseResolver, Document, resolveDocument, ResolveError, YamlParseError, makeDocumentFromString, } from './resolve';
|
|
18
|
+
export { parseYaml, stringifyYaml } from './js-yaml';
|
|
19
|
+
export { unescapePointer, isRef, isAbsoluteUrl } from './ref-utils';
|
|
20
|
+
export { SpecMajorVersion, getMajorSpecVersion, SpecVersion, detectSpec, getTypes, } from './oas-types';
|
|
21
|
+
export { normalizeVisitors } from './visitors';
|
|
22
|
+
export { WalkContext, walkDocument, NormalizedProblem, ProblemSeverity, LineColLocationObject, LocationObject, Loc, } from './walk';
|
|
23
|
+
export { getAstNodeByPointer, getLineColLocation } from './format/codeframes';
|
|
24
|
+
export { formatProblems, OutputFormat, getTotals, Totals } from './format/format';
|
|
25
|
+
export { lint, lint as validate, lintDocument, lintFromString, lintConfig } from './lint';
|
|
26
|
+
export { bundle, bundleDocument, mapTypeToComponent, bundleFromString } from './bundle';
|
package/lib/index.js
CHANGED
|
@@ -1,24 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.validate = exports.lint = exports.getTotals = exports.formatProblems = exports.getLineColLocation = exports.getAstNodeByPointer = exports.walkDocument = exports.normalizeVisitors = exports.getTypes = exports.detectSpec = exports.SpecVersion = exports.getMajorSpecVersion = exports.SpecMajorVersion = exports.isAbsoluteUrl = exports.isRef = exports.unescapePointer = exports.stringifyYaml = exports.parseYaml = exports.makeDocumentFromString = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.Source = exports.RedoclyClient = exports.createConfig = exports.CONFIG_FILE_NAMES = exports.findConfig = exports.getConfig = exports.loadConfig = exports.transformConfig = exports.getMergedConfig = exports.IGNORE_FILE = exports.StyleguideConfig = exports.Config = exports.Stats = exports.normalizeTypes = exports.ConfigTypes = exports.AsyncApi3Types = exports.AsyncApi2Types = exports.Oas2Types = exports.Oas3Types = exports.Arazzo1Types = exports.Oas3_1Types = exports.pause = exports.getProxyAgent = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
|
|
18
|
+
exports.bundleFromString = exports.mapTypeToComponent = exports.bundleDocument = exports.bundle = exports.lintConfig = exports.lintFromString = exports.lintDocument = void 0;
|
|
19
|
+
var utils_1 = require("./utils");
|
|
20
|
+
Object.defineProperty(exports, "readFileFromUrl", { enumerable: true, get: function () { return utils_1.readFileFromUrl; } });
|
|
21
|
+
Object.defineProperty(exports, "slash", { enumerable: true, get: function () { return utils_1.slash; } });
|
|
22
|
+
Object.defineProperty(exports, "doesYamlFileExist", { enumerable: true, get: function () { return utils_1.doesYamlFileExist; } });
|
|
23
|
+
Object.defineProperty(exports, "isTruthy", { enumerable: true, get: function () { return utils_1.isTruthy; } });
|
|
24
|
+
Object.defineProperty(exports, "getProxyAgent", { enumerable: true, get: function () { return utils_1.getProxyAgent; } });
|
|
25
|
+
Object.defineProperty(exports, "pause", { enumerable: true, get: function () { return utils_1.pause; } });
|
|
26
|
+
var oas3_1_1 = require("./types/oas3_1");
|
|
27
|
+
Object.defineProperty(exports, "Oas3_1Types", { enumerable: true, get: function () { return oas3_1_1.Oas3_1Types; } });
|
|
28
|
+
var arazzo_1 = require("./types/arazzo");
|
|
29
|
+
Object.defineProperty(exports, "Arazzo1Types", { enumerable: true, get: function () { return arazzo_1.Arazzo1Types; } });
|
|
30
|
+
var oas3_1 = require("./types/oas3");
|
|
31
|
+
Object.defineProperty(exports, "Oas3Types", { enumerable: true, get: function () { return oas3_1.Oas3Types; } });
|
|
32
|
+
var oas2_1 = require("./types/oas2");
|
|
33
|
+
Object.defineProperty(exports, "Oas2Types", { enumerable: true, get: function () { return oas2_1.Oas2Types; } });
|
|
34
|
+
var asyncapi2_1 = require("./types/asyncapi2");
|
|
35
|
+
Object.defineProperty(exports, "AsyncApi2Types", { enumerable: true, get: function () { return asyncapi2_1.AsyncApi2Types; } });
|
|
36
|
+
var asyncapi3_1 = require("./types/asyncapi3");
|
|
37
|
+
Object.defineProperty(exports, "AsyncApi3Types", { enumerable: true, get: function () { return asyncapi3_1.AsyncApi3Types; } });
|
|
38
|
+
var redocly_yaml_1 = require("./types/redocly-yaml");
|
|
39
|
+
Object.defineProperty(exports, "ConfigTypes", { enumerable: true, get: function () { return redocly_yaml_1.ConfigTypes; } });
|
|
40
|
+
var types_1 = require("./types");
|
|
41
|
+
Object.defineProperty(exports, "normalizeTypes", { enumerable: true, get: function () { return types_1.normalizeTypes; } });
|
|
42
|
+
var stats_1 = require("./rules/other/stats");
|
|
43
|
+
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return stats_1.Stats; } });
|
|
44
|
+
var config_1 = require("./config");
|
|
45
|
+
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
|
|
46
|
+
Object.defineProperty(exports, "StyleguideConfig", { enumerable: true, get: function () { return config_1.StyleguideConfig; } });
|
|
47
|
+
Object.defineProperty(exports, "IGNORE_FILE", { enumerable: true, get: function () { return config_1.IGNORE_FILE; } });
|
|
48
|
+
Object.defineProperty(exports, "getMergedConfig", { enumerable: true, get: function () { return config_1.getMergedConfig; } });
|
|
49
|
+
Object.defineProperty(exports, "transformConfig", { enumerable: true, get: function () { return config_1.transformConfig; } });
|
|
50
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_1.loadConfig; } });
|
|
51
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return config_1.getConfig; } });
|
|
52
|
+
Object.defineProperty(exports, "findConfig", { enumerable: true, get: function () { return config_1.findConfig; } });
|
|
53
|
+
Object.defineProperty(exports, "CONFIG_FILE_NAMES", { enumerable: true, get: function () { return config_1.CONFIG_FILE_NAMES; } });
|
|
54
|
+
Object.defineProperty(exports, "createConfig", { enumerable: true, get: function () { return config_1.createConfig; } });
|
|
55
|
+
var redocly_1 = require("./redocly");
|
|
56
|
+
Object.defineProperty(exports, "RedoclyClient", { enumerable: true, get: function () { return redocly_1.RedoclyClient; } });
|
|
57
|
+
__exportStar(require("./redocly/domains"), exports);
|
|
58
|
+
var resolve_1 = require("./resolve");
|
|
59
|
+
Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return resolve_1.Source; } });
|
|
60
|
+
Object.defineProperty(exports, "BaseResolver", { enumerable: true, get: function () { return resolve_1.BaseResolver; } });
|
|
61
|
+
Object.defineProperty(exports, "resolveDocument", { enumerable: true, get: function () { return resolve_1.resolveDocument; } });
|
|
62
|
+
Object.defineProperty(exports, "ResolveError", { enumerable: true, get: function () { return resolve_1.ResolveError; } });
|
|
63
|
+
Object.defineProperty(exports, "YamlParseError", { enumerable: true, get: function () { return resolve_1.YamlParseError; } });
|
|
64
|
+
Object.defineProperty(exports, "makeDocumentFromString", { enumerable: true, get: function () { return resolve_1.makeDocumentFromString; } });
|
|
65
|
+
var js_yaml_1 = require("./js-yaml");
|
|
66
|
+
Object.defineProperty(exports, "parseYaml", { enumerable: true, get: function () { return js_yaml_1.parseYaml; } });
|
|
67
|
+
Object.defineProperty(exports, "stringifyYaml", { enumerable: true, get: function () { return js_yaml_1.stringifyYaml; } });
|
|
68
|
+
var ref_utils_1 = require("./ref-utils");
|
|
69
|
+
Object.defineProperty(exports, "unescapePointer", { enumerable: true, get: function () { return ref_utils_1.unescapePointer; } });
|
|
70
|
+
Object.defineProperty(exports, "isRef", { enumerable: true, get: function () { return ref_utils_1.isRef; } });
|
|
71
|
+
Object.defineProperty(exports, "isAbsoluteUrl", { enumerable: true, get: function () { return ref_utils_1.isAbsoluteUrl; } });
|
|
72
|
+
var oas_types_1 = require("./oas-types");
|
|
73
|
+
Object.defineProperty(exports, "SpecMajorVersion", { enumerable: true, get: function () { return oas_types_1.SpecMajorVersion; } });
|
|
74
|
+
Object.defineProperty(exports, "getMajorSpecVersion", { enumerable: true, get: function () { return oas_types_1.getMajorSpecVersion; } });
|
|
75
|
+
Object.defineProperty(exports, "SpecVersion", { enumerable: true, get: function () { return oas_types_1.SpecVersion; } });
|
|
76
|
+
Object.defineProperty(exports, "detectSpec", { enumerable: true, get: function () { return oas_types_1.detectSpec; } });
|
|
77
|
+
Object.defineProperty(exports, "getTypes", { enumerable: true, get: function () { return oas_types_1.getTypes; } });
|
|
78
|
+
var visitors_1 = require("./visitors");
|
|
79
|
+
Object.defineProperty(exports, "normalizeVisitors", { enumerable: true, get: function () { return visitors_1.normalizeVisitors; } });
|
|
80
|
+
var walk_1 = require("./walk");
|
|
81
|
+
Object.defineProperty(exports, "walkDocument", { enumerable: true, get: function () { return walk_1.walkDocument; } });
|
|
82
|
+
var codeframes_1 = require("./format/codeframes");
|
|
83
|
+
Object.defineProperty(exports, "getAstNodeByPointer", { enumerable: true, get: function () { return codeframes_1.getAstNodeByPointer; } });
|
|
84
|
+
Object.defineProperty(exports, "getLineColLocation", { enumerable: true, get: function () { return codeframes_1.getLineColLocation; } });
|
|
85
|
+
var format_1 = require("./format/format");
|
|
86
|
+
Object.defineProperty(exports, "formatProblems", { enumerable: true, get: function () { return format_1.formatProblems; } });
|
|
87
|
+
Object.defineProperty(exports, "getTotals", { enumerable: true, get: function () { return format_1.getTotals; } });
|
|
88
|
+
var lint_1 = require("./lint");
|
|
89
|
+
Object.defineProperty(exports, "lint", { enumerable: true, get: function () { return lint_1.lint; } });
|
|
90
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return lint_1.lint; } });
|
|
91
|
+
Object.defineProperty(exports, "lintDocument", { enumerable: true, get: function () { return lint_1.lintDocument; } });
|
|
92
|
+
Object.defineProperty(exports, "lintFromString", { enumerable: true, get: function () { return lint_1.lintFromString; } });
|
|
93
|
+
Object.defineProperty(exports, "lintConfig", { enumerable: true, get: function () { return lint_1.lintConfig; } });
|
|
94
|
+
var bundle_1 = require("./bundle");
|
|
95
|
+
Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return bundle_1.bundle; } });
|
|
96
|
+
Object.defineProperty(exports, "bundleDocument", { enumerable: true, get: function () { return bundle_1.bundleDocument; } });
|
|
97
|
+
Object.defineProperty(exports, "mapTypeToComponent", { enumerable: true, get: function () { return bundle_1.mapTypeToComponent; } });
|
|
98
|
+
Object.defineProperty(exports, "bundleFromString", { enumerable: true, get: function () { return bundle_1.bundleFromString; } });
|
package/lib/js-yaml/index.d.ts
CHANGED
package/lib/js-yaml/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringifyYaml = exports.parseYaml = void 0;
|
|
1
4
|
// TODO: add a type for "types" https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/js-yaml/index.d.ts
|
|
2
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
6
|
// @ts-ignore
|
|
4
|
-
|
|
5
|
-
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = JSON_SCHEMA.extend({
|
|
6
|
-
implicit: [types.merge],
|
|
7
|
-
explicit: [types.binary, types.omap, types.pairs, types.set],
|
|
7
|
+
const js_yaml_1 = require("js-yaml");
|
|
8
|
+
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = js_yaml_1.JSON_SCHEMA.extend({
|
|
9
|
+
implicit: [js_yaml_1.types.merge],
|
|
10
|
+
explicit: [js_yaml_1.types.binary, js_yaml_1.types.omap, js_yaml_1.types.pairs, js_yaml_1.types.set],
|
|
8
11
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const parseYaml = (str, opts) => (0, js_yaml_1.load)(str, { schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts });
|
|
13
|
+
exports.parseYaml = parseYaml;
|
|
14
|
+
const stringifyYaml = (obj, opts) => (0, js_yaml_1.dump)(obj, opts);
|
|
15
|
+
exports.stringifyYaml = stringifyYaml;
|
package/lib/lint.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { BaseResolver } from './resolve
|
|
2
|
-
import type { StyleguideConfig, Config } from './config
|
|
3
|
-
import type { Document, ResolvedRefMap } from './resolve
|
|
4
|
-
import type { ProblemSeverity } from './walk
|
|
5
|
-
import type { NodeType } from './types
|
|
6
|
-
import type { CollectFn } from './utils
|
|
1
|
+
import { BaseResolver } from './resolve';
|
|
2
|
+
import type { StyleguideConfig, Config } from './config';
|
|
3
|
+
import type { Document, ResolvedRefMap } from './resolve';
|
|
4
|
+
import type { ProblemSeverity } from './walk';
|
|
5
|
+
import type { NodeType } from './types';
|
|
6
|
+
import type { CollectFn } from './utils';
|
|
7
7
|
export declare function lint(opts: {
|
|
8
8
|
ref: string;
|
|
9
9
|
config: Config;
|
|
10
10
|
externalRefResolver?: BaseResolver;
|
|
11
11
|
collectSpecData?: CollectFn;
|
|
12
|
-
}): Promise<import("./walk
|
|
12
|
+
}): Promise<import("./walk").NormalizedProblem[]>;
|
|
13
13
|
export declare function lintFromString(opts: {
|
|
14
14
|
source: string;
|
|
15
15
|
absoluteRef?: string;
|
|
16
16
|
config: Config;
|
|
17
17
|
externalRefResolver?: BaseResolver;
|
|
18
|
-
}): Promise<import("./walk
|
|
18
|
+
}): Promise<import("./walk").NormalizedProblem[]>;
|
|
19
19
|
export declare function lintDocument(opts: {
|
|
20
20
|
document: Document;
|
|
21
21
|
config: StyleguideConfig;
|
|
22
22
|
customTypes?: Record<string, NodeType>;
|
|
23
23
|
externalRefResolver: BaseResolver;
|
|
24
|
-
}): Promise<import("./walk
|
|
24
|
+
}): Promise<import("./walk").NormalizedProblem[]>;
|
|
25
25
|
export declare function lintConfig(opts: {
|
|
26
26
|
document: Document;
|
|
27
27
|
config: Config;
|
|
@@ -29,5 +29,4 @@ export declare function lintConfig(opts: {
|
|
|
29
29
|
severity?: ProblemSeverity;
|
|
30
30
|
externalRefResolver?: BaseResolver;
|
|
31
31
|
externalConfigTypes?: Record<string, NodeType>;
|
|
32
|
-
}): Promise<import("./walk
|
|
33
|
-
//# sourceMappingURL=lint.d.ts.map
|
|
32
|
+
}): Promise<import("./walk").NormalizedProblem[]>;
|