@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/lib/index.js
CHANGED
|
@@ -1,98 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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; } });
|
|
1
|
+
export { readFileFromUrl, slash, doesYamlFileExist, isTruthy, pause, isPlainObject, dequal, pluralize, isEmptyObject, isNotEmptyArray, isNotEmptyObject, } from './utils.js';
|
|
2
|
+
export { Oas3_1Types } from './types/oas3_1.js';
|
|
3
|
+
export { Arazzo1Types } from './types/arazzo.js';
|
|
4
|
+
export { Oas3Types } from './types/oas3.js';
|
|
5
|
+
export { Oas2Types } from './types/oas2.js';
|
|
6
|
+
export { AsyncApi2Types } from './types/asyncapi2.js';
|
|
7
|
+
export { AsyncApi3Types } from './types/asyncapi3.js';
|
|
8
|
+
export { ConfigTypes, createConfigTypes } from './types/redocly-yaml.js';
|
|
9
|
+
export { normalizeTypes } from './types/index.js';
|
|
10
|
+
export { Stats } from './rules/other/stats.js';
|
|
11
|
+
export { Config, // FIXME: only export as a type in v2
|
|
12
|
+
IGNORE_FILE, loadConfig, findConfig, CONFIG_FILE_NAMES, createConfig, ConfigValidationError, resolvePlugins, } from './config/index.js';
|
|
13
|
+
export { Source, BaseResolver, resolveDocument, ResolveError, YamlParseError, makeDocumentFromString, } from './resolve.js';
|
|
14
|
+
export { parseYaml, stringifyYaml } from './js-yaml/index.js';
|
|
15
|
+
export { unescapePointer, isRef, isAbsoluteUrl, escapePointer } from './ref-utils.js';
|
|
16
|
+
export { SpecMajorVersion, getMajorSpecVersion, SpecVersion, detectSpec, getTypes, } from './oas-types.js';
|
|
17
|
+
export { normalizeVisitors } from './visitors.js';
|
|
18
|
+
export { walkDocument, } from './walk.js';
|
|
19
|
+
export { getAstNodeByPointer, getLineColLocation, getCodeframe } from './format/codeframes.js';
|
|
20
|
+
export { formatProblems, getTotals } from './format/format.js';
|
|
21
|
+
export { lint, lint as validate, lintDocument, lintFromString, lintConfig } from './lint.js';
|
|
22
|
+
export { bundle, bundleDocument, mapTypeToComponent, bundleFromString, } from './bundle.js';
|
|
23
|
+
export { logger } from './logger.js';
|
|
24
|
+
export { HandledError } from './utils/error.js';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,KAAK,EACL,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACL,aAAa,EACb,MAAM,EACN,SAAS,EACT,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAA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AAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAEL,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/js-yaml/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxD,eAAO,MAAM,SAAS,QAAS,MAAM,SAAS,WAAW,KAAG,OACM,CAAC;AAEnE,eAAO,MAAM,aAAa,QAAS,GAAG,SAAS,WAAW,KAAG,MAAyB,CAAC"}
|
package/lib/js-yaml/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyYaml = exports.parseYaml = void 0;
|
|
4
1
|
// TODO: add a type for "types" https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/js-yaml/index.d.ts
|
|
5
2
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
3
|
// @ts-ignore
|
|
7
|
-
|
|
8
|
-
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP =
|
|
9
|
-
implicit: [
|
|
10
|
-
explicit: [
|
|
4
|
+
import { JSON_SCHEMA, types, load, dump } from 'js-yaml';
|
|
5
|
+
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = JSON_SCHEMA.extend({
|
|
6
|
+
implicit: [types.merge],
|
|
7
|
+
explicit: [types.binary, types.omap, types.pairs, types.set],
|
|
11
8
|
});
|
|
12
|
-
const parseYaml = (str, opts) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.stringifyYaml = stringifyYaml;
|
|
9
|
+
export const parseYaml = (str, opts) => load(str, { schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts });
|
|
10
|
+
export const stringifyYaml = (obj, opts) => dump(obj, opts);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js-yaml/index.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,6DAA6D;AAC7D,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIzD,MAAM,gCAAgC,GAAG,WAAW,CAAC,MAAM,CAAC;IAC1D,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,IAAkB,EAAW,EAAE,CACpE,IAAI,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,gCAAgC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,IAAkB,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC"}
|
package/lib/lint.d.ts
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { BaseResolver } from './resolve';
|
|
2
|
-
import
|
|
3
|
-
import type { Document
|
|
4
|
-
import type { ProblemSeverity } from './walk';
|
|
5
|
-
import type { NodeType } from './types';
|
|
6
|
-
import type { CollectFn } from './utils';
|
|
1
|
+
import { BaseResolver } from './resolve.js';
|
|
2
|
+
import { type Config } from './config/index.js';
|
|
3
|
+
import type { Document } from './resolve.js';
|
|
4
|
+
import type { ProblemSeverity } from './walk.js';
|
|
5
|
+
import type { NodeType } from './types/index.js';
|
|
6
|
+
import type { CollectFn } from './utils.js';
|
|
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").NormalizedProblem[]>;
|
|
12
|
+
}): Promise<import("./walk.js").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").NormalizedProblem[]>;
|
|
18
|
+
}): Promise<import("./walk.js").NormalizedProblem[]>;
|
|
19
19
|
export declare function lintDocument(opts: {
|
|
20
20
|
document: Document;
|
|
21
|
-
config:
|
|
21
|
+
config: Config;
|
|
22
22
|
customTypes?: Record<string, NodeType>;
|
|
23
23
|
externalRefResolver: BaseResolver;
|
|
24
|
-
}): Promise<import("./walk").NormalizedProblem[]>;
|
|
24
|
+
}): Promise<import("./walk.js").NormalizedProblem[]>;
|
|
25
25
|
export declare function lintConfig(opts: {
|
|
26
|
-
document: Document;
|
|
27
26
|
config: Config;
|
|
28
|
-
resolvedRefMap?: ResolvedRefMap;
|
|
29
27
|
severity?: ProblemSeverity;
|
|
30
28
|
externalRefResolver?: BaseResolver;
|
|
31
29
|
externalConfigTypes?: Record<string, NodeType>;
|
|
32
|
-
}): Promise<import("./walk").NormalizedProblem[]>;
|
|
30
|
+
}): Promise<import("./walk.js").NormalizedProblem[]>;
|
|
31
|
+
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.d.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|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const oas_types_1 = require("./oas-types");
|
|
15
|
-
const redocly_yaml_1 = require("./types/redocly-yaml");
|
|
16
|
-
const struct_1 = require("./rules/common/struct");
|
|
17
|
-
const no_unresolved_refs_1 = require("./rules/no-unresolved-refs");
|
|
18
|
-
async function lint(opts) {
|
|
19
|
-
const { ref, externalRefResolver = new resolve_1.BaseResolver(opts.config.resolve) } = opts;
|
|
1
|
+
import { rootRedoclyConfigSchema } from '@redocly/config';
|
|
2
|
+
import { BaseResolver, resolveDocument, makeDocumentFromString } from './resolve.js';
|
|
3
|
+
import { normalizeVisitors } from './visitors.js';
|
|
4
|
+
import { walkDocument } from './walk.js';
|
|
5
|
+
import { initRules } from './config/rules.js';
|
|
6
|
+
import { normalizeTypes } from './types/index.js';
|
|
7
|
+
import { releaseAjvInstance } from './rules/ajv.js';
|
|
8
|
+
import { SpecVersion, getMajorSpecVersion, detectSpec, getTypes } from './oas-types.js';
|
|
9
|
+
import { createConfigTypes } from './types/redocly-yaml.js';
|
|
10
|
+
import { Struct } from './rules/common/struct.js';
|
|
11
|
+
import { NoUnresolvedRefs } from './rules/no-unresolved-refs.js';
|
|
12
|
+
export async function lint(opts) {
|
|
13
|
+
const { ref, externalRefResolver = new BaseResolver(opts.config.resolve) } = opts;
|
|
20
14
|
const document = (await externalRefResolver.resolveDocument(null, ref, true));
|
|
21
15
|
opts.collectSpecData?.(document.parsed);
|
|
22
16
|
return lintDocument({
|
|
23
17
|
document,
|
|
24
18
|
...opts,
|
|
25
19
|
externalRefResolver,
|
|
26
|
-
config: opts.config.styleguide,
|
|
27
20
|
});
|
|
28
21
|
}
|
|
29
|
-
async function lintFromString(opts) {
|
|
30
|
-
const { source, absoluteRef, externalRefResolver = new
|
|
31
|
-
const document =
|
|
22
|
+
export async function lintFromString(opts) {
|
|
23
|
+
const { source, absoluteRef, externalRefResolver = new BaseResolver(opts.config.resolve) } = opts;
|
|
24
|
+
const document = makeDocumentFromString(source, absoluteRef || '/');
|
|
32
25
|
return lintDocument({
|
|
33
26
|
document,
|
|
34
27
|
...opts,
|
|
35
28
|
externalRefResolver,
|
|
36
|
-
config: opts.config.styleguide,
|
|
37
29
|
});
|
|
38
30
|
}
|
|
39
|
-
async function lintDocument(opts) {
|
|
40
|
-
|
|
31
|
+
export async function lintDocument(opts) {
|
|
32
|
+
releaseAjvInstance(); // FIXME: preprocessors can modify nodes which are then cached to ajv-instance by absolute path
|
|
41
33
|
const { document, customTypes, externalRefResolver, config } = opts;
|
|
42
|
-
const specVersion =
|
|
43
|
-
const specMajorVersion =
|
|
34
|
+
const specVersion = detectSpec(document.parsed);
|
|
35
|
+
const specMajorVersion = getMajorSpecVersion(specVersion);
|
|
44
36
|
const rules = config.getRulesForSpecVersion(specMajorVersion);
|
|
45
|
-
const types =
|
|
37
|
+
const types = normalizeTypes(config.extendTypes(customTypes ?? getTypes(specVersion), specVersion), config);
|
|
46
38
|
const ctx = {
|
|
47
39
|
problems: [],
|
|
48
40
|
oasVersion: specVersion,
|
|
49
41
|
visitorsData: {},
|
|
50
42
|
};
|
|
51
|
-
const preprocessors =
|
|
52
|
-
const regularRules =
|
|
53
|
-
let resolvedRefMap = await
|
|
43
|
+
const preprocessors = initRules(rules, config, 'preprocessors', specVersion);
|
|
44
|
+
const regularRules = initRules(rules, config, 'rules', specVersion);
|
|
45
|
+
let resolvedRefMap = await resolveDocument({
|
|
54
46
|
rootDocument: document,
|
|
55
47
|
rootType: types.Root,
|
|
56
48
|
externalRefResolver,
|
|
57
49
|
});
|
|
58
50
|
if (preprocessors.length > 0) {
|
|
59
51
|
// Make additional pass to resolve refs defined in preprocessors.
|
|
60
|
-
|
|
52
|
+
walkDocument({
|
|
61
53
|
document,
|
|
62
54
|
rootType: types.Root,
|
|
63
|
-
normalizedVisitors:
|
|
55
|
+
normalizedVisitors: normalizeVisitors(preprocessors, types),
|
|
64
56
|
resolvedRefMap,
|
|
65
57
|
ctx,
|
|
66
58
|
});
|
|
67
|
-
resolvedRefMap = await
|
|
59
|
+
resolvedRefMap = await resolveDocument({
|
|
68
60
|
rootDocument: document,
|
|
69
61
|
rootType: types.Root,
|
|
70
62
|
externalRefResolver,
|
|
71
63
|
});
|
|
72
64
|
}
|
|
73
|
-
const normalizedVisitors =
|
|
74
|
-
|
|
65
|
+
const normalizedVisitors = normalizeVisitors(regularRules, types);
|
|
66
|
+
walkDocument({
|
|
75
67
|
document,
|
|
76
68
|
rootType: types.Root,
|
|
77
69
|
normalizedVisitors,
|
|
@@ -80,35 +72,38 @@ async function lintDocument(opts) {
|
|
|
80
72
|
});
|
|
81
73
|
return ctx.problems.map((problem) => config.addProblemToIgnore(problem));
|
|
82
74
|
}
|
|
83
|
-
async function lintConfig(opts) {
|
|
84
|
-
const {
|
|
75
|
+
export async function lintConfig(opts) {
|
|
76
|
+
const { severity, externalRefResolver = new BaseResolver(), config } = opts;
|
|
77
|
+
if (!config.document) {
|
|
78
|
+
throw new Error('Config document is not set.');
|
|
79
|
+
}
|
|
85
80
|
const ctx = {
|
|
86
81
|
problems: [],
|
|
87
|
-
oasVersion:
|
|
82
|
+
oasVersion: SpecVersion.OAS3_0, // TODO: use config-specific version; rename `oasVersion`
|
|
88
83
|
visitorsData: {},
|
|
89
84
|
};
|
|
90
|
-
const types =
|
|
85
|
+
const types = normalizeTypes(opts.externalConfigTypes || createConfigTypes(rootRedoclyConfigSchema, config));
|
|
91
86
|
const rules = [
|
|
92
87
|
{
|
|
93
88
|
severity: severity || 'error',
|
|
94
|
-
ruleId: 'configuration
|
|
95
|
-
visitor:
|
|
89
|
+
ruleId: 'configuration struct',
|
|
90
|
+
visitor: Struct({ severity: 'error' }),
|
|
96
91
|
},
|
|
97
92
|
{
|
|
98
93
|
severity: severity || 'error',
|
|
99
94
|
ruleId: 'configuration no-unresolved-refs',
|
|
100
|
-
visitor:
|
|
95
|
+
visitor: NoUnresolvedRefs({ severity: 'error' }),
|
|
101
96
|
},
|
|
102
97
|
];
|
|
103
|
-
const normalizedVisitors =
|
|
104
|
-
const resolvedRefMap =
|
|
105
|
-
(await
|
|
106
|
-
rootDocument: document,
|
|
98
|
+
const normalizedVisitors = normalizeVisitors(rules, types);
|
|
99
|
+
const resolvedRefMap = config.resolvedRefMap ||
|
|
100
|
+
(await resolveDocument({
|
|
101
|
+
rootDocument: config.document,
|
|
107
102
|
rootType: types.ConfigRoot,
|
|
108
103
|
externalRefResolver,
|
|
109
104
|
}));
|
|
110
|
-
|
|
111
|
-
document,
|
|
105
|
+
walkDocument({
|
|
106
|
+
document: config.document,
|
|
112
107
|
rootType: types.ConfigRoot,
|
|
113
108
|
normalizedVisitors,
|
|
114
109
|
resolvedRefMap,
|
|
@@ -116,3 +111,4 @@ async function lintConfig(opts) {
|
|
|
116
111
|
});
|
|
117
112
|
return ctx.problems;
|
|
118
113
|
}
|
|
114
|
+
//# sourceMappingURL=lint.js.map
|
package/lib/lint.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU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QAAQ,EAAE,KAAK,CAAC,UAAU;YAC1B,mBAAmB;SACpB,CAAC,CAAC,CAAC;IACN,YAAY,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,KAAK,CAAC,UAAU;QAC1B,kBAAkB;QAClB,cAAc;QACd,GAAG;KACJ,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,QAAQ,CAAC;AACtB,CAAC"}
|
package/lib/logger.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export declare const colorOptions: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const colorize: typeof colorette;
|
|
6
6
|
declare class Logger {
|
|
7
|
-
protected stderr(str: string): boolean;
|
|
8
7
|
info(str: string): boolean | void;
|
|
9
8
|
warn(str: string): boolean | void;
|
|
10
9
|
error(str: string): boolean | void;
|
|
10
|
+
output(str: string): boolean | void;
|
|
11
11
|
}
|
|
12
12
|
export declare const logger: Logger;
|
|
13
13
|
export {};
|
|
14
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAMvC,eAAO,MAAM,YAAY;;CAAoB,CAAC;AAE9C,eAAO,MAAM,QAAQ,kBAQnB,CAAC;AAEH,cAAM,MAAM;IACV,IAAI,CAAC,GAAG,EAAE,MAAM;IAIhB,IAAI,CAAC,GAAG,EAAE,MAAM;IAIhB,KAAK,CAAC,GAAG,EAAE,MAAM;IAIjB,MAAM,CAAC,GAAG,EAAE,MAAM;CAGnB;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
package/lib/logger.js
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const colorette = require("colorette");
|
|
5
|
-
const env_1 = require("./env");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
1
|
+
import * as colorette from 'colorette';
|
|
2
|
+
import { isBrowser } from './env.js';
|
|
3
|
+
import { identity } from './utils.js';
|
|
7
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
5
|
// @ts-ignore this works but some types are not working
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const colorOptions = colorette.options;
|
|
7
|
+
export const colorize = new Proxy(colorette, {
|
|
11
8
|
get(target, prop) {
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
9
|
+
if (isBrowser) {
|
|
10
|
+
return identity;
|
|
14
11
|
}
|
|
15
12
|
return target[prop];
|
|
16
13
|
},
|
|
17
14
|
});
|
|
18
15
|
class Logger {
|
|
19
|
-
stderr(str) {
|
|
20
|
-
return process.stderr.write(str);
|
|
21
|
-
}
|
|
22
16
|
info(str) {
|
|
23
|
-
return
|
|
17
|
+
return isBrowser ? console.info(str) : process.stderr.write(str);
|
|
24
18
|
}
|
|
25
19
|
warn(str) {
|
|
26
|
-
return
|
|
20
|
+
return isBrowser ? console.warn(str) : process.stderr.write(colorize.yellow(str));
|
|
27
21
|
}
|
|
28
22
|
error(str) {
|
|
29
|
-
return
|
|
23
|
+
return isBrowser ? console.error(str) : process.stderr.write(colorize.red(str));
|
|
24
|
+
}
|
|
25
|
+
output(str) {
|
|
26
|
+
return isBrowser ? console.info(str) : process.stdout.write(str);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
|
-
|
|
29
|
+
export const logger = new Logger();
|
|
30
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,6DAA6D;AAC7D,uDAAuD;AACvD,MAAM,CA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