@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.
Files changed (392) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/server/chunks/nitro/nitro.mjs +18 -87
  3. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  4. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  5. package/.output/server/index.mjs +1 -1
  6. package/.output/server/node_modules/.nitro/picomatch@4.0.3/index.js +17 -0
  7. package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/constants.js +180 -0
  8. package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/parse.js +1085 -0
  9. package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/picomatch.js +341 -0
  10. package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/scan.js +391 -0
  11. package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/utils.js +72 -0
  12. package/.output/server/node_modules/.nitro/picomatch@4.0.3/package.json +83 -0
  13. package/.output/server/node_modules/@redocly/ajv/dist/2020.js +55 -0
  14. package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +50 -0
  15. package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +156 -0
  16. package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +697 -0
  17. package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +143 -0
  18. package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +123 -0
  19. package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +249 -0
  20. package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +29 -0
  21. package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +12 -0
  22. package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +155 -0
  23. package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +26 -0
  24. package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +178 -0
  25. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +19 -0
  26. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +50 -0
  27. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +203 -0
  28. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +35 -0
  29. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +534 -0
  30. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +124 -0
  31. package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +81 -0
  32. package/.output/server/node_modules/@redocly/ajv/dist/core.js +632 -0
  33. package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +56 -0
  34. package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +13 -0
  35. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
  36. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
  37. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
  38. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
  39. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  40. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  41. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  42. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
  43. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
  44. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +138 -0
  45. package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +151 -0
  46. package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +7 -0
  47. package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +24 -0
  48. package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +6 -0
  49. package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +11 -0
  50. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
  51. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +107 -0
  52. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +23 -0
  53. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
  54. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +95 -0
  55. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
  56. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
  57. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +66 -0
  58. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +44 -0
  59. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +52 -0
  60. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +30 -0
  61. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +26 -0
  62. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
  63. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
  64. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
  65. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +55 -0
  66. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
  67. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
  68. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +138 -0
  69. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +10 -0
  70. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +16 -0
  71. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +132 -0
  72. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +139 -0
  73. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +9 -0
  74. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +23 -0
  75. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +29 -0
  76. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +17 -0
  77. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
  78. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
  79. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +9 -0
  80. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
  81. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
  82. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +92 -0
  83. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +6 -0
  84. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +26 -0
  85. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +8 -0
  86. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +26 -0
  87. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +7 -0
  88. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
  89. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +84 -0
  90. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +25 -0
  91. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
  92. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
  93. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
  94. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +48 -0
  95. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +37 -0
  96. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +15 -0
  97. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +24 -0
  98. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +27 -0
  99. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
  100. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
  101. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
  102. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +33 -0
  103. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +20 -0
  104. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +86 -0
  105. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
  106. package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
  107. package/.output/server/node_modules/@redocly/ajv/package.json +130 -0
  108. package/.output/server/node_modules/@redocly/config/lib/common.js +103 -0
  109. package/.output/server/node_modules/@redocly/config/lib/constants/config.js +17 -0
  110. package/.output/server/node_modules/@redocly/config/lib/constants/entities.js +58 -0
  111. package/.output/server/node_modules/@redocly/config/lib/constants/enum.js +6 -0
  112. package/.output/server/node_modules/@redocly/config/lib/constants/shared.js +22 -0
  113. package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +54 -0
  114. package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +186 -0
  115. package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +283 -0
  116. package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +682 -0
  117. package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +88 -0
  118. package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +157 -0
  119. package/.output/server/node_modules/@redocly/config/lib/index.js +41 -0
  120. package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +43 -0
  121. package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +120 -0
  122. package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +518 -0
  123. package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +25 -0
  124. package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +103 -0
  125. package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +558 -0
  126. package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +242 -0
  127. package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +3 -0
  128. package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +3 -0
  129. package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +3 -0
  130. package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +3 -0
  131. package/.output/server/node_modules/@redocly/config/lib/types/index.js +21 -0
  132. package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +18 -0
  133. package/.output/server/node_modules/@redocly/config/package.json +28 -0
  134. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +85 -0
  135. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +257 -0
  136. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +74 -0
  137. package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +310 -0
  138. package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +58 -0
  139. package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +27 -0
  140. package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +335 -0
  141. package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +338 -0
  142. package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +13 -0
  143. package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +9 -0
  144. package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +51 -0
  145. package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +8 -0
  146. package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +98 -0
  147. package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +289 -0
  148. package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +289 -0
  149. package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +289 -0
  150. package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +35 -0
  151. package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +289 -0
  152. package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +2 -0
  153. package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +129 -0
  154. package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +99 -0
  155. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +2 -0
  156. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +2 -0
  157. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +2 -0
  158. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +65 -0
  159. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +14 -0
  160. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +14 -0
  161. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +21 -0
  162. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +14 -0
  163. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +58 -0
  164. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +27 -0
  165. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +68 -0
  166. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +23 -0
  167. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +19 -0
  168. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +88 -0
  169. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +21 -0
  170. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +116 -0
  171. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +2 -0
  172. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +2 -0
  173. package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +79 -0
  174. package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +5 -0
  175. package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +14 -0
  176. package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +177 -0
  177. package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +365 -0
  178. package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +49 -0
  179. package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +11 -0
  180. package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +171 -0
  181. package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +123 -0
  182. package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +56 -0
  183. package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +35 -0
  184. package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +109 -0
  185. package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +326 -0
  186. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +106 -0
  187. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +68 -0
  188. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +52 -0
  189. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +139 -0
  190. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +27 -0
  191. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +30 -0
  192. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +19 -0
  193. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +21 -0
  194. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +15 -0
  195. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +27 -0
  196. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +27 -0
  197. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +23 -0
  198. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +53 -0
  199. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +19 -0
  200. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +16 -0
  201. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +32 -0
  202. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +13 -0
  203. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +16 -0
  204. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +32 -0
  205. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +13 -0
  206. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +39 -0
  207. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +269 -0
  208. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +22 -0
  209. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +215 -0
  210. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +14 -0
  211. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +23 -0
  212. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +14 -0
  213. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +42 -0
  214. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +21 -0
  215. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +38 -0
  216. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +31 -0
  217. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +21 -0
  218. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +32 -0
  219. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +34 -0
  220. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +13 -0
  221. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +78 -0
  222. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +19 -0
  223. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +42 -0
  224. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +20 -0
  225. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +20 -0
  226. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +9 -0
  227. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +17 -0
  228. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +15 -0
  229. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +13 -0
  230. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +37 -0
  231. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +13 -0
  232. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +9 -0
  233. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +27 -0
  234. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +19 -0
  235. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +13 -0
  236. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +23 -0
  237. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +15 -0
  238. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +145 -0
  239. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +30 -0
  240. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +17 -0
  241. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +34 -0
  242. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +26 -0
  243. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +39 -0
  244. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +62 -0
  245. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +27 -0
  246. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +150 -0
  247. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +9 -0
  248. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +18 -0
  249. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +19 -0
  250. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +93 -0
  251. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +14 -0
  252. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +34 -0
  253. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +14 -0
  254. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +26 -0
  255. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +21 -0
  256. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +130 -0
  257. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +129 -0
  258. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +20 -0
  259. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +13 -0
  260. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +59 -0
  261. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +15 -0
  262. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +15 -0
  263. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +58 -0
  264. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +28 -0
  265. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +83 -0
  266. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +15 -0
  267. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +33 -0
  268. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +28 -0
  269. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +36 -0
  270. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +28 -0
  271. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +59 -0
  272. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +32 -0
  273. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +31 -0
  274. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
  275. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
  276. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +65 -0
  277. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +20 -0
  278. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +82 -0
  279. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
  280. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
  281. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +190 -0
  282. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +12 -0
  283. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +20 -0
  284. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
  285. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
  286. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +18 -0
  287. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
  288. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +60 -0
  289. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +172 -0
  290. package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +482 -0
  291. package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +1157 -0
  292. package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +511 -0
  293. package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +32 -0
  294. package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +90 -0
  295. package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +181 -0
  296. package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +101 -0
  297. package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +454 -0
  298. package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +828 -0
  299. package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +292 -0
  300. package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +306 -0
  301. package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +360 -0
  302. package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +61 -0
  303. package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +573 -0
  304. package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +3 -0
  305. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +28 -0
  306. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +36 -0
  307. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +7 -0
  308. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +3 -0
  309. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +11 -0
  310. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +4 -0
  311. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +4 -0
  312. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +4 -0
  313. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +4 -0
  314. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +4 -0
  315. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +4 -0
  316. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +5 -0
  317. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +4 -0
  318. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +6 -0
  319. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +5 -0
  320. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +27 -0
  321. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +4 -0
  322. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +4 -0
  323. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +4 -0
  324. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +4 -0
  325. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +6 -0
  326. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +4 -0
  327. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +6 -0
  328. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +4 -0
  329. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +8 -0
  330. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +4 -0
  331. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +8 -0
  332. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +26 -0
  333. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +5 -0
  334. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +99 -0
  335. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +11 -0
  336. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +13 -0
  337. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +7 -0
  338. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +31 -0
  339. package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +23 -0
  340. package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +177 -0
  341. package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +303 -0
  342. package/.output/server/node_modules/@redocly/openapi-core/package.json +74 -0
  343. package/.output/server/node_modules/ajv-formats/dist/formats.js +208 -0
  344. package/.output/server/node_modules/ajv-formats/dist/index.js +37 -0
  345. package/.output/server/node_modules/ajv-formats/dist/limit.js +69 -0
  346. package/.output/server/node_modules/ajv-formats/package.json +74 -0
  347. package/.output/server/node_modules/colorette/index.js +82 -0
  348. package/.output/server/node_modules/colorette/package.json +39 -0
  349. package/.output/server/node_modules/js-levenshtein/index.js +105 -0
  350. package/.output/server/node_modules/js-levenshtein/package.json +49 -0
  351. package/.output/server/node_modules/pluralize/package.json +40 -0
  352. package/.output/server/node_modules/pluralize/pluralize.js +503 -0
  353. package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +45 -0
  354. package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +644 -0
  355. package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +40 -0
  356. package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +22 -0
  357. package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +1416 -0
  358. package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +62 -0
  359. package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +82 -0
  360. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +8 -0
  361. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +14 -0
  362. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +19 -0
  363. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +10 -0
  364. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +14 -0
  365. package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +78 -0
  366. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +92 -0
  367. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +32 -0
  368. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +95 -0
  369. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +155 -0
  370. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +64 -0
  371. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +22 -0
  372. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +7 -0
  373. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +10 -0
  374. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +30 -0
  375. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +46 -0
  376. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +55 -0
  377. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +7 -0
  378. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +22 -0
  379. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +7 -0
  380. package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +70 -0
  381. package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +54 -0
  382. package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +82 -0
  383. package/.output/server/node_modules/yaml-ast-parser/package.json +39 -0
  384. package/.output/server/package.json +9 -1
  385. package/package.json +16 -16
  386. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/index.js +0 -0
  387. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/constants.js +0 -0
  388. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/parse.js +0 -0
  389. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/picomatch.js +0 -0
  390. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/scan.js +0 -0
  391. /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/utils.js +0 -0
  392. /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 '&lt;';
298
+ case '>':
299
+ return '&gt;';
300
+ case '&':
301
+ return '&amp;';
302
+ case '"':
303
+ return '&quot;';
304
+ case "'":
305
+ return '&apos;';
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