@redocly/openapi-core 0.0.0-snapshot.1744188073 → 0.0.0-snapshot.1744801622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +19 -17
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +19 -15
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +1 -2
- package/lib/benchmark/benches/recommended-oas3.bench.js +18 -15
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +1 -2
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +17 -14
- package/lib/benchmark/utils.d.ts +4 -5
- package/lib/benchmark/utils.js +14 -11
- package/lib/bundle.d.ts +9 -8
- package/lib/bundle.js +84 -72
- package/lib/config/all.d.ts +1 -2
- package/lib/config/all.js +3 -2
- package/lib/config/builtIn.d.ts +1 -2
- package/lib/config/builtIn.js +49 -44
- package/lib/config/config-resolvers.d.ts +5 -6
- package/lib/config/config-resolvers.js +94 -85
- package/lib/config/config.d.ts +8 -6
- package/lib/config/config.js +73 -66
- package/lib/config/index.d.ts +7 -8
- package/lib/config/index.js +23 -8
- package/lib/config/load.d.ts +8 -5
- package/lib/config/load.js +73 -28
- package/lib/config/minimal.d.ts +1 -2
- package/lib/config/minimal.js +3 -2
- package/lib/config/recommended-strict.d.ts +1 -2
- package/lib/config/recommended-strict.js +3 -2
- package/lib/config/recommended.d.ts +1 -2
- package/lib/config/recommended.js +3 -2
- package/lib/config/rules.d.ts +3 -4
- package/lib/config/rules.js +6 -4
- package/lib/config/spec.d.ts +1 -2
- package/lib/config/spec.js +3 -2
- package/lib/config/types.d.ts +13 -6
- package/lib/config/types.js +2 -2
- package/lib/config/utils.d.ts +2 -3
- package/lib/config/utils.js +89 -75
- package/lib/decorators/arazzo/index.d.ts +0 -1
- package/lib/decorators/arazzo/index.js +4 -2
- package/lib/decorators/async2/index.d.ts +0 -1
- package/lib/decorators/async2/index.js +4 -2
- package/lib/decorators/async3/index.d.ts +0 -1
- package/lib/decorators/async3/index.js +4 -2
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -2
- package/lib/decorators/common/filters/filter-helper.js +12 -9
- package/lib/decorators/common/filters/filter-in.d.ts +1 -2
- package/lib/decorators/common/filters/filter-in.js +8 -5
- package/lib/decorators/common/filters/filter-out.d.ts +1 -2
- package/lib/decorators/common/filters/filter-out.js +8 -5
- package/lib/decorators/common/info-description-override.d.ts +1 -2
- package/lib/decorators/common/info-description-override.js +7 -4
- package/lib/decorators/common/info-override.d.ts +1 -2
- package/lib/decorators/common/info-override.js +5 -2
- package/lib/decorators/common/media-type-examples-override.d.ts +1 -2
- package/lib/decorators/common/media-type-examples-override.js +10 -7
- package/lib/decorators/common/operation-description-override.d.ts +1 -2
- package/lib/decorators/common/operation-description-override.js +7 -4
- package/lib/decorators/common/registry-dependencies.d.ts +2 -0
- package/lib/decorators/common/registry-dependencies.js +24 -0
- package/lib/decorators/common/remove-x-internal.d.ts +1 -2
- package/lib/decorators/common/remove-x-internal.js +14 -11
- package/lib/decorators/common/tag-description-override.d.ts +1 -2
- package/lib/decorators/common/tag-description-override.js +7 -4
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.js +20 -16
- package/lib/decorators/oas2/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas2/remove-unused-components.js +7 -4
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.js +22 -18
- package/lib/decorators/oas3/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas3/remove-unused-components.js +8 -5
- package/lib/decorators/overlay1/index.d.ts +0 -1
- package/lib/decorators/overlay1/index.js +4 -2
- package/lib/env.d.ts +0 -1
- package/lib/env.js +5 -3
- package/lib/format/codeframes.d.ts +1 -2
- package/lib/format/codeframes.js +19 -15
- package/lib/format/format.d.ts +1 -2
- package/lib/format/format.js +62 -57
- package/lib/index.d.ts +26 -29
- package/lib/index.js +98 -24
- package/lib/js-yaml/index.d.ts +0 -1
- package/lib/js-yaml/index.js +11 -7
- package/lib/lint.d.ts +10 -11
- package/lib/lint.js +44 -39
- package/lib/logger.d.ts +1 -2
- package/lib/logger.js +17 -15
- package/lib/oas-types.d.ts +3 -4
- package/lib/oas-types.js +32 -27
- package/lib/output.d.ts +3 -0
- package/lib/output.js +9 -0
- package/lib/redocly/domains.d.ts +14 -0
- package/lib/redocly/domains.js +41 -0
- package/lib/redocly/index.d.ts +30 -0
- package/lib/redocly/index.js +131 -0
- package/lib/redocly/redocly-client-types.d.ts +8 -0
- package/lib/redocly/redocly-client-types.js +2 -0
- package/lib/redocly/registry-api-types.d.ts +29 -0
- package/lib/redocly/registry-api-types.js +2 -0
- package/lib/redocly/registry-api.d.ts +17 -0
- package/lib/redocly/registry-api.js +100 -0
- package/lib/ref-utils.d.ts +2 -3
- package/lib/ref-utils.js +33 -18
- package/lib/resolve.d.ts +2 -3
- package/lib/resolve.js +45 -36
- package/lib/rules/ajv.d.ts +3 -4
- package/lib/rules/ajv.js +10 -7
- package/lib/rules/arazzo/criteria-unique.d.ts +1 -2
- package/lib/rules/arazzo/criteria-unique.js +5 -2
- package/lib/rules/arazzo/index.d.ts +1 -2
- package/lib/rules/arazzo/index.js +35 -33
- package/lib/rules/arazzo/parameters-unique.d.ts +1 -2
- package/lib/rules/arazzo/parameters-unique.js +5 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +1 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescription-type.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +5 -2
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onFailure-unique.js +5 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onSuccess-unique.js +5 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +1 -2
- package/lib/rules/arazzo/stepId-unique.js +5 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +1 -2
- package/lib/rules/arazzo/workflow-dependsOn.js +5 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +1 -2
- package/lib/rules/arazzo/workflowId-unique.js +5 -2
- package/lib/rules/async2/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async2/channels-kebab-case.js +5 -2
- package/lib/rules/async2/index.d.ts +1 -2
- package/lib/rules/async2/index.js +24 -22
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async2/no-channel-trailing-slash.js +5 -2
- package/lib/rules/async3/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async3/channels-kebab-case.js +5 -2
- package/lib/rules/async3/index.d.ts +1 -2
- package/lib/rules/async3/index.js +24 -22
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async3/no-channel-trailing-slash.js +6 -3
- package/lib/rules/common/assertions/asserts.d.ts +2 -3
- package/lib/rules/common/assertions/asserts.js +38 -35
- package/lib/rules/common/assertions/index.d.ts +3 -4
- package/lib/rules/common/assertions/index.js +10 -7
- package/lib/rules/common/assertions/utils.d.ts +4 -5
- package/lib/rules/common/assertions/utils.js +29 -21
- package/lib/rules/common/info-contact.d.ts +1 -2
- package/lib/rules/common/info-contact.js +7 -4
- package/lib/rules/common/info-license-strict.d.ts +1 -2
- package/lib/rules/common/info-license-strict.js +10 -7
- package/lib/rules/common/info-license-url.d.ts +1 -2
- package/lib/rules/common/info-license-url.js +7 -4
- package/lib/rules/common/info-license.d.ts +1 -2
- package/lib/rules/common/info-license.js +7 -4
- package/lib/rules/common/no-ambiguous-paths.d.ts +1 -2
- package/lib/rules/common/no-ambiguous-paths.js +5 -2
- package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-enum-type-mismatch.js +9 -6
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -2
- package/lib/rules/common/no-http-verbs-in-paths.js +8 -5
- package/lib/rules/common/no-identical-paths.d.ts +1 -2
- package/lib/rules/common/no-identical-paths.js +5 -2
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js +9 -6
- package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -2
- package/lib/rules/common/no-invalid-schema-examples.js +9 -6
- package/lib/rules/common/no-path-trailing-slash.d.ts +1 -2
- package/lib/rules/common/no-path-trailing-slash.js +5 -2
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -2
- package/lib/rules/common/no-required-schema-properties-undefined.js +7 -4
- package/lib/rules/common/no-schema-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-schema-type-mismatch.js +5 -2
- package/lib/rules/common/operation-2xx-response.d.ts +1 -2
- package/lib/rules/common/operation-2xx-response.js +8 -5
- package/lib/rules/common/operation-4xx-response.d.ts +1 -2
- package/lib/rules/common/operation-4xx-response.js +8 -5
- package/lib/rules/common/operation-description.d.ts +1 -2
- package/lib/rules/common/operation-description.js +7 -4
- package/lib/rules/common/operation-operationId-unique.d.ts +1 -2
- package/lib/rules/common/operation-operationId-unique.js +5 -2
- package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -2
- package/lib/rules/common/operation-operationId-url-safe.js +5 -2
- package/lib/rules/common/operation-operationId.d.ts +1 -2
- package/lib/rules/common/operation-operationId.js +7 -4
- package/lib/rules/common/operation-parameters-unique.d.ts +1 -2
- package/lib/rules/common/operation-parameters-unique.js +5 -2
- package/lib/rules/common/operation-singular-tag.d.ts +1 -2
- package/lib/rules/common/operation-singular-tag.js +5 -2
- package/lib/rules/common/operation-summary.d.ts +1 -2
- package/lib/rules/common/operation-summary.js +7 -4
- package/lib/rules/common/operation-tag-defined.d.ts +1 -2
- package/lib/rules/common/operation-tag-defined.js +5 -2
- package/lib/rules/common/parameter-description.d.ts +1 -2
- package/lib/rules/common/parameter-description.js +5 -2
- package/lib/rules/common/path-declaration-must-exist.d.ts +1 -2
- package/lib/rules/common/path-declaration-must-exist.js +5 -2
- package/lib/rules/common/path-excludes-patterns.d.ts +1 -2
- package/lib/rules/common/path-excludes-patterns.js +5 -2
- package/lib/rules/common/path-http-verbs-order.d.ts +1 -2
- package/lib/rules/common/path-http-verbs-order.js +5 -2
- package/lib/rules/common/path-not-include-query.d.ts +1 -2
- package/lib/rules/common/path-not-include-query.js +5 -2
- package/lib/rules/common/path-params-defined.d.ts +1 -2
- package/lib/rules/common/path-params-defined.js +5 -2
- package/lib/rules/common/path-segment-plural.d.ts +1 -2
- package/lib/rules/common/path-segment-plural.js +8 -5
- package/lib/rules/common/paths-kebab-case.d.ts +1 -2
- package/lib/rules/common/paths-kebab-case.js +5 -2
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -2
- package/lib/rules/common/required-string-property-missing-min-length.js +5 -2
- package/lib/rules/common/response-contains-header.d.ts +1 -2
- package/lib/rules/common/response-contains-header.js +8 -5
- package/lib/rules/common/scalar-property-missing-example.d.ts +1 -2
- package/lib/rules/common/scalar-property-missing-example.js +7 -4
- package/lib/rules/common/security-defined.d.ts +1 -2
- package/lib/rules/common/security-defined.js +5 -2
- package/lib/rules/common/spec-strict-refs.d.ts +1 -2
- package/lib/rules/common/spec-strict-refs.js +7 -4
- package/lib/rules/common/struct.d.ts +1 -2
- package/lib/rules/common/struct.js +21 -18
- package/lib/rules/common/tag-description.d.ts +1 -2
- package/lib/rules/common/tag-description.js +7 -4
- package/lib/rules/common/tags-alphabetical.d.ts +1 -2
- package/lib/rules/common/tags-alphabetical.js +5 -2
- package/lib/rules/no-unresolved-refs.d.ts +3 -4
- package/lib/rules/no-unresolved-refs.js +9 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas2/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas2/index.d.ts +1 -2
- package/lib/rules/oas2/index.js +97 -95
- package/lib/rules/oas2/request-mime-type.d.ts +1 -2
- package/lib/rules/oas2/request-mime-type.js +8 -5
- package/lib/rules/oas2/response-contains-property.d.ts +1 -2
- package/lib/rules/oas2/response-contains-property.js +8 -5
- package/lib/rules/oas2/response-mime-type.d.ts +1 -2
- package/lib/rules/oas2/response-mime-type.js +8 -5
- package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -2
- package/lib/rules/oas3/array-parameter-serialization.js +7 -4
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas3/component-name-unique.d.ts +1 -2
- package/lib/rules/oas3/component-name-unique.js +5 -2
- package/lib/rules/oas3/index.d.ts +1 -2
- package/lib/rules/oas3/index.js +121 -119
- package/lib/rules/oas3/no-empty-servers.d.ts +1 -2
- package/lib/rules/oas3/no-empty-servers.js +5 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.js +5 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.js +10 -7
- package/lib/rules/oas3/no-server-example.com.d.ts +1 -2
- package/lib/rules/oas3/no-server-example.com.js +5 -2
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -2
- package/lib/rules/oas3/no-server-trailing-slash.js +5 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.js +5 -2
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -2
- package/lib/rules/oas3/no-undefined-server-variable.js +5 -2
- package/lib/rules/oas3/no-unused-components.d.ts +1 -2
- package/lib/rules/oas3/no-unused-components.js +5 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +1 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +9 -6
- package/lib/rules/oas3/request-mime-type.d.ts +1 -2
- package/lib/rules/oas3/request-mime-type.js +9 -6
- package/lib/rules/oas3/response-contains-property.d.ts +1 -2
- package/lib/rules/oas3/response-contains-property.js +8 -5
- package/lib/rules/oas3/response-mime-type.d.ts +1 -2
- package/lib/rules/oas3/response-mime-type.js +9 -6
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -2
- package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -2
- package/lib/rules/other/stats.d.ts +3 -4
- package/lib/rules/other/stats.js +5 -2
- package/lib/rules/overlay1/index.d.ts +1 -2
- package/lib/rules/overlay1/index.js +11 -9
- package/lib/rules/respect/no-criteria-xpath.d.ts +1 -2
- package/lib/rules/respect/no-criteria-xpath.js +5 -2
- package/lib/rules/respect/respect-supported-versions.d.ts +1 -2
- package/lib/rules/respect/respect-supported-versions.js +10 -7
- package/lib/rules/utils.d.ts +3 -4
- package/lib/rules/utils.js +36 -23
- package/lib/types/arazzo.d.ts +1 -2
- package/lib/types/arazzo.js +23 -21
- package/lib/types/asyncapi2.d.ts +1 -2
- package/lib/types/asyncapi2.js +56 -54
- package/lib/types/asyncapi3.d.ts +1 -2
- package/lib/types/asyncapi3.js +43 -41
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +13 -7
- package/lib/types/json-schema-adapter.d.ts +1 -2
- package/lib/types/json-schema-adapter.js +17 -15
- package/lib/types/oas2.d.ts +2 -3
- package/lib/types/oas2.js +19 -17
- package/lib/types/oas3.d.ts +2 -3
- package/lib/types/oas3.js +41 -39
- package/lib/types/oas3_1.d.ts +2 -3
- package/lib/types/oas3_1.js +20 -18
- package/lib/types/overlay.d.ts +1 -2
- package/lib/types/overlay.js +6 -4
- package/lib/types/redocly-yaml.d.ts +3 -4
- package/lib/types/redocly-yaml.js +48 -31
- package/lib/typings/arazzo.d.ts +0 -1
- package/lib/typings/arazzo.js +5 -3
- package/lib/typings/asyncapi.d.ts +0 -1
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi3.d.ts +0 -1
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/common.d.ts +0 -1
- package/lib/typings/common.js +2 -2
- package/lib/typings/openapi.d.ts +0 -1
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/overlay.d.ts +0 -1
- package/lib/typings/overlay.js +4 -2
- package/lib/typings/swagger.d.ts +1 -2
- package/lib/typings/swagger.js +2 -2
- package/lib/utils.d.ts +5 -4
- package/lib/utils.js +99 -53
- package/lib/visitors.d.ts +10 -11
- package/lib/visitors.js +6 -4
- package/lib/walk.d.ts +8 -9
- package/lib/walk.js +25 -23
- package/package.json +9 -30
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-many-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.js.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.js.map +0 -1
- package/lib/benchmark/utils.d.ts.map +0 -1
- package/lib/benchmark/utils.js.map +0 -1
- package/lib/bundle.d.ts.map +0 -1
- package/lib/bundle.js.map +0 -1
- package/lib/config/all.d.ts.map +0 -1
- package/lib/config/all.js.map +0 -1
- package/lib/config/builtIn.d.ts.map +0 -1
- package/lib/config/builtIn.js.map +0 -1
- package/lib/config/config-resolvers.d.ts.map +0 -1
- package/lib/config/config-resolvers.js.map +0 -1
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js.map +0 -1
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/index.js.map +0 -1
- package/lib/config/load.d.ts.map +0 -1
- package/lib/config/load.js.map +0 -1
- package/lib/config/minimal.d.ts.map +0 -1
- package/lib/config/minimal.js.map +0 -1
- package/lib/config/recommended-strict.d.ts.map +0 -1
- package/lib/config/recommended-strict.js.map +0 -1
- package/lib/config/recommended.d.ts.map +0 -1
- package/lib/config/recommended.js.map +0 -1
- package/lib/config/rules.d.ts.map +0 -1
- package/lib/config/rules.js.map +0 -1
- package/lib/config/spec.d.ts.map +0 -1
- package/lib/config/spec.js.map +0 -1
- package/lib/config/types.d.ts.map +0 -1
- package/lib/config/types.js.map +0 -1
- package/lib/config/utils.d.ts.map +0 -1
- package/lib/config/utils.js.map +0 -1
- package/lib/decorators/arazzo/index.d.ts.map +0 -1
- package/lib/decorators/arazzo/index.js.map +0 -1
- package/lib/decorators/async2/index.d.ts.map +0 -1
- package/lib/decorators/async2/index.js.map +0 -1
- package/lib/decorators/async3/index.d.ts.map +0 -1
- package/lib/decorators/async3/index.js.map +0 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-helper.js.map +0 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-in.js.map +0 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-out.js.map +0 -1
- package/lib/decorators/common/info-description-override.d.ts.map +0 -1
- package/lib/decorators/common/info-description-override.js.map +0 -1
- package/lib/decorators/common/info-override.d.ts.map +0 -1
- package/lib/decorators/common/info-override.js.map +0 -1
- package/lib/decorators/common/media-type-examples-override.d.ts.map +0 -1
- package/lib/decorators/common/media-type-examples-override.js.map +0 -1
- package/lib/decorators/common/operation-description-override.d.ts.map +0 -1
- package/lib/decorators/common/operation-description-override.js.map +0 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +0 -1
- package/lib/decorators/common/remove-x-internal.js.map +0 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +0 -1
- package/lib/decorators/common/tag-description-override.js.map +0 -1
- package/lib/decorators/oas2/index.d.ts.map +0 -1
- package/lib/decorators/oas2/index.js.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.js.map +0 -1
- package/lib/decorators/oas3/index.d.ts.map +0 -1
- package/lib/decorators/oas3/index.js.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.js.map +0 -1
- package/lib/decorators/overlay1/index.d.ts.map +0 -1
- package/lib/decorators/overlay1/index.js.map +0 -1
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js.map +0 -1
- package/lib/format/codeframes.d.ts.map +0 -1
- package/lib/format/codeframes.js.map +0 -1
- package/lib/format/format.d.ts.map +0 -1
- package/lib/format/format.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/js-yaml/index.d.ts.map +0 -1
- package/lib/js-yaml/index.js.map +0 -1
- package/lib/lint.d.ts.map +0 -1
- package/lib/lint.js.map +0 -1
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js.map +0 -1
- package/lib/oas-types.d.ts.map +0 -1
- package/lib/oas-types.js.map +0 -1
- package/lib/ref-utils.d.ts.map +0 -1
- package/lib/ref-utils.js.map +0 -1
- package/lib/resolve.d.ts.map +0 -1
- package/lib/resolve.js.map +0 -1
- package/lib/rules/ajv.d.ts.map +0 -1
- package/lib/rules/ajv.js.map +0 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/criteria-unique.js.map +0 -1
- package/lib/rules/arazzo/index.d.ts.map +0 -1
- package/lib/rules/arazzo/index.js.map +0 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/parameters-unique.js.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.js.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +0 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/stepId-unique.js.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.js.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.js.map +0 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async2/channels-kebab-case.js.map +0 -1
- package/lib/rules/async2/index.d.ts.map +0 -1
- package/lib/rules/async2/index.js.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async3/channels-kebab-case.js.map +0 -1
- package/lib/rules/async3/index.d.ts.map +0 -1
- package/lib/rules/async3/index.js.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/common/assertions/asserts.d.ts.map +0 -1
- package/lib/rules/common/assertions/asserts.js.map +0 -1
- package/lib/rules/common/assertions/index.d.ts.map +0 -1
- package/lib/rules/common/assertions/index.js.map +0 -1
- package/lib/rules/common/assertions/utils.d.ts.map +0 -1
- package/lib/rules/common/assertions/utils.js.map +0 -1
- package/lib/rules/common/info-contact.d.ts.map +0 -1
- package/lib/rules/common/info-contact.js.map +0 -1
- package/lib/rules/common/info-license-strict.d.ts.map +0 -1
- package/lib/rules/common/info-license-strict.js.map +0 -1
- package/lib/rules/common/info-license-url.d.ts.map +0 -1
- package/lib/rules/common/info-license-url.js.map +0 -1
- package/lib/rules/common/info-license.d.ts.map +0 -1
- package/lib/rules/common/info-license.js.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.js.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.js.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.js.map +0 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +0 -1
- package/lib/rules/common/no-identical-paths.js.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.js.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.js.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.js.map +0 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-2xx-response.js.map +0 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-4xx-response.js.map +0 -1
- package/lib/rules/common/operation-description.d.ts.map +0 -1
- package/lib/rules/common/operation-description.js.map +0 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-unique.js.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.js.map +0 -1
- package/lib/rules/common/operation-operationId.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId.js.map +0 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-parameters-unique.js.map +0 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +0 -1
- package/lib/rules/common/operation-singular-tag.js.map +0 -1
- package/lib/rules/common/operation-summary.d.ts.map +0 -1
- package/lib/rules/common/operation-summary.js.map +0 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +0 -1
- package/lib/rules/common/operation-tag-defined.js.map +0 -1
- package/lib/rules/common/parameter-description.d.ts.map +0 -1
- package/lib/rules/common/parameter-description.js.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.js.map +0 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +0 -1
- package/lib/rules/common/path-excludes-patterns.js.map +0 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +0 -1
- package/lib/rules/common/path-http-verbs-order.js.map +0 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +0 -1
- package/lib/rules/common/path-not-include-query.js.map +0 -1
- package/lib/rules/common/path-params-defined.d.ts.map +0 -1
- package/lib/rules/common/path-params-defined.js.map +0 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +0 -1
- package/lib/rules/common/path-segment-plural.js.map +0 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +0 -1
- package/lib/rules/common/paths-kebab-case.js.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.js.map +0 -1
- package/lib/rules/common/response-contains-header.d.ts.map +0 -1
- package/lib/rules/common/response-contains-header.js.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.js.map +0 -1
- package/lib/rules/common/security-defined.d.ts.map +0 -1
- package/lib/rules/common/security-defined.js.map +0 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +0 -1
- package/lib/rules/common/spec-strict-refs.js.map +0 -1
- package/lib/rules/common/struct.d.ts.map +0 -1
- package/lib/rules/common/struct.js.map +0 -1
- package/lib/rules/common/tag-description.d.ts.map +0 -1
- package/lib/rules/common/tag-description.js.map +0 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +0 -1
- package/lib/rules/common/tags-alphabetical.js.map +0 -1
- package/lib/rules/no-unresolved-refs.d.ts.map +0 -1
- package/lib/rules/no-unresolved-refs.js.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas2/index.d.ts.map +0 -1
- package/lib/rules/oas2/index.js.map +0 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/request-mime-type.js.map +0 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas2/response-contains-property.js.map +0 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.js.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +0 -1
- package/lib/rules/oas3/component-name-unique.js.map +0 -1
- package/lib/rules/oas3/index.d.ts.map +0 -1
- package/lib/rules/oas3/index.js.map +0 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +0 -1
- package/lib/rules/oas3/no-empty-servers.js.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +0 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-example.com.js.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.js.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.js.map +0 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +0 -1
- package/lib/rules/oas3/no-unused-components.js.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +0 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/request-mime-type.js.map +0 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas3/response-contains-property.js.map +0 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +0 -1
- package/lib/rules/other/stats.d.ts.map +0 -1
- package/lib/rules/other/stats.js.map +0 -1
- package/lib/rules/overlay1/index.d.ts.map +0 -1
- package/lib/rules/overlay1/index.js.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.js.map +0 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
- package/lib/rules/respect/respect-supported-versions.js.map +0 -1
- package/lib/rules/utils.d.ts.map +0 -1
- package/lib/rules/utils.js.map +0 -1
- package/lib/types/arazzo.d.ts.map +0 -1
- package/lib/types/arazzo.js.map +0 -1
- package/lib/types/asyncapi2.d.ts.map +0 -1
- package/lib/types/asyncapi2.js.map +0 -1
- package/lib/types/asyncapi3.d.ts.map +0 -1
- package/lib/types/asyncapi3.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/json-schema-adapter.d.ts.map +0 -1
- package/lib/types/json-schema-adapter.js.map +0 -1
- package/lib/types/oas2.d.ts.map +0 -1
- package/lib/types/oas2.js.map +0 -1
- package/lib/types/oas3.d.ts.map +0 -1
- package/lib/types/oas3.js.map +0 -1
- package/lib/types/oas3_1.d.ts.map +0 -1
- package/lib/types/oas3_1.js.map +0 -1
- package/lib/types/overlay.d.ts.map +0 -1
- package/lib/types/overlay.js.map +0 -1
- package/lib/types/redocly-yaml.d.ts.map +0 -1
- package/lib/types/redocly-yaml.js.map +0 -1
- package/lib/typings/arazzo.d.ts.map +0 -1
- package/lib/typings/arazzo.js.map +0 -1
- package/lib/typings/asyncapi.d.ts.map +0 -1
- package/lib/typings/asyncapi.js.map +0 -1
- package/lib/typings/asyncapi3.d.ts.map +0 -1
- package/lib/typings/asyncapi3.js.map +0 -1
- package/lib/typings/common.d.ts.map +0 -1
- package/lib/typings/common.js.map +0 -1
- package/lib/typings/openapi.d.ts.map +0 -1
- package/lib/typings/openapi.js.map +0 -1
- package/lib/typings/overlay.d.ts.map +0 -1
- package/lib/typings/overlay.js.map +0 -1
- package/lib/typings/swagger.d.ts.map +0 -1
- package/lib/typings/swagger.js.map +0 -1
- package/lib/utils/error.d.ts +0 -3
- package/lib/utils/error.d.ts.map +0 -1
- package/lib/utils/error.js +0 -3
- package/lib/utils/error.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/visitors.d.ts.map +0 -1
- package/lib/visitors.js.map +0 -1
- package/lib/walk.d.ts.map +0 -1
- package/lib/walk.js.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegistryApi = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const domains_1 = require("./domains");
|
|
6
|
+
const version = require('../../package.json').version;
|
|
7
|
+
class RegistryApi {
|
|
8
|
+
constructor(accessTokens, region) {
|
|
9
|
+
this.accessTokens = accessTokens;
|
|
10
|
+
this.region = region;
|
|
11
|
+
}
|
|
12
|
+
get accessToken() {
|
|
13
|
+
return (0, utils_1.isNotEmptyObject)(this.accessTokens) && this.accessTokens[this.region];
|
|
14
|
+
}
|
|
15
|
+
getBaseUrl() {
|
|
16
|
+
return `https://api.${(0, domains_1.getRedoclyDomain)()}/registry`;
|
|
17
|
+
}
|
|
18
|
+
setAccessTokens(accessTokens) {
|
|
19
|
+
this.accessTokens = accessTokens;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
async request(path = '', options = {}) {
|
|
23
|
+
const currentCommand = typeof process !== 'undefined' ? process.env?.REDOCLY_CLI_COMMAND || '' : '';
|
|
24
|
+
const redoclyEnv = typeof process !== 'undefined' ? process.env?.REDOCLY_ENVIRONMENT || '' : '';
|
|
25
|
+
const headers = Object.assign({}, options.headers || {}, {
|
|
26
|
+
'x-redocly-cli-version': version,
|
|
27
|
+
'user-agent': `redocly-cli / ${version} ${currentCommand} ${redoclyEnv}`,
|
|
28
|
+
});
|
|
29
|
+
if (!headers.hasOwnProperty('authorization')) {
|
|
30
|
+
throw new Error('Unauthorized');
|
|
31
|
+
}
|
|
32
|
+
const requestOptions = {
|
|
33
|
+
...options,
|
|
34
|
+
headers,
|
|
35
|
+
agent: (0, utils_1.getProxyAgent)(),
|
|
36
|
+
};
|
|
37
|
+
const response = await fetch(`${this.getBaseUrl()}${path}`, requestOptions);
|
|
38
|
+
if (response.status === 401) {
|
|
39
|
+
throw new Error('Unauthorized');
|
|
40
|
+
}
|
|
41
|
+
if (response.status === 404) {
|
|
42
|
+
const body = await response.json();
|
|
43
|
+
throw new Error(body.code);
|
|
44
|
+
}
|
|
45
|
+
return response;
|
|
46
|
+
}
|
|
47
|
+
async authStatus(accessToken, verbose = false) {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.request('', { headers: { authorization: accessToken } });
|
|
50
|
+
return await response.json();
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (verbose) {
|
|
54
|
+
console.log(error);
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async prepareFileUpload({ organizationId, name, version, filesHash, filename, isUpsert, }) {
|
|
60
|
+
const response = await this.request(`/${organizationId}/${name}/${version}/prepare-file-upload`, {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: {
|
|
63
|
+
'content-type': 'application/json',
|
|
64
|
+
authorization: this.accessToken,
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify({
|
|
67
|
+
filesHash,
|
|
68
|
+
filename,
|
|
69
|
+
isUpsert,
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
if (response.ok) {
|
|
73
|
+
return response.json();
|
|
74
|
+
}
|
|
75
|
+
throw new Error('Could not prepare file upload');
|
|
76
|
+
}
|
|
77
|
+
async pushApi({ organizationId, name, version, rootFilePath, filePaths, branch, isUpsert, isPublic, batchId, batchSize, }) {
|
|
78
|
+
const response = await this.request(`/${organizationId}/${name}/${version}`, {
|
|
79
|
+
method: 'PUT',
|
|
80
|
+
headers: {
|
|
81
|
+
'content-type': 'application/json',
|
|
82
|
+
authorization: this.accessToken,
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify({
|
|
85
|
+
rootFilePath,
|
|
86
|
+
filePaths,
|
|
87
|
+
branch,
|
|
88
|
+
isUpsert,
|
|
89
|
+
isPublic,
|
|
90
|
+
batchId,
|
|
91
|
+
batchSize,
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
if (response.ok) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
throw new Error('Could not push api');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.RegistryApi = RegistryApi;
|
package/lib/ref-utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Source } from './resolve
|
|
2
|
-
import type { OasRef } from './typings/openapi
|
|
1
|
+
import type { Source } from './resolve';
|
|
2
|
+
import type { OasRef } from './typings/openapi';
|
|
3
3
|
export declare function joinPointer(base: string, key: string | number): string;
|
|
4
4
|
export declare function isRef(node: unknown): node is OasRef;
|
|
5
5
|
export declare function isExternalValue(node: unknown): boolean;
|
|
@@ -25,4 +25,3 @@ export declare function refBaseName(ref: string): string;
|
|
|
25
25
|
export declare function isAbsoluteUrl(ref: string): boolean;
|
|
26
26
|
export declare function isMappingRef(mapping: string): boolean;
|
|
27
27
|
export declare function isAnchor(ref: string): boolean;
|
|
28
|
-
//# sourceMappingURL=ref-utils.d.ts.map
|
package/lib/ref-utils.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Location = void 0;
|
|
4
|
+
exports.joinPointer = joinPointer;
|
|
5
|
+
exports.isRef = isRef;
|
|
6
|
+
exports.isExternalValue = isExternalValue;
|
|
7
|
+
exports.unescapePointer = unescapePointer;
|
|
8
|
+
exports.escapePointer = escapePointer;
|
|
9
|
+
exports.parseRef = parseRef;
|
|
10
|
+
exports.parsePointer = parsePointer;
|
|
11
|
+
exports.pointerBaseName = pointerBaseName;
|
|
12
|
+
exports.refBaseName = refBaseName;
|
|
13
|
+
exports.isAbsoluteUrl = isAbsoluteUrl;
|
|
14
|
+
exports.isMappingRef = isMappingRef;
|
|
15
|
+
exports.isAnchor = isAnchor;
|
|
16
|
+
const utils_1 = require("./utils");
|
|
17
|
+
function joinPointer(base, key) {
|
|
3
18
|
if (base === '')
|
|
4
19
|
base = '#/';
|
|
5
20
|
return base[base.length - 1] === '/' ? base + key : base + '/' + key;
|
|
6
21
|
}
|
|
7
|
-
|
|
8
|
-
return isPlainObject(node) && typeof node.$ref === 'string';
|
|
22
|
+
function isRef(node) {
|
|
23
|
+
return (0, utils_1.isPlainObject)(node) && typeof node.$ref === 'string';
|
|
9
24
|
}
|
|
10
|
-
|
|
11
|
-
return isPlainObject(node) && typeof node.externalValue === 'string';
|
|
25
|
+
function isExternalValue(node) {
|
|
26
|
+
return (0, utils_1.isPlainObject)(node) && typeof node.externalValue === 'string';
|
|
12
27
|
}
|
|
13
|
-
|
|
28
|
+
class Location {
|
|
14
29
|
constructor(source, pointer) {
|
|
15
30
|
this.source = source;
|
|
16
31
|
this.pointer = pointer;
|
|
@@ -25,37 +40,38 @@ export class Location {
|
|
|
25
40
|
return this.source.absoluteRef + (this.pointer === '#/' ? '' : this.pointer);
|
|
26
41
|
}
|
|
27
42
|
}
|
|
28
|
-
|
|
43
|
+
exports.Location = Location;
|
|
44
|
+
function unescapePointer(fragment) {
|
|
29
45
|
return decodeURIComponent(fragment.replace(/~1/g, '/').replace(/~0/g, '~'));
|
|
30
46
|
}
|
|
31
|
-
|
|
47
|
+
function escapePointer(fragment) {
|
|
32
48
|
if (typeof fragment === 'number')
|
|
33
49
|
return fragment;
|
|
34
50
|
return fragment.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
35
51
|
}
|
|
36
|
-
|
|
52
|
+
function parseRef(ref) {
|
|
37
53
|
const [uri, pointer = ''] = ref.split('#/');
|
|
38
54
|
return {
|
|
39
55
|
uri: (uri.endsWith('#') ? uri.slice(0, -1) : uri) || null,
|
|
40
56
|
pointer: parsePointer(pointer),
|
|
41
57
|
};
|
|
42
58
|
}
|
|
43
|
-
|
|
44
|
-
return pointer.split('/').map(unescapePointer).filter(isTruthy);
|
|
59
|
+
function parsePointer(pointer) {
|
|
60
|
+
return pointer.split('/').map(unescapePointer).filter(utils_1.isTruthy);
|
|
45
61
|
}
|
|
46
|
-
|
|
62
|
+
function pointerBaseName(pointer) {
|
|
47
63
|
const parts = pointer.split('/');
|
|
48
64
|
return parts[parts.length - 1];
|
|
49
65
|
}
|
|
50
|
-
|
|
66
|
+
function refBaseName(ref) {
|
|
51
67
|
// eslint-disable-next-line no-useless-escape
|
|
52
68
|
const parts = ref.split(/[\/\\]/); // split by '\' and '/'
|
|
53
69
|
return parts[parts.length - 1].replace(/\.[^.]+$/, ''); // replace extension with empty string
|
|
54
70
|
}
|
|
55
|
-
|
|
71
|
+
function isAbsoluteUrl(ref) {
|
|
56
72
|
return ref.startsWith('http://') || ref.startsWith('https://');
|
|
57
73
|
}
|
|
58
|
-
|
|
74
|
+
function isMappingRef(mapping) {
|
|
59
75
|
// TODO: proper detection of mapping refs
|
|
60
76
|
return (mapping.startsWith('#') ||
|
|
61
77
|
mapping.startsWith('https://') ||
|
|
@@ -64,7 +80,6 @@ export function isMappingRef(mapping) {
|
|
|
64
80
|
mapping.startsWith('../') ||
|
|
65
81
|
mapping.indexOf('/') > -1);
|
|
66
82
|
}
|
|
67
|
-
|
|
83
|
+
function isAnchor(ref) {
|
|
68
84
|
return /^#[A-Za-z][A-Za-z0-9\-_:.]*$/.test(ref);
|
|
69
85
|
}
|
|
70
|
-
//# sourceMappingURL=ref-utils.js.map
|
package/lib/resolve.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { YAMLNode, LoadOptions } from 'yaml-ast-parser';
|
|
2
|
-
import type { NormalizedNodeType } from './types
|
|
3
|
-
import type { ResolveConfig } from './config/types
|
|
2
|
+
import type { NormalizedNodeType } from './types';
|
|
3
|
+
import type { ResolveConfig } from './config/types';
|
|
4
4
|
export type CollectedRefs = Map<string, Document>;
|
|
5
5
|
export declare class Source {
|
|
6
6
|
absoluteRef: string;
|
|
@@ -64,4 +64,3 @@ export declare function resolveDocument(opts: {
|
|
|
64
64
|
externalRefResolver: BaseResolver;
|
|
65
65
|
rootType: NormalizedNodeType;
|
|
66
66
|
}): Promise<ResolvedRefMap>;
|
|
67
|
-
//# sourceMappingURL=resolve.d.ts.map
|
package/lib/resolve.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseResolver = exports.YamlParseError = exports.ResolveError = exports.Source = void 0;
|
|
4
|
+
exports.makeRefId = makeRefId;
|
|
5
|
+
exports.makeDocumentFromString = makeDocumentFromString;
|
|
6
|
+
exports.resolveDocument = resolveDocument;
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const ref_utils_1 = require("./ref-utils");
|
|
10
|
+
const types_1 = require("./types");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
class Source {
|
|
7
13
|
constructor(absoluteRef, body, mimeType) {
|
|
8
14
|
this.absoluteRef = absoluteRef;
|
|
9
15
|
this.body = body;
|
|
@@ -31,7 +37,8 @@ export class Source {
|
|
|
31
37
|
return this._lines;
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
|
-
|
|
40
|
+
exports.Source = Source;
|
|
41
|
+
class ResolveError extends Error {
|
|
35
42
|
constructor(originalError) {
|
|
36
43
|
super(originalError.message);
|
|
37
44
|
this.originalError = originalError;
|
|
@@ -39,8 +46,9 @@ export class ResolveError extends Error {
|
|
|
39
46
|
Object.setPrototypeOf(this, ResolveError.prototype);
|
|
40
47
|
}
|
|
41
48
|
}
|
|
49
|
+
exports.ResolveError = ResolveError;
|
|
42
50
|
const jsYamlErrorLineColRegexp = /\((\d+):(\d+)\)$/;
|
|
43
|
-
|
|
51
|
+
class YamlParseError extends Error {
|
|
44
52
|
constructor(originalError, source) {
|
|
45
53
|
super(originalError.message.split('\n')[0]);
|
|
46
54
|
this.originalError = originalError;
|
|
@@ -52,22 +60,23 @@ export class YamlParseError extends Error {
|
|
|
52
60
|
this.col = parseInt(col, 10);
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
|
-
|
|
63
|
+
exports.YamlParseError = YamlParseError;
|
|
64
|
+
function makeRefId(absoluteRef, pointer) {
|
|
56
65
|
return absoluteRef + '::' + pointer;
|
|
57
66
|
}
|
|
58
|
-
|
|
67
|
+
function makeDocumentFromString(sourceString, absoluteRef) {
|
|
59
68
|
const source = new Source(absoluteRef, sourceString);
|
|
60
69
|
try {
|
|
61
70
|
return {
|
|
62
71
|
source,
|
|
63
|
-
parsed: parseYaml(sourceString, { filename: absoluteRef }),
|
|
72
|
+
parsed: (0, utils_1.parseYaml)(sourceString, { filename: absoluteRef }),
|
|
64
73
|
};
|
|
65
74
|
}
|
|
66
75
|
catch (e) {
|
|
67
76
|
throw new YamlParseError(e, source);
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
|
-
|
|
79
|
+
class BaseResolver {
|
|
71
80
|
constructor(config = { http: { headers: [] } }) {
|
|
72
81
|
this.config = config;
|
|
73
82
|
this.cache = new Map();
|
|
@@ -76,18 +85,18 @@ export class BaseResolver {
|
|
|
76
85
|
return new Set(Array.from(this.cache.keys()));
|
|
77
86
|
}
|
|
78
87
|
resolveExternalRef(base, ref) {
|
|
79
|
-
if (isAbsoluteUrl(ref)) {
|
|
88
|
+
if ((0, ref_utils_1.isAbsoluteUrl)(ref)) {
|
|
80
89
|
return ref;
|
|
81
90
|
}
|
|
82
|
-
if (base && isAbsoluteUrl(base)) {
|
|
91
|
+
if (base && (0, ref_utils_1.isAbsoluteUrl)(base)) {
|
|
83
92
|
return new URL(ref, base).href;
|
|
84
93
|
}
|
|
85
94
|
return path.resolve(base ? path.dirname(base) : process.cwd(), ref);
|
|
86
95
|
}
|
|
87
96
|
async loadExternalRef(absoluteRef) {
|
|
88
97
|
try {
|
|
89
|
-
if (isAbsoluteUrl(absoluteRef)) {
|
|
90
|
-
const { body, mimeType } = await readFileFromUrl(absoluteRef, this.config.http);
|
|
98
|
+
if ((0, ref_utils_1.isAbsoluteUrl)(absoluteRef)) {
|
|
99
|
+
const { body, mimeType } = await (0, utils_1.readFileFromUrl)(absoluteRef, this.config.http);
|
|
91
100
|
return new Source(absoluteRef, body, mimeType);
|
|
92
101
|
}
|
|
93
102
|
else {
|
|
@@ -115,7 +124,7 @@ export class BaseResolver {
|
|
|
115
124
|
try {
|
|
116
125
|
return {
|
|
117
126
|
source,
|
|
118
|
-
parsed: parseYaml(source.body, { filename: source.absoluteRef }),
|
|
127
|
+
parsed: (0, utils_1.parseYaml)(source.body, { filename: source.absoluteRef }),
|
|
119
128
|
};
|
|
120
129
|
}
|
|
121
130
|
catch (e) {
|
|
@@ -135,6 +144,7 @@ export class BaseResolver {
|
|
|
135
144
|
return doc;
|
|
136
145
|
}
|
|
137
146
|
}
|
|
147
|
+
exports.BaseResolver = BaseResolver;
|
|
138
148
|
function pushRef(head, node) {
|
|
139
149
|
return {
|
|
140
150
|
prev: head,
|
|
@@ -152,7 +162,7 @@ function hasRef(head, node) {
|
|
|
152
162
|
}
|
|
153
163
|
const unknownType = { name: 'unknown', properties: {} };
|
|
154
164
|
const resolvableScalarType = { name: 'scalar', properties: {} };
|
|
155
|
-
|
|
165
|
+
async function resolveDocument(opts) {
|
|
156
166
|
const { rootDocument, externalRefResolver, rootType } = opts;
|
|
157
167
|
const resolvedRefMap = new Map();
|
|
158
168
|
const seenNodes = new Set(); // format "${type}::${absoluteRef}${pointer}"
|
|
@@ -183,19 +193,19 @@ export async function resolveDocument(opts) {
|
|
|
183
193
|
if (Array.isArray(node)) {
|
|
184
194
|
const itemsType = type.items;
|
|
185
195
|
// we continue resolving unknown types, but stop early on known scalars
|
|
186
|
-
if (itemsType === undefined && type !== unknownType && type !== SpecExtension) {
|
|
196
|
+
if (itemsType === undefined && type !== unknownType && type !== types_1.SpecExtension) {
|
|
187
197
|
return;
|
|
188
198
|
}
|
|
189
199
|
const isTypeAFunction = typeof itemsType === 'function';
|
|
190
200
|
for (let i = 0; i < node.length; i++) {
|
|
191
201
|
const itemType = isTypeAFunction
|
|
192
|
-
? itemsType(node[i], joinPointer(nodeAbsoluteRef, i))
|
|
202
|
+
? itemsType(node[i], (0, ref_utils_1.joinPointer)(nodeAbsoluteRef, i))
|
|
193
203
|
: itemsType;
|
|
194
204
|
// we continue resolving unknown types, but stop early on known scalars
|
|
195
|
-
if (itemType === undefined && type !== unknownType && type !== SpecExtension) {
|
|
205
|
+
if (itemType === undefined && type !== unknownType && type !== types_1.SpecExtension) {
|
|
196
206
|
continue;
|
|
197
207
|
}
|
|
198
|
-
walk(node[i], isNamedType(itemType) ? itemType : unknownType, joinPointer(nodeAbsoluteRef, i));
|
|
208
|
+
walk(node[i], (0, types_1.isNamedType)(itemType) ? itemType : unknownType, (0, ref_utils_1.joinPointer)(nodeAbsoluteRef, i));
|
|
199
209
|
}
|
|
200
210
|
return;
|
|
201
211
|
}
|
|
@@ -211,21 +221,21 @@ export async function resolveDocument(opts) {
|
|
|
211
221
|
if (type.extensionsPrefix &&
|
|
212
222
|
propName.startsWith(type.extensionsPrefix) &&
|
|
213
223
|
propType === unknownType) {
|
|
214
|
-
propType = SpecExtension;
|
|
224
|
+
propType = types_1.SpecExtension;
|
|
215
225
|
}
|
|
216
|
-
if (!isNamedType(propType) && propType?.directResolveAs) {
|
|
226
|
+
if (!(0, types_1.isNamedType)(propType) && propType?.directResolveAs) {
|
|
217
227
|
propType = propType.directResolveAs;
|
|
218
228
|
propValue = { $ref: propValue };
|
|
219
229
|
}
|
|
220
230
|
if (propType && propType.name === undefined && propType.resolvable !== false) {
|
|
221
231
|
propType = resolvableScalarType;
|
|
222
232
|
}
|
|
223
|
-
if (!isNamedType(propType) || typeof propValue !== 'object') {
|
|
233
|
+
if (!(0, types_1.isNamedType)(propType) || typeof propValue !== 'object') {
|
|
224
234
|
continue;
|
|
225
235
|
}
|
|
226
|
-
walk(propValue, propType, joinPointer(nodeAbsoluteRef, escapePointer(propName)));
|
|
236
|
+
walk(propValue, propType, (0, ref_utils_1.joinPointer)(nodeAbsoluteRef, (0, ref_utils_1.escapePointer)(propName)));
|
|
227
237
|
}
|
|
228
|
-
if (isRef(node)) {
|
|
238
|
+
if ((0, ref_utils_1.isRef)(node)) {
|
|
229
239
|
const promise = followRef(rootNodeDocument, node, {
|
|
230
240
|
prev: null,
|
|
231
241
|
node,
|
|
@@ -237,7 +247,7 @@ export async function resolveDocument(opts) {
|
|
|
237
247
|
resolvePromises.push(promise);
|
|
238
248
|
}
|
|
239
249
|
// handle example.externalValue as reference
|
|
240
|
-
if (isExternalValue(node)) {
|
|
250
|
+
if ((0, ref_utils_1.isExternalValue)(node)) {
|
|
241
251
|
const promise = followRef(rootNodeDocument, { $ref: node.externalValue }, {
|
|
242
252
|
prev: null,
|
|
243
253
|
node,
|
|
@@ -253,9 +263,9 @@ export async function resolveDocument(opts) {
|
|
|
253
263
|
if (hasRef(refStack.prev, ref)) {
|
|
254
264
|
throw new Error('Self-referencing circular pointer');
|
|
255
265
|
}
|
|
256
|
-
if (isAnchor(ref.$ref)) {
|
|
266
|
+
if ((0, ref_utils_1.isAnchor)(ref.$ref)) {
|
|
257
267
|
// Wait for all anchors in the document to be collected firstly.
|
|
258
|
-
await nextTick();
|
|
268
|
+
await (0, utils_1.nextTick)();
|
|
259
269
|
const resolvedRef = {
|
|
260
270
|
resolved: true,
|
|
261
271
|
isRemote: false,
|
|
@@ -267,7 +277,7 @@ export async function resolveDocument(opts) {
|
|
|
267
277
|
resolvedRefMap.set(refId, resolvedRef);
|
|
268
278
|
return resolvedRef;
|
|
269
279
|
}
|
|
270
|
-
const { uri, pointer } = parseRef(ref.$ref);
|
|
280
|
+
const { uri, pointer } = (0, ref_utils_1.parseRef)(ref.$ref);
|
|
271
281
|
const isRemote = uri !== null;
|
|
272
282
|
let targetDoc;
|
|
273
283
|
try {
|
|
@@ -302,9 +312,9 @@ export async function resolveDocument(opts) {
|
|
|
302
312
|
}
|
|
303
313
|
else if (target[segment] !== undefined) {
|
|
304
314
|
target = target[segment];
|
|
305
|
-
resolvedRef.nodePointer = joinPointer(resolvedRef.nodePointer, escapePointer(segment));
|
|
315
|
+
resolvedRef.nodePointer = (0, ref_utils_1.joinPointer)(resolvedRef.nodePointer, (0, ref_utils_1.escapePointer)(segment));
|
|
306
316
|
}
|
|
307
|
-
else if (isRef(target)) {
|
|
317
|
+
else if ((0, ref_utils_1.isRef)(target)) {
|
|
308
318
|
resolvedRef = await followRef(targetDoc, target, pushRef(refStack, target));
|
|
309
319
|
targetDoc = resolvedRef.document || targetDoc;
|
|
310
320
|
if (typeof resolvedRef.node !== 'object') {
|
|
@@ -312,7 +322,7 @@ export async function resolveDocument(opts) {
|
|
|
312
322
|
break;
|
|
313
323
|
}
|
|
314
324
|
target = resolvedRef.node[segment];
|
|
315
|
-
resolvedRef.nodePointer = joinPointer(resolvedRef.nodePointer, escapePointer(segment));
|
|
325
|
+
resolvedRef.nodePointer = (0, ref_utils_1.joinPointer)(resolvedRef.nodePointer, (0, ref_utils_1.escapePointer)(segment));
|
|
316
326
|
}
|
|
317
327
|
else {
|
|
318
328
|
target = undefined;
|
|
@@ -322,7 +332,7 @@ export async function resolveDocument(opts) {
|
|
|
322
332
|
resolvedRef.node = target;
|
|
323
333
|
resolvedRef.document = targetDoc;
|
|
324
334
|
const refId = makeRefId(document.source.absoluteRef, ref.$ref);
|
|
325
|
-
if (resolvedRef.document && isRef(target)) {
|
|
335
|
+
if (resolvedRef.document && (0, ref_utils_1.isRef)(target)) {
|
|
326
336
|
resolvedRef = await followRef(resolvedRef.document, target, pushRef(refStack, target));
|
|
327
337
|
}
|
|
328
338
|
resolvedRefMap.set(refId, resolvedRef);
|
|
@@ -330,4 +340,3 @@ export async function resolveDocument(opts) {
|
|
|
330
340
|
}
|
|
331
341
|
}
|
|
332
342
|
}
|
|
333
|
-
//# sourceMappingURL=resolve.js.map
|
package/lib/rules/ajv.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Location } from '../ref-utils
|
|
2
|
-
import type { ErrorObject } from '@redocly/ajv/dist/2020
|
|
3
|
-
import type { ResolveFn } from '../walk
|
|
1
|
+
import type { Location } from '../ref-utils';
|
|
2
|
+
import type { ErrorObject } from '@redocly/ajv/dist/2020';
|
|
3
|
+
import type { ResolveFn } from '../walk';
|
|
4
4
|
export declare function releaseAjvInstance(): void;
|
|
5
5
|
export declare function validateJsonSchema(data: any, schema: any, schemaLoc: Location, instancePath: string, resolve: ResolveFn, allowAdditionalProperties: boolean): {
|
|
6
6
|
valid: boolean;
|
|
@@ -8,4 +8,3 @@ export declare function validateJsonSchema(data: any, schema: any, schemaLoc: Lo
|
|
|
8
8
|
suggest?: string[];
|
|
9
9
|
})[];
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=ajv.d.ts.map
|
package/lib/rules/ajv.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.releaseAjvInstance = releaseAjvInstance;
|
|
4
|
+
exports.validateJsonSchema = validateJsonSchema;
|
|
5
|
+
const _2020_1 = require("@redocly/ajv/dist/2020");
|
|
6
|
+
const ref_utils_1 = require("../ref-utils");
|
|
3
7
|
let ajvInstance = null;
|
|
4
|
-
|
|
8
|
+
function releaseAjvInstance() {
|
|
5
9
|
ajvInstance = null;
|
|
6
10
|
}
|
|
7
11
|
function getAjv(resolve, allowAdditionalProperties) {
|
|
8
12
|
if (!ajvInstance) {
|
|
9
|
-
ajvInstance = new
|
|
13
|
+
ajvInstance = new _2020_1.default({
|
|
10
14
|
schemaId: '$id',
|
|
11
15
|
meta: true,
|
|
12
16
|
allErrors: true,
|
|
@@ -35,7 +39,7 @@ function getAjvValidator(schema, loc, resolve, allowAdditionalProperties) {
|
|
|
35
39
|
}
|
|
36
40
|
return ajv.getSchema(loc.absolutePointer);
|
|
37
41
|
}
|
|
38
|
-
|
|
42
|
+
function validateJsonSchema(data, schema, schemaLoc, instancePath, resolve, allowAdditionalProperties) {
|
|
39
43
|
const validate = getAjvValidator(schema, schemaLoc, resolve, allowAdditionalProperties);
|
|
40
44
|
if (!validate)
|
|
41
45
|
return { valid: true, errors: [] }; // unresolved refs are reported
|
|
@@ -67,7 +71,7 @@ export function validateJsonSchema(data, schema, schemaLoc, instancePath, resolv
|
|
|
67
71
|
if (error.keyword === 'additionalProperties' || error.keyword === 'unevaluatedProperties') {
|
|
68
72
|
const property = error.params.additionalProperty || error.params.unevaluatedProperty;
|
|
69
73
|
message = `${message} \`${property}\``;
|
|
70
|
-
error.instancePath += '/' + escapePointer(property);
|
|
74
|
+
error.instancePath += '/' + (0, ref_utils_1.escapePointer)(property);
|
|
71
75
|
}
|
|
72
76
|
return {
|
|
73
77
|
...error,
|
|
@@ -76,4 +80,3 @@ export function validateJsonSchema(data, schema, schemaLoc, instancePath, resolv
|
|
|
76
80
|
};
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
|
-
//# sourceMappingURL=ajv.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CriteriaUnique = void 0;
|
|
4
|
+
const CriteriaUnique = () => {
|
|
2
5
|
return {
|
|
3
6
|
FailureActionObject: {
|
|
4
7
|
enter(action, { report, location }) {
|
|
@@ -65,4 +68,4 @@ export const CriteriaUnique = () => {
|
|
|
65
68
|
},
|
|
66
69
|
};
|
|
67
70
|
};
|
|
68
|
-
|
|
71
|
+
exports.CriteriaUnique = CriteriaUnique;
|
|
@@ -1,34 +1,36 @@
|
|
|
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
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preprocessors = exports.rules = void 0;
|
|
4
|
+
const struct_1 = require("../common/struct");
|
|
5
|
+
const assertions_1 = require("../common/assertions");
|
|
6
|
+
const sourceDescription_type_1 = require("../arazzo/sourceDescription-type");
|
|
7
|
+
const sourceDescriptions_not_empty_1 = require("./sourceDescriptions-not-empty");
|
|
8
|
+
const respect_supported_versions_1 = require("../respect/respect-supported-versions");
|
|
9
|
+
const workflowId_unique_1 = require("./workflowId-unique");
|
|
10
|
+
const stepId_unique_1 = require("./stepId-unique");
|
|
11
|
+
const sourceDescriptions_name_unique_1 = require("./sourceDescriptions-name-unique");
|
|
12
|
+
const workflow_dependsOn_1 = require("./workflow-dependsOn");
|
|
13
|
+
const parameters_unique_1 = require("./parameters-unique");
|
|
14
|
+
const step_onSuccess_unique_1 = require("./step-onSuccess-unique");
|
|
15
|
+
const step_onFailure_unique_1 = require("./step-onFailure-unique");
|
|
16
|
+
const requestBody_replacements_unique_1 = require("./requestBody-replacements-unique");
|
|
17
|
+
const no_criteria_xpath_1 = require("../respect/no-criteria-xpath");
|
|
18
|
+
const criteria_unique_1 = require("./criteria-unique");
|
|
19
|
+
exports.rules = {
|
|
20
|
+
struct: struct_1.Struct,
|
|
21
|
+
assertions: assertions_1.Assertions,
|
|
22
|
+
'sourceDescription-type': sourceDescription_type_1.SourceDescriptionType,
|
|
23
|
+
'respect-supported-versions': respect_supported_versions_1.RespectSupportedVersions,
|
|
24
|
+
'workflowId-unique': workflowId_unique_1.WorkflowIdUnique,
|
|
25
|
+
'stepId-unique': stepId_unique_1.StepIdUnique,
|
|
26
|
+
'sourceDescription-name-unique': sourceDescriptions_name_unique_1.SourceDescriptionsNameUnique,
|
|
27
|
+
'sourceDescriptions-not-empty': sourceDescriptions_not_empty_1.SourceDescriptionsNotEmpty,
|
|
28
|
+
'workflow-dependsOn': workflow_dependsOn_1.WorkflowDependsOn,
|
|
29
|
+
'parameters-unique': parameters_unique_1.ParametersUnique,
|
|
30
|
+
'step-onSuccess-unique': step_onSuccess_unique_1.StepOnSuccessUnique,
|
|
31
|
+
'step-onFailure-unique': step_onFailure_unique_1.StepOnFailureUnique,
|
|
32
|
+
'requestBody-replacements-unique': requestBody_replacements_unique_1.RequestBodyReplacementsUnique,
|
|
33
|
+
'no-criteria-xpath': no_criteria_xpath_1.NoCriteriaXpath,
|
|
34
|
+
'criteria-unique': criteria_unique_1.CriteriaUnique,
|
|
32
35
|
};
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
36
|
+
exports.preprocessors = {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParametersUnique = void 0;
|
|
4
|
+
const ParametersUnique = () => {
|
|
2
5
|
return {
|
|
3
6
|
Parameters: {
|
|
4
7
|
enter(parameters, { report, location }) {
|
|
@@ -26,4 +29,4 @@ export const ParametersUnique = () => {
|
|
|
26
29
|
},
|
|
27
30
|
};
|
|
28
31
|
};
|
|
29
|
-
|
|
32
|
+
exports.ParametersUnique = ParametersUnique;
|