@kubb/agent 4.33.1 → 4.33.2
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +18 -87
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/index.js +17 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/constants.js +180 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/parse.js +1085 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/picomatch.js +341 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/scan.js +391 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/utils.js +72 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/package.json +83 -0
- package/.output/server/node_modules/@redocly/ajv/dist/2020.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +156 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +697 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +143 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +123 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +249 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +155 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +178 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +203 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +35 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +534 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +124 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +81 -0
- package/.output/server/node_modules/@redocly/ajv/dist/core.js +632 -0
- package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +56 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +107 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +132 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +139 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +92 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +8 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +84 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +25 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +86 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/package.json +130 -0
- package/.output/server/node_modules/@redocly/config/lib/common.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/config.js +17 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/entities.js +58 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/enum.js +6 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/shared.js +22 -0
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +54 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +186 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +283 -0
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +682 -0
- package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +88 -0
- package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +157 -0
- package/.output/server/node_modules/@redocly/config/lib/index.js +41 -0
- package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +43 -0
- package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +120 -0
- package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +518 -0
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +25 -0
- package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +558 -0
- package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +242 -0
- package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/index.js +21 -0
- package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +18 -0
- package/.output/server/node_modules/@redocly/config/package.json +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +85 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +257 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +74 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +310 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +335 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +338 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +51 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +98 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +88 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +116 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +79 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +365 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +49 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +171 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +123 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +56 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +109 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +326 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +106 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +52 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +139 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +53 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +269 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +22 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +215 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +78 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +37 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +145 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +62 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +150 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +93 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +130 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +83 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +33 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +82 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +190 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +12 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +172 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +482 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +1157 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +511 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +90 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +181 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +101 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +454 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +828 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +292 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +306 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +360 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +61 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +573 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +303 -0
- package/.output/server/node_modules/@redocly/openapi-core/package.json +74 -0
- package/.output/server/node_modules/ajv-formats/dist/formats.js +208 -0
- package/.output/server/node_modules/ajv-formats/dist/index.js +37 -0
- package/.output/server/node_modules/ajv-formats/dist/limit.js +69 -0
- package/.output/server/node_modules/ajv-formats/package.json +74 -0
- package/.output/server/node_modules/colorette/index.js +82 -0
- package/.output/server/node_modules/colorette/package.json +39 -0
- package/.output/server/node_modules/js-levenshtein/index.js +105 -0
- package/.output/server/node_modules/js-levenshtein/package.json +49 -0
- package/.output/server/node_modules/pluralize/package.json +40 -0
- package/.output/server/node_modules/pluralize/pluralize.js +503 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +45 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +644 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +40 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +1416 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +62 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +8 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +19 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +78 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +92 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +32 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +95 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +155 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +64 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +30 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +46 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +55 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +70 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +54 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/package.json +39 -0
- package/.output/server/package.json +9 -1
- package/package.json +16 -16
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/index.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/parse.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/picomatch.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/scan.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/utils.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/package.json +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as yamlAst from 'yaml-ast-parser';
|
|
2
|
+
import { colorize, colorOptions } from '../logger.js';
|
|
3
|
+
import { parsePointer } from '../ref-utils.js';
|
|
4
|
+
const MAX_LINE_LENGTH = 150;
|
|
5
|
+
const MAX_CODEFRAME_LINES = 3;
|
|
6
|
+
export function getCodeframe(location, color) {
|
|
7
|
+
colorOptions.enabled = color;
|
|
8
|
+
const { start, end = { line: start.line, col: start.col + 1 }, source } = location;
|
|
9
|
+
const lines = source.getLines();
|
|
10
|
+
const startLineNum = start.line;
|
|
11
|
+
const endLineNum = Math.max(Math.min(end.line, lines.length), start.line);
|
|
12
|
+
let skipLines = Math.max(endLineNum - startLineNum - MAX_CODEFRAME_LINES + 1, 0);
|
|
13
|
+
if (skipLines < 2)
|
|
14
|
+
skipLines = 0; // do not skip one line
|
|
15
|
+
// Lines specified like this: ["prefix", "string"],
|
|
16
|
+
const prefixedLines = [];
|
|
17
|
+
let currentPad = 0;
|
|
18
|
+
for (let i = startLineNum; i <= endLineNum; i++) {
|
|
19
|
+
if (skipLines > 0 && i >= endLineNum - skipLines)
|
|
20
|
+
break;
|
|
21
|
+
const line = lines[i - 1] || '';
|
|
22
|
+
if (line !== '')
|
|
23
|
+
currentPad = padSize(line);
|
|
24
|
+
const startIdx = i === startLineNum ? start.col - 1 : currentPad;
|
|
25
|
+
const endIdx = i === endLineNum ? end.col - 1 : line.length;
|
|
26
|
+
prefixedLines.push([`${i}`, markLine(line, startIdx, endIdx, colorize.red)]);
|
|
27
|
+
if (!color)
|
|
28
|
+
prefixedLines.push(['', underlineLine(line, startIdx, endIdx)]);
|
|
29
|
+
}
|
|
30
|
+
if (skipLines > 0) {
|
|
31
|
+
prefixedLines.push([
|
|
32
|
+
`…`,
|
|
33
|
+
`${whitespace(currentPad)}${colorize.gray(`< ${skipLines} more lines >`)}`,
|
|
34
|
+
]);
|
|
35
|
+
// print last line
|
|
36
|
+
prefixedLines.push([
|
|
37
|
+
`${endLineNum}`,
|
|
38
|
+
markLine(lines[endLineNum - 1], -1, end.col - 1, colorize.red),
|
|
39
|
+
]);
|
|
40
|
+
if (!color)
|
|
41
|
+
prefixedLines.push(['', underlineLine(lines[endLineNum - 1], -1, end.col - 1)]);
|
|
42
|
+
}
|
|
43
|
+
return printPrefixedLines([
|
|
44
|
+
[`${startLineNum - 2}`, markLine(lines[startLineNum - 1 - 2])],
|
|
45
|
+
[`${startLineNum - 1}`, markLine(lines[startLineNum - 1 - 1])],
|
|
46
|
+
...prefixedLines,
|
|
47
|
+
[`${endLineNum + 1}`, markLine(lines[endLineNum - 1 + 1])],
|
|
48
|
+
[`${endLineNum + 2}`, markLine(lines[endLineNum - 1 + 2])],
|
|
49
|
+
]);
|
|
50
|
+
function markLine(line, startIdx = -1, endIdx = +Infinity, variant = colorize.gray) {
|
|
51
|
+
if (!color)
|
|
52
|
+
return line;
|
|
53
|
+
if (!line)
|
|
54
|
+
return line;
|
|
55
|
+
if (startIdx === -1) {
|
|
56
|
+
startIdx = padSize(line);
|
|
57
|
+
}
|
|
58
|
+
endIdx = Math.min(endIdx, line.length);
|
|
59
|
+
return (line.substr(0, startIdx) + variant(line.substring(startIdx, endIdx)) + line.substr(endIdx));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function printPrefixedLines(lines) {
|
|
63
|
+
const existingLines = lines.filter(([_, line]) => line !== undefined);
|
|
64
|
+
const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
|
|
65
|
+
const dedentLen = Math.min(...existingLines.map(([_, line]) => (line === '' ? Infinity : padSize(line))));
|
|
66
|
+
return existingLines
|
|
67
|
+
.map(([prefix, line]) => colorize.gray(leftPad(padLen, prefix) + ' |') +
|
|
68
|
+
(line ? ' ' + limitLineLength(line.substring(dedentLen)) : ''))
|
|
69
|
+
.join('\n');
|
|
70
|
+
}
|
|
71
|
+
function limitLineLength(line, maxLen = MAX_LINE_LENGTH) {
|
|
72
|
+
const overflowLen = line.length - maxLen;
|
|
73
|
+
if (overflowLen > 0) {
|
|
74
|
+
const charsMoreText = colorize.gray(`...<${overflowLen} chars>`);
|
|
75
|
+
return line.substring(0, maxLen - charsMoreText.length) + charsMoreText;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return line;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function underlineLine(line, startIdx = -1, endIdx = +Infinity) {
|
|
82
|
+
if (startIdx === -1) {
|
|
83
|
+
startIdx = padSize(line);
|
|
84
|
+
}
|
|
85
|
+
endIdx = Math.min(endIdx, line.length);
|
|
86
|
+
return whitespace(startIdx) + '^'.repeat(Math.max(endIdx - startIdx, 1));
|
|
87
|
+
}
|
|
88
|
+
function whitespace(len) {
|
|
89
|
+
return ' '.repeat(len);
|
|
90
|
+
}
|
|
91
|
+
function leftPad(len, str) {
|
|
92
|
+
return whitespace(len - str.length) + str;
|
|
93
|
+
}
|
|
94
|
+
function padSize(line) {
|
|
95
|
+
for (let i = 0; i < line.length; i++) {
|
|
96
|
+
if (line[i] !== ' ')
|
|
97
|
+
return i;
|
|
98
|
+
}
|
|
99
|
+
return line.length;
|
|
100
|
+
}
|
|
101
|
+
export function getLineColLocation(location) {
|
|
102
|
+
if (location.pointer === undefined)
|
|
103
|
+
return location;
|
|
104
|
+
const { source, pointer, reportOnKey } = location;
|
|
105
|
+
const ast = source.getAst(yamlAst.safeLoad);
|
|
106
|
+
const astNode = getAstNodeByPointer(ast, pointer, !!reportOnKey);
|
|
107
|
+
return {
|
|
108
|
+
...location,
|
|
109
|
+
pointer: undefined,
|
|
110
|
+
...positionsToLoc(source.body, astNode?.startPosition ?? 1, astNode?.endPosition ?? 1),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function positionsToLoc(source, startPos, endPos) {
|
|
114
|
+
let currentLine = 1;
|
|
115
|
+
let currentCol = 1;
|
|
116
|
+
let start = { line: 1, col: 1 };
|
|
117
|
+
for (let i = 0; i < endPos - 1; i++) {
|
|
118
|
+
if (i === startPos - 1) {
|
|
119
|
+
start = { line: currentLine, col: currentCol + 1 };
|
|
120
|
+
}
|
|
121
|
+
if (source[i] === '\n') {
|
|
122
|
+
currentLine++;
|
|
123
|
+
currentCol = 1;
|
|
124
|
+
if (i === startPos - 1) {
|
|
125
|
+
start = { line: currentLine, col: currentCol };
|
|
126
|
+
}
|
|
127
|
+
if (source[i + 1] === '\r')
|
|
128
|
+
i++; // TODO: test it
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
currentCol++;
|
|
132
|
+
}
|
|
133
|
+
const end = startPos === endPos ? { ...start } : { line: currentLine, col: currentCol + 1 };
|
|
134
|
+
return { start, end };
|
|
135
|
+
}
|
|
136
|
+
export function getAstNodeByPointer(root, pointer, reportOnKey) {
|
|
137
|
+
const pointerSegments = parsePointer(pointer.substr(2));
|
|
138
|
+
if (root === undefined) {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
let currentNode = root;
|
|
142
|
+
for (const key of pointerSegments) {
|
|
143
|
+
if (currentNode.kind === yamlAst.Kind.MAP) {
|
|
144
|
+
const mapping = currentNode.mappings.find((m) => m.key.value === key);
|
|
145
|
+
if (!mapping)
|
|
146
|
+
break;
|
|
147
|
+
currentNode = mapping;
|
|
148
|
+
if (!mapping?.value)
|
|
149
|
+
break; // If node has value - return value, if not - return node itself
|
|
150
|
+
currentNode = mapping.value;
|
|
151
|
+
}
|
|
152
|
+
else if (currentNode.kind === yamlAst.Kind.SEQ) {
|
|
153
|
+
const elem = currentNode.items[parseInt(key, 10)];
|
|
154
|
+
if (!elem)
|
|
155
|
+
break;
|
|
156
|
+
currentNode = elem;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (!reportOnKey) {
|
|
160
|
+
return currentNode;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const parent = currentNode.parent;
|
|
164
|
+
if (!parent)
|
|
165
|
+
return currentNode;
|
|
166
|
+
if (parent.kind === yamlAst.Kind.SEQ) {
|
|
167
|
+
return currentNode;
|
|
168
|
+
}
|
|
169
|
+
else if (parent.kind === yamlAst.Kind.MAPPING) {
|
|
170
|
+
return parent.key;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return currentNode;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=codeframes.js.map
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { env, isBrowser } from '../env.js';
|
|
3
|
+
import { colorOptions, colorize, logger } from '../logger.js';
|
|
4
|
+
import { isAbsoluteUrl } from '../ref-utils.js';
|
|
5
|
+
import { getCodeframe, getLineColLocation } from './codeframes.js';
|
|
6
|
+
const ERROR_MESSAGE = {
|
|
7
|
+
INVALID_SEVERITY_LEVEL: 'Invalid severity level; accepted values: error or warn',
|
|
8
|
+
};
|
|
9
|
+
const BG_COLORS = {
|
|
10
|
+
warn: (str) => colorize.bgYellow(colorize.black(str)),
|
|
11
|
+
error: colorize.bgRed,
|
|
12
|
+
};
|
|
13
|
+
const COLORS = {
|
|
14
|
+
warn: colorize.yellow,
|
|
15
|
+
error: colorize.red,
|
|
16
|
+
};
|
|
17
|
+
const SEVERITY_NAMES = {
|
|
18
|
+
warn: 'Warning',
|
|
19
|
+
error: 'Error',
|
|
20
|
+
};
|
|
21
|
+
const CODECLIMATE_SEVERITY_MAPPING = {
|
|
22
|
+
error: 'critical',
|
|
23
|
+
warn: 'minor',
|
|
24
|
+
};
|
|
25
|
+
const MAX_SUGGEST = +(env.REDOCLY_CLI_LINT_MAX_SUGGESTIONS ?? 5);
|
|
26
|
+
function severityToNumber(severity) {
|
|
27
|
+
return severity === 'error' ? 1 : 2;
|
|
28
|
+
}
|
|
29
|
+
export function getTotals(problems) {
|
|
30
|
+
let errors = 0;
|
|
31
|
+
let warnings = 0;
|
|
32
|
+
let ignored = 0;
|
|
33
|
+
for (const m of problems) {
|
|
34
|
+
if (m.ignored) {
|
|
35
|
+
ignored++;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (m.severity === 'error')
|
|
39
|
+
errors++;
|
|
40
|
+
if (m.severity === 'warn')
|
|
41
|
+
warnings++;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
errors,
|
|
45
|
+
warnings,
|
|
46
|
+
ignored,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function formatProblems(problems, opts) {
|
|
50
|
+
const { maxProblems = 100, cwd = isBrowser ? '' : process.cwd(), format = 'codeframe', color = colorOptions.enabled, totals = getTotals(problems), version = '2.0', command, } = opts;
|
|
51
|
+
colorOptions.enabled = color; // force colors if specified
|
|
52
|
+
const totalProblems = problems.length;
|
|
53
|
+
problems = problems.filter((m) => !m.ignored);
|
|
54
|
+
const ignoredProblems = totalProblems - problems.length;
|
|
55
|
+
problems = problems
|
|
56
|
+
.sort((a, b) => severityToNumber(a.severity) - severityToNumber(b.severity))
|
|
57
|
+
.slice(0, maxProblems);
|
|
58
|
+
if (!totalProblems && format !== 'json')
|
|
59
|
+
return;
|
|
60
|
+
switch (format) {
|
|
61
|
+
case 'json':
|
|
62
|
+
outputJSON();
|
|
63
|
+
break;
|
|
64
|
+
case 'codeframe':
|
|
65
|
+
for (let i = 0; i < problems.length; i++) {
|
|
66
|
+
const problem = problems[i];
|
|
67
|
+
if (command === 'bundle') {
|
|
68
|
+
logger.info(`${formatCodeframe(problem, i)}\n`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
logger.output(`${formatCodeframe(problem, i)}\n`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case 'stylish': {
|
|
76
|
+
const groupedByFile = groupByFiles(problems);
|
|
77
|
+
for (const [file, { ruleIdPad, locationPad: positionPad, fileProblems }] of Object.entries(groupedByFile)) {
|
|
78
|
+
logger.output(`${colorize.blue(isAbsoluteUrl(file) ? file : path.relative(cwd, file))}:\n`);
|
|
79
|
+
for (let i = 0; i < fileProblems.length; i++) {
|
|
80
|
+
const problem = fileProblems[i];
|
|
81
|
+
logger.output(`${formatStylish(problem, positionPad, ruleIdPad)}\n`);
|
|
82
|
+
}
|
|
83
|
+
logger.output('\n');
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case 'markdown': {
|
|
88
|
+
const groupedByFile = groupByFiles(problems);
|
|
89
|
+
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
90
|
+
logger.output(`## Lint: ${isAbsoluteUrl(file) ? file : path.relative(cwd, file)}\n\n`);
|
|
91
|
+
logger.output(`| Severity | Location | Problem | Message |\n`);
|
|
92
|
+
logger.output(`|---|---|---|---|\n`);
|
|
93
|
+
for (let i = 0; i < fileProblems.length; i++) {
|
|
94
|
+
const problem = fileProblems[i];
|
|
95
|
+
logger.output(`${formatMarkdown(problem)}\n`);
|
|
96
|
+
}
|
|
97
|
+
logger.output('\n');
|
|
98
|
+
if (totals.errors > 0) {
|
|
99
|
+
logger.output(`Validation failed\nErrors: ${totals.errors}\n`);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
logger.output('Validation successful\n');
|
|
103
|
+
}
|
|
104
|
+
if (totals.warnings > 0) {
|
|
105
|
+
logger.output(`Warnings: ${totals.warnings}\n`);
|
|
106
|
+
}
|
|
107
|
+
logger.output('\n');
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'checkstyle': {
|
|
112
|
+
const groupedByFile = groupByFiles(problems);
|
|
113
|
+
logger.output('<?xml version="1.0" encoding="UTF-8"?>\n');
|
|
114
|
+
logger.output('<checkstyle version="4.3">\n');
|
|
115
|
+
for (const [file, { fileProblems }] of Object.entries(groupedByFile)) {
|
|
116
|
+
logger.output(`<file name="${xmlEscape(isAbsoluteUrl(file) ? file : path.relative(cwd, file))}">\n`);
|
|
117
|
+
fileProblems.forEach(formatCheckstyle);
|
|
118
|
+
logger.output(`</file>\n`);
|
|
119
|
+
}
|
|
120
|
+
logger.output(`</checkstyle>\n`);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case 'codeclimate':
|
|
124
|
+
outputForCodeClimate();
|
|
125
|
+
break;
|
|
126
|
+
case 'summary':
|
|
127
|
+
formatSummary(problems);
|
|
128
|
+
break;
|
|
129
|
+
case 'github-actions':
|
|
130
|
+
outputForGithubActions(problems, cwd);
|
|
131
|
+
}
|
|
132
|
+
if (totalProblems - ignoredProblems > maxProblems) {
|
|
133
|
+
logger.info(`< ... ${totalProblems - maxProblems} more problems hidden > ${colorize.gray('increase with `--max-problems N`')}\n`);
|
|
134
|
+
}
|
|
135
|
+
function outputForCodeClimate() {
|
|
136
|
+
const issues = problems.map((p) => {
|
|
137
|
+
const location = p.location[0]; // TODO: support multiple location
|
|
138
|
+
const lineCol = getLineColLocation(location);
|
|
139
|
+
return {
|
|
140
|
+
description: p.message,
|
|
141
|
+
location: {
|
|
142
|
+
path: isAbsoluteUrl(location.source.absoluteRef)
|
|
143
|
+
? location.source.absoluteRef
|
|
144
|
+
: path.relative(cwd, location.source.absoluteRef),
|
|
145
|
+
lines: {
|
|
146
|
+
begin: lineCol.start.line,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
severity: CODECLIMATE_SEVERITY_MAPPING[p.severity],
|
|
150
|
+
fingerprint: `${p.ruleId}${p.location.length > 0 ? '-' + p.location[0].pointer : ''}`,
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
logger.output(JSON.stringify(issues, null, 2));
|
|
154
|
+
}
|
|
155
|
+
function outputJSON() {
|
|
156
|
+
const resultObject = {
|
|
157
|
+
totals,
|
|
158
|
+
version,
|
|
159
|
+
problems: problems.map((p) => {
|
|
160
|
+
const problem = {
|
|
161
|
+
...p,
|
|
162
|
+
location: p.location.map((location) => ({
|
|
163
|
+
...location,
|
|
164
|
+
source: {
|
|
165
|
+
ref: isAbsoluteUrl(location.source.absoluteRef)
|
|
166
|
+
? location.source.absoluteRef
|
|
167
|
+
: path.relative(cwd, location.source.absoluteRef),
|
|
168
|
+
},
|
|
169
|
+
})),
|
|
170
|
+
from: p.from
|
|
171
|
+
? {
|
|
172
|
+
...p.from,
|
|
173
|
+
source: {
|
|
174
|
+
ref: isAbsoluteUrl(p.from?.source.absoluteRef)
|
|
175
|
+
? p.from?.source.absoluteRef
|
|
176
|
+
: path.relative(cwd, p.from?.source.absoluteRef || cwd),
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
: undefined,
|
|
180
|
+
};
|
|
181
|
+
if (env.FORMAT_JSON_WITH_CODEFRAMES) {
|
|
182
|
+
const location = p.location[0]; // TODO: support multiple locations
|
|
183
|
+
const loc = getLineColLocation(location);
|
|
184
|
+
problem.codeframe = getCodeframe(loc, color);
|
|
185
|
+
}
|
|
186
|
+
return problem;
|
|
187
|
+
}),
|
|
188
|
+
};
|
|
189
|
+
logger.output(JSON.stringify(resultObject, null, 2));
|
|
190
|
+
}
|
|
191
|
+
function getBgColor(problem) {
|
|
192
|
+
const { severity } = problem;
|
|
193
|
+
if (!BG_COLORS[severity]) {
|
|
194
|
+
throw new Error(ERROR_MESSAGE.INVALID_SEVERITY_LEVEL);
|
|
195
|
+
}
|
|
196
|
+
return BG_COLORS[severity];
|
|
197
|
+
}
|
|
198
|
+
function formatCodeframe(problem, idx) {
|
|
199
|
+
const bgColor = getBgColor(problem);
|
|
200
|
+
const location = problem.location[0]; // TODO: support multiple locations
|
|
201
|
+
const relativePath = isAbsoluteUrl(location.source.absoluteRef)
|
|
202
|
+
? location.source.absoluteRef
|
|
203
|
+
: path.relative(cwd, location.source.absoluteRef);
|
|
204
|
+
const loc = getLineColLocation(location);
|
|
205
|
+
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
206
|
+
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
207
|
+
return (`[${idx + 1}] ${bgColor(fileWithLoc)} ${atPointer}\n\n` +
|
|
208
|
+
`${problem.message}\n\n` +
|
|
209
|
+
formatDidYouMean(problem) +
|
|
210
|
+
getCodeframe(loc, color) +
|
|
211
|
+
'\n\n' +
|
|
212
|
+
formatFrom(cwd, problem.from) +
|
|
213
|
+
`${SEVERITY_NAMES[problem.severity]} was generated by the ${colorize.blue(problem.ruleId)} rule.\n\n`);
|
|
214
|
+
}
|
|
215
|
+
function formatStylish(problem, locationPad, ruleIdPad) {
|
|
216
|
+
const color = COLORS[problem.severity];
|
|
217
|
+
if (!SEVERITY_NAMES[problem.severity]) {
|
|
218
|
+
return 'Error not found severity. Please check your config file. Allowed values: `warn,error,off`';
|
|
219
|
+
}
|
|
220
|
+
const severityName = color(SEVERITY_NAMES[problem.severity].toLowerCase().padEnd(7));
|
|
221
|
+
const { start } = problem.location[0];
|
|
222
|
+
return ` ${`${start.line}:${start.col}`.padEnd(locationPad)} ${severityName} ${problem.ruleId.padEnd(ruleIdPad)} ${problem.message}`;
|
|
223
|
+
}
|
|
224
|
+
function formatMarkdown(problem) {
|
|
225
|
+
if (!SEVERITY_NAMES[problem.severity]) {
|
|
226
|
+
return 'Error not found severity. Please check your config file. Allowed values: `warn,error,off`';
|
|
227
|
+
}
|
|
228
|
+
const severityName = SEVERITY_NAMES[problem.severity].toLowerCase();
|
|
229
|
+
const { start } = problem.location[0];
|
|
230
|
+
return `| ${severityName} | line ${`${start.line}:${start.col}`} | [${problem.ruleId}](https://redocly.com/docs/cli/rules/${problem.ruleId}/) | ${problem.message.replaceAll('\n', '<br>')} |`;
|
|
231
|
+
}
|
|
232
|
+
function formatCheckstyle(problem) {
|
|
233
|
+
const { line, col } = problem.location[0].start;
|
|
234
|
+
const severity = problem.severity == 'warn' ? 'warning' : 'error';
|
|
235
|
+
const message = xmlEscape(problem.message);
|
|
236
|
+
const source = xmlEscape(problem.ruleId);
|
|
237
|
+
logger.output(`<error line="${line}" column="${col}" severity="${severity}" message="${message}" source="${source}" />\n`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function formatSummary(problems) {
|
|
241
|
+
const counts = {};
|
|
242
|
+
for (const problem of problems) {
|
|
243
|
+
counts[problem.ruleId] = counts[problem.ruleId] || { count: 0, severity: problem.severity };
|
|
244
|
+
counts[problem.ruleId].count++;
|
|
245
|
+
}
|
|
246
|
+
const sorted = Object.entries(counts).sort(([, a], [, b]) => {
|
|
247
|
+
const severityDiff = severityToNumber(a.severity) - severityToNumber(b.severity);
|
|
248
|
+
return severityDiff || b.count - a.count;
|
|
249
|
+
});
|
|
250
|
+
for (const [ruleId, info] of sorted) {
|
|
251
|
+
const color = COLORS[info.severity];
|
|
252
|
+
const severityName = color(SEVERITY_NAMES[info.severity].toLowerCase().padEnd(7));
|
|
253
|
+
logger.output(`${severityName} ${ruleId}: ${info.count}\n`);
|
|
254
|
+
}
|
|
255
|
+
logger.output('\n');
|
|
256
|
+
}
|
|
257
|
+
function formatFrom(cwd, location) {
|
|
258
|
+
if (!location)
|
|
259
|
+
return '';
|
|
260
|
+
const relativePath = path.relative(cwd, location.source.absoluteRef);
|
|
261
|
+
const loc = getLineColLocation(location);
|
|
262
|
+
const fileWithLoc = `${relativePath}:${loc.start.line}:${loc.start.col}`;
|
|
263
|
+
const atPointer = location.pointer ? colorize.gray(`at ${location.pointer}`) : '';
|
|
264
|
+
return `referenced from ${colorize.blue(fileWithLoc)} ${atPointer} \n\n`;
|
|
265
|
+
}
|
|
266
|
+
function formatDidYouMean(problem) {
|
|
267
|
+
if (problem.suggest.length === 0)
|
|
268
|
+
return '';
|
|
269
|
+
if (problem.suggest.length === 1) {
|
|
270
|
+
return `Did you mean: ${problem.suggest[0]} ?\n\n`;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
return `Did you mean:\n - ${problem.suggest.slice(0, MAX_SUGGEST).join('\n - ')}\n\n`;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const groupByFiles = (problems) => {
|
|
277
|
+
const fileGroups = {};
|
|
278
|
+
for (const problem of problems) {
|
|
279
|
+
const absoluteRef = problem.location[0].source.absoluteRef; // TODO: multiple errors
|
|
280
|
+
fileGroups[absoluteRef] = fileGroups[absoluteRef] || {
|
|
281
|
+
fileProblems: [],
|
|
282
|
+
ruleIdPad: 0,
|
|
283
|
+
locationPad: 0,
|
|
284
|
+
};
|
|
285
|
+
const mappedProblem = { ...problem, location: problem.location.map(getLineColLocation) };
|
|
286
|
+
fileGroups[absoluteRef].fileProblems.push(mappedProblem);
|
|
287
|
+
fileGroups[absoluteRef].ruleIdPad = Math.max(problem.ruleId.length, fileGroups[absoluteRef].ruleIdPad);
|
|
288
|
+
fileGroups[absoluteRef].locationPad = Math.max(Math.max(...mappedProblem.location.map((loc) => `${loc.start.line}:${loc.start.col}`.length)), fileGroups[absoluteRef].locationPad);
|
|
289
|
+
}
|
|
290
|
+
return fileGroups;
|
|
291
|
+
};
|
|
292
|
+
function xmlEscape(s) {
|
|
293
|
+
// eslint-disable-next-line no-control-regex
|
|
294
|
+
return s.replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, (char) => {
|
|
295
|
+
switch (char) {
|
|
296
|
+
case '<':
|
|
297
|
+
return '<';
|
|
298
|
+
case '>':
|
|
299
|
+
return '>';
|
|
300
|
+
case '&':
|
|
301
|
+
return '&';
|
|
302
|
+
case '"':
|
|
303
|
+
return '"';
|
|
304
|
+
case "'":
|
|
305
|
+
return ''';
|
|
306
|
+
default:
|
|
307
|
+
return `&#${char.charCodeAt(0)};`;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function outputForGithubActions(problems, cwd) {
|
|
312
|
+
for (const problem of problems) {
|
|
313
|
+
for (const location of problem.location.map(getLineColLocation)) {
|
|
314
|
+
let command;
|
|
315
|
+
switch (problem.severity) {
|
|
316
|
+
case 'error':
|
|
317
|
+
command = 'error';
|
|
318
|
+
break;
|
|
319
|
+
case 'warn':
|
|
320
|
+
command = 'warning';
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
const suggest = formatDidYouMean(problem);
|
|
324
|
+
const message = suggest !== '' ? problem.message + '\n\n' + suggest : problem.message;
|
|
325
|
+
const properties = {
|
|
326
|
+
title: problem.ruleId,
|
|
327
|
+
file: isAbsoluteUrl(location.source.absoluteRef)
|
|
328
|
+
? location.source.absoluteRef
|
|
329
|
+
: path.relative(cwd, location.source.absoluteRef),
|
|
330
|
+
line: location.start.line,
|
|
331
|
+
col: location.start.col,
|
|
332
|
+
endLine: location.end?.line,
|
|
333
|
+
endColumn: location.end?.col,
|
|
334
|
+
};
|
|
335
|
+
logger.output(`::${command} ${formatProperties(properties)}::${escapeMessage(message)}\n`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function formatProperties(props) {
|
|
339
|
+
return Object.entries(props)
|
|
340
|
+
.filter(([, v]) => v !== null && v !== undefined)
|
|
341
|
+
.map(([k, v]) => `${k}=${escapeProperty(v)}`)
|
|
342
|
+
.join(',');
|
|
343
|
+
}
|
|
344
|
+
function toString(v) {
|
|
345
|
+
if (v === null || v === undefined) {
|
|
346
|
+
return '';
|
|
347
|
+
}
|
|
348
|
+
else if (typeof v === 'string' || v instanceof String) {
|
|
349
|
+
return v;
|
|
350
|
+
}
|
|
351
|
+
return JSON.stringify(v);
|
|
352
|
+
}
|
|
353
|
+
function escapeMessage(v) {
|
|
354
|
+
return toString(v).replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
|
355
|
+
}
|
|
356
|
+
function escapeProperty(v) {
|
|
357
|
+
return toString(v)
|
|
358
|
+
.replace(/%/g, '%25')
|
|
359
|
+
.replace(/\r/g, '%0D')
|
|
360
|
+
.replace(/\n/g, '%0A')
|
|
361
|
+
.replace(/:/g, '%3A')
|
|
362
|
+
.replace(/,/g, '%2C');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export { doesYamlFileExist } from './utils/does-yaml-file-exist.js';
|
|
2
|
+
export { dequal } from './utils/dequal.js';
|
|
3
|
+
export { isEmptyObject } from './utils/is-empty-object.js';
|
|
4
|
+
export { isNotEmptyArray } from './utils/is-not-empty-array.js';
|
|
5
|
+
export { isNotEmptyObject } from './utils/is-not-empty-object.js';
|
|
6
|
+
export { isPlainObject } from './utils/is-plain-object.js';
|
|
7
|
+
export { isString } from './utils/is-string.js';
|
|
8
|
+
export { isTruthy } from './utils/is-truthy.js';
|
|
9
|
+
export { keysOf } from './utils/keys-of.js';
|
|
10
|
+
export { pause } from './utils/pause.js';
|
|
11
|
+
export { pluralize } from './utils/pluralize.js';
|
|
12
|
+
export { readFileFromUrl } from './utils/read-file-from-url.js';
|
|
13
|
+
export { slash } from './utils/slash.js';
|
|
14
|
+
export { Oas2Types } from './types/oas2.js';
|
|
15
|
+
export { Oas3Types } from './types/oas3.js';
|
|
16
|
+
export { Oas3_1Types } from './types/oas3_1.js';
|
|
17
|
+
export { Oas3_2Types } from './types/oas3_2.js';
|
|
18
|
+
export { AsyncApi2Types } from './types/asyncapi2.js';
|
|
19
|
+
export { AsyncApi3Types } from './types/asyncapi3.js';
|
|
20
|
+
export { Arazzo1Types } from './types/arazzo.js';
|
|
21
|
+
export { Overlay1Types } from './types/overlay.js';
|
|
22
|
+
export { OpenRpcTypes } from './types/openrpc.js';
|
|
23
|
+
export { ConfigTypes, createConfigTypes } from './types/redocly-yaml.js';
|
|
24
|
+
export { createEntityTypes } from './types/entity.js';
|
|
25
|
+
export { normalizeTypes } from './types/index.js';
|
|
26
|
+
export { StatsOAS, StatsAsync2, StatsAsync3 } from './rules/other/stats.js';
|
|
27
|
+
export { loadConfig, loadIgnoreConfig, createConfig, findConfig, resolvePlugins, ConfigValidationError, Config, // FIXME: export it as a type
|
|
28
|
+
} from './config/index.js';
|
|
29
|
+
export * from './config/constants.js';
|
|
30
|
+
export { Source, BaseResolver, ResolveError, resolveDocument, makeDocumentFromString, } from './resolve.js';
|
|
31
|
+
export { YamlParseError } from './errors/yaml-parse-error.js';
|
|
32
|
+
export { parseYaml, stringifyYaml } from './js-yaml/index.js';
|
|
33
|
+
export { unescapePointerFragment, isRef, isAbsoluteUrl, getDir, resolvePath, escapePointerFragment, } from './ref-utils.js';
|
|
34
|
+
export { detectSpec } from './detect-spec.js';
|
|
35
|
+
export { getTypes } from './oas-types.js';
|
|
36
|
+
export { getMajorSpecVersion } from './detect-spec.js';
|
|
37
|
+
export { normalizeVisitors, } from './visitors.js';
|
|
38
|
+
export { walkDocument, } from './walk.js';
|
|
39
|
+
export { getAstNodeByPointer, getLineColLocation, getCodeframe } from './format/codeframes.js';
|
|
40
|
+
export { formatProblems, getTotals } from './format/format.js';
|
|
41
|
+
export { lint, lint as validate, lintDocument, lintFromString, lintConfig } from './lint.js';
|
|
42
|
+
export { lintEntityFile, lintEntityWithScorecardLevel, lintSchema } from './lint-entity.js';
|
|
43
|
+
export { bundle, bundleFromString } from './bundle/bundle.js';
|
|
44
|
+
export { bundleDocument } from './bundle/bundle-document.js';
|
|
45
|
+
export { mapTypeToComponent } from './bundle/bundle-visitor.js';
|
|
46
|
+
export { logger } from './logger.js';
|
|
47
|
+
export { HandledError } from './utils/error.js';
|
|
48
|
+
export { isBrowser } from './env.js';
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// TODO: add a type for "types" https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/js-yaml/index.d.ts
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { JSON_SCHEMA, types, load, dump } from 'js-yaml';
|
|
5
|
+
const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = JSON_SCHEMA.extend({
|
|
6
|
+
implicit: [types.merge],
|
|
7
|
+
explicit: [types.binary, types.omap, types.pairs, types.set],
|
|
8
|
+
});
|
|
9
|
+
export const parseYaml = (str, opts) => load(str, { schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts });
|
|
10
|
+
export const stringifyYaml = (obj, opts) => dump(obj, opts);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|