@redocly/openapi-core 1.34.3 → 2.0.0-next.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 +42 -4
- package/lib/bundle.d.ts +16 -15
- package/lib/bundle.d.ts.map +1 -0
- package/lib/bundle.js +88 -109
- package/lib/bundle.js.map +1 -0
- package/lib/config/all.d.ts +3 -2
- package/lib/config/all.d.ts.map +1 -0
- package/lib/config/all.js +5 -3
- package/lib/config/all.js.map +1 -0
- package/lib/config/builtIn.d.ts +3 -2
- package/lib/config/builtIn.d.ts.map +1 -0
- package/lib/config/builtIn.js +44 -49
- package/lib/config/builtIn.js.map +1 -0
- package/lib/config/bundle-extends.d.ts +8 -0
- package/lib/config/bundle-extends.d.ts.map +1 -0
- package/lib/config/bundle-extends.js +27 -0
- package/lib/config/bundle-extends.js.map +1 -0
- package/lib/config/config-resolvers.d.ts +15 -27
- package/lib/config/config-resolvers.d.ts.map +1 -0
- package/lib/config/config-resolvers.js +259 -373
- package/lib/config/config-resolvers.js.map +1 -0
- package/lib/config/config.d.ts +22 -26
- package/lib/config/config.d.ts.map +1 -0
- package/lib/config/config.js +104 -112
- package/lib/config/config.js.map +1 -0
- package/lib/config/index.d.ts +8 -7
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/index.js +8 -23
- package/lib/config/index.js.map +1 -0
- package/lib/config/load.d.ts +8 -19
- package/lib/config/load.d.ts.map +1 -0
- package/lib/config/load.js +62 -107
- package/lib/config/load.js.map +1 -0
- package/lib/config/minimal.d.ts +3 -2
- package/lib/config/minimal.d.ts.map +1 -0
- package/lib/config/minimal.js +5 -3
- package/lib/config/minimal.js.map +1 -0
- package/lib/config/recommended-strict.d.ts +3 -2
- package/lib/config/recommended-strict.d.ts.map +1 -0
- package/lib/config/recommended-strict.js +5 -3
- package/lib/config/recommended-strict.js.map +1 -0
- package/lib/config/recommended.d.ts +3 -2
- package/lib/config/recommended.d.ts.map +1 -0
- package/lib/config/recommended.js +5 -3
- package/lib/config/recommended.js.map +1 -0
- package/lib/config/rules.d.ts +5 -4
- package/lib/config/rules.d.ts.map +1 -0
- package/lib/config/rules.js +4 -6
- package/lib/config/rules.js.map +1 -0
- package/lib/config/spec.d.ts +3 -2
- package/lib/config/spec.d.ts.map +1 -0
- package/lib/config/spec.js +6 -4
- package/lib/config/spec.js.map +1 -0
- package/lib/config/types.d.ts +19 -62
- package/lib/config/types.d.ts.map +1 -0
- package/lib/config/types.js +2 -2
- package/lib/config/types.js.map +1 -0
- package/lib/config/utils.d.ts +5 -9
- package/lib/config/utils.d.ts.map +1 -0
- package/lib/config/utils.js +56 -258
- package/lib/config/utils.js.map +1 -0
- package/lib/config/visitors.d.ts +36 -0
- package/lib/config/visitors.d.ts.map +1 -0
- package/lib/config/visitors.js +88 -0
- package/lib/config/visitors.js.map +1 -0
- package/lib/decorators/arazzo/index.d.ts +1 -0
- package/lib/decorators/arazzo/index.d.ts.map +1 -0
- package/lib/decorators/arazzo/index.js +2 -4
- package/lib/decorators/arazzo/index.js.map +1 -0
- package/lib/decorators/async2/index.d.ts +1 -0
- package/lib/decorators/async2/index.d.ts.map +1 -0
- package/lib/decorators/async2/index.js +2 -4
- package/lib/decorators/async2/index.js.map +1 -0
- package/lib/decorators/async3/index.d.ts +1 -0
- package/lib/decorators/async3/index.d.ts.map +1 -0
- package/lib/decorators/async3/index.js +2 -4
- package/lib/decorators/async3/index.js.map +1 -0
- package/lib/decorators/common/filters/filter-helper.d.ts +2 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-helper.js +9 -12
- package/lib/decorators/common/filters/filter-helper.js.map +1 -0
- package/lib/decorators/common/filters/filter-in.d.ts +2 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-in.js +5 -8
- package/lib/decorators/common/filters/filter-in.js.map +1 -0
- package/lib/decorators/common/filters/filter-out.d.ts +2 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-out.js +5 -8
- package/lib/decorators/common/filters/filter-out.js.map +1 -0
- package/lib/decorators/common/info-description-override.d.ts +2 -1
- package/lib/decorators/common/info-description-override.d.ts.map +1 -0
- package/lib/decorators/common/info-description-override.js +4 -7
- package/lib/decorators/common/info-description-override.js.map +1 -0
- package/lib/decorators/common/info-override.d.ts +2 -1
- package/lib/decorators/common/info-override.d.ts.map +1 -0
- package/lib/decorators/common/info-override.js +2 -5
- package/lib/decorators/common/info-override.js.map +1 -0
- package/lib/decorators/common/media-type-examples-override.d.ts +2 -1
- package/lib/decorators/common/media-type-examples-override.d.ts.map +1 -0
- package/lib/decorators/common/media-type-examples-override.js +7 -10
- package/lib/decorators/common/media-type-examples-override.js.map +1 -0
- package/lib/decorators/common/operation-description-override.d.ts +2 -1
- package/lib/decorators/common/operation-description-override.d.ts.map +1 -0
- package/lib/decorators/common/operation-description-override.js +4 -7
- package/lib/decorators/common/operation-description-override.js.map +1 -0
- package/lib/decorators/common/remove-x-internal.d.ts +2 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +1 -0
- package/lib/decorators/common/remove-x-internal.js +11 -14
- package/lib/decorators/common/remove-x-internal.js.map +1 -0
- package/lib/decorators/common/tag-description-override.d.ts +2 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +1 -0
- package/lib/decorators/common/tag-description-override.js +4 -7
- package/lib/decorators/common/tag-description-override.js.map +1 -0
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.d.ts.map +1 -0
- package/lib/decorators/oas2/index.js +16 -20
- package/lib/decorators/oas2/index.js.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.d.ts +2 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.js +4 -7
- package/lib/decorators/oas2/remove-unused-components.js.map +1 -0
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.d.ts.map +1 -0
- package/lib/decorators/oas3/index.js +18 -22
- package/lib/decorators/oas3/index.js.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts +2 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.js +5 -8
- package/lib/decorators/oas3/remove-unused-components.js.map +1 -0
- package/lib/decorators/overlay1/index.d.ts +1 -0
- package/lib/decorators/overlay1/index.d.ts.map +1 -0
- package/lib/decorators/overlay1/index.js +2 -4
- package/lib/decorators/overlay1/index.js.map +1 -0
- package/lib/env.d.ts +1 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +3 -5
- package/lib/env.js.map +1 -0
- package/lib/format/codeframes.d.ts +2 -1
- package/lib/format/codeframes.d.ts.map +1 -0
- package/lib/format/codeframes.js +15 -19
- package/lib/format/codeframes.js.map +1 -0
- package/lib/format/format.d.ts +2 -1
- package/lib/format/format.d.ts.map +1 -0
- package/lib/format/format.js +57 -62
- package/lib/format/format.js.map +1 -0
- package/lib/index.d.ts +31 -26
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +25 -98
- package/lib/index.js.map +1 -0
- package/lib/js-yaml/index.d.ts +1 -0
- package/lib/js-yaml/index.d.ts.map +1 -0
- package/lib/js-yaml/index.js +7 -11
- package/lib/js-yaml/index.js.map +1 -0
- package/lib/lint.d.ts +12 -13
- package/lib/lint.d.ts.map +1 -0
- package/lib/lint.js +46 -50
- package/lib/lint.js.map +1 -0
- package/lib/logger.d.ts +2 -1
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +15 -17
- package/lib/logger.js.map +1 -0
- package/lib/oas-types.d.ts +395 -3
- package/lib/oas-types.d.ts.map +1 -0
- package/lib/oas-types.js +28 -32
- package/lib/oas-types.js.map +1 -0
- package/lib/ref-utils.d.ts +5 -2
- package/lib/ref-utils.d.ts.map +1 -0
- package/lib/ref-utils.js +30 -33
- package/lib/ref-utils.js.map +1 -0
- package/lib/resolve.d.ts +7 -9
- package/lib/resolve.d.ts.map +1 -0
- package/lib/resolve.js +40 -47
- package/lib/resolve.js.map +1 -0
- package/lib/rules/ajv.d.ts +4 -3
- package/lib/rules/ajv.d.ts.map +1 -0
- package/lib/rules/ajv.js +7 -10
- package/lib/rules/ajv.js.map +1 -0
- package/lib/rules/arazzo/criteria-unique.d.ts +2 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/criteria-unique.js +2 -5
- package/lib/rules/arazzo/criteria-unique.js.map +1 -0
- package/lib/rules/arazzo/index.d.ts +2 -1
- package/lib/rules/arazzo/index.d.ts.map +1 -0
- package/lib/rules/arazzo/index.js +39 -35
- package/lib/rules/arazzo/index.js.map +1 -0
- package/lib/rules/arazzo/parameters-unique.d.ts +2 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/parameters-unique.js +2 -5
- package/lib/rules/arazzo/parameters-unique.js.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js +2 -5
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.js +2 -5
- package/lib/rules/arazzo/sourceDescription-type.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +2 -5
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +2 -5
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.js +2 -5
- package/lib/rules/arazzo/step-onFailure-unique.js.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js +2 -5
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +1 -0
- package/lib/rules/arazzo/stepId-unique.d.ts +2 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/stepId-unique.js +2 -5
- package/lib/rules/arazzo/stepId-unique.js.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.js +2 -5
- package/lib/rules/arazzo/workflow-dependsOn.js.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.d.ts +2 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.js +2 -5
- package/lib/rules/arazzo/workflowId-unique.js.map +1 -0
- package/lib/rules/async2/channels-kebab-case.d.ts +2 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async2/channels-kebab-case.js +2 -5
- package/lib/rules/async2/channels-kebab-case.js.map +1 -0
- package/lib/rules/async2/index.d.ts +2 -1
- package/lib/rules/async2/index.d.ts.map +1 -0
- package/lib/rules/async2/index.js +21 -26
- package/lib/rules/async2/index.js.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +2 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.js +2 -5
- package/lib/rules/async2/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/async3/channels-kebab-case.d.ts +2 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async3/channels-kebab-case.js +2 -5
- package/lib/rules/async3/channels-kebab-case.js.map +1 -0
- package/lib/rules/async3/index.d.ts +2 -1
- package/lib/rules/async3/index.d.ts.map +1 -0
- package/lib/rules/async3/index.js +21 -26
- package/lib/rules/async3/index.js.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +2 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.js +3 -6
- package/lib/rules/async3/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/common/assertions/asserts.d.ts +3 -3
- package/lib/rules/common/assertions/asserts.d.ts.map +1 -0
- package/lib/rules/common/assertions/asserts.js +35 -51
- package/lib/rules/common/assertions/asserts.js.map +1 -0
- package/lib/rules/common/assertions/index.d.ts +4 -3
- package/lib/rules/common/assertions/index.d.ts.map +1 -0
- package/lib/rules/common/assertions/index.js +7 -10
- package/lib/rules/common/assertions/index.js.map +1 -0
- package/lib/rules/common/assertions/utils.d.ts +5 -4
- package/lib/rules/common/assertions/utils.d.ts.map +1 -0
- package/lib/rules/common/assertions/utils.js +21 -29
- package/lib/rules/common/assertions/utils.js.map +1 -0
- package/lib/rules/common/info-contact.d.ts +2 -1
- package/lib/rules/common/info-contact.d.ts.map +1 -0
- package/lib/rules/common/info-contact.js +4 -7
- package/lib/rules/common/info-contact.js.map +1 -0
- package/lib/rules/common/info-license-strict.d.ts +2 -1
- package/lib/rules/common/info-license-strict.d.ts.map +1 -0
- package/lib/rules/common/info-license-strict.js +7 -10
- package/lib/rules/common/info-license-strict.js.map +1 -0
- package/lib/rules/common/info-license-url.d.ts +2 -1
- package/lib/rules/common/info-license-url.d.ts.map +1 -0
- package/lib/rules/common/info-license-url.js +4 -7
- package/lib/rules/common/info-license-url.js.map +1 -0
- package/lib/rules/common/info-license.d.ts +2 -1
- package/lib/rules/common/info-license.d.ts.map +1 -0
- package/lib/rules/common/info-license.js +4 -7
- package/lib/rules/common/info-license.js.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.d.ts +2 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.js +2 -5
- package/lib/rules/common/no-ambiguous-paths.js.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.d.ts +2 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.js +6 -9
- package/lib/rules/common/no-enum-type-mismatch.js.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +2 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.js +5 -8
- package/lib/rules/common/no-http-verbs-in-paths.js.map +1 -0
- package/lib/rules/common/no-identical-paths.d.ts +2 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +1 -0
- package/lib/rules/common/no-identical-paths.js +2 -5
- package/lib/rules/common/no-identical-paths.js.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.js +5 -9
- package/lib/rules/common/no-invalid-parameter-examples.js.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.d.ts +2 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.js +5 -9
- package/lib/rules/common/no-invalid-schema-examples.js.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.d.ts +2 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.js +2 -5
- package/lib/rules/common/no-path-trailing-slash.js.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +2 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js +6 -8
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts +2 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.js +2 -5
- package/lib/rules/common/no-schema-type-mismatch.js.map +1 -0
- package/lib/rules/common/operation-2xx-response.d.ts +2 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-2xx-response.js +5 -8
- package/lib/rules/common/operation-2xx-response.js.map +1 -0
- package/lib/rules/common/operation-4xx-response.d.ts +2 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-4xx-response.js +5 -8
- package/lib/rules/common/operation-4xx-response.js.map +1 -0
- package/lib/rules/common/operation-description.d.ts +2 -1
- package/lib/rules/common/operation-description.d.ts.map +1 -0
- package/lib/rules/common/operation-description.js +4 -7
- package/lib/rules/common/operation-description.js.map +1 -0
- package/lib/rules/common/operation-operationId-unique.d.ts +2 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-unique.js +2 -5
- package/lib/rules/common/operation-operationId-unique.js.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.d.ts +2 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.js +2 -5
- package/lib/rules/common/operation-operationId-url-safe.js.map +1 -0
- package/lib/rules/common/operation-operationId.d.ts +2 -1
- package/lib/rules/common/operation-operationId.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId.js +4 -7
- package/lib/rules/common/operation-operationId.js.map +1 -0
- package/lib/rules/common/operation-parameters-unique.d.ts +2 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-parameters-unique.js +2 -5
- package/lib/rules/common/operation-parameters-unique.js.map +1 -0
- package/lib/rules/common/operation-singular-tag.d.ts +2 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +1 -0
- package/lib/rules/common/operation-singular-tag.js +2 -5
- package/lib/rules/common/operation-singular-tag.js.map +1 -0
- package/lib/rules/common/operation-summary.d.ts +2 -1
- package/lib/rules/common/operation-summary.d.ts.map +1 -0
- package/lib/rules/common/operation-summary.js +4 -7
- package/lib/rules/common/operation-summary.js.map +1 -0
- package/lib/rules/common/operation-tag-defined.d.ts +2 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +1 -0
- package/lib/rules/common/operation-tag-defined.js +2 -5
- package/lib/rules/common/operation-tag-defined.js.map +1 -0
- package/lib/rules/common/parameter-description.d.ts +2 -1
- package/lib/rules/common/parameter-description.d.ts.map +1 -0
- package/lib/rules/common/parameter-description.js +2 -5
- package/lib/rules/common/parameter-description.js.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.d.ts +2 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.js +2 -5
- package/lib/rules/common/path-declaration-must-exist.js.map +1 -0
- package/lib/rules/common/path-excludes-patterns.d.ts +2 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +1 -0
- package/lib/rules/common/path-excludes-patterns.js +2 -5
- package/lib/rules/common/path-excludes-patterns.js.map +1 -0
- package/lib/rules/common/path-http-verbs-order.d.ts +2 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +1 -0
- package/lib/rules/common/path-http-verbs-order.js +2 -5
- package/lib/rules/common/path-http-verbs-order.js.map +1 -0
- package/lib/rules/common/path-not-include-query.d.ts +2 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +1 -0
- package/lib/rules/common/path-not-include-query.js +2 -5
- package/lib/rules/common/path-not-include-query.js.map +1 -0
- package/lib/rules/common/path-params-defined.d.ts +2 -1
- package/lib/rules/common/path-params-defined.d.ts.map +1 -0
- package/lib/rules/common/path-params-defined.js +2 -5
- package/lib/rules/common/path-params-defined.js.map +1 -0
- package/lib/rules/common/path-segment-plural.d.ts +2 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +1 -0
- package/lib/rules/common/path-segment-plural.js +6 -9
- package/lib/rules/common/path-segment-plural.js.map +1 -0
- package/lib/rules/common/paths-kebab-case.d.ts +2 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +1 -0
- package/lib/rules/common/paths-kebab-case.js +2 -5
- package/lib/rules/common/paths-kebab-case.js.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +2 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.js +2 -5
- package/lib/rules/common/required-string-property-missing-min-length.js.map +1 -0
- package/lib/rules/common/response-contains-header.d.ts +2 -1
- package/lib/rules/common/response-contains-header.d.ts.map +1 -0
- package/lib/rules/common/response-contains-header.js +5 -8
- package/lib/rules/common/response-contains-header.js.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.d.ts +2 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.js +6 -8
- package/lib/rules/common/scalar-property-missing-example.js.map +1 -0
- package/lib/rules/common/security-defined.d.ts +2 -1
- package/lib/rules/common/security-defined.d.ts.map +1 -0
- package/lib/rules/common/security-defined.js +2 -5
- package/lib/rules/common/security-defined.js.map +1 -0
- package/lib/rules/common/spec-strict-refs.d.ts +2 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +1 -0
- package/lib/rules/common/spec-strict-refs.js +4 -7
- package/lib/rules/common/spec-strict-refs.js.map +1 -0
- package/lib/rules/common/struct.d.ts +2 -1
- package/lib/rules/common/struct.d.ts.map +1 -0
- package/lib/rules/common/struct.js +19 -22
- package/lib/rules/common/struct.js.map +1 -0
- package/lib/rules/common/tag-description.d.ts +2 -1
- package/lib/rules/common/tag-description.d.ts.map +1 -0
- package/lib/rules/common/tag-description.js +4 -7
- package/lib/rules/common/tag-description.js.map +1 -0
- package/lib/rules/common/tags-alphabetical.d.ts +2 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +1 -0
- package/lib/rules/common/tags-alphabetical.js +2 -5
- package/lib/rules/common/tags-alphabetical.js.map +1 -0
- package/lib/rules/no-unresolved-refs.d.ts +4 -3
- package/lib/rules/no-unresolved-refs.d.ts.map +1 -0
- package/lib/rules/no-unresolved-refs.js +5 -9
- package/lib/rules/no-unresolved-refs.js.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +2 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js +2 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas2/index.d.ts +2 -1
- package/lib/rules/oas2/index.d.ts.map +1 -0
- package/lib/rules/oas2/index.js +94 -99
- package/lib/rules/oas2/index.js.map +1 -0
- package/lib/rules/oas2/request-mime-type.d.ts +2 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/request-mime-type.js +5 -8
- package/lib/rules/oas2/request-mime-type.js.map +1 -0
- package/lib/rules/oas2/response-contains-property.d.ts +2 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas2/response-contains-property.js +5 -8
- package/lib/rules/oas2/response-contains-property.js.map +1 -0
- package/lib/rules/oas2/response-mime-type.d.ts +2 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/response-mime-type.js +5 -8
- package/lib/rules/oas2/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.d.ts +2 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.js +4 -7
- package/lib/rules/oas3/array-parameter-serialization.js.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +2 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js +2 -5
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas3/component-name-unique.d.ts +2 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +1 -0
- package/lib/rules/oas3/component-name-unique.js +2 -5
- package/lib/rules/oas3/component-name-unique.js.map +1 -0
- package/lib/rules/oas3/index.d.ts +2 -1
- package/lib/rules/oas3/index.d.ts.map +1 -0
- package/lib/rules/oas3/index.js +118 -123
- package/lib/rules/oas3/index.js.map +1 -0
- package/lib/rules/oas3/no-empty-servers.d.ts +2 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +1 -0
- package/lib/rules/oas3/no-empty-servers.js +2 -5
- package/lib/rules/oas3/no-empty-servers.js.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +2 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js +2 -5
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +2 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js +6 -10
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +1 -0
- package/lib/rules/oas3/no-server-example.com.d.ts +2 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-example.com.js +2 -5
- package/lib/rules/oas3/no-server-example.com.js.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +2 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.js +2 -5
- package/lib/rules/oas3/no-server-trailing-slash.js.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +2 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js +2 -5
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +2 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.js +3 -6
- package/lib/rules/oas3/no-undefined-server-variable.js.map +1 -0
- package/lib/rules/oas3/no-unused-components.d.ts +2 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +1 -0
- package/lib/rules/oas3/no-unused-components.js +2 -5
- package/lib/rules/oas3/no-unused-components.js.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +2 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +6 -9
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +1 -0
- package/lib/rules/oas3/request-mime-type.d.ts +2 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/request-mime-type.js +6 -9
- package/lib/rules/oas3/request-mime-type.js.map +1 -0
- package/lib/rules/oas3/response-contains-property.d.ts +2 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas3/response-contains-property.js +5 -8
- package/lib/rules/oas3/response-contains-property.js.map +1 -0
- package/lib/rules/oas3/response-mime-type.d.ts +2 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/response-mime-type.js +6 -9
- package/lib/rules/oas3/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +2 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.js +2 -5
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +1 -0
- package/lib/rules/other/stats.d.ts +4 -3
- package/lib/rules/other/stats.d.ts.map +1 -0
- package/lib/rules/other/stats.js +2 -5
- package/lib/rules/other/stats.js.map +1 -0
- package/lib/rules/overlay1/index.d.ts +2 -1
- package/lib/rules/overlay1/index.d.ts.map +1 -0
- package/lib/rules/overlay1/index.js +9 -11
- package/lib/rules/overlay1/index.js.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.d.ts +2 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.js +2 -5
- package/lib/rules/respect/no-criteria-xpath.js.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts +3 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.js +21 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.js.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts +3 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js.map +1 -0
- package/lib/rules/respect/respect-supported-versions.d.ts +2 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +1 -0
- package/lib/rules/respect/respect-supported-versions.js +7 -10
- package/lib/rules/respect/respect-supported-versions.js.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts +3 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/lib/rules/respect/x-security-scheme-required-values.js.map +1 -0
- package/lib/rules/utils.d.ts +4 -4
- package/lib/rules/utils.d.ts.map +1 -0
- package/lib/rules/utils.js +20 -43
- package/lib/rules/utils.js.map +1 -0
- package/lib/types/arazzo.d.ts +2 -1
- package/lib/types/arazzo.d.ts.map +1 -0
- package/lib/types/arazzo.js +40 -23
- package/lib/types/arazzo.js.map +1 -0
- package/lib/types/asyncapi2.d.ts +2 -1
- package/lib/types/asyncapi2.d.ts.map +1 -0
- package/lib/types/asyncapi2.js +54 -56
- package/lib/types/asyncapi2.js.map +1 -0
- package/lib/types/asyncapi3.d.ts +2 -1
- package/lib/types/asyncapi3.d.ts.map +1 -0
- package/lib/types/asyncapi3.js +41 -43
- package/lib/types/asyncapi3.js.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +7 -13
- package/lib/types/index.js.map +1 -0
- package/lib/types/json-schema-adapter.d.ts +2 -1
- package/lib/types/json-schema-adapter.d.ts.map +1 -0
- package/lib/types/json-schema-adapter.js +15 -17
- package/lib/types/json-schema-adapter.js.map +1 -0
- package/lib/types/oas2.d.ts +85 -3
- package/lib/types/oas2.d.ts.map +1 -0
- package/lib/types/oas2.js +17 -19
- package/lib/types/oas2.js.map +1 -0
- package/lib/types/oas3.d.ts +159 -3
- package/lib/types/oas3.d.ts.map +1 -0
- package/lib/types/oas3.js +44 -46
- package/lib/types/oas3.js.map +1 -0
- package/lib/types/oas3_1.d.ts +162 -3
- package/lib/types/oas3_1.d.ts.map +1 -0
- package/lib/types/oas3_1.js +19 -21
- package/lib/types/oas3_1.js.map +1 -0
- package/lib/types/overlay.d.ts +2 -1
- package/lib/types/overlay.d.ts.map +1 -0
- package/lib/types/overlay.js +4 -6
- package/lib/types/overlay.js.map +1 -0
- package/lib/types/redocly-yaml.d.ts +6 -10
- package/lib/types/redocly-yaml.d.ts.map +1 -0
- package/lib/types/redocly-yaml.js +74 -813
- package/lib/types/redocly-yaml.js.map +1 -0
- package/lib/typings/arazzo.d.ts +41 -0
- package/lib/typings/arazzo.d.ts.map +1 -0
- package/lib/typings/arazzo.js +3 -5
- package/lib/typings/arazzo.js.map +1 -0
- package/lib/typings/asyncapi.d.ts +1 -0
- package/lib/typings/asyncapi.d.ts.map +1 -0
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi.js.map +1 -0
- package/lib/typings/asyncapi3.d.ts +1 -0
- package/lib/typings/asyncapi3.d.ts.map +1 -0
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/asyncapi3.js.map +1 -0
- package/lib/typings/common.d.ts +1 -0
- package/lib/typings/common.d.ts.map +1 -0
- package/lib/typings/common.js +2 -2
- package/lib/typings/common.js.map +1 -0
- package/lib/typings/openapi.d.ts +45 -15
- package/lib/typings/openapi.d.ts.map +1 -0
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/openapi.js.map +1 -0
- package/lib/typings/overlay.d.ts +1 -0
- package/lib/typings/overlay.d.ts.map +1 -0
- package/lib/typings/overlay.js +2 -4
- package/lib/typings/overlay.js.map +1 -0
- package/lib/typings/swagger.d.ts +2 -1
- package/lib/typings/swagger.d.ts.map +1 -0
- package/lib/typings/swagger.js +2 -2
- package/lib/typings/swagger.js.map +1 -0
- package/lib/utils/error.d.ts +3 -0
- package/lib/utils/error.d.ts.map +1 -0
- package/lib/utils/error.js +3 -0
- package/lib/utils/error.js.map +1 -0
- package/lib/utils.d.ts +6 -11
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +50 -123
- package/lib/utils.js.map +1 -0
- package/lib/visitors.d.ts +16 -15
- package/lib/visitors.d.ts.map +1 -0
- package/lib/visitors.js +4 -6
- package/lib/visitors.js.map +1 -0
- package/lib/walk.d.ts +9 -8
- package/lib/walk.d.ts.map +1 -0
- package/lib/walk.js +31 -28
- package/lib/walk.js.map +1 -0
- package/package.json +31 -10
- package/CHANGELOG.md +0 -561
- package/__tests__/utils.ts +0 -92
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +0 -38
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +0 -44
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +0 -25
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +0 -37
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +0 -36
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +0 -3
- package/lib/benchmark/benches/recommended-oas3.bench.js +0 -21
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +0 -3
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +0 -22
- package/lib/benchmark/utils.d.ts +0 -6
- package/lib/benchmark/utils.js +0 -34
- package/lib/decorators/common/registry-dependencies.d.ts +0 -2
- package/lib/decorators/common/registry-dependencies.js +0 -24
- package/lib/output.d.ts +0 -3
- package/lib/output.js +0 -9
- package/lib/redocly/domains.d.ts +0 -14
- package/lib/redocly/domains.js +0 -41
- package/lib/redocly/index.d.ts +0 -30
- package/lib/redocly/index.js +0 -131
- package/lib/redocly/redocly-client-types.d.ts +0 -8
- package/lib/redocly/redocly-client-types.js +0 -2
- package/lib/redocly/registry-api-types.d.ts +0 -29
- package/lib/redocly/registry-api-types.js +0 -2
- package/lib/redocly/registry-api.d.ts +0 -17
- package/lib/redocly/registry-api.js +0 -100
- package/src/__tests__/__snapshots__/bundle.test.ts.snap +0 -461
- package/src/__tests__/bundle.test.ts +0 -478
- package/src/__tests__/codeframes.test.ts +0 -530
- package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +0 -5
- package/src/__tests__/fixtures/extension.js +0 -24
- package/src/__tests__/fixtures/lint/openapi.yaml +0 -10
- package/src/__tests__/fixtures/redocly.yaml +0 -2
- package/src/__tests__/fixtures/refs/definitions.yaml +0 -3
- package/src/__tests__/fixtures/refs/examples.yaml +0 -8
- package/src/__tests__/fixtures/refs/external-request-body.yaml +0 -13
- package/src/__tests__/fixtures/refs/externalref.yaml +0 -35
- package/src/__tests__/fixtures/refs/hosted.yaml +0 -35
- package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +0 -21
- package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +0 -33
- package/src/__tests__/fixtures/refs/openapi-with-special-names-in-props.yaml +0 -19
- package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +0 -18
- package/src/__tests__/fixtures/refs/param-b.yaml +0 -1
- package/src/__tests__/fixtures/refs/param-c.yaml +0 -1
- package/src/__tests__/fixtures/refs/rename.yaml +0 -1
- package/src/__tests__/fixtures/refs/requestBody.yaml +0 -9
- package/src/__tests__/fixtures/refs/schema-a.yaml +0 -1
- package/src/__tests__/fixtures/refs/simple.yaml +0 -1
- package/src/__tests__/fixtures/refs/vendor.schema.yaml +0 -20
- package/src/__tests__/fixtures/resolve/External.yaml +0 -10
- package/src/__tests__/fixtures/resolve/External2.yaml +0 -4
- package/src/__tests__/fixtures/resolve/description.md +0 -3
- package/src/__tests__/fixtures/resolve/externalInfo.yaml +0 -4
- package/src/__tests__/fixtures/resolve/externalLicense.yaml +0 -1
- package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +0 -13
- package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +0 -5
- package/src/__tests__/fixtures/resolve/openapi.yaml +0 -28
- package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +0 -10
- package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +0 -6
- package/src/__tests__/fixtures/resolve/transitive/a.yaml +0 -1
- package/src/__tests__/fixtures/resolve/transitive/components.yaml +0 -5
- package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +0 -3
- package/src/__tests__/format.test.ts +0 -147
- package/src/__tests__/js-yaml.test.ts +0 -73
- package/src/__tests__/lint.test.ts +0 -1772
- package/src/__tests__/logger-browser.test.ts +0 -53
- package/src/__tests__/logger.test.ts +0 -47
- package/src/__tests__/login.test.ts +0 -17
- package/src/__tests__/normalizeVisitors.test.ts +0 -169
- package/src/__tests__/output-browser.test.ts +0 -18
- package/src/__tests__/output.test.ts +0 -15
- package/src/__tests__/ref-utils.test.ts +0 -142
- package/src/__tests__/resolve-http.test.ts +0 -77
- package/src/__tests__/resolve.test.ts +0 -431
- package/src/__tests__/utils-browser.test.ts +0 -11
- package/src/__tests__/utils.test.ts +0 -144
- package/src/__tests__/walk.test.ts +0 -1596
- package/src/benchmark/benches/lint-with-many-rules.bench.ts +0 -41
- package/src/benchmark/benches/lint-with-nested-rule.bench.ts +0 -45
- package/src/benchmark/benches/lint-with-no-rules.bench.ts +0 -27
- package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +0 -40
- package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +0 -38
- package/src/benchmark/benches/rebilly.yaml +0 -32272
- package/src/benchmark/benches/recommended-oas3.bench.ts +0 -22
- package/src/benchmark/benches/resolve-with-no-external.bench.ts +0 -23
- package/src/benchmark/benchmark.js +0 -311
- package/src/benchmark/colors.js +0 -29
- package/src/benchmark/fork.js +0 -87
- package/src/benchmark/utils.ts +0 -37
- package/src/bundle.ts +0 -531
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +0 -485
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +0 -232
- package/src/config/__tests__/config-resolvers.test.ts +0 -668
- package/src/config/__tests__/config.test.ts +0 -356
- package/src/config/__tests__/fixtures/ingore-file.ts +0 -8
- package/src/config/__tests__/fixtures/load-external.yaml +0 -2
- package/src/config/__tests__/fixtures/load-redocly.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin-config.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin.js +0 -56
- package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +0 -11
- package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +0 -69
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +0 -7
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-commonjs-export-function.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +0 -17
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-esm.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +0 -18
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-plugin-init.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-realm-plugin.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +0 -15
- package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin-esm.mjs +0 -10
- package/src/config/__tests__/fixtures/resolve-config/plugin-with-export-function.cjs +0 -10
- package/src/config/__tests__/fixtures/resolve-config/plugin-with-init-logic.js +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin.js +0 -80
- package/src/config/__tests__/fixtures/resolve-config/realm-plugin.js +0 -12
- package/src/config/__tests__/fixtures/resolve-refs-in-config/config-with-refs.yaml +0 -8
- package/src/config/__tests__/fixtures/resolve-refs-in-config/rules.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-refs-in-config/seo.yaml +0 -1
- package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +0 -3
- package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +0 -4
- package/src/config/__tests__/load.test.ts +0 -320
- package/src/config/__tests__/resolve-plugins.test.ts +0 -30
- package/src/config/__tests__/utils.test.ts +0 -225
- package/src/config/all.ts +0 -234
- package/src/config/builtIn.ts +0 -59
- package/src/config/config-resolvers.ts +0 -657
- package/src/config/config.ts +0 -423
- package/src/config/index.ts +0 -7
- package/src/config/load.ts +0 -213
- package/src/config/minimal.ts +0 -210
- package/src/config/recommended-strict.ts +0 -210
- package/src/config/recommended.ts +0 -210
- package/src/config/rules.ts +0 -72
- package/src/config/spec.ts +0 -33
- package/src/config/types.ts +0 -306
- package/src/config/utils.ts +0 -439
- package/src/decorators/__tests__/filter-in.test.ts +0 -313
- package/src/decorators/__tests__/filter-out.test.ts +0 -344
- package/src/decorators/__tests__/media-type-examples-override.test.ts +0 -665
- package/src/decorators/__tests__/remove-x-internal.test.ts +0 -416
- package/src/decorators/__tests__/resources/request.yaml +0 -3
- package/src/decorators/__tests__/resources/response.yaml +0 -3
- package/src/decorators/arazzo/index.ts +0 -1
- package/src/decorators/async2/index.ts +0 -1
- package/src/decorators/async3/index.ts +0 -1
- package/src/decorators/common/filters/filter-helper.ts +0 -73
- package/src/decorators/common/filters/filter-in.ts +0 -19
- package/src/decorators/common/filters/filter-out.ts +0 -19
- package/src/decorators/common/info-description-override.ts +0 -25
- package/src/decorators/common/info-override.ts +0 -15
- package/src/decorators/common/media-type-examples-override.ts +0 -80
- package/src/decorators/common/operation-description-override.ts +0 -31
- package/src/decorators/common/registry-dependencies.ts +0 -25
- package/src/decorators/common/remove-x-internal.ts +0 -77
- package/src/decorators/common/tag-description-override.ts +0 -26
- package/src/decorators/oas2/__tests__/remove-unused-components.test.ts +0 -228
- package/src/decorators/oas2/index.ts +0 -21
- package/src/decorators/oas2/remove-unused-components.ts +0 -109
- package/src/decorators/oas3/__tests__/remove-unused-components.test.ts +0 -313
- package/src/decorators/oas3/index.ts +0 -23
- package/src/decorators/oas3/remove-unused-components.ts +0 -138
- package/src/decorators/overlay1/index.ts +0 -1
- package/src/env.ts +0 -5
- package/src/format/codeframes.ts +0 -217
- package/src/format/format.ts +0 -479
- package/src/index.ts +0 -91
- package/src/js-yaml/index.ts +0 -16
- package/src/lint.ts +0 -190
- package/src/logger.ts +0 -36
- package/src/oas-types.ts +0 -178
- package/src/output.ts +0 -7
- package/src/redocly/__tests__/domains.test.ts +0 -52
- package/src/redocly/__tests__/redocly-client.test.ts +0 -156
- package/src/redocly/domains.ts +0 -48
- package/src/redocly/index.ts +0 -177
- package/src/redocly/redocly-client-types.ts +0 -10
- package/src/redocly/registry-api-types.ts +0 -32
- package/src/redocly/registry-api.ts +0 -147
- package/src/ref-utils.ts +0 -91
- package/src/resolve.ts +0 -461
- package/src/rules/__tests__/fixtures/code-sample.php +0 -9
- package/src/rules/__tests__/fixtures/invalid-yaml.yaml +0 -1
- package/src/rules/__tests__/fixtures/ref.yaml +0 -1
- package/src/rules/__tests__/no-unresolved-refs.test.ts +0 -271
- package/src/rules/__tests__/utils.test.ts +0 -160
- package/src/rules/ajv.ts +0 -105
- package/src/rules/arazzo/__tests__/criteria-unique.test.ts +0 -160
- package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +0 -126
- package/src/rules/arazzo/__tests__/parameters-unique.test.ts +0 -113
- package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +0 -108
- package/src/rules/arazzo/__tests__/respect-supported-versions.test.ts +0 -116
- package/src/rules/arazzo/__tests__/source-description-type.test.ts +0 -78
- package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +0 -78
- package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +0 -104
- package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +0 -110
- package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +0 -110
- package/src/rules/arazzo/__tests__/stepId-unique.test.ts +0 -94
- package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +0 -209
- package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +0 -88
- package/src/rules/arazzo/criteria-unique.ts +0 -70
- package/src/rules/arazzo/index.ts +0 -38
- package/src/rules/arazzo/parameters-unique.ts +0 -33
- package/src/rules/arazzo/requestBody-replacements-unique.ts +0 -33
- package/src/rules/arazzo/sourceDescription-type.ts +0 -21
- package/src/rules/arazzo/sourceDescriptions-name-unique.ts +0 -23
- package/src/rules/arazzo/sourceDescriptions-not-empty.ts +0 -17
- package/src/rules/arazzo/step-onFailure-unique.ts +0 -33
- package/src/rules/arazzo/step-onSuccess-unique.ts +0 -33
- package/src/rules/arazzo/stepId-unique.ts +0 -24
- package/src/rules/arazzo/workflow-dependsOn.ts +0 -56
- package/src/rules/arazzo/workflowId-unique.ts +0 -21
- package/src/rules/async2/__tests__/channels-kebab-case.test.ts +0 -145
- package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +0 -97
- package/src/rules/async2/channels-kebab-case.ts +0 -18
- package/src/rules/async2/index.ts +0 -29
- package/src/rules/async2/no-channel-trailing-slash.ts +0 -15
- package/src/rules/async3/__tests__/channels-kebab-case.test.ts +0 -145
- package/src/rules/async3/__tests__/no-channel-trailing-slash.test.ts +0 -96
- package/src/rules/async3/channels-kebab-case.ts +0 -19
- package/src/rules/async3/index.ts +0 -29
- package/src/rules/async3/no-channel-trailing-slash.ts +0 -16
- package/src/rules/common/__tests__/info-license-strict.test.ts +0 -141
- package/src/rules/common/__tests__/info-license.test.ts +0 -62
- package/src/rules/common/__tests__/license-url.test.ts +0 -63
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +0 -96
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +0 -210
- package/src/rules/common/__tests__/no-identical-paths.test.ts +0 -58
- package/src/rules/common/__tests__/no-invalid-parameter-examples.test.ts +0 -53
- package/src/rules/common/__tests__/no-invalid-schema-examples.test.ts +0 -86
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +0 -126
- package/src/rules/common/__tests__/no-required-schema-properties-undefined.test.ts +0 -550
- package/src/rules/common/__tests__/no-schema-type-mismatch.test.ts +0 -126
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +0 -194
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +0 -233
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +0 -76
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +0 -45
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +0 -167
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +0 -72
- package/src/rules/common/__tests__/operation-tag-defined.test.ts +0 -68
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +0 -95
- package/src/rules/common/__tests__/path-not-include-query.test.ts +0 -64
- package/src/rules/common/__tests__/path-params-defined.test.ts +0 -202
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +0 -110
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +0 -264
- package/src/rules/common/__tests__/security-defined.test.ts +0 -284
- package/src/rules/common/__tests__/spec-strict-refs.test.ts +0 -69
- package/src/rules/common/__tests__/struct.test.ts +0 -657
- package/src/rules/common/__tests__/tag-description.test.ts +0 -65
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +0 -124
- package/src/rules/common/assertions/__tests__/asserts.test.ts +0 -877
- package/src/rules/common/assertions/__tests__/index.test.ts +0 -100
- package/src/rules/common/assertions/__tests__/utils.test.ts +0 -236
- package/src/rules/common/assertions/asserts.ts +0 -365
- package/src/rules/common/assertions/index.ts +0 -68
- package/src/rules/common/assertions/utils.ts +0 -333
- package/src/rules/common/info-contact.ts +0 -16
- package/src/rules/common/info-license-strict.ts +0 -24
- package/src/rules/common/info-license-url.ts +0 -11
- package/src/rules/common/info-license.ts +0 -16
- package/src/rules/common/no-ambiguous-paths.ts +0 -50
- package/src/rules/common/no-enum-type-mismatch.ts +0 -53
- package/src/rules/common/no-http-verbs-in-paths.ts +0 -37
- package/src/rules/common/no-identical-paths.ts +0 -24
- package/src/rules/common/no-invalid-parameter-examples.ts +0 -37
- package/src/rules/common/no-invalid-schema-examples.ts +0 -40
- package/src/rules/common/no-path-trailing-slash.ts +0 -15
- package/src/rules/common/no-required-schema-properties-undefined.ts +0 -54
- package/src/rules/common/no-schema-type-mismatch.ts +0 -24
- package/src/rules/common/operation-2xx-response.ts +0 -25
- package/src/rules/common/operation-4xx-response.ts +0 -25
- package/src/rules/common/operation-description.ts +0 -14
- package/src/rules/common/operation-operationId-unique.ts +0 -21
- package/src/rules/common/operation-operationId-url-safe.ts +0 -20
- package/src/rules/common/operation-operationId.ts +0 -18
- package/src/rules/common/operation-parameters-unique.ts +0 -48
- package/src/rules/common/operation-singular-tag.ts +0 -17
- package/src/rules/common/operation-summary.ts +0 -14
- package/src/rules/common/operation-tag-defined.ts +0 -31
- package/src/rules/common/parameter-description.ts +0 -22
- package/src/rules/common/path-declaration-must-exist.ts +0 -15
- package/src/rules/common/path-excludes-patterns.ts +0 -23
- package/src/rules/common/path-http-verbs-order.ts +0 -30
- package/src/rules/common/path-not-include-query.ts +0 -17
- package/src/rules/common/path-params-defined.ts +0 -65
- package/src/rules/common/path-segment-plural.ts +0 -33
- package/src/rules/common/paths-kebab-case.ts +0 -19
- package/src/rules/common/required-string-property-missing-min-length.ts +0 -44
- package/src/rules/common/response-contains-header.ts +0 -36
- package/src/rules/common/scalar-property-missing-example.ts +0 -59
- package/src/rules/common/security-defined.ts +0 -89
- package/src/rules/common/spec-strict-refs.ts +0 -31
- package/src/rules/common/struct.ts +0 -189
- package/src/rules/common/tag-description.ts +0 -11
- package/src/rules/common/tags-alphabetical.ts +0 -27
- package/src/rules/no-unresolved-refs.ts +0 -52
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +0 -112
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +0 -180
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +0 -161
- package/src/rules/oas2/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas2/__tests__/spec/info.test.ts +0 -355
- package/src/rules/oas2/__tests__/spec/operation.test.ts +0 -123
- package/src/rules/oas2/__tests__/spec/paths.test.ts +0 -245
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +0 -37
- package/src/rules/oas2/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas2/boolean-parameter-prefixes.ts +0 -26
- package/src/rules/oas2/index.ts +0 -102
- package/src/rules/oas2/request-mime-type.ts +0 -17
- package/src/rules/oas2/response-contains-property.ts +0 -37
- package/src/rules/oas2/response-mime-type.ts +0 -17
- package/src/rules/oas3/__tests__/array-parameter-serialization.test.ts +0 -275
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +0 -113
- package/src/rules/oas3/__tests__/component-name-unique.test.ts +0 -966
- package/src/rules/oas3/__tests__/fixtures/common.yaml +0 -11
- package/src/rules/oas3/__tests__/fixtures/external-value.yaml +0 -2
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +0 -205
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +0 -65
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +0 -732
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +0 -95
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +0 -79
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +0 -131
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +0 -145
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +0 -401
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +0 -417
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +0 -41
- package/src/rules/oas3/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +0 -391
- package/src/rules/oas3/__tests__/spec/operation.test.ts +0 -253
- package/src/rules/oas3/__tests__/spec/paths.test.ts +0 -284
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +0 -77
- package/src/rules/oas3/__tests__/spec/servers.test.ts +0 -505
- package/src/rules/oas3/__tests__/spec/spec.test.ts +0 -307
- package/src/rules/oas3/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +0 -282
- package/src/rules/oas3/__tests__/utils/lint-document-for-test.ts +0 -23
- package/src/rules/oas3/array-parameter-serialization.ts +0 -47
- package/src/rules/oas3/boolean-parameter-prefixes.ts +0 -28
- package/src/rules/oas3/component-name-unique.ts +0 -162
- package/src/rules/oas3/index.ts +0 -126
- package/src/rules/oas3/no-empty-servers.ts +0 -22
- package/src/rules/oas3/no-example-value-and-externalValue.ts +0 -14
- package/src/rules/oas3/no-invalid-media-type-examples.ts +0 -54
- package/src/rules/oas3/no-server-example.com.ts +0 -16
- package/src/rules/oas3/no-server-trailing-slash.ts +0 -15
- package/src/rules/oas3/no-server-variables-empty-enum.ts +0 -66
- package/src/rules/oas3/no-undefined-server-variable.ts +0 -30
- package/src/rules/oas3/no-unused-components.ts +0 -75
- package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +0 -36
- package/src/rules/oas3/request-mime-type.ts +0 -31
- package/src/rules/oas3/response-contains-property.ts +0 -39
- package/src/rules/oas3/response-mime-type.ts +0 -31
- package/src/rules/oas3/spec-components-invalid-map-name.ts +0 -69
- package/src/rules/other/stats.ts +0 -75
- package/src/rules/overlay1/__tests__/info-contact.test.ts +0 -112
- package/src/rules/overlay1/index.ts +0 -14
- package/src/rules/respect/no-criteria-xpath.ts +0 -20
- package/src/rules/respect/respect-supported-versions.ts +0 -24
- package/src/rules/utils.ts +0 -230
- package/src/types/arazzo.ts +0 -305
- package/src/types/asyncapi2.ts +0 -1121
- package/src/types/asyncapi3.ts +0 -383
- package/src/types/index.ts +0 -144
- package/src/types/json-schema-adapter.ts +0 -217
- package/src/types/oas2.ts +0 -481
- package/src/types/oas3.ts +0 -594
- package/src/types/oas3_1.ts +0 -290
- package/src/types/overlay.ts +0 -40
- package/src/types/redocly-yaml.ts +0 -1226
- package/src/typings/arazzo.ts +0 -172
- package/src/typings/asyncapi.ts +0 -26
- package/src/typings/asyncapi3.ts +0 -61
- package/src/typings/common.ts +0 -18
- package/src/typings/openapi.ts +0 -347
- package/src/typings/overlay.ts +0 -19
- package/src/typings/swagger.ts +0 -236
- package/src/utils.ts +0 -357
- package/src/visitors.ts +0 -598
- package/src/walk.ts +0 -467
- package/tsconfig.json +0 -8
- package/tsconfig.tsbuildinfo +0 -1
package/src/format/format.ts
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import { colorOptions, colorize, logger } from '../logger';
|
|
3
|
-
import { output } from '../output';
|
|
4
|
-
import { getCodeframe, getLineColLocation } from './codeframes';
|
|
5
|
-
import { env, isBrowser } from '../env';
|
|
6
|
-
import { isAbsoluteUrl } from '../ref-utils';
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
NormalizedProblem,
|
|
10
|
-
ProblemSeverity,
|
|
11
|
-
LineColLocationObject,
|
|
12
|
-
LocationObject,
|
|
13
|
-
} from '../walk';
|
|
14
|
-
|
|
15
|
-
const coreVersion = require('../../package.json').version;
|
|
16
|
-
|
|
17
|
-
export type Totals = {
|
|
18
|
-
errors: number;
|
|
19
|
-
warnings: number;
|
|
20
|
-
ignored: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const ERROR_MESSAGE = {
|
|
24
|
-
INVALID_SEVERITY_LEVEL: 'Invalid severity level; accepted values: error or warn',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const BG_COLORS = {
|
|
28
|
-
warn: (str: string) => colorize.bgYellow(colorize.black(str)),
|
|
29
|
-
error: colorize.bgRed,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const COLORS = {
|
|
33
|
-
warn: colorize.yellow,
|
|
34
|
-
error: colorize.red,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const SEVERITY_NAMES = {
|
|
38
|
-
warn: 'Warning',
|
|
39
|
-
error: 'Error',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const CODECLIMATE_SEVERITY_MAPPING = {
|
|
43
|
-
error: 'critical',
|
|
44
|
-
warn: 'minor',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const MAX_SUGGEST = 5;
|
|
48
|
-
|
|
49
|
-
function severityToNumber(severity: ProblemSeverity) {
|
|
50
|
-
return severity === 'error' ? 1 : 2;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type OutputFormat =
|
|
54
|
-
| 'codeframe'
|
|
55
|
-
| 'stylish'
|
|
56
|
-
| 'json'
|
|
57
|
-
| 'checkstyle'
|
|
58
|
-
| 'codeclimate'
|
|
59
|
-
| 'summary'
|
|
60
|
-
| 'github-actions'
|
|
61
|
-
| 'markdown';
|
|
62
|
-
|
|
63
|
-
export function getTotals(problems: (NormalizedProblem & { ignored?: boolean })[]): Totals {
|
|
64
|
-
let errors = 0;
|
|
65
|
-
let warnings = 0;
|
|
66
|
-
let ignored = 0;
|
|
67
|
-
|
|
68
|
-
for (const m of problems) {
|
|
69
|
-
if (m.ignored) {
|
|
70
|
-
ignored++;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (m.severity === 'error') errors++;
|
|
74
|
-
if (m.severity === 'warn') warnings++;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
errors,
|
|
79
|
-
warnings,
|
|
80
|
-
ignored,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function formatProblems(
|
|
85
|
-
problems: (NormalizedProblem & { ignored?: boolean })[],
|
|
86
|
-
opts: {
|
|
87
|
-
maxProblems?: number;
|
|
88
|
-
cwd?: string;
|
|
89
|
-
format?: OutputFormat;
|
|
90
|
-
color?: boolean;
|
|
91
|
-
totals: Totals;
|
|
92
|
-
version: string;
|
|
93
|
-
}
|
|
94
|
-
) {
|
|
95
|
-
const {
|
|
96
|
-
maxProblems = 100,
|
|
97
|
-
cwd = isBrowser ? '' : process.cwd(),
|
|
98
|
-
format = 'codeframe',
|
|
99
|
-
color = colorOptions.enabled,
|
|
100
|
-
totals = getTotals(problems),
|
|
101
|
-
version = coreVersion,
|
|
102
|
-
} = opts;
|
|
103
|
-
|
|
104
|
-
colorOptions.enabled = color; // force colors if specified
|
|
105
|
-
|
|
106
|
-
const totalProblems = problems.length;
|
|
107
|
-
problems = problems.filter((m) => !m.ignored);
|
|
108
|
-
const ignoredProblems = totalProblems - problems.length;
|
|
109
|
-
|
|
110
|
-
problems = problems
|
|
111
|
-
.sort((a, b) => severityToNumber(a.severity) - severityToNumber(b.severity))
|
|
112
|
-
.slice(0, maxProblems);
|
|
113
|
-
|
|
114
|
-
if (!totalProblems && format !== 'json') return;
|
|
115
|
-
|
|
116
|
-
switch (format) {
|
|
117
|
-
case 'json':
|
|
118
|
-
outputJSON();
|
|
119
|
-
break;
|
|
120
|
-
case 'codeframe':
|
|
121
|
-
for (let i = 0; i < problems.length; i++) {
|
|
122
|
-
const problem = problems[i];
|
|
123
|
-
logger.info(`${formatCodeframe(problem, i)}\n`);
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
case 'stylish': {
|
|
127
|
-
const groupedByFile = groupByFiles(problems);
|
|
128
|
-
for (const [file, { ruleIdPad, locationPad: positionPad, fileProblems }] of Object.entries(
|
|
129
|
-
groupedByFile
|
|
130
|
-
)) {
|
|
131
|
-
logger.info(`${colorize.blue(isAbsoluteUrl(file) ? file : path.relative(cwd, file))}:\n`);
|
|
132
|
-
|
|
133
|
-
for (let i = 0; i < fileProblems.length; i++) {
|
|
134
|
-
const problem = fileProblems[i];
|
|
135
|
-
logger.info(`${formatStylish(problem, positionPad, ruleIdPad)}\n`);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
logger.info('\n');
|
|
139
|
-
}
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case 'markdown': {
|
|
143
|
-
const groupedByFile = groupByFiles(problems);
|
|
144
|
-
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
145
|
-
output.write(`## Lint: ${isAbsoluteUrl(file) ? file : path.relative(cwd, file)}\n\n`);
|
|
146
|
-
|
|
147
|
-
output.write(`| Severity | Location | Problem | Message |\n`);
|
|
148
|
-
output.write(`|---|---|---|---|\n`);
|
|
149
|
-
for (let i = 0; i < fileProblems.length; i++) {
|
|
150
|
-
const problem = fileProblems[i];
|
|
151
|
-
output.write(`${formatMarkdown(problem)}\n`);
|
|
152
|
-
}
|
|
153
|
-
output.write('\n');
|
|
154
|
-
|
|
155
|
-
if (totals.errors > 0) {
|
|
156
|
-
output.write(`Validation failed\nErrors: ${totals.errors}\n`);
|
|
157
|
-
} else {
|
|
158
|
-
output.write('Validation successful\n');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (totals.warnings > 0) {
|
|
162
|
-
output.write(`Warnings: ${totals.warnings}\n`);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
output.write('\n');
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case 'checkstyle': {
|
|
170
|
-
const groupedByFile = groupByFiles(problems);
|
|
171
|
-
|
|
172
|
-
output.write('<?xml version="1.0" encoding="UTF-8"?>\n');
|
|
173
|
-
output.write('<checkstyle version="4.3">\n');
|
|
174
|
-
|
|
175
|
-
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
176
|
-
output.write(
|
|
177
|
-
`<file name="${xmlEscape(isAbsoluteUrl(file) ? file : path.relative(cwd, file))}">\n`
|
|
178
|
-
);
|
|
179
|
-
fileProblems.forEach(formatCheckstyle);
|
|
180
|
-
output.write(`</file>\n`);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
output.write(`</checkstyle>\n`);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
case 'codeclimate':
|
|
187
|
-
outputForCodeClimate();
|
|
188
|
-
break;
|
|
189
|
-
case 'summary':
|
|
190
|
-
formatSummary(problems);
|
|
191
|
-
break;
|
|
192
|
-
case 'github-actions':
|
|
193
|
-
outputForGithubActions(problems, cwd);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (totalProblems - ignoredProblems > maxProblems) {
|
|
197
|
-
logger.info(
|
|
198
|
-
`< ... ${totalProblems - maxProblems} more problems hidden > ${colorize.gray(
|
|
199
|
-
'increase with `--max-problems N`'
|
|
200
|
-
)}\n`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function outputForCodeClimate() {
|
|
205
|
-
const issues = problems.map((p) => {
|
|
206
|
-
const location = p.location[0]; // TODO: support multiple location
|
|
207
|
-
const lineCol = getLineColLocation(location);
|
|
208
|
-
return {
|
|
209
|
-
description: p.message,
|
|
210
|
-
location: {
|
|
211
|
-
path: isAbsoluteUrl(location.source.absoluteRef)
|
|
212
|
-
? location.source.absoluteRef
|
|
213
|
-
: path.relative(cwd, location.source.absoluteRef),
|
|
214
|
-
lines: {
|
|
215
|
-
begin: lineCol.start.line,
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
severity: CODECLIMATE_SEVERITY_MAPPING[p.severity],
|
|
219
|
-
fingerprint: `${p.ruleId}${p.location.length > 0 ? '-' + p.location[0].pointer : ''}`,
|
|
220
|
-
};
|
|
221
|
-
});
|
|
222
|
-
output.write(JSON.stringify(issues, null, 2));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function outputJSON() {
|
|
226
|
-
const resultObject = {
|
|
227
|
-
totals,
|
|
228
|
-
version,
|
|
229
|
-
problems: problems.map((p) => {
|
|
230
|
-
const problem = {
|
|
231
|
-
...p,
|
|
232
|
-
location: p.location.map((location: any) => ({
|
|
233
|
-
...location,
|
|
234
|
-
source: {
|
|
235
|
-
ref: isAbsoluteUrl(location.source.absoluteRef)
|
|
236
|
-
? location.source.absoluteRef
|
|
237
|
-
: path.relative(cwd, location.source.absoluteRef),
|
|
238
|
-
},
|
|
239
|
-
})),
|
|
240
|
-
from: p.from
|
|
241
|
-
? {
|
|
242
|
-
...p.from,
|
|
243
|
-
source: {
|
|
244
|
-
ref: isAbsoluteUrl(p.from?.source.absoluteRef)
|
|
245
|
-
? p.from?.source.absoluteRef
|
|
246
|
-
: path.relative(cwd, p.from?.source.absoluteRef || cwd),
|
|
247
|
-
},
|
|
248
|
-
}
|
|
249
|
-
: undefined,
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
if (env.FORMAT_JSON_WITH_CODEFRAMES) {
|
|
253
|
-
const location = p.location[0]; // TODO: support multiple locations
|
|
254
|
-
const loc = getLineColLocation(location);
|
|
255
|
-
(problem as any).codeframe = getCodeframe(loc, color);
|
|
256
|
-
}
|
|
257
|
-
return problem;
|
|
258
|
-
}),
|
|
259
|
-
};
|
|
260
|
-
output.write(JSON.stringify(resultObject, null, 2));
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function getBgColor(problem: NormalizedProblem) {
|
|
264
|
-
const { severity } = problem;
|
|
265
|
-
if (!BG_COLORS[severity]) {
|
|
266
|
-
throw new Error(ERROR_MESSAGE.INVALID_SEVERITY_LEVEL);
|
|
267
|
-
}
|
|
268
|
-
return BG_COLORS[severity];
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
function formatCodeframe(problem: NormalizedProblem, idx: number) {
|
|
272
|
-
const bgColor = getBgColor(problem);
|
|
273
|
-
const location = problem.location[0]; // TODO: support multiple locations
|
|
274
|
-
const relativePath = isAbsoluteUrl(location.source.absoluteRef)
|
|
275
|
-
? location.source.absoluteRef
|
|
276
|
-
: path.relative(cwd, location.source.absoluteRef);
|
|
277
|
-
const loc = getLineColLocation(location);
|
|
278
|
-
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
279
|
-
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
280
|
-
return (
|
|
281
|
-
`[${idx + 1}] ${bgColor(fileWithLoc)} ${atPointer}\n\n` +
|
|
282
|
-
`${problem.message}\n\n` +
|
|
283
|
-
formatDidYouMean(problem) +
|
|
284
|
-
getCodeframe(loc, color) +
|
|
285
|
-
'\n\n' +
|
|
286
|
-
formatFrom(cwd, problem.from) +
|
|
287
|
-
`${SEVERITY_NAMES[problem.severity]} was generated by the ${colorize.blue(
|
|
288
|
-
problem.ruleId
|
|
289
|
-
)} rule.\n\n`
|
|
290
|
-
);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function formatStylish(problem: OnlyLineColProblem, locationPad: number, ruleIdPad: number) {
|
|
294
|
-
const color = COLORS[problem.severity];
|
|
295
|
-
if (!SEVERITY_NAMES[problem.severity]) {
|
|
296
|
-
return 'Error not found severity. Please check your config file. Allowed values: `warn,error,off`';
|
|
297
|
-
}
|
|
298
|
-
const severityName = color(SEVERITY_NAMES[problem.severity].toLowerCase().padEnd(7));
|
|
299
|
-
const { start } = problem.location[0];
|
|
300
|
-
return ` ${`${start.line}:${start.col}`.padEnd(
|
|
301
|
-
locationPad
|
|
302
|
-
)} ${severityName} ${problem.ruleId.padEnd(ruleIdPad)} ${problem.message}`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function formatMarkdown(problem: OnlyLineColProblem) {
|
|
306
|
-
if (!SEVERITY_NAMES[problem.severity]) {
|
|
307
|
-
return 'Error not found severity. Please check your config file. Allowed values: `warn,error,off`';
|
|
308
|
-
}
|
|
309
|
-
const severityName = SEVERITY_NAMES[problem.severity].toLowerCase();
|
|
310
|
-
const { start } = problem.location[0];
|
|
311
|
-
return `| ${severityName} | line ${`${start.line}:${start.col}`} | [${
|
|
312
|
-
problem.ruleId
|
|
313
|
-
}](https://redocly.com/docs/cli/rules/${problem.ruleId}/) | ${problem.message} |`;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function formatCheckstyle(problem: OnlyLineColProblem) {
|
|
317
|
-
const { line, col } = problem.location[0].start;
|
|
318
|
-
const severity = problem.severity == 'warn' ? 'warning' : 'error';
|
|
319
|
-
const message = xmlEscape(problem.message);
|
|
320
|
-
const source = xmlEscape(problem.ruleId);
|
|
321
|
-
output.write(
|
|
322
|
-
`<error line="${line}" column="${col}" severity="${severity}" message="${message}" source="${source}" />\n`
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
function formatSummary(problems: NormalizedProblem[]): void {
|
|
328
|
-
const counts: Record<string, { count: number; severity: ProblemSeverity }> = {};
|
|
329
|
-
for (const problem of problems) {
|
|
330
|
-
counts[problem.ruleId] = counts[problem.ruleId] || { count: 0, severity: problem.severity };
|
|
331
|
-
counts[problem.ruleId].count++;
|
|
332
|
-
}
|
|
333
|
-
const sorted = Object.entries(counts).sort(([, a], [, b]) => {
|
|
334
|
-
const severityDiff = severityToNumber(a.severity) - severityToNumber(b.severity);
|
|
335
|
-
return severityDiff || b.count - a.count;
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
for (const [ruleId, info] of sorted) {
|
|
339
|
-
const color = COLORS[info.severity];
|
|
340
|
-
const severityName = color(SEVERITY_NAMES[info.severity].toLowerCase().padEnd(7));
|
|
341
|
-
logger.info(`${severityName} ${ruleId}: ${info.count}\n`);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
logger.info('\n');
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function formatFrom(cwd: string, location?: LocationObject) {
|
|
348
|
-
if (!location) return '';
|
|
349
|
-
const relativePath = path.relative(cwd, location.source.absoluteRef);
|
|
350
|
-
const loc = getLineColLocation(location);
|
|
351
|
-
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
352
|
-
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
353
|
-
|
|
354
|
-
return `referenced from ${colorize.blue(fileWithLoc)} ${atPointer} \n\n`;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
function formatDidYouMean(problem: NormalizedProblem) {
|
|
358
|
-
if (problem.suggest.length === 0) return '';
|
|
359
|
-
|
|
360
|
-
if (problem.suggest.length === 1) {
|
|
361
|
-
return `Did you mean: ${problem.suggest[0]} ?\n\n`;
|
|
362
|
-
} else {
|
|
363
|
-
return `Did you mean:\n - ${problem.suggest.slice(0, MAX_SUGGEST).join('\n - ')}\n\n`;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
type OnlyLineColProblem = Omit<NormalizedProblem, 'location'> & {
|
|
368
|
-
location: LineColLocationObject[];
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
const groupByFiles = (problems: NormalizedProblem[]) => {
|
|
372
|
-
const fileGroups: Record<
|
|
373
|
-
string,
|
|
374
|
-
{
|
|
375
|
-
locationPad: number;
|
|
376
|
-
ruleIdPad: number;
|
|
377
|
-
fileProblems: OnlyLineColProblem[];
|
|
378
|
-
}
|
|
379
|
-
> = {};
|
|
380
|
-
for (const problem of problems) {
|
|
381
|
-
const absoluteRef = problem.location[0].source.absoluteRef; // TODO: multiple errors
|
|
382
|
-
fileGroups[absoluteRef] = fileGroups[absoluteRef] || {
|
|
383
|
-
fileProblems: [],
|
|
384
|
-
ruleIdPad: 0,
|
|
385
|
-
locationPad: 0,
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
const mappedProblem = { ...problem, location: problem.location.map(getLineColLocation) };
|
|
389
|
-
fileGroups[absoluteRef].fileProblems.push(mappedProblem);
|
|
390
|
-
fileGroups[absoluteRef].ruleIdPad = Math.max(
|
|
391
|
-
problem.ruleId.length,
|
|
392
|
-
fileGroups[absoluteRef].ruleIdPad
|
|
393
|
-
);
|
|
394
|
-
|
|
395
|
-
fileGroups[absoluteRef].locationPad = Math.max(
|
|
396
|
-
Math.max(...mappedProblem.location.map((loc) => `${loc.start.line}:${loc.start.col}`.length)),
|
|
397
|
-
fileGroups[absoluteRef].locationPad
|
|
398
|
-
);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
return fileGroups;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
function xmlEscape(s: string): string {
|
|
405
|
-
// eslint-disable-next-line no-control-regex
|
|
406
|
-
return s.replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, (char) => {
|
|
407
|
-
switch (char) {
|
|
408
|
-
case '<':
|
|
409
|
-
return '<';
|
|
410
|
-
case '>':
|
|
411
|
-
return '>';
|
|
412
|
-
case '&':
|
|
413
|
-
return '&';
|
|
414
|
-
case '"':
|
|
415
|
-
return '"';
|
|
416
|
-
case "'":
|
|
417
|
-
return ''';
|
|
418
|
-
default:
|
|
419
|
-
return `&#${char.charCodeAt(0)};`;
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
function outputForGithubActions(problems: NormalizedProblem[], cwd: string): void {
|
|
425
|
-
for (const problem of problems) {
|
|
426
|
-
for (const location of problem.location.map(getLineColLocation)) {
|
|
427
|
-
let command;
|
|
428
|
-
switch (problem.severity) {
|
|
429
|
-
case 'error':
|
|
430
|
-
command = 'error';
|
|
431
|
-
break;
|
|
432
|
-
case 'warn':
|
|
433
|
-
command = 'warning';
|
|
434
|
-
break;
|
|
435
|
-
}
|
|
436
|
-
const suggest = formatDidYouMean(problem);
|
|
437
|
-
const message = suggest !== '' ? problem.message + '\n\n' + suggest : problem.message;
|
|
438
|
-
const properties = {
|
|
439
|
-
title: problem.ruleId,
|
|
440
|
-
file: isAbsoluteUrl(location.source.absoluteRef)
|
|
441
|
-
? location.source.absoluteRef
|
|
442
|
-
: path.relative(cwd, location.source.absoluteRef),
|
|
443
|
-
line: location.start.line,
|
|
444
|
-
col: location.start.col,
|
|
445
|
-
endLine: location.end?.line,
|
|
446
|
-
endColumn: location.end?.col,
|
|
447
|
-
};
|
|
448
|
-
output.write(`::${command} ${formatProperties(properties)}::${escapeMessage(message)}\n`);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
function formatProperties(props: Record<string, any>): string {
|
|
453
|
-
return Object.entries(props)
|
|
454
|
-
.filter(([, v]) => v !== null && v !== undefined)
|
|
455
|
-
.map(([k, v]) => `${k}=${escapeProperty(v)}`)
|
|
456
|
-
.join(',');
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
function toString(v: any): string {
|
|
460
|
-
if (v === null || v === undefined) {
|
|
461
|
-
return '';
|
|
462
|
-
} else if (typeof v === 'string' || v instanceof String) {
|
|
463
|
-
return v as string;
|
|
464
|
-
}
|
|
465
|
-
return JSON.stringify(v);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
function escapeMessage(v: any): string {
|
|
469
|
-
return toString(v).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
|
470
|
-
}
|
|
471
|
-
function escapeProperty(v: any): string {
|
|
472
|
-
return toString(v)
|
|
473
|
-
.replace(/%/g, '%25')
|
|
474
|
-
.replace(/\r/g, '%0D')
|
|
475
|
-
.replace(/\n/g, '%0A')
|
|
476
|
-
.replace(/:/g, '%3A')
|
|
477
|
-
.replace(/,/g, '%2C');
|
|
478
|
-
}
|
|
479
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
BundleOutputFormat,
|
|
3
|
-
readFileFromUrl,
|
|
4
|
-
slash,
|
|
5
|
-
doesYamlFileExist,
|
|
6
|
-
isTruthy,
|
|
7
|
-
getProxyAgent,
|
|
8
|
-
pause,
|
|
9
|
-
} from './utils';
|
|
10
|
-
export { Oas3_1Types } from './types/oas3_1';
|
|
11
|
-
export { Arazzo1Types } from './types/arazzo';
|
|
12
|
-
export { Oas3Types } from './types/oas3';
|
|
13
|
-
export { Oas2Types } from './types/oas2';
|
|
14
|
-
export { AsyncApi2Types } from './types/asyncapi2';
|
|
15
|
-
export { AsyncApi3Types } from './types/asyncapi3';
|
|
16
|
-
export { ConfigTypes } from './types/redocly-yaml';
|
|
17
|
-
export type {
|
|
18
|
-
Oas3Definition,
|
|
19
|
-
Oas3_1Definition,
|
|
20
|
-
Oas3Components,
|
|
21
|
-
Oas3_1Components,
|
|
22
|
-
Oas3PathItem,
|
|
23
|
-
Oas3Paths,
|
|
24
|
-
Oas3ComponentName,
|
|
25
|
-
Oas3Schema,
|
|
26
|
-
Oas3_1Schema,
|
|
27
|
-
Oas3Tag,
|
|
28
|
-
Referenced,
|
|
29
|
-
OasRef,
|
|
30
|
-
} from './typings/openapi';
|
|
31
|
-
export type { Oas2Definition } from './typings/swagger';
|
|
32
|
-
export type { StatsAccumulator, StatsName } from './typings/common';
|
|
33
|
-
export { normalizeTypes } from './types';
|
|
34
|
-
export { Stats } from './rules/other/stats';
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
Config,
|
|
38
|
-
StyleguideConfig,
|
|
39
|
-
RawConfig,
|
|
40
|
-
RawUniversalConfig,
|
|
41
|
-
IGNORE_FILE,
|
|
42
|
-
Region,
|
|
43
|
-
getMergedConfig,
|
|
44
|
-
transformConfig,
|
|
45
|
-
loadConfig,
|
|
46
|
-
getConfig,
|
|
47
|
-
findConfig,
|
|
48
|
-
CONFIG_FILE_NAMES,
|
|
49
|
-
RuleSeverity,
|
|
50
|
-
createConfig,
|
|
51
|
-
ResolvedApi,
|
|
52
|
-
} from './config';
|
|
53
|
-
|
|
54
|
-
export { RedoclyClient } from './redocly';
|
|
55
|
-
|
|
56
|
-
export * from './redocly/domains';
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
Source,
|
|
60
|
-
BaseResolver,
|
|
61
|
-
Document,
|
|
62
|
-
resolveDocument,
|
|
63
|
-
ResolveError,
|
|
64
|
-
YamlParseError,
|
|
65
|
-
makeDocumentFromString,
|
|
66
|
-
} from './resolve';
|
|
67
|
-
export { parseYaml, stringifyYaml } from './js-yaml';
|
|
68
|
-
export { unescapePointer, isRef, isAbsoluteUrl } from './ref-utils';
|
|
69
|
-
export {
|
|
70
|
-
SpecMajorVersion,
|
|
71
|
-
getMajorSpecVersion,
|
|
72
|
-
SpecVersion,
|
|
73
|
-
detectSpec,
|
|
74
|
-
getTypes,
|
|
75
|
-
} from './oas-types';
|
|
76
|
-
export { normalizeVisitors } from './visitors';
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
WalkContext,
|
|
80
|
-
walkDocument,
|
|
81
|
-
NormalizedProblem,
|
|
82
|
-
ProblemSeverity,
|
|
83
|
-
LineColLocationObject,
|
|
84
|
-
LocationObject,
|
|
85
|
-
Loc,
|
|
86
|
-
} from './walk';
|
|
87
|
-
|
|
88
|
-
export { getAstNodeByPointer, getLineColLocation } from './format/codeframes';
|
|
89
|
-
export { formatProblems, OutputFormat, getTotals, Totals } from './format/format';
|
|
90
|
-
export { lint, lint as validate, lintDocument, lintFromString, lintConfig } from './lint';
|
|
91
|
-
export { bundle, bundleDocument, mapTypeToComponent, bundleFromString } from './bundle';
|
package/src/js-yaml/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// TODO: add a type for "types" https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/js-yaml/index.d.ts
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { JSON_SCHEMA, types, load, dump } from 'js-yaml';
|
|
5
|
-
|
|
6
|
-
import type { LoadOptions, DumpOptions } from 'js-yaml';
|
|
7
|
-
|
|
8
|
-
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = JSON_SCHEMA.extend({
|
|
9
|
-
implicit: [types.merge],
|
|
10
|
-
explicit: [types.binary, types.omap, types.pairs, types.set],
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const parseYaml = (str: string, opts?: LoadOptions): unknown =>
|
|
14
|
-
load(str, { schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts });
|
|
15
|
-
|
|
16
|
-
export const stringifyYaml = (obj: any, opts?: DumpOptions): string => dump(obj, opts);
|