@redocly/openapi-core 0.0.0-snapshot.1744362365 → 0.0.0-snapshot.1744801622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +19 -17
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +19 -15
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +1 -2
- package/lib/benchmark/benches/recommended-oas3.bench.js +18 -15
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +1 -2
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +17 -14
- package/lib/benchmark/utils.d.ts +4 -5
- package/lib/benchmark/utils.js +14 -11
- package/lib/bundle.d.ts +9 -8
- package/lib/bundle.js +84 -72
- package/lib/config/all.d.ts +1 -2
- package/lib/config/all.js +3 -2
- package/lib/config/builtIn.d.ts +1 -2
- package/lib/config/builtIn.js +49 -44
- package/lib/config/config-resolvers.d.ts +5 -6
- package/lib/config/config-resolvers.js +94 -85
- package/lib/config/config.d.ts +8 -6
- package/lib/config/config.js +73 -66
- package/lib/config/index.d.ts +7 -8
- package/lib/config/index.js +23 -8
- package/lib/config/load.d.ts +8 -5
- package/lib/config/load.js +73 -28
- package/lib/config/minimal.d.ts +1 -2
- package/lib/config/minimal.js +3 -2
- package/lib/config/recommended-strict.d.ts +1 -2
- package/lib/config/recommended-strict.js +3 -2
- package/lib/config/recommended.d.ts +1 -2
- package/lib/config/recommended.js +3 -2
- package/lib/config/rules.d.ts +3 -4
- package/lib/config/rules.js +6 -4
- package/lib/config/spec.d.ts +1 -2
- package/lib/config/spec.js +3 -2
- package/lib/config/types.d.ts +13 -6
- package/lib/config/types.js +2 -2
- package/lib/config/utils.d.ts +2 -3
- package/lib/config/utils.js +89 -75
- package/lib/decorators/arazzo/index.d.ts +0 -1
- package/lib/decorators/arazzo/index.js +4 -2
- package/lib/decorators/async2/index.d.ts +0 -1
- package/lib/decorators/async2/index.js +4 -2
- package/lib/decorators/async3/index.d.ts +0 -1
- package/lib/decorators/async3/index.js +4 -2
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -2
- package/lib/decorators/common/filters/filter-helper.js +12 -9
- package/lib/decorators/common/filters/filter-in.d.ts +1 -2
- package/lib/decorators/common/filters/filter-in.js +8 -5
- package/lib/decorators/common/filters/filter-out.d.ts +1 -2
- package/lib/decorators/common/filters/filter-out.js +8 -5
- package/lib/decorators/common/info-description-override.d.ts +1 -2
- package/lib/decorators/common/info-description-override.js +7 -4
- package/lib/decorators/common/info-override.d.ts +1 -2
- package/lib/decorators/common/info-override.js +5 -2
- package/lib/decorators/common/media-type-examples-override.d.ts +1 -2
- package/lib/decorators/common/media-type-examples-override.js +10 -7
- package/lib/decorators/common/operation-description-override.d.ts +1 -2
- package/lib/decorators/common/operation-description-override.js +7 -4
- package/lib/decorators/common/registry-dependencies.d.ts +2 -0
- package/lib/decorators/common/registry-dependencies.js +24 -0
- package/lib/decorators/common/remove-x-internal.d.ts +1 -2
- package/lib/decorators/common/remove-x-internal.js +14 -11
- package/lib/decorators/common/tag-description-override.d.ts +1 -2
- package/lib/decorators/common/tag-description-override.js +7 -4
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.js +20 -16
- package/lib/decorators/oas2/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas2/remove-unused-components.js +7 -4
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.js +22 -18
- package/lib/decorators/oas3/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas3/remove-unused-components.js +8 -5
- package/lib/decorators/overlay1/index.d.ts +0 -1
- package/lib/decorators/overlay1/index.js +4 -2
- package/lib/env.d.ts +0 -1
- package/lib/env.js +5 -3
- package/lib/format/codeframes.d.ts +1 -2
- package/lib/format/codeframes.js +19 -15
- package/lib/format/format.d.ts +1 -2
- package/lib/format/format.js +62 -57
- package/lib/index.d.ts +26 -29
- package/lib/index.js +98 -24
- package/lib/js-yaml/index.d.ts +0 -1
- package/lib/js-yaml/index.js +11 -7
- package/lib/lint.d.ts +10 -11
- package/lib/lint.js +44 -39
- package/lib/logger.d.ts +1 -2
- package/lib/logger.js +17 -15
- package/lib/oas-types.d.ts +3 -4
- package/lib/oas-types.js +32 -27
- package/lib/output.d.ts +3 -0
- package/lib/output.js +9 -0
- package/lib/redocly/domains.d.ts +14 -0
- package/lib/redocly/domains.js +41 -0
- package/lib/redocly/index.d.ts +30 -0
- package/lib/redocly/index.js +131 -0
- package/lib/redocly/redocly-client-types.d.ts +8 -0
- package/lib/redocly/redocly-client-types.js +2 -0
- package/lib/redocly/registry-api-types.d.ts +29 -0
- package/lib/redocly/registry-api-types.js +2 -0
- package/lib/redocly/registry-api.d.ts +17 -0
- package/lib/redocly/registry-api.js +100 -0
- package/lib/ref-utils.d.ts +2 -3
- package/lib/ref-utils.js +33 -18
- package/lib/resolve.d.ts +2 -3
- package/lib/resolve.js +45 -36
- package/lib/rules/ajv.d.ts +3 -4
- package/lib/rules/ajv.js +10 -7
- package/lib/rules/arazzo/criteria-unique.d.ts +1 -2
- package/lib/rules/arazzo/criteria-unique.js +5 -2
- package/lib/rules/arazzo/index.d.ts +1 -2
- package/lib/rules/arazzo/index.js +35 -33
- package/lib/rules/arazzo/parameters-unique.d.ts +1 -2
- package/lib/rules/arazzo/parameters-unique.js +5 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +1 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescription-type.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +5 -2
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onFailure-unique.js +5 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onSuccess-unique.js +5 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +1 -2
- package/lib/rules/arazzo/stepId-unique.js +5 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +1 -2
- package/lib/rules/arazzo/workflow-dependsOn.js +5 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +1 -2
- package/lib/rules/arazzo/workflowId-unique.js +5 -2
- package/lib/rules/async2/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async2/channels-kebab-case.js +5 -2
- package/lib/rules/async2/index.d.ts +1 -2
- package/lib/rules/async2/index.js +24 -22
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async2/no-channel-trailing-slash.js +5 -2
- package/lib/rules/async3/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async3/channels-kebab-case.js +5 -2
- package/lib/rules/async3/index.d.ts +1 -2
- package/lib/rules/async3/index.js +24 -22
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async3/no-channel-trailing-slash.js +6 -3
- package/lib/rules/common/assertions/asserts.d.ts +2 -3
- package/lib/rules/common/assertions/asserts.js +38 -35
- package/lib/rules/common/assertions/index.d.ts +3 -4
- package/lib/rules/common/assertions/index.js +10 -7
- package/lib/rules/common/assertions/utils.d.ts +4 -5
- package/lib/rules/common/assertions/utils.js +29 -21
- package/lib/rules/common/info-contact.d.ts +1 -2
- package/lib/rules/common/info-contact.js +7 -4
- package/lib/rules/common/info-license-strict.d.ts +1 -2
- package/lib/rules/common/info-license-strict.js +10 -7
- package/lib/rules/common/info-license-url.d.ts +1 -2
- package/lib/rules/common/info-license-url.js +7 -4
- package/lib/rules/common/info-license.d.ts +1 -2
- package/lib/rules/common/info-license.js +7 -4
- package/lib/rules/common/no-ambiguous-paths.d.ts +1 -2
- package/lib/rules/common/no-ambiguous-paths.js +5 -2
- package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-enum-type-mismatch.js +9 -6
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -2
- package/lib/rules/common/no-http-verbs-in-paths.js +8 -5
- package/lib/rules/common/no-identical-paths.d.ts +1 -2
- package/lib/rules/common/no-identical-paths.js +5 -2
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js +9 -6
- package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -2
- package/lib/rules/common/no-invalid-schema-examples.js +9 -6
- package/lib/rules/common/no-path-trailing-slash.d.ts +1 -2
- package/lib/rules/common/no-path-trailing-slash.js +5 -2
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -2
- package/lib/rules/common/no-required-schema-properties-undefined.js +7 -4
- package/lib/rules/common/no-schema-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-schema-type-mismatch.js +5 -2
- package/lib/rules/common/operation-2xx-response.d.ts +1 -2
- package/lib/rules/common/operation-2xx-response.js +8 -5
- package/lib/rules/common/operation-4xx-response.d.ts +1 -2
- package/lib/rules/common/operation-4xx-response.js +8 -5
- package/lib/rules/common/operation-description.d.ts +1 -2
- package/lib/rules/common/operation-description.js +7 -4
- package/lib/rules/common/operation-operationId-unique.d.ts +1 -2
- package/lib/rules/common/operation-operationId-unique.js +5 -2
- package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -2
- package/lib/rules/common/operation-operationId-url-safe.js +5 -2
- package/lib/rules/common/operation-operationId.d.ts +1 -2
- package/lib/rules/common/operation-operationId.js +7 -4
- package/lib/rules/common/operation-parameters-unique.d.ts +1 -2
- package/lib/rules/common/operation-parameters-unique.js +5 -2
- package/lib/rules/common/operation-singular-tag.d.ts +1 -2
- package/lib/rules/common/operation-singular-tag.js +5 -2
- package/lib/rules/common/operation-summary.d.ts +1 -2
- package/lib/rules/common/operation-summary.js +7 -4
- package/lib/rules/common/operation-tag-defined.d.ts +1 -2
- package/lib/rules/common/operation-tag-defined.js +5 -2
- package/lib/rules/common/parameter-description.d.ts +1 -2
- package/lib/rules/common/parameter-description.js +5 -2
- package/lib/rules/common/path-declaration-must-exist.d.ts +1 -2
- package/lib/rules/common/path-declaration-must-exist.js +5 -2
- package/lib/rules/common/path-excludes-patterns.d.ts +1 -2
- package/lib/rules/common/path-excludes-patterns.js +5 -2
- package/lib/rules/common/path-http-verbs-order.d.ts +1 -2
- package/lib/rules/common/path-http-verbs-order.js +5 -2
- package/lib/rules/common/path-not-include-query.d.ts +1 -2
- package/lib/rules/common/path-not-include-query.js +5 -2
- package/lib/rules/common/path-params-defined.d.ts +1 -2
- package/lib/rules/common/path-params-defined.js +5 -2
- package/lib/rules/common/path-segment-plural.d.ts +1 -2
- package/lib/rules/common/path-segment-plural.js +8 -5
- package/lib/rules/common/paths-kebab-case.d.ts +1 -2
- package/lib/rules/common/paths-kebab-case.js +5 -2
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -2
- package/lib/rules/common/required-string-property-missing-min-length.js +5 -2
- package/lib/rules/common/response-contains-header.d.ts +1 -2
- package/lib/rules/common/response-contains-header.js +8 -5
- package/lib/rules/common/scalar-property-missing-example.d.ts +1 -2
- package/lib/rules/common/scalar-property-missing-example.js +7 -4
- package/lib/rules/common/security-defined.d.ts +1 -2
- package/lib/rules/common/security-defined.js +5 -2
- package/lib/rules/common/spec-strict-refs.d.ts +1 -2
- package/lib/rules/common/spec-strict-refs.js +7 -4
- package/lib/rules/common/struct.d.ts +1 -2
- package/lib/rules/common/struct.js +21 -18
- package/lib/rules/common/tag-description.d.ts +1 -2
- package/lib/rules/common/tag-description.js +7 -4
- package/lib/rules/common/tags-alphabetical.d.ts +1 -2
- package/lib/rules/common/tags-alphabetical.js +5 -2
- package/lib/rules/no-unresolved-refs.d.ts +3 -4
- package/lib/rules/no-unresolved-refs.js +9 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas2/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas2/index.d.ts +1 -2
- package/lib/rules/oas2/index.js +97 -95
- package/lib/rules/oas2/request-mime-type.d.ts +1 -2
- package/lib/rules/oas2/request-mime-type.js +8 -5
- package/lib/rules/oas2/response-contains-property.d.ts +1 -2
- package/lib/rules/oas2/response-contains-property.js +8 -5
- package/lib/rules/oas2/response-mime-type.d.ts +1 -2
- package/lib/rules/oas2/response-mime-type.js +8 -5
- package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -2
- package/lib/rules/oas3/array-parameter-serialization.js +7 -4
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas3/component-name-unique.d.ts +1 -2
- package/lib/rules/oas3/component-name-unique.js +5 -2
- package/lib/rules/oas3/index.d.ts +1 -2
- package/lib/rules/oas3/index.js +121 -119
- package/lib/rules/oas3/no-empty-servers.d.ts +1 -2
- package/lib/rules/oas3/no-empty-servers.js +5 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.js +5 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.js +10 -7
- package/lib/rules/oas3/no-server-example.com.d.ts +1 -2
- package/lib/rules/oas3/no-server-example.com.js +5 -2
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -2
- package/lib/rules/oas3/no-server-trailing-slash.js +5 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.js +5 -2
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -2
- package/lib/rules/oas3/no-undefined-server-variable.js +5 -2
- package/lib/rules/oas3/no-unused-components.d.ts +1 -2
- package/lib/rules/oas3/no-unused-components.js +5 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +1 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +9 -6
- package/lib/rules/oas3/request-mime-type.d.ts +1 -2
- package/lib/rules/oas3/request-mime-type.js +9 -6
- package/lib/rules/oas3/response-contains-property.d.ts +1 -2
- package/lib/rules/oas3/response-contains-property.js +8 -5
- package/lib/rules/oas3/response-mime-type.d.ts +1 -2
- package/lib/rules/oas3/response-mime-type.js +9 -6
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -2
- package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -2
- package/lib/rules/other/stats.d.ts +3 -4
- package/lib/rules/other/stats.js +5 -2
- package/lib/rules/overlay1/index.d.ts +1 -2
- package/lib/rules/overlay1/index.js +11 -9
- package/lib/rules/respect/no-criteria-xpath.d.ts +1 -2
- package/lib/rules/respect/no-criteria-xpath.js +5 -2
- package/lib/rules/respect/respect-supported-versions.d.ts +1 -2
- package/lib/rules/respect/respect-supported-versions.js +10 -7
- package/lib/rules/utils.d.ts +3 -4
- package/lib/rules/utils.js +36 -23
- package/lib/types/arazzo.d.ts +1 -2
- package/lib/types/arazzo.js +23 -21
- package/lib/types/asyncapi2.d.ts +1 -2
- package/lib/types/asyncapi2.js +56 -54
- package/lib/types/asyncapi3.d.ts +1 -2
- package/lib/types/asyncapi3.js +43 -41
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +13 -7
- package/lib/types/json-schema-adapter.d.ts +1 -2
- package/lib/types/json-schema-adapter.js +17 -15
- package/lib/types/oas2.d.ts +2 -3
- package/lib/types/oas2.js +19 -17
- package/lib/types/oas3.d.ts +2 -3
- package/lib/types/oas3.js +41 -39
- package/lib/types/oas3_1.d.ts +2 -3
- package/lib/types/oas3_1.js +20 -18
- package/lib/types/overlay.d.ts +1 -2
- package/lib/types/overlay.js +6 -4
- package/lib/types/redocly-yaml.d.ts +3 -4
- package/lib/types/redocly-yaml.js +48 -31
- package/lib/typings/arazzo.d.ts +0 -1
- package/lib/typings/arazzo.js +5 -3
- package/lib/typings/asyncapi.d.ts +0 -1
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi3.d.ts +0 -1
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/common.d.ts +0 -1
- package/lib/typings/common.js +2 -2
- package/lib/typings/openapi.d.ts +0 -1
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/overlay.d.ts +0 -1
- package/lib/typings/overlay.js +4 -2
- package/lib/typings/swagger.d.ts +1 -2
- package/lib/typings/swagger.js +2 -2
- package/lib/utils.d.ts +5 -4
- package/lib/utils.js +99 -52
- package/lib/visitors.d.ts +10 -11
- package/lib/visitors.js +6 -4
- package/lib/walk.d.ts +8 -9
- package/lib/walk.js +25 -23
- package/package.json +9 -30
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-many-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.js.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.js.map +0 -1
- package/lib/benchmark/utils.d.ts.map +0 -1
- package/lib/benchmark/utils.js.map +0 -1
- package/lib/bundle.d.ts.map +0 -1
- package/lib/bundle.js.map +0 -1
- package/lib/config/all.d.ts.map +0 -1
- package/lib/config/all.js.map +0 -1
- package/lib/config/builtIn.d.ts.map +0 -1
- package/lib/config/builtIn.js.map +0 -1
- package/lib/config/config-resolvers.d.ts.map +0 -1
- package/lib/config/config-resolvers.js.map +0 -1
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js.map +0 -1
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/index.js.map +0 -1
- package/lib/config/load.d.ts.map +0 -1
- package/lib/config/load.js.map +0 -1
- package/lib/config/minimal.d.ts.map +0 -1
- package/lib/config/minimal.js.map +0 -1
- package/lib/config/recommended-strict.d.ts.map +0 -1
- package/lib/config/recommended-strict.js.map +0 -1
- package/lib/config/recommended.d.ts.map +0 -1
- package/lib/config/recommended.js.map +0 -1
- package/lib/config/rules.d.ts.map +0 -1
- package/lib/config/rules.js.map +0 -1
- package/lib/config/spec.d.ts.map +0 -1
- package/lib/config/spec.js.map +0 -1
- package/lib/config/types.d.ts.map +0 -1
- package/lib/config/types.js.map +0 -1
- package/lib/config/utils.d.ts.map +0 -1
- package/lib/config/utils.js.map +0 -1
- package/lib/decorators/arazzo/index.d.ts.map +0 -1
- package/lib/decorators/arazzo/index.js.map +0 -1
- package/lib/decorators/async2/index.d.ts.map +0 -1
- package/lib/decorators/async2/index.js.map +0 -1
- package/lib/decorators/async3/index.d.ts.map +0 -1
- package/lib/decorators/async3/index.js.map +0 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-helper.js.map +0 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-in.js.map +0 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-out.js.map +0 -1
- package/lib/decorators/common/info-description-override.d.ts.map +0 -1
- package/lib/decorators/common/info-description-override.js.map +0 -1
- package/lib/decorators/common/info-override.d.ts.map +0 -1
- package/lib/decorators/common/info-override.js.map +0 -1
- package/lib/decorators/common/media-type-examples-override.d.ts.map +0 -1
- package/lib/decorators/common/media-type-examples-override.js.map +0 -1
- package/lib/decorators/common/operation-description-override.d.ts.map +0 -1
- package/lib/decorators/common/operation-description-override.js.map +0 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +0 -1
- package/lib/decorators/common/remove-x-internal.js.map +0 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +0 -1
- package/lib/decorators/common/tag-description-override.js.map +0 -1
- package/lib/decorators/oas2/index.d.ts.map +0 -1
- package/lib/decorators/oas2/index.js.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.js.map +0 -1
- package/lib/decorators/oas3/index.d.ts.map +0 -1
- package/lib/decorators/oas3/index.js.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.js.map +0 -1
- package/lib/decorators/overlay1/index.d.ts.map +0 -1
- package/lib/decorators/overlay1/index.js.map +0 -1
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js.map +0 -1
- package/lib/format/codeframes.d.ts.map +0 -1
- package/lib/format/codeframes.js.map +0 -1
- package/lib/format/format.d.ts.map +0 -1
- package/lib/format/format.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/js-yaml/index.d.ts.map +0 -1
- package/lib/js-yaml/index.js.map +0 -1
- package/lib/lint.d.ts.map +0 -1
- package/lib/lint.js.map +0 -1
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js.map +0 -1
- package/lib/oas-types.d.ts.map +0 -1
- package/lib/oas-types.js.map +0 -1
- package/lib/ref-utils.d.ts.map +0 -1
- package/lib/ref-utils.js.map +0 -1
- package/lib/resolve.d.ts.map +0 -1
- package/lib/resolve.js.map +0 -1
- package/lib/rules/ajv.d.ts.map +0 -1
- package/lib/rules/ajv.js.map +0 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/criteria-unique.js.map +0 -1
- package/lib/rules/arazzo/index.d.ts.map +0 -1
- package/lib/rules/arazzo/index.js.map +0 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/parameters-unique.js.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.js.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +0 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/stepId-unique.js.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.js.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.js.map +0 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async2/channels-kebab-case.js.map +0 -1
- package/lib/rules/async2/index.d.ts.map +0 -1
- package/lib/rules/async2/index.js.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async3/channels-kebab-case.js.map +0 -1
- package/lib/rules/async3/index.d.ts.map +0 -1
- package/lib/rules/async3/index.js.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/common/assertions/asserts.d.ts.map +0 -1
- package/lib/rules/common/assertions/asserts.js.map +0 -1
- package/lib/rules/common/assertions/index.d.ts.map +0 -1
- package/lib/rules/common/assertions/index.js.map +0 -1
- package/lib/rules/common/assertions/utils.d.ts.map +0 -1
- package/lib/rules/common/assertions/utils.js.map +0 -1
- package/lib/rules/common/info-contact.d.ts.map +0 -1
- package/lib/rules/common/info-contact.js.map +0 -1
- package/lib/rules/common/info-license-strict.d.ts.map +0 -1
- package/lib/rules/common/info-license-strict.js.map +0 -1
- package/lib/rules/common/info-license-url.d.ts.map +0 -1
- package/lib/rules/common/info-license-url.js.map +0 -1
- package/lib/rules/common/info-license.d.ts.map +0 -1
- package/lib/rules/common/info-license.js.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.js.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.js.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.js.map +0 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +0 -1
- package/lib/rules/common/no-identical-paths.js.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.js.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.js.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.js.map +0 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-2xx-response.js.map +0 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-4xx-response.js.map +0 -1
- package/lib/rules/common/operation-description.d.ts.map +0 -1
- package/lib/rules/common/operation-description.js.map +0 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-unique.js.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.js.map +0 -1
- package/lib/rules/common/operation-operationId.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId.js.map +0 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-parameters-unique.js.map +0 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +0 -1
- package/lib/rules/common/operation-singular-tag.js.map +0 -1
- package/lib/rules/common/operation-summary.d.ts.map +0 -1
- package/lib/rules/common/operation-summary.js.map +0 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +0 -1
- package/lib/rules/common/operation-tag-defined.js.map +0 -1
- package/lib/rules/common/parameter-description.d.ts.map +0 -1
- package/lib/rules/common/parameter-description.js.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.js.map +0 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +0 -1
- package/lib/rules/common/path-excludes-patterns.js.map +0 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +0 -1
- package/lib/rules/common/path-http-verbs-order.js.map +0 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +0 -1
- package/lib/rules/common/path-not-include-query.js.map +0 -1
- package/lib/rules/common/path-params-defined.d.ts.map +0 -1
- package/lib/rules/common/path-params-defined.js.map +0 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +0 -1
- package/lib/rules/common/path-segment-plural.js.map +0 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +0 -1
- package/lib/rules/common/paths-kebab-case.js.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.js.map +0 -1
- package/lib/rules/common/response-contains-header.d.ts.map +0 -1
- package/lib/rules/common/response-contains-header.js.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.js.map +0 -1
- package/lib/rules/common/security-defined.d.ts.map +0 -1
- package/lib/rules/common/security-defined.js.map +0 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +0 -1
- package/lib/rules/common/spec-strict-refs.js.map +0 -1
- package/lib/rules/common/struct.d.ts.map +0 -1
- package/lib/rules/common/struct.js.map +0 -1
- package/lib/rules/common/tag-description.d.ts.map +0 -1
- package/lib/rules/common/tag-description.js.map +0 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +0 -1
- package/lib/rules/common/tags-alphabetical.js.map +0 -1
- package/lib/rules/no-unresolved-refs.d.ts.map +0 -1
- package/lib/rules/no-unresolved-refs.js.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas2/index.d.ts.map +0 -1
- package/lib/rules/oas2/index.js.map +0 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/request-mime-type.js.map +0 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas2/response-contains-property.js.map +0 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.js.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +0 -1
- package/lib/rules/oas3/component-name-unique.js.map +0 -1
- package/lib/rules/oas3/index.d.ts.map +0 -1
- package/lib/rules/oas3/index.js.map +0 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +0 -1
- package/lib/rules/oas3/no-empty-servers.js.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +0 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-example.com.js.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.js.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.js.map +0 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +0 -1
- package/lib/rules/oas3/no-unused-components.js.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +0 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/request-mime-type.js.map +0 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas3/response-contains-property.js.map +0 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +0 -1
- package/lib/rules/other/stats.d.ts.map +0 -1
- package/lib/rules/other/stats.js.map +0 -1
- package/lib/rules/overlay1/index.d.ts.map +0 -1
- package/lib/rules/overlay1/index.js.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.js.map +0 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
- package/lib/rules/respect/respect-supported-versions.js.map +0 -1
- package/lib/rules/utils.d.ts.map +0 -1
- package/lib/rules/utils.js.map +0 -1
- package/lib/types/arazzo.d.ts.map +0 -1
- package/lib/types/arazzo.js.map +0 -1
- package/lib/types/asyncapi2.d.ts.map +0 -1
- package/lib/types/asyncapi2.js.map +0 -1
- package/lib/types/asyncapi3.d.ts.map +0 -1
- package/lib/types/asyncapi3.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/json-schema-adapter.d.ts.map +0 -1
- package/lib/types/json-schema-adapter.js.map +0 -1
- package/lib/types/oas2.d.ts.map +0 -1
- package/lib/types/oas2.js.map +0 -1
- package/lib/types/oas3.d.ts.map +0 -1
- package/lib/types/oas3.js.map +0 -1
- package/lib/types/oas3_1.d.ts.map +0 -1
- package/lib/types/oas3_1.js.map +0 -1
- package/lib/types/overlay.d.ts.map +0 -1
- package/lib/types/overlay.js.map +0 -1
- package/lib/types/redocly-yaml.d.ts.map +0 -1
- package/lib/types/redocly-yaml.js.map +0 -1
- package/lib/typings/arazzo.d.ts.map +0 -1
- package/lib/typings/arazzo.js.map +0 -1
- package/lib/typings/asyncapi.d.ts.map +0 -1
- package/lib/typings/asyncapi.js.map +0 -1
- package/lib/typings/asyncapi3.d.ts.map +0 -1
- package/lib/typings/asyncapi3.js.map +0 -1
- package/lib/typings/common.d.ts.map +0 -1
- package/lib/typings/common.js.map +0 -1
- package/lib/typings/openapi.d.ts.map +0 -1
- package/lib/typings/openapi.js.map +0 -1
- package/lib/typings/overlay.d.ts.map +0 -1
- package/lib/typings/overlay.js.map +0 -1
- package/lib/typings/swagger.d.ts.map +0 -1
- package/lib/typings/swagger.js.map +0 -1
- package/lib/utils/error.d.ts +0 -3
- package/lib/utils/error.d.ts.map +0 -1
- package/lib/utils/error.js +0 -3
- package/lib/utils/error.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/visitors.d.ts.map +0 -1
- package/lib/visitors.js.map +0 -1
- package/lib/walk.d.ts.map +0 -1
- package/lib/walk.js.map +0 -1
package/lib/config/spec.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
const spec = {
|
|
2
4
|
rules: {
|
|
3
5
|
struct: 'error',
|
|
@@ -27,5 +29,4 @@ const spec = {
|
|
|
27
29
|
'info-contact': 'warn',
|
|
28
30
|
},
|
|
29
31
|
};
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=spec.js.map
|
|
32
|
+
exports.default = spec;
|
package/lib/config/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Location } from '../ref-utils
|
|
2
|
-
import type { ProblemSeverity, UserContext } from '../walk
|
|
3
|
-
import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet, Async3PreprocessorsSet, Async3DecoratorsSet, Async3RuleSet, Arazzo1RuleSet, Arazzo1PreprocessorsSet, Arazzo1DecoratorsSet, RuleMap, Overlay1PreprocessorsSet, Overlay1DecoratorsSet, Overlay1RuleSet } from '../oas-types
|
|
4
|
-
import type { NodeType } from '../types
|
|
5
|
-
import type { SkipFunctionContext } from '../visitors
|
|
1
|
+
import type { Location } from '../ref-utils';
|
|
2
|
+
import type { ProblemSeverity, UserContext } from '../walk';
|
|
3
|
+
import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet, Async3PreprocessorsSet, Async3DecoratorsSet, Async3RuleSet, Arazzo1RuleSet, Arazzo1PreprocessorsSet, Arazzo1DecoratorsSet, RuleMap, Overlay1PreprocessorsSet, Overlay1DecoratorsSet, Overlay1RuleSet } from '../oas-types';
|
|
4
|
+
import type { NodeType } from '../types';
|
|
5
|
+
import type { SkipFunctionContext } from '../visitors';
|
|
6
6
|
import type { JSONSchema } from 'json-schema-to-ts';
|
|
7
7
|
export type RuleSeverity = ProblemSeverity | 'off';
|
|
8
8
|
export type RuleSettings = {
|
|
@@ -137,7 +137,11 @@ export type HttpResolveConfig = {
|
|
|
137
137
|
export type ResolveConfig = {
|
|
138
138
|
http: HttpResolveConfig;
|
|
139
139
|
};
|
|
140
|
+
export type Region = 'us' | 'eu';
|
|
140
141
|
export type Telemetry = 'on' | 'off';
|
|
142
|
+
export type AccessTokens = {
|
|
143
|
+
[region in Region]?: string;
|
|
144
|
+
};
|
|
141
145
|
export type DeprecatedInRawConfig = {
|
|
142
146
|
apiDefinitions?: Record<string, string>;
|
|
143
147
|
lint?: StyleguideRawConfig;
|
|
@@ -155,11 +159,15 @@ export type DeprecatedInApi = {
|
|
|
155
159
|
} & DeprecatedFeaturesConfig;
|
|
156
160
|
export type ResolvedApi = Omit<Api, 'styleguide'> & {
|
|
157
161
|
styleguide: ResolvedStyleguideConfig;
|
|
162
|
+
files?: string[];
|
|
158
163
|
};
|
|
159
164
|
export type RawConfig = {
|
|
160
165
|
apis?: Record<string, Api>;
|
|
161
166
|
styleguide?: StyleguideRawConfig;
|
|
162
167
|
resolve?: RawResolveConfig;
|
|
168
|
+
region?: Region;
|
|
169
|
+
organization?: string;
|
|
170
|
+
files?: string[];
|
|
163
171
|
telemetry?: Telemetry;
|
|
164
172
|
} & ThemeConfig;
|
|
165
173
|
export type RawUniversalConfig = Omit<RawConfig, 'styleguide'> & StyleguideRawConfig;
|
|
@@ -185,4 +193,3 @@ export type ThemeRawConfig = {
|
|
|
185
193
|
};
|
|
186
194
|
export type RulesFields = 'rules' | 'oas2Rules' | 'oas3_0Rules' | 'oas3_1Rules' | 'async2Rules' | 'async3Rules' | 'arazzo1Rules' | 'overlay1Rules' | 'preprocessors' | 'oas2Preprocessors' | 'oas3_0Preprocessors' | 'oas3_1Preprocessors' | 'async2Preprocessors' | 'async3Preprocessors' | 'arazzo1Preprocessors' | 'overlay1Preprocessors' | 'decorators' | 'oas2Decorators' | 'oas3_0Decorators' | 'oas3_1Decorators' | 'async2Decorators' | 'async3Decorators' | 'arazzo1Decorators' | 'overlay1Decorators';
|
|
187
195
|
export {};
|
|
188
|
-
//# sourceMappingURL=types.d.ts.map
|
package/lib/config/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/config/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Config } from './config
|
|
2
|
-
import type { Api, DeprecatedInRawConfig, ImportedPlugin, FlatRawConfig, RawConfig, RawResolveConfig, ResolveConfig, ResolvedStyleguideConfig, RulesFields, Plugin, PluginCreator } from './types
|
|
1
|
+
import { Config } from './config';
|
|
2
|
+
import type { Api, DeprecatedInRawConfig, ImportedPlugin, FlatRawConfig, RawConfig, RawResolveConfig, ResolveConfig, ResolvedStyleguideConfig, RulesFields, Plugin, PluginCreator } from './types';
|
|
3
3
|
export declare function parsePresetName(presetName: string): {
|
|
4
4
|
pluginId: string;
|
|
5
5
|
configName: string;
|
|
@@ -17,4 +17,3 @@ export declare class ConfigValidationError extends Error {
|
|
|
17
17
|
export declare function deepCloneMapWithJSON<K, V>(originalMap: Map<K, V>): Map<K, V>;
|
|
18
18
|
export declare function isDeprecatedPluginFormat(plugin: ImportedPlugin | undefined): plugin is Plugin;
|
|
19
19
|
export declare function isCommonJsPlugin(plugin: ImportedPlugin | undefined): plugin is PluginCreator;
|
|
20
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/lib/config/utils.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigValidationError = void 0;
|
|
4
|
+
exports.parsePresetName = parsePresetName;
|
|
5
|
+
exports.transformApiDefinitionsToApis = transformApiDefinitionsToApis;
|
|
6
|
+
exports.prefixRules = prefixRules;
|
|
7
|
+
exports.mergeExtends = mergeExtends;
|
|
8
|
+
exports.getMergedConfig = getMergedConfig;
|
|
9
|
+
exports.checkForDeprecatedFields = checkForDeprecatedFields;
|
|
10
|
+
exports.transformConfig = transformConfig;
|
|
11
|
+
exports.getResolveConfig = getResolveConfig;
|
|
12
|
+
exports.getUniquePlugins = getUniquePlugins;
|
|
13
|
+
exports.deepCloneMapWithJSON = deepCloneMapWithJSON;
|
|
14
|
+
exports.isDeprecatedPluginFormat = isDeprecatedPluginFormat;
|
|
15
|
+
exports.isCommonJsPlugin = isCommonJsPlugin;
|
|
16
|
+
const utils_1 = require("../utils");
|
|
17
|
+
const config_1 = require("./config");
|
|
18
|
+
const logger_1 = require("../logger");
|
|
19
|
+
function parsePresetName(presetName) {
|
|
5
20
|
if (presetName.indexOf('/') > -1) {
|
|
6
21
|
const [pluginId, configName] = presetName.split('/');
|
|
7
22
|
return { pluginId, configName };
|
|
@@ -10,7 +25,7 @@ export function parsePresetName(presetName) {
|
|
|
10
25
|
return { pluginId: '', configName: presetName };
|
|
11
26
|
}
|
|
12
27
|
}
|
|
13
|
-
|
|
28
|
+
function transformApiDefinitionsToApis(apiDefinitions) {
|
|
14
29
|
if (!apiDefinitions)
|
|
15
30
|
return undefined;
|
|
16
31
|
const apis = {};
|
|
@@ -50,12 +65,12 @@ function extractFlatConfig({ plugins, extends: _extends, rules, oas2Rules, oas3_
|
|
|
50
65
|
doNotResolveExamples: rawConfigRest.resolve?.doNotResolveExamples,
|
|
51
66
|
};
|
|
52
67
|
if ((rawConfigRest.lint && rawConfigRest.styleguide) ||
|
|
53
|
-
(Object.values(styleguideConfig).some(isDefined) &&
|
|
68
|
+
(Object.values(styleguideConfig).some(utils_1.isDefined) &&
|
|
54
69
|
(rawConfigRest.lint || rawConfigRest.styleguide))) {
|
|
55
70
|
throw new Error(`Do not use 'lint', 'styleguide' and flat syntax together. \nSee more about the configuration in the docs: https://redocly.com/docs/cli/configuration/ \n`);
|
|
56
71
|
}
|
|
57
72
|
return {
|
|
58
|
-
styleguideConfig: Object.values(styleguideConfig).some(isDefined)
|
|
73
|
+
styleguideConfig: Object.values(styleguideConfig).some(utils_1.isDefined)
|
|
59
74
|
? styleguideConfig
|
|
60
75
|
: undefined,
|
|
61
76
|
rawConfigRest,
|
|
@@ -74,7 +89,7 @@ function transformApis(legacyApis) {
|
|
|
74
89
|
}
|
|
75
90
|
return apis;
|
|
76
91
|
}
|
|
77
|
-
|
|
92
|
+
function prefixRules(rules, prefix) {
|
|
78
93
|
if (!prefix)
|
|
79
94
|
return rules;
|
|
80
95
|
const res = {};
|
|
@@ -83,7 +98,7 @@ export function prefixRules(rules, prefix) {
|
|
|
83
98
|
}
|
|
84
99
|
return res;
|
|
85
100
|
}
|
|
86
|
-
|
|
101
|
+
function mergeExtends(rulesConfList) {
|
|
87
102
|
const result = {
|
|
88
103
|
rules: {},
|
|
89
104
|
oas2Rules: {},
|
|
@@ -117,72 +132,72 @@ export function mergeExtends(rulesConfList) {
|
|
|
117
132
|
if (rulesConf.extends) {
|
|
118
133
|
throw new Error(`'extends' is not supported in shared configs yet:\n${JSON.stringify(rulesConf, null, 2)}`);
|
|
119
134
|
}
|
|
120
|
-
assignConfig(result.rules, rulesConf.rules);
|
|
121
|
-
assignConfig(result.oas2Rules, rulesConf.oas2Rules);
|
|
122
|
-
assignOnlyExistingConfig(result.oas2Rules, rulesConf.rules);
|
|
123
|
-
assignConfig(result.oas3_0Rules, rulesConf.oas3_0Rules);
|
|
124
|
-
assignOnlyExistingConfig(result.oas3_0Rules, rulesConf.rules);
|
|
125
|
-
assignConfig(result.oas3_1Rules, rulesConf.oas3_1Rules);
|
|
126
|
-
assignOnlyExistingConfig(result.oas3_1Rules, rulesConf.rules);
|
|
127
|
-
assignConfig(result.async2Rules, rulesConf.async2Rules);
|
|
128
|
-
assignOnlyExistingConfig(result.async2Rules, rulesConf.rules);
|
|
129
|
-
assignConfig(result.async3Rules, rulesConf.async3Rules);
|
|
130
|
-
assignOnlyExistingConfig(result.async3Rules, rulesConf.rules);
|
|
131
|
-
assignConfig(result.arazzo1Rules, rulesConf.arazzo1Rules);
|
|
132
|
-
assignOnlyExistingConfig(result.arazzo1Rules, rulesConf.rules);
|
|
133
|
-
assignConfig(result.overlay1Rules, rulesConf.overlay1Rules);
|
|
134
|
-
assignOnlyExistingConfig(result.overlay1Rules, rulesConf.rules);
|
|
135
|
-
assignConfig(result.preprocessors, rulesConf.preprocessors);
|
|
136
|
-
assignConfig(result.oas2Preprocessors, rulesConf.oas2Preprocessors);
|
|
137
|
-
assignOnlyExistingConfig(result.oas2Preprocessors, rulesConf.preprocessors);
|
|
138
|
-
assignConfig(result.oas3_0Preprocessors, rulesConf.oas3_0Preprocessors);
|
|
139
|
-
assignOnlyExistingConfig(result.oas3_0Preprocessors, rulesConf.preprocessors);
|
|
140
|
-
assignConfig(result.oas3_1Preprocessors, rulesConf.oas3_1Preprocessors);
|
|
141
|
-
assignOnlyExistingConfig(result.oas3_1Preprocessors, rulesConf.preprocessors);
|
|
142
|
-
assignConfig(result.async2Preprocessors, rulesConf.async2Preprocessors);
|
|
143
|
-
assignOnlyExistingConfig(result.async2Preprocessors, rulesConf.preprocessors);
|
|
144
|
-
assignConfig(result.async3Preprocessors, rulesConf.async3Preprocessors);
|
|
145
|
-
assignOnlyExistingConfig(result.async3Preprocessors, rulesConf.preprocessors);
|
|
146
|
-
assignConfig(result.arazzo1Preprocessors, rulesConf.arazzo1Preprocessors);
|
|
147
|
-
assignOnlyExistingConfig(result.arazzo1Preprocessors, rulesConf.preprocessors);
|
|
148
|
-
assignConfig(result.overlay1Preprocessors, rulesConf.overlay1Preprocessors);
|
|
149
|
-
assignOnlyExistingConfig(result.overlay1Preprocessors, rulesConf.preprocessors);
|
|
150
|
-
assignConfig(result.decorators, rulesConf.decorators);
|
|
151
|
-
assignConfig(result.oas2Decorators, rulesConf.oas2Decorators);
|
|
152
|
-
assignOnlyExistingConfig(result.oas2Decorators, rulesConf.decorators);
|
|
153
|
-
assignConfig(result.oas3_0Decorators, rulesConf.oas3_0Decorators);
|
|
154
|
-
assignOnlyExistingConfig(result.oas3_0Decorators, rulesConf.decorators);
|
|
155
|
-
assignConfig(result.oas3_1Decorators, rulesConf.oas3_1Decorators);
|
|
156
|
-
assignOnlyExistingConfig(result.oas3_1Decorators, rulesConf.decorators);
|
|
157
|
-
assignConfig(result.async2Decorators, rulesConf.async2Decorators);
|
|
158
|
-
assignOnlyExistingConfig(result.async2Decorators, rulesConf.decorators);
|
|
159
|
-
assignConfig(result.async3Decorators, rulesConf.async3Decorators);
|
|
160
|
-
assignOnlyExistingConfig(result.async3Decorators, rulesConf.decorators);
|
|
161
|
-
assignConfig(result.arazzo1Decorators, rulesConf.arazzo1Decorators);
|
|
162
|
-
assignOnlyExistingConfig(result.arazzo1Decorators, rulesConf.decorators);
|
|
163
|
-
assignConfig(result.overlay1Decorators, rulesConf.overlay1Decorators);
|
|
164
|
-
assignOnlyExistingConfig(result.overlay1Decorators, rulesConf.decorators);
|
|
135
|
+
(0, utils_1.assignConfig)(result.rules, rulesConf.rules);
|
|
136
|
+
(0, utils_1.assignConfig)(result.oas2Rules, rulesConf.oas2Rules);
|
|
137
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas2Rules, rulesConf.rules);
|
|
138
|
+
(0, utils_1.assignConfig)(result.oas3_0Rules, rulesConf.oas3_0Rules);
|
|
139
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_0Rules, rulesConf.rules);
|
|
140
|
+
(0, utils_1.assignConfig)(result.oas3_1Rules, rulesConf.oas3_1Rules);
|
|
141
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_1Rules, rulesConf.rules);
|
|
142
|
+
(0, utils_1.assignConfig)(result.async2Rules, rulesConf.async2Rules);
|
|
143
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async2Rules, rulesConf.rules);
|
|
144
|
+
(0, utils_1.assignConfig)(result.async3Rules, rulesConf.async3Rules);
|
|
145
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async3Rules, rulesConf.rules);
|
|
146
|
+
(0, utils_1.assignConfig)(result.arazzo1Rules, rulesConf.arazzo1Rules);
|
|
147
|
+
(0, utils_1.assignOnlyExistingConfig)(result.arazzo1Rules, rulesConf.rules);
|
|
148
|
+
(0, utils_1.assignConfig)(result.overlay1Rules, rulesConf.overlay1Rules);
|
|
149
|
+
(0, utils_1.assignOnlyExistingConfig)(result.overlay1Rules, rulesConf.rules);
|
|
150
|
+
(0, utils_1.assignConfig)(result.preprocessors, rulesConf.preprocessors);
|
|
151
|
+
(0, utils_1.assignConfig)(result.oas2Preprocessors, rulesConf.oas2Preprocessors);
|
|
152
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas2Preprocessors, rulesConf.preprocessors);
|
|
153
|
+
(0, utils_1.assignConfig)(result.oas3_0Preprocessors, rulesConf.oas3_0Preprocessors);
|
|
154
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_0Preprocessors, rulesConf.preprocessors);
|
|
155
|
+
(0, utils_1.assignConfig)(result.oas3_1Preprocessors, rulesConf.oas3_1Preprocessors);
|
|
156
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_1Preprocessors, rulesConf.preprocessors);
|
|
157
|
+
(0, utils_1.assignConfig)(result.async2Preprocessors, rulesConf.async2Preprocessors);
|
|
158
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async2Preprocessors, rulesConf.preprocessors);
|
|
159
|
+
(0, utils_1.assignConfig)(result.async3Preprocessors, rulesConf.async3Preprocessors);
|
|
160
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async3Preprocessors, rulesConf.preprocessors);
|
|
161
|
+
(0, utils_1.assignConfig)(result.arazzo1Preprocessors, rulesConf.arazzo1Preprocessors);
|
|
162
|
+
(0, utils_1.assignOnlyExistingConfig)(result.arazzo1Preprocessors, rulesConf.preprocessors);
|
|
163
|
+
(0, utils_1.assignConfig)(result.overlay1Preprocessors, rulesConf.overlay1Preprocessors);
|
|
164
|
+
(0, utils_1.assignOnlyExistingConfig)(result.overlay1Preprocessors, rulesConf.preprocessors);
|
|
165
|
+
(0, utils_1.assignConfig)(result.decorators, rulesConf.decorators);
|
|
166
|
+
(0, utils_1.assignConfig)(result.oas2Decorators, rulesConf.oas2Decorators);
|
|
167
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas2Decorators, rulesConf.decorators);
|
|
168
|
+
(0, utils_1.assignConfig)(result.oas3_0Decorators, rulesConf.oas3_0Decorators);
|
|
169
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_0Decorators, rulesConf.decorators);
|
|
170
|
+
(0, utils_1.assignConfig)(result.oas3_1Decorators, rulesConf.oas3_1Decorators);
|
|
171
|
+
(0, utils_1.assignOnlyExistingConfig)(result.oas3_1Decorators, rulesConf.decorators);
|
|
172
|
+
(0, utils_1.assignConfig)(result.async2Decorators, rulesConf.async2Decorators);
|
|
173
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async2Decorators, rulesConf.decorators);
|
|
174
|
+
(0, utils_1.assignConfig)(result.async3Decorators, rulesConf.async3Decorators);
|
|
175
|
+
(0, utils_1.assignOnlyExistingConfig)(result.async3Decorators, rulesConf.decorators);
|
|
176
|
+
(0, utils_1.assignConfig)(result.arazzo1Decorators, rulesConf.arazzo1Decorators);
|
|
177
|
+
(0, utils_1.assignOnlyExistingConfig)(result.arazzo1Decorators, rulesConf.decorators);
|
|
178
|
+
(0, utils_1.assignConfig)(result.overlay1Decorators, rulesConf.overlay1Decorators);
|
|
179
|
+
(0, utils_1.assignOnlyExistingConfig)(result.overlay1Decorators, rulesConf.decorators);
|
|
165
180
|
result.plugins.push(...(rulesConf.plugins || []));
|
|
166
181
|
result.pluginPaths.push(...(rulesConf.pluginPaths || []));
|
|
167
182
|
result.extendPaths.push(...new Set(rulesConf.extendPaths));
|
|
168
183
|
}
|
|
169
184
|
return result;
|
|
170
185
|
}
|
|
171
|
-
|
|
186
|
+
function getMergedConfig(config, apiName) {
|
|
172
187
|
const extendPaths = [
|
|
173
188
|
...Object.values(config.apis).map((api) => api?.styleguide?.extendPaths),
|
|
174
189
|
config.rawConfig?.styleguide?.extendPaths,
|
|
175
190
|
]
|
|
176
191
|
.flat()
|
|
177
|
-
.filter(isTruthy);
|
|
192
|
+
.filter(utils_1.isTruthy);
|
|
178
193
|
const pluginPaths = [
|
|
179
194
|
...Object.values(config.apis).map((api) => api?.styleguide?.pluginPaths),
|
|
180
195
|
config.rawConfig?.styleguide?.pluginPaths,
|
|
181
196
|
]
|
|
182
197
|
.flat()
|
|
183
|
-
.filter(isTruthy);
|
|
198
|
+
.filter(utils_1.isTruthy);
|
|
184
199
|
return apiName
|
|
185
|
-
? new Config({
|
|
200
|
+
? new config_1.Config({
|
|
186
201
|
...config.rawConfig,
|
|
187
202
|
styleguide: {
|
|
188
203
|
...(config.apis[apiName]
|
|
@@ -191,32 +206,32 @@ export function getMergedConfig(config, apiName) {
|
|
|
191
206
|
extendPaths,
|
|
192
207
|
pluginPaths,
|
|
193
208
|
},
|
|
194
|
-
// FIXME: theme is deprecated (2.0)
|
|
195
209
|
theme: {
|
|
196
210
|
...config.rawConfig.theme,
|
|
197
211
|
...config.apis[apiName]?.theme,
|
|
198
212
|
},
|
|
213
|
+
files: [...config.files, ...(config.apis?.[apiName]?.files ?? [])],
|
|
199
214
|
// TODO: merge everything else here
|
|
200
215
|
}, config.configFile)
|
|
201
216
|
: config;
|
|
202
217
|
}
|
|
203
|
-
|
|
218
|
+
function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject, link) {
|
|
204
219
|
const isDeprecatedFieldInApis = rawConfig.apis &&
|
|
205
220
|
Object.values(rawConfig.apis).some((api) => api[deprecatedField]);
|
|
206
221
|
if (rawConfig[deprecatedField] && updatedField === null) {
|
|
207
|
-
showWarningForDeprecatedField(deprecatedField, undefined, updatedObject, link);
|
|
222
|
+
(0, utils_1.showWarningForDeprecatedField)(deprecatedField, undefined, updatedObject, link);
|
|
208
223
|
}
|
|
209
224
|
if (rawConfig[deprecatedField] && updatedField && rawConfig[updatedField]) {
|
|
210
|
-
showErrorForDeprecatedField(deprecatedField, updatedField);
|
|
225
|
+
(0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField);
|
|
211
226
|
}
|
|
212
227
|
if (rawConfig[deprecatedField] && updatedObject && rawConfig[updatedObject]) {
|
|
213
|
-
showErrorForDeprecatedField(deprecatedField, updatedField, updatedObject);
|
|
228
|
+
(0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField, updatedObject);
|
|
214
229
|
}
|
|
215
230
|
if (rawConfig[deprecatedField] || isDeprecatedFieldInApis) {
|
|
216
|
-
showWarningForDeprecatedField(deprecatedField, updatedField, updatedObject, link);
|
|
231
|
+
(0, utils_1.showWarningForDeprecatedField)(deprecatedField, updatedField, updatedObject, link);
|
|
217
232
|
}
|
|
218
233
|
}
|
|
219
|
-
|
|
234
|
+
function transformConfig(rawConfig) {
|
|
220
235
|
const migratedFields = [
|
|
221
236
|
['apiDefinitions', 'apis', undefined, undefined],
|
|
222
237
|
['referenceDocs', 'openapi', 'theme', undefined],
|
|
@@ -240,7 +255,6 @@ export function transformConfig(rawConfig) {
|
|
|
240
255
|
const { apis, apiDefinitions, referenceDocs, lint, ...rest } = rawConfig;
|
|
241
256
|
const { styleguideConfig, rawConfigRest } = extractFlatConfig(rest);
|
|
242
257
|
const transformedConfig = {
|
|
243
|
-
// FIXME: theme is deprecated (2.0)
|
|
244
258
|
theme: {
|
|
245
259
|
openapi: {
|
|
246
260
|
...referenceDocs,
|
|
@@ -266,11 +280,11 @@ function showDeprecationMessages(config) {
|
|
|
266
280
|
}
|
|
267
281
|
for (const ruleKey of Object.keys(allRules)) {
|
|
268
282
|
if (ruleKey.startsWith('assert/')) {
|
|
269
|
-
logger.warn(`\nThe 'assert/' syntax in ${ruleKey} is deprecated. Update your configuration to use 'rule/' instead. Examples and more information: https://redocly.com/docs/cli/rules/configurable-rules/\n`);
|
|
283
|
+
logger_1.logger.warn(`\nThe 'assert/' syntax in ${ruleKey} is deprecated. Update your configuration to use 'rule/' instead. Examples and more information: https://redocly.com/docs/cli/rules/configurable-rules/\n`);
|
|
270
284
|
}
|
|
271
285
|
}
|
|
272
286
|
}
|
|
273
|
-
|
|
287
|
+
function getResolveConfig(resolve) {
|
|
274
288
|
return {
|
|
275
289
|
http: {
|
|
276
290
|
headers: resolve?.http?.headers ?? [],
|
|
@@ -278,7 +292,7 @@ export function getResolveConfig(resolve) {
|
|
|
278
292
|
},
|
|
279
293
|
};
|
|
280
294
|
}
|
|
281
|
-
|
|
295
|
+
function getUniquePlugins(plugins) {
|
|
282
296
|
const seen = new Set();
|
|
283
297
|
const results = [];
|
|
284
298
|
for (const p of plugins) {
|
|
@@ -287,20 +301,20 @@ export function getUniquePlugins(plugins) {
|
|
|
287
301
|
seen.add(p.id);
|
|
288
302
|
}
|
|
289
303
|
else if (p.id) {
|
|
290
|
-
logger.warn(`Duplicate plugin id "${colorize.red(p.id)}".\n`);
|
|
304
|
+
logger_1.logger.warn(`Duplicate plugin id "${logger_1.colorize.red(p.id)}".\n`);
|
|
291
305
|
}
|
|
292
306
|
}
|
|
293
307
|
return results;
|
|
294
308
|
}
|
|
295
|
-
|
|
309
|
+
class ConfigValidationError extends Error {
|
|
296
310
|
}
|
|
297
|
-
|
|
311
|
+
exports.ConfigValidationError = ConfigValidationError;
|
|
312
|
+
function deepCloneMapWithJSON(originalMap) {
|
|
298
313
|
return new Map(JSON.parse(JSON.stringify([...originalMap])));
|
|
299
314
|
}
|
|
300
|
-
|
|
315
|
+
function isDeprecatedPluginFormat(plugin) {
|
|
301
316
|
return plugin !== undefined && typeof plugin === 'object' && 'id' in plugin;
|
|
302
317
|
}
|
|
303
|
-
|
|
318
|
+
function isCommonJsPlugin(plugin) {
|
|
304
319
|
return typeof plugin === 'function';
|
|
305
320
|
}
|
|
306
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { UserContext } from '../../../walk
|
|
1
|
+
import type { UserContext } from '../../../walk';
|
|
2
2
|
export declare function filter(node: any, ctx: UserContext, criteria: (item: any) => boolean): void;
|
|
3
3
|
export declare function checkIfMatchByStrategy(nodeValue: any, decoratorValue: any, strategy: 'all' | 'any'): boolean;
|
|
4
|
-
//# sourceMappingURL=filter-helper.d.ts.map
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filter = filter;
|
|
4
|
+
exports.checkIfMatchByStrategy = checkIfMatchByStrategy;
|
|
5
|
+
const ref_utils_1 = require("../../../ref-utils");
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
function filter(node, ctx, criteria) {
|
|
4
8
|
const { parent, key } = ctx;
|
|
5
9
|
let didDelete = false;
|
|
6
10
|
if (Array.isArray(node)) {
|
|
7
11
|
for (let i = 0; i < node.length; i++) {
|
|
8
|
-
if (isRef(node[i])) {
|
|
12
|
+
if ((0, ref_utils_1.isRef)(node[i])) {
|
|
9
13
|
const resolved = ctx.resolve(node[i]);
|
|
10
14
|
if (criteria(resolved.node)) {
|
|
11
15
|
node.splice(i, 1);
|
|
@@ -20,10 +24,10 @@ export function filter(node, ctx, criteria) {
|
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
|
-
else if (isPlainObject(node)) {
|
|
27
|
+
else if ((0, utils_1.isPlainObject)(node)) {
|
|
24
28
|
for (const key of Object.keys(node)) {
|
|
25
29
|
node = node;
|
|
26
|
-
if (isRef(node[key])) {
|
|
30
|
+
if ((0, ref_utils_1.isRef)(node[key])) {
|
|
27
31
|
const resolved = ctx.resolve(node[key]);
|
|
28
32
|
if (criteria(resolved.node)) {
|
|
29
33
|
delete node[key];
|
|
@@ -36,11 +40,11 @@ export function filter(node, ctx, criteria) {
|
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
|
-
if (didDelete && (isEmptyObject(node) || isEmptyArray(node))) {
|
|
43
|
+
if (didDelete && ((0, utils_1.isEmptyObject)(node) || (0, utils_1.isEmptyArray)(node))) {
|
|
40
44
|
delete parent[key];
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
|
|
47
|
+
function checkIfMatchByStrategy(nodeValue, decoratorValue, strategy) {
|
|
44
48
|
if (nodeValue === undefined || decoratorValue === undefined) {
|
|
45
49
|
return false;
|
|
46
50
|
}
|
|
@@ -60,4 +64,3 @@ export function checkIfMatchByStrategy(nodeValue, decoratorValue, strategy) {
|
|
|
60
64
|
function toArrayIfNeeded(value) {
|
|
61
65
|
return Array.isArray(value) ? value : [value];
|
|
62
66
|
}
|
|
63
|
-
//# sourceMappingURL=filter-helper.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterIn = void 0;
|
|
4
|
+
const filter_helper_1 = require("./filter-helper");
|
|
2
5
|
const DEFAULT_STRATEGY = 'any';
|
|
3
|
-
|
|
6
|
+
const FilterIn = ({ property, value, matchStrategy }) => {
|
|
4
7
|
const strategy = matchStrategy || DEFAULT_STRATEGY;
|
|
5
|
-
const filterInCriteria = (item) => item?.[property] && !checkIfMatchByStrategy(item?.[property], value, strategy);
|
|
8
|
+
const filterInCriteria = (item) => item?.[property] && !(0, filter_helper_1.checkIfMatchByStrategy)(item?.[property], value, strategy);
|
|
6
9
|
return {
|
|
7
10
|
any: {
|
|
8
11
|
enter: (node, ctx) => {
|
|
9
|
-
filter(node, ctx, filterInCriteria);
|
|
12
|
+
(0, filter_helper_1.filter)(node, ctx, filterInCriteria);
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.FilterIn = FilterIn;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterOut = void 0;
|
|
4
|
+
const filter_helper_1 = require("./filter-helper");
|
|
2
5
|
const DEFAULT_STRATEGY = 'any';
|
|
3
|
-
|
|
6
|
+
const FilterOut = ({ property, value, matchStrategy }) => {
|
|
4
7
|
const strategy = matchStrategy || DEFAULT_STRATEGY;
|
|
5
|
-
const filterOutCriteria = (item) => checkIfMatchByStrategy(item?.[property], value, strategy);
|
|
8
|
+
const filterOutCriteria = (item) => (0, filter_helper_1.checkIfMatchByStrategy)(item?.[property], value, strategy);
|
|
6
9
|
return {
|
|
7
10
|
any: {
|
|
8
11
|
enter: (node, ctx) => {
|
|
9
|
-
filter(node, ctx, filterOutCriteria);
|
|
12
|
+
(0, filter_helper_1.filter)(node, ctx, filterOutCriteria);
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.FilterOut = FilterOut;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { Oas3Decorator, Oas2Decorator } from '../../visitors
|
|
1
|
+
import type { Oas3Decorator, Oas2Decorator } from '../../visitors';
|
|
2
2
|
export declare const InfoDescriptionOverride: Oas3Decorator | Oas2Decorator;
|
|
3
|
-
//# sourceMappingURL=info-description-override.d.ts.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InfoDescriptionOverride = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const InfoDescriptionOverride = ({ filePath }) => {
|
|
3
6
|
return {
|
|
4
7
|
Info: {
|
|
5
8
|
leave(info, { report, location }) {
|
|
6
9
|
if (!filePath)
|
|
7
10
|
throw new Error(`Parameter "filePath" is not provided for "info-description-override" rule`);
|
|
8
11
|
try {
|
|
9
|
-
info.description = readFileAsStringSync(filePath);
|
|
12
|
+
info.description = (0, utils_1.readFileAsStringSync)(filePath);
|
|
10
13
|
}
|
|
11
14
|
catch (e) {
|
|
12
15
|
report({
|
|
@@ -18,4 +21,4 @@ export const InfoDescriptionOverride = ({ filePath }) => {
|
|
|
18
21
|
},
|
|
19
22
|
};
|
|
20
23
|
};
|
|
21
|
-
|
|
24
|
+
exports.InfoDescriptionOverride = InfoDescriptionOverride;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InfoOverride = void 0;
|
|
4
|
+
const InfoOverride = (newInfo) => {
|
|
2
5
|
return {
|
|
3
6
|
Info: {
|
|
4
7
|
leave(info) {
|
|
@@ -11,4 +14,4 @@ export const InfoOverride = (newInfo) => {
|
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.InfoOverride = InfoOverride;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaTypeExamplesOverride = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const ref_utils_1 = require("../../ref-utils");
|
|
6
|
+
const MediaTypeExamplesOverride = ({ operationIds }) => {
|
|
4
7
|
return {
|
|
5
8
|
Operation: {
|
|
6
9
|
enter(operation, ctx) {
|
|
@@ -22,7 +25,7 @@ export const MediaTypeExamplesOverride = ({ operationIds }) => {
|
|
|
22
25
|
Object.keys(properties.responses[responseCode]).forEach((mimeType) => {
|
|
23
26
|
resolvedResponse.content[mimeType] = {
|
|
24
27
|
...resolvedResponse.content[mimeType],
|
|
25
|
-
examples: yamlAndJsonSyncReader(properties.responses[responseCode][mimeType]),
|
|
28
|
+
examples: (0, utils_1.yamlAndJsonSyncReader)(properties.responses[responseCode][mimeType]),
|
|
26
29
|
};
|
|
27
30
|
});
|
|
28
31
|
operation.responses[responseCode] = resolvedResponse;
|
|
@@ -37,7 +40,7 @@ export const MediaTypeExamplesOverride = ({ operationIds }) => {
|
|
|
37
40
|
Object.keys(properties.request).forEach((mimeType) => {
|
|
38
41
|
resolvedRequest.content[mimeType] = {
|
|
39
42
|
...resolvedRequest.content[mimeType],
|
|
40
|
-
examples: yamlAndJsonSyncReader(properties.request[mimeType]),
|
|
43
|
+
examples: (0, utils_1.yamlAndJsonSyncReader)(properties.request[mimeType]),
|
|
41
44
|
};
|
|
42
45
|
});
|
|
43
46
|
operation.requestBody = resolvedRequest;
|
|
@@ -46,11 +49,11 @@ export const MediaTypeExamplesOverride = ({ operationIds }) => {
|
|
|
46
49
|
},
|
|
47
50
|
};
|
|
48
51
|
};
|
|
52
|
+
exports.MediaTypeExamplesOverride = MediaTypeExamplesOverride;
|
|
49
53
|
function checkAndResolveRef(node, resolver) {
|
|
50
|
-
if (!isRef(node)) {
|
|
54
|
+
if (!(0, ref_utils_1.isRef)(node)) {
|
|
51
55
|
return node;
|
|
52
56
|
}
|
|
53
57
|
const resolved = resolver(node);
|
|
54
58
|
return resolved.error ? undefined : JSON.parse(JSON.stringify(resolved.node));
|
|
55
59
|
}
|
|
56
|
-
//# sourceMappingURL=media-type-examples-override.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { Oas3Decorator, Oas2Decorator } from '../../visitors
|
|
1
|
+
import type { Oas3Decorator, Oas2Decorator } from '../../visitors';
|
|
2
2
|
export declare const OperationDescriptionOverride: Oas3Decorator | Oas2Decorator;
|
|
3
|
-
//# sourceMappingURL=operation-description-override.d.ts.map
|