@redocly/openapi-core 0.0.0-snapshot.1744188073 → 0.0.0-snapshot.1744801622

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (651) hide show
  1. package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -2
  2. package/lib/benchmark/benches/lint-with-many-rules.bench.js +19 -17
  3. package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -2
  4. package/lib/benchmark/benches/lint-with-nested-rule.bench.js +19 -15
  5. package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -2
  6. package/lib/benchmark/benches/lint-with-no-rules.bench.js +19 -15
  7. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -2
  8. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +19 -15
  9. package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -2
  10. package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +19 -15
  11. package/lib/benchmark/benches/recommended-oas3.bench.d.ts +1 -2
  12. package/lib/benchmark/benches/recommended-oas3.bench.js +18 -15
  13. package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +1 -2
  14. package/lib/benchmark/benches/resolve-with-no-external.bench.js +17 -14
  15. package/lib/benchmark/utils.d.ts +4 -5
  16. package/lib/benchmark/utils.js +14 -11
  17. package/lib/bundle.d.ts +9 -8
  18. package/lib/bundle.js +84 -72
  19. package/lib/config/all.d.ts +1 -2
  20. package/lib/config/all.js +3 -2
  21. package/lib/config/builtIn.d.ts +1 -2
  22. package/lib/config/builtIn.js +49 -44
  23. package/lib/config/config-resolvers.d.ts +5 -6
  24. package/lib/config/config-resolvers.js +94 -85
  25. package/lib/config/config.d.ts +8 -6
  26. package/lib/config/config.js +73 -66
  27. package/lib/config/index.d.ts +7 -8
  28. package/lib/config/index.js +23 -8
  29. package/lib/config/load.d.ts +8 -5
  30. package/lib/config/load.js +73 -28
  31. package/lib/config/minimal.d.ts +1 -2
  32. package/lib/config/minimal.js +3 -2
  33. package/lib/config/recommended-strict.d.ts +1 -2
  34. package/lib/config/recommended-strict.js +3 -2
  35. package/lib/config/recommended.d.ts +1 -2
  36. package/lib/config/recommended.js +3 -2
  37. package/lib/config/rules.d.ts +3 -4
  38. package/lib/config/rules.js +6 -4
  39. package/lib/config/spec.d.ts +1 -2
  40. package/lib/config/spec.js +3 -2
  41. package/lib/config/types.d.ts +13 -6
  42. package/lib/config/types.js +2 -2
  43. package/lib/config/utils.d.ts +2 -3
  44. package/lib/config/utils.js +89 -75
  45. package/lib/decorators/arazzo/index.d.ts +0 -1
  46. package/lib/decorators/arazzo/index.js +4 -2
  47. package/lib/decorators/async2/index.d.ts +0 -1
  48. package/lib/decorators/async2/index.js +4 -2
  49. package/lib/decorators/async3/index.d.ts +0 -1
  50. package/lib/decorators/async3/index.js +4 -2
  51. package/lib/decorators/common/filters/filter-helper.d.ts +1 -2
  52. package/lib/decorators/common/filters/filter-helper.js +12 -9
  53. package/lib/decorators/common/filters/filter-in.d.ts +1 -2
  54. package/lib/decorators/common/filters/filter-in.js +8 -5
  55. package/lib/decorators/common/filters/filter-out.d.ts +1 -2
  56. package/lib/decorators/common/filters/filter-out.js +8 -5
  57. package/lib/decorators/common/info-description-override.d.ts +1 -2
  58. package/lib/decorators/common/info-description-override.js +7 -4
  59. package/lib/decorators/common/info-override.d.ts +1 -2
  60. package/lib/decorators/common/info-override.js +5 -2
  61. package/lib/decorators/common/media-type-examples-override.d.ts +1 -2
  62. package/lib/decorators/common/media-type-examples-override.js +10 -7
  63. package/lib/decorators/common/operation-description-override.d.ts +1 -2
  64. package/lib/decorators/common/operation-description-override.js +7 -4
  65. package/lib/decorators/common/registry-dependencies.d.ts +2 -0
  66. package/lib/decorators/common/registry-dependencies.js +24 -0
  67. package/lib/decorators/common/remove-x-internal.d.ts +1 -2
  68. package/lib/decorators/common/remove-x-internal.js +14 -11
  69. package/lib/decorators/common/tag-description-override.d.ts +1 -2
  70. package/lib/decorators/common/tag-description-override.js +7 -4
  71. package/lib/decorators/oas2/index.d.ts +2 -2
  72. package/lib/decorators/oas2/index.js +20 -16
  73. package/lib/decorators/oas2/remove-unused-components.d.ts +1 -2
  74. package/lib/decorators/oas2/remove-unused-components.js +7 -4
  75. package/lib/decorators/oas3/index.d.ts +2 -2
  76. package/lib/decorators/oas3/index.js +22 -18
  77. package/lib/decorators/oas3/remove-unused-components.d.ts +1 -2
  78. package/lib/decorators/oas3/remove-unused-components.js +8 -5
  79. package/lib/decorators/overlay1/index.d.ts +0 -1
  80. package/lib/decorators/overlay1/index.js +4 -2
  81. package/lib/env.d.ts +0 -1
  82. package/lib/env.js +5 -3
  83. package/lib/format/codeframes.d.ts +1 -2
  84. package/lib/format/codeframes.js +19 -15
  85. package/lib/format/format.d.ts +1 -2
  86. package/lib/format/format.js +62 -57
  87. package/lib/index.d.ts +26 -29
  88. package/lib/index.js +98 -24
  89. package/lib/js-yaml/index.d.ts +0 -1
  90. package/lib/js-yaml/index.js +11 -7
  91. package/lib/lint.d.ts +10 -11
  92. package/lib/lint.js +44 -39
  93. package/lib/logger.d.ts +1 -2
  94. package/lib/logger.js +17 -15
  95. package/lib/oas-types.d.ts +3 -4
  96. package/lib/oas-types.js +32 -27
  97. package/lib/output.d.ts +3 -0
  98. package/lib/output.js +9 -0
  99. package/lib/redocly/domains.d.ts +14 -0
  100. package/lib/redocly/domains.js +41 -0
  101. package/lib/redocly/index.d.ts +30 -0
  102. package/lib/redocly/index.js +131 -0
  103. package/lib/redocly/redocly-client-types.d.ts +8 -0
  104. package/lib/redocly/redocly-client-types.js +2 -0
  105. package/lib/redocly/registry-api-types.d.ts +29 -0
  106. package/lib/redocly/registry-api-types.js +2 -0
  107. package/lib/redocly/registry-api.d.ts +17 -0
  108. package/lib/redocly/registry-api.js +100 -0
  109. package/lib/ref-utils.d.ts +2 -3
  110. package/lib/ref-utils.js +33 -18
  111. package/lib/resolve.d.ts +2 -3
  112. package/lib/resolve.js +45 -36
  113. package/lib/rules/ajv.d.ts +3 -4
  114. package/lib/rules/ajv.js +10 -7
  115. package/lib/rules/arazzo/criteria-unique.d.ts +1 -2
  116. package/lib/rules/arazzo/criteria-unique.js +5 -2
  117. package/lib/rules/arazzo/index.d.ts +1 -2
  118. package/lib/rules/arazzo/index.js +35 -33
  119. package/lib/rules/arazzo/parameters-unique.d.ts +1 -2
  120. package/lib/rules/arazzo/parameters-unique.js +5 -2
  121. package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +1 -2
  122. package/lib/rules/arazzo/requestBody-replacements-unique.js +5 -2
  123. package/lib/rules/arazzo/sourceDescription-type.d.ts +1 -2
  124. package/lib/rules/arazzo/sourceDescription-type.js +5 -2
  125. package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +1 -2
  126. package/lib/rules/arazzo/sourceDescriptions-name-unique.js +5 -2
  127. package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +1 -2
  128. package/lib/rules/arazzo/sourceDescriptions-not-empty.js +5 -2
  129. package/lib/rules/arazzo/step-onFailure-unique.d.ts +1 -2
  130. package/lib/rules/arazzo/step-onFailure-unique.js +5 -2
  131. package/lib/rules/arazzo/step-onSuccess-unique.d.ts +1 -2
  132. package/lib/rules/arazzo/step-onSuccess-unique.js +5 -2
  133. package/lib/rules/arazzo/stepId-unique.d.ts +1 -2
  134. package/lib/rules/arazzo/stepId-unique.js +5 -2
  135. package/lib/rules/arazzo/workflow-dependsOn.d.ts +1 -2
  136. package/lib/rules/arazzo/workflow-dependsOn.js +5 -2
  137. package/lib/rules/arazzo/workflowId-unique.d.ts +1 -2
  138. package/lib/rules/arazzo/workflowId-unique.js +5 -2
  139. package/lib/rules/async2/channels-kebab-case.d.ts +1 -2
  140. package/lib/rules/async2/channels-kebab-case.js +5 -2
  141. package/lib/rules/async2/index.d.ts +1 -2
  142. package/lib/rules/async2/index.js +24 -22
  143. package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -2
  144. package/lib/rules/async2/no-channel-trailing-slash.js +5 -2
  145. package/lib/rules/async3/channels-kebab-case.d.ts +1 -2
  146. package/lib/rules/async3/channels-kebab-case.js +5 -2
  147. package/lib/rules/async3/index.d.ts +1 -2
  148. package/lib/rules/async3/index.js +24 -22
  149. package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -2
  150. package/lib/rules/async3/no-channel-trailing-slash.js +6 -3
  151. package/lib/rules/common/assertions/asserts.d.ts +2 -3
  152. package/lib/rules/common/assertions/asserts.js +38 -35
  153. package/lib/rules/common/assertions/index.d.ts +3 -4
  154. package/lib/rules/common/assertions/index.js +10 -7
  155. package/lib/rules/common/assertions/utils.d.ts +4 -5
  156. package/lib/rules/common/assertions/utils.js +29 -21
  157. package/lib/rules/common/info-contact.d.ts +1 -2
  158. package/lib/rules/common/info-contact.js +7 -4
  159. package/lib/rules/common/info-license-strict.d.ts +1 -2
  160. package/lib/rules/common/info-license-strict.js +10 -7
  161. package/lib/rules/common/info-license-url.d.ts +1 -2
  162. package/lib/rules/common/info-license-url.js +7 -4
  163. package/lib/rules/common/info-license.d.ts +1 -2
  164. package/lib/rules/common/info-license.js +7 -4
  165. package/lib/rules/common/no-ambiguous-paths.d.ts +1 -2
  166. package/lib/rules/common/no-ambiguous-paths.js +5 -2
  167. package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -2
  168. package/lib/rules/common/no-enum-type-mismatch.js +9 -6
  169. package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -2
  170. package/lib/rules/common/no-http-verbs-in-paths.js +8 -5
  171. package/lib/rules/common/no-identical-paths.d.ts +1 -2
  172. package/lib/rules/common/no-identical-paths.js +5 -2
  173. package/lib/rules/common/no-invalid-parameter-examples.d.ts +0 -1
  174. package/lib/rules/common/no-invalid-parameter-examples.js +9 -6
  175. package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -2
  176. package/lib/rules/common/no-invalid-schema-examples.js +9 -6
  177. package/lib/rules/common/no-path-trailing-slash.d.ts +1 -2
  178. package/lib/rules/common/no-path-trailing-slash.js +5 -2
  179. package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -2
  180. package/lib/rules/common/no-required-schema-properties-undefined.js +7 -4
  181. package/lib/rules/common/no-schema-type-mismatch.d.ts +1 -2
  182. package/lib/rules/common/no-schema-type-mismatch.js +5 -2
  183. package/lib/rules/common/operation-2xx-response.d.ts +1 -2
  184. package/lib/rules/common/operation-2xx-response.js +8 -5
  185. package/lib/rules/common/operation-4xx-response.d.ts +1 -2
  186. package/lib/rules/common/operation-4xx-response.js +8 -5
  187. package/lib/rules/common/operation-description.d.ts +1 -2
  188. package/lib/rules/common/operation-description.js +7 -4
  189. package/lib/rules/common/operation-operationId-unique.d.ts +1 -2
  190. package/lib/rules/common/operation-operationId-unique.js +5 -2
  191. package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -2
  192. package/lib/rules/common/operation-operationId-url-safe.js +5 -2
  193. package/lib/rules/common/operation-operationId.d.ts +1 -2
  194. package/lib/rules/common/operation-operationId.js +7 -4
  195. package/lib/rules/common/operation-parameters-unique.d.ts +1 -2
  196. package/lib/rules/common/operation-parameters-unique.js +5 -2
  197. package/lib/rules/common/operation-singular-tag.d.ts +1 -2
  198. package/lib/rules/common/operation-singular-tag.js +5 -2
  199. package/lib/rules/common/operation-summary.d.ts +1 -2
  200. package/lib/rules/common/operation-summary.js +7 -4
  201. package/lib/rules/common/operation-tag-defined.d.ts +1 -2
  202. package/lib/rules/common/operation-tag-defined.js +5 -2
  203. package/lib/rules/common/parameter-description.d.ts +1 -2
  204. package/lib/rules/common/parameter-description.js +5 -2
  205. package/lib/rules/common/path-declaration-must-exist.d.ts +1 -2
  206. package/lib/rules/common/path-declaration-must-exist.js +5 -2
  207. package/lib/rules/common/path-excludes-patterns.d.ts +1 -2
  208. package/lib/rules/common/path-excludes-patterns.js +5 -2
  209. package/lib/rules/common/path-http-verbs-order.d.ts +1 -2
  210. package/lib/rules/common/path-http-verbs-order.js +5 -2
  211. package/lib/rules/common/path-not-include-query.d.ts +1 -2
  212. package/lib/rules/common/path-not-include-query.js +5 -2
  213. package/lib/rules/common/path-params-defined.d.ts +1 -2
  214. package/lib/rules/common/path-params-defined.js +5 -2
  215. package/lib/rules/common/path-segment-plural.d.ts +1 -2
  216. package/lib/rules/common/path-segment-plural.js +8 -5
  217. package/lib/rules/common/paths-kebab-case.d.ts +1 -2
  218. package/lib/rules/common/paths-kebab-case.js +5 -2
  219. package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -2
  220. package/lib/rules/common/required-string-property-missing-min-length.js +5 -2
  221. package/lib/rules/common/response-contains-header.d.ts +1 -2
  222. package/lib/rules/common/response-contains-header.js +8 -5
  223. package/lib/rules/common/scalar-property-missing-example.d.ts +1 -2
  224. package/lib/rules/common/scalar-property-missing-example.js +7 -4
  225. package/lib/rules/common/security-defined.d.ts +1 -2
  226. package/lib/rules/common/security-defined.js +5 -2
  227. package/lib/rules/common/spec-strict-refs.d.ts +1 -2
  228. package/lib/rules/common/spec-strict-refs.js +7 -4
  229. package/lib/rules/common/struct.d.ts +1 -2
  230. package/lib/rules/common/struct.js +21 -18
  231. package/lib/rules/common/tag-description.d.ts +1 -2
  232. package/lib/rules/common/tag-description.js +7 -4
  233. package/lib/rules/common/tags-alphabetical.d.ts +1 -2
  234. package/lib/rules/common/tags-alphabetical.js +5 -2
  235. package/lib/rules/no-unresolved-refs.d.ts +3 -4
  236. package/lib/rules/no-unresolved-refs.js +9 -5
  237. package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -2
  238. package/lib/rules/oas2/boolean-parameter-prefixes.js +5 -2
  239. package/lib/rules/oas2/index.d.ts +1 -2
  240. package/lib/rules/oas2/index.js +97 -95
  241. package/lib/rules/oas2/request-mime-type.d.ts +1 -2
  242. package/lib/rules/oas2/request-mime-type.js +8 -5
  243. package/lib/rules/oas2/response-contains-property.d.ts +1 -2
  244. package/lib/rules/oas2/response-contains-property.js +8 -5
  245. package/lib/rules/oas2/response-mime-type.d.ts +1 -2
  246. package/lib/rules/oas2/response-mime-type.js +8 -5
  247. package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -2
  248. package/lib/rules/oas3/array-parameter-serialization.js +7 -4
  249. package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -2
  250. package/lib/rules/oas3/boolean-parameter-prefixes.js +5 -2
  251. package/lib/rules/oas3/component-name-unique.d.ts +1 -2
  252. package/lib/rules/oas3/component-name-unique.js +5 -2
  253. package/lib/rules/oas3/index.d.ts +1 -2
  254. package/lib/rules/oas3/index.js +121 -119
  255. package/lib/rules/oas3/no-empty-servers.d.ts +1 -2
  256. package/lib/rules/oas3/no-empty-servers.js +5 -2
  257. package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -2
  258. package/lib/rules/oas3/no-example-value-and-externalValue.js +5 -2
  259. package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -2
  260. package/lib/rules/oas3/no-invalid-media-type-examples.js +10 -7
  261. package/lib/rules/oas3/no-server-example.com.d.ts +1 -2
  262. package/lib/rules/oas3/no-server-example.com.js +5 -2
  263. package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -2
  264. package/lib/rules/oas3/no-server-trailing-slash.js +5 -2
  265. package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -2
  266. package/lib/rules/oas3/no-server-variables-empty-enum.js +5 -2
  267. package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -2
  268. package/lib/rules/oas3/no-undefined-server-variable.js +5 -2
  269. package/lib/rules/oas3/no-unused-components.d.ts +1 -2
  270. package/lib/rules/oas3/no-unused-components.js +5 -2
  271. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +1 -2
  272. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +9 -6
  273. package/lib/rules/oas3/request-mime-type.d.ts +1 -2
  274. package/lib/rules/oas3/request-mime-type.js +9 -6
  275. package/lib/rules/oas3/response-contains-property.d.ts +1 -2
  276. package/lib/rules/oas3/response-contains-property.js +8 -5
  277. package/lib/rules/oas3/response-mime-type.d.ts +1 -2
  278. package/lib/rules/oas3/response-mime-type.js +9 -6
  279. package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -2
  280. package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -2
  281. package/lib/rules/other/stats.d.ts +3 -4
  282. package/lib/rules/other/stats.js +5 -2
  283. package/lib/rules/overlay1/index.d.ts +1 -2
  284. package/lib/rules/overlay1/index.js +11 -9
  285. package/lib/rules/respect/no-criteria-xpath.d.ts +1 -2
  286. package/lib/rules/respect/no-criteria-xpath.js +5 -2
  287. package/lib/rules/respect/respect-supported-versions.d.ts +1 -2
  288. package/lib/rules/respect/respect-supported-versions.js +10 -7
  289. package/lib/rules/utils.d.ts +3 -4
  290. package/lib/rules/utils.js +36 -23
  291. package/lib/types/arazzo.d.ts +1 -2
  292. package/lib/types/arazzo.js +23 -21
  293. package/lib/types/asyncapi2.d.ts +1 -2
  294. package/lib/types/asyncapi2.js +56 -54
  295. package/lib/types/asyncapi3.d.ts +1 -2
  296. package/lib/types/asyncapi3.js +43 -41
  297. package/lib/types/index.d.ts +0 -1
  298. package/lib/types/index.js +13 -7
  299. package/lib/types/json-schema-adapter.d.ts +1 -2
  300. package/lib/types/json-schema-adapter.js +17 -15
  301. package/lib/types/oas2.d.ts +2 -3
  302. package/lib/types/oas2.js +19 -17
  303. package/lib/types/oas3.d.ts +2 -3
  304. package/lib/types/oas3.js +41 -39
  305. package/lib/types/oas3_1.d.ts +2 -3
  306. package/lib/types/oas3_1.js +20 -18
  307. package/lib/types/overlay.d.ts +1 -2
  308. package/lib/types/overlay.js +6 -4
  309. package/lib/types/redocly-yaml.d.ts +3 -4
  310. package/lib/types/redocly-yaml.js +48 -31
  311. package/lib/typings/arazzo.d.ts +0 -1
  312. package/lib/typings/arazzo.js +5 -3
  313. package/lib/typings/asyncapi.d.ts +0 -1
  314. package/lib/typings/asyncapi.js +2 -2
  315. package/lib/typings/asyncapi3.d.ts +0 -1
  316. package/lib/typings/asyncapi3.js +2 -2
  317. package/lib/typings/common.d.ts +0 -1
  318. package/lib/typings/common.js +2 -2
  319. package/lib/typings/openapi.d.ts +0 -1
  320. package/lib/typings/openapi.js +2 -2
  321. package/lib/typings/overlay.d.ts +0 -1
  322. package/lib/typings/overlay.js +4 -2
  323. package/lib/typings/swagger.d.ts +1 -2
  324. package/lib/typings/swagger.js +2 -2
  325. package/lib/utils.d.ts +5 -4
  326. package/lib/utils.js +99 -53
  327. package/lib/visitors.d.ts +10 -11
  328. package/lib/visitors.js +6 -4
  329. package/lib/walk.d.ts +8 -9
  330. package/lib/walk.js +25 -23
  331. package/package.json +9 -30
  332. package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts.map +0 -1
  333. package/lib/benchmark/benches/lint-with-many-rules.bench.js.map +0 -1
  334. package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts.map +0 -1
  335. package/lib/benchmark/benches/lint-with-nested-rule.bench.js.map +0 -1
  336. package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts.map +0 -1
  337. package/lib/benchmark/benches/lint-with-no-rules.bench.js.map +0 -1
  338. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts.map +0 -1
  339. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js.map +0 -1
  340. package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts.map +0 -1
  341. package/lib/benchmark/benches/lint-with-top-level-rule.bench.js.map +0 -1
  342. package/lib/benchmark/benches/recommended-oas3.bench.d.ts.map +0 -1
  343. package/lib/benchmark/benches/recommended-oas3.bench.js.map +0 -1
  344. package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts.map +0 -1
  345. package/lib/benchmark/benches/resolve-with-no-external.bench.js.map +0 -1
  346. package/lib/benchmark/utils.d.ts.map +0 -1
  347. package/lib/benchmark/utils.js.map +0 -1
  348. package/lib/bundle.d.ts.map +0 -1
  349. package/lib/bundle.js.map +0 -1
  350. package/lib/config/all.d.ts.map +0 -1
  351. package/lib/config/all.js.map +0 -1
  352. package/lib/config/builtIn.d.ts.map +0 -1
  353. package/lib/config/builtIn.js.map +0 -1
  354. package/lib/config/config-resolvers.d.ts.map +0 -1
  355. package/lib/config/config-resolvers.js.map +0 -1
  356. package/lib/config/config.d.ts.map +0 -1
  357. package/lib/config/config.js.map +0 -1
  358. package/lib/config/index.d.ts.map +0 -1
  359. package/lib/config/index.js.map +0 -1
  360. package/lib/config/load.d.ts.map +0 -1
  361. package/lib/config/load.js.map +0 -1
  362. package/lib/config/minimal.d.ts.map +0 -1
  363. package/lib/config/minimal.js.map +0 -1
  364. package/lib/config/recommended-strict.d.ts.map +0 -1
  365. package/lib/config/recommended-strict.js.map +0 -1
  366. package/lib/config/recommended.d.ts.map +0 -1
  367. package/lib/config/recommended.js.map +0 -1
  368. package/lib/config/rules.d.ts.map +0 -1
  369. package/lib/config/rules.js.map +0 -1
  370. package/lib/config/spec.d.ts.map +0 -1
  371. package/lib/config/spec.js.map +0 -1
  372. package/lib/config/types.d.ts.map +0 -1
  373. package/lib/config/types.js.map +0 -1
  374. package/lib/config/utils.d.ts.map +0 -1
  375. package/lib/config/utils.js.map +0 -1
  376. package/lib/decorators/arazzo/index.d.ts.map +0 -1
  377. package/lib/decorators/arazzo/index.js.map +0 -1
  378. package/lib/decorators/async2/index.d.ts.map +0 -1
  379. package/lib/decorators/async2/index.js.map +0 -1
  380. package/lib/decorators/async3/index.d.ts.map +0 -1
  381. package/lib/decorators/async3/index.js.map +0 -1
  382. package/lib/decorators/common/filters/filter-helper.d.ts.map +0 -1
  383. package/lib/decorators/common/filters/filter-helper.js.map +0 -1
  384. package/lib/decorators/common/filters/filter-in.d.ts.map +0 -1
  385. package/lib/decorators/common/filters/filter-in.js.map +0 -1
  386. package/lib/decorators/common/filters/filter-out.d.ts.map +0 -1
  387. package/lib/decorators/common/filters/filter-out.js.map +0 -1
  388. package/lib/decorators/common/info-description-override.d.ts.map +0 -1
  389. package/lib/decorators/common/info-description-override.js.map +0 -1
  390. package/lib/decorators/common/info-override.d.ts.map +0 -1
  391. package/lib/decorators/common/info-override.js.map +0 -1
  392. package/lib/decorators/common/media-type-examples-override.d.ts.map +0 -1
  393. package/lib/decorators/common/media-type-examples-override.js.map +0 -1
  394. package/lib/decorators/common/operation-description-override.d.ts.map +0 -1
  395. package/lib/decorators/common/operation-description-override.js.map +0 -1
  396. package/lib/decorators/common/remove-x-internal.d.ts.map +0 -1
  397. package/lib/decorators/common/remove-x-internal.js.map +0 -1
  398. package/lib/decorators/common/tag-description-override.d.ts.map +0 -1
  399. package/lib/decorators/common/tag-description-override.js.map +0 -1
  400. package/lib/decorators/oas2/index.d.ts.map +0 -1
  401. package/lib/decorators/oas2/index.js.map +0 -1
  402. package/lib/decorators/oas2/remove-unused-components.d.ts.map +0 -1
  403. package/lib/decorators/oas2/remove-unused-components.js.map +0 -1
  404. package/lib/decorators/oas3/index.d.ts.map +0 -1
  405. package/lib/decorators/oas3/index.js.map +0 -1
  406. package/lib/decorators/oas3/remove-unused-components.d.ts.map +0 -1
  407. package/lib/decorators/oas3/remove-unused-components.js.map +0 -1
  408. package/lib/decorators/overlay1/index.d.ts.map +0 -1
  409. package/lib/decorators/overlay1/index.js.map +0 -1
  410. package/lib/env.d.ts.map +0 -1
  411. package/lib/env.js.map +0 -1
  412. package/lib/format/codeframes.d.ts.map +0 -1
  413. package/lib/format/codeframes.js.map +0 -1
  414. package/lib/format/format.d.ts.map +0 -1
  415. package/lib/format/format.js.map +0 -1
  416. package/lib/index.d.ts.map +0 -1
  417. package/lib/index.js.map +0 -1
  418. package/lib/js-yaml/index.d.ts.map +0 -1
  419. package/lib/js-yaml/index.js.map +0 -1
  420. package/lib/lint.d.ts.map +0 -1
  421. package/lib/lint.js.map +0 -1
  422. package/lib/logger.d.ts.map +0 -1
  423. package/lib/logger.js.map +0 -1
  424. package/lib/oas-types.d.ts.map +0 -1
  425. package/lib/oas-types.js.map +0 -1
  426. package/lib/ref-utils.d.ts.map +0 -1
  427. package/lib/ref-utils.js.map +0 -1
  428. package/lib/resolve.d.ts.map +0 -1
  429. package/lib/resolve.js.map +0 -1
  430. package/lib/rules/ajv.d.ts.map +0 -1
  431. package/lib/rules/ajv.js.map +0 -1
  432. package/lib/rules/arazzo/criteria-unique.d.ts.map +0 -1
  433. package/lib/rules/arazzo/criteria-unique.js.map +0 -1
  434. package/lib/rules/arazzo/index.d.ts.map +0 -1
  435. package/lib/rules/arazzo/index.js.map +0 -1
  436. package/lib/rules/arazzo/parameters-unique.d.ts.map +0 -1
  437. package/lib/rules/arazzo/parameters-unique.js.map +0 -1
  438. package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +0 -1
  439. package/lib/rules/arazzo/requestBody-replacements-unique.js.map +0 -1
  440. package/lib/rules/arazzo/sourceDescription-type.d.ts.map +0 -1
  441. package/lib/rules/arazzo/sourceDescription-type.js.map +0 -1
  442. package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +0 -1
  443. package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +0 -1
  444. package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +0 -1
  445. package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +0 -1
  446. package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +0 -1
  447. package/lib/rules/arazzo/step-onFailure-unique.js.map +0 -1
  448. package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +0 -1
  449. package/lib/rules/arazzo/step-onSuccess-unique.js.map +0 -1
  450. package/lib/rules/arazzo/stepId-unique.d.ts.map +0 -1
  451. package/lib/rules/arazzo/stepId-unique.js.map +0 -1
  452. package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +0 -1
  453. package/lib/rules/arazzo/workflow-dependsOn.js.map +0 -1
  454. package/lib/rules/arazzo/workflowId-unique.d.ts.map +0 -1
  455. package/lib/rules/arazzo/workflowId-unique.js.map +0 -1
  456. package/lib/rules/async2/channels-kebab-case.d.ts.map +0 -1
  457. package/lib/rules/async2/channels-kebab-case.js.map +0 -1
  458. package/lib/rules/async2/index.d.ts.map +0 -1
  459. package/lib/rules/async2/index.js.map +0 -1
  460. package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +0 -1
  461. package/lib/rules/async2/no-channel-trailing-slash.js.map +0 -1
  462. package/lib/rules/async3/channels-kebab-case.d.ts.map +0 -1
  463. package/lib/rules/async3/channels-kebab-case.js.map +0 -1
  464. package/lib/rules/async3/index.d.ts.map +0 -1
  465. package/lib/rules/async3/index.js.map +0 -1
  466. package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +0 -1
  467. package/lib/rules/async3/no-channel-trailing-slash.js.map +0 -1
  468. package/lib/rules/common/assertions/asserts.d.ts.map +0 -1
  469. package/lib/rules/common/assertions/asserts.js.map +0 -1
  470. package/lib/rules/common/assertions/index.d.ts.map +0 -1
  471. package/lib/rules/common/assertions/index.js.map +0 -1
  472. package/lib/rules/common/assertions/utils.d.ts.map +0 -1
  473. package/lib/rules/common/assertions/utils.js.map +0 -1
  474. package/lib/rules/common/info-contact.d.ts.map +0 -1
  475. package/lib/rules/common/info-contact.js.map +0 -1
  476. package/lib/rules/common/info-license-strict.d.ts.map +0 -1
  477. package/lib/rules/common/info-license-strict.js.map +0 -1
  478. package/lib/rules/common/info-license-url.d.ts.map +0 -1
  479. package/lib/rules/common/info-license-url.js.map +0 -1
  480. package/lib/rules/common/info-license.d.ts.map +0 -1
  481. package/lib/rules/common/info-license.js.map +0 -1
  482. package/lib/rules/common/no-ambiguous-paths.d.ts.map +0 -1
  483. package/lib/rules/common/no-ambiguous-paths.js.map +0 -1
  484. package/lib/rules/common/no-enum-type-mismatch.d.ts.map +0 -1
  485. package/lib/rules/common/no-enum-type-mismatch.js.map +0 -1
  486. package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +0 -1
  487. package/lib/rules/common/no-http-verbs-in-paths.js.map +0 -1
  488. package/lib/rules/common/no-identical-paths.d.ts.map +0 -1
  489. package/lib/rules/common/no-identical-paths.js.map +0 -1
  490. package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +0 -1
  491. package/lib/rules/common/no-invalid-parameter-examples.js.map +0 -1
  492. package/lib/rules/common/no-invalid-schema-examples.d.ts.map +0 -1
  493. package/lib/rules/common/no-invalid-schema-examples.js.map +0 -1
  494. package/lib/rules/common/no-path-trailing-slash.d.ts.map +0 -1
  495. package/lib/rules/common/no-path-trailing-slash.js.map +0 -1
  496. package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +0 -1
  497. package/lib/rules/common/no-required-schema-properties-undefined.js.map +0 -1
  498. package/lib/rules/common/no-schema-type-mismatch.d.ts.map +0 -1
  499. package/lib/rules/common/no-schema-type-mismatch.js.map +0 -1
  500. package/lib/rules/common/operation-2xx-response.d.ts.map +0 -1
  501. package/lib/rules/common/operation-2xx-response.js.map +0 -1
  502. package/lib/rules/common/operation-4xx-response.d.ts.map +0 -1
  503. package/lib/rules/common/operation-4xx-response.js.map +0 -1
  504. package/lib/rules/common/operation-description.d.ts.map +0 -1
  505. package/lib/rules/common/operation-description.js.map +0 -1
  506. package/lib/rules/common/operation-operationId-unique.d.ts.map +0 -1
  507. package/lib/rules/common/operation-operationId-unique.js.map +0 -1
  508. package/lib/rules/common/operation-operationId-url-safe.d.ts.map +0 -1
  509. package/lib/rules/common/operation-operationId-url-safe.js.map +0 -1
  510. package/lib/rules/common/operation-operationId.d.ts.map +0 -1
  511. package/lib/rules/common/operation-operationId.js.map +0 -1
  512. package/lib/rules/common/operation-parameters-unique.d.ts.map +0 -1
  513. package/lib/rules/common/operation-parameters-unique.js.map +0 -1
  514. package/lib/rules/common/operation-singular-tag.d.ts.map +0 -1
  515. package/lib/rules/common/operation-singular-tag.js.map +0 -1
  516. package/lib/rules/common/operation-summary.d.ts.map +0 -1
  517. package/lib/rules/common/operation-summary.js.map +0 -1
  518. package/lib/rules/common/operation-tag-defined.d.ts.map +0 -1
  519. package/lib/rules/common/operation-tag-defined.js.map +0 -1
  520. package/lib/rules/common/parameter-description.d.ts.map +0 -1
  521. package/lib/rules/common/parameter-description.js.map +0 -1
  522. package/lib/rules/common/path-declaration-must-exist.d.ts.map +0 -1
  523. package/lib/rules/common/path-declaration-must-exist.js.map +0 -1
  524. package/lib/rules/common/path-excludes-patterns.d.ts.map +0 -1
  525. package/lib/rules/common/path-excludes-patterns.js.map +0 -1
  526. package/lib/rules/common/path-http-verbs-order.d.ts.map +0 -1
  527. package/lib/rules/common/path-http-verbs-order.js.map +0 -1
  528. package/lib/rules/common/path-not-include-query.d.ts.map +0 -1
  529. package/lib/rules/common/path-not-include-query.js.map +0 -1
  530. package/lib/rules/common/path-params-defined.d.ts.map +0 -1
  531. package/lib/rules/common/path-params-defined.js.map +0 -1
  532. package/lib/rules/common/path-segment-plural.d.ts.map +0 -1
  533. package/lib/rules/common/path-segment-plural.js.map +0 -1
  534. package/lib/rules/common/paths-kebab-case.d.ts.map +0 -1
  535. package/lib/rules/common/paths-kebab-case.js.map +0 -1
  536. package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +0 -1
  537. package/lib/rules/common/required-string-property-missing-min-length.js.map +0 -1
  538. package/lib/rules/common/response-contains-header.d.ts.map +0 -1
  539. package/lib/rules/common/response-contains-header.js.map +0 -1
  540. package/lib/rules/common/scalar-property-missing-example.d.ts.map +0 -1
  541. package/lib/rules/common/scalar-property-missing-example.js.map +0 -1
  542. package/lib/rules/common/security-defined.d.ts.map +0 -1
  543. package/lib/rules/common/security-defined.js.map +0 -1
  544. package/lib/rules/common/spec-strict-refs.d.ts.map +0 -1
  545. package/lib/rules/common/spec-strict-refs.js.map +0 -1
  546. package/lib/rules/common/struct.d.ts.map +0 -1
  547. package/lib/rules/common/struct.js.map +0 -1
  548. package/lib/rules/common/tag-description.d.ts.map +0 -1
  549. package/lib/rules/common/tag-description.js.map +0 -1
  550. package/lib/rules/common/tags-alphabetical.d.ts.map +0 -1
  551. package/lib/rules/common/tags-alphabetical.js.map +0 -1
  552. package/lib/rules/no-unresolved-refs.d.ts.map +0 -1
  553. package/lib/rules/no-unresolved-refs.js.map +0 -1
  554. package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +0 -1
  555. package/lib/rules/oas2/boolean-parameter-prefixes.js.map +0 -1
  556. package/lib/rules/oas2/index.d.ts.map +0 -1
  557. package/lib/rules/oas2/index.js.map +0 -1
  558. package/lib/rules/oas2/request-mime-type.d.ts.map +0 -1
  559. package/lib/rules/oas2/request-mime-type.js.map +0 -1
  560. package/lib/rules/oas2/response-contains-property.d.ts.map +0 -1
  561. package/lib/rules/oas2/response-contains-property.js.map +0 -1
  562. package/lib/rules/oas2/response-mime-type.d.ts.map +0 -1
  563. package/lib/rules/oas2/response-mime-type.js.map +0 -1
  564. package/lib/rules/oas3/array-parameter-serialization.d.ts.map +0 -1
  565. package/lib/rules/oas3/array-parameter-serialization.js.map +0 -1
  566. package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +0 -1
  567. package/lib/rules/oas3/boolean-parameter-prefixes.js.map +0 -1
  568. package/lib/rules/oas3/component-name-unique.d.ts.map +0 -1
  569. package/lib/rules/oas3/component-name-unique.js.map +0 -1
  570. package/lib/rules/oas3/index.d.ts.map +0 -1
  571. package/lib/rules/oas3/index.js.map +0 -1
  572. package/lib/rules/oas3/no-empty-servers.d.ts.map +0 -1
  573. package/lib/rules/oas3/no-empty-servers.js.map +0 -1
  574. package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +0 -1
  575. package/lib/rules/oas3/no-example-value-and-externalValue.js.map +0 -1
  576. package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +0 -1
  577. package/lib/rules/oas3/no-invalid-media-type-examples.js.map +0 -1
  578. package/lib/rules/oas3/no-server-example.com.d.ts.map +0 -1
  579. package/lib/rules/oas3/no-server-example.com.js.map +0 -1
  580. package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +0 -1
  581. package/lib/rules/oas3/no-server-trailing-slash.js.map +0 -1
  582. package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +0 -1
  583. package/lib/rules/oas3/no-server-variables-empty-enum.js.map +0 -1
  584. package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +0 -1
  585. package/lib/rules/oas3/no-undefined-server-variable.js.map +0 -1
  586. package/lib/rules/oas3/no-unused-components.d.ts.map +0 -1
  587. package/lib/rules/oas3/no-unused-components.js.map +0 -1
  588. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +0 -1
  589. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +0 -1
  590. package/lib/rules/oas3/request-mime-type.d.ts.map +0 -1
  591. package/lib/rules/oas3/request-mime-type.js.map +0 -1
  592. package/lib/rules/oas3/response-contains-property.d.ts.map +0 -1
  593. package/lib/rules/oas3/response-contains-property.js.map +0 -1
  594. package/lib/rules/oas3/response-mime-type.d.ts.map +0 -1
  595. package/lib/rules/oas3/response-mime-type.js.map +0 -1
  596. package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +0 -1
  597. package/lib/rules/oas3/spec-components-invalid-map-name.js.map +0 -1
  598. package/lib/rules/other/stats.d.ts.map +0 -1
  599. package/lib/rules/other/stats.js.map +0 -1
  600. package/lib/rules/overlay1/index.d.ts.map +0 -1
  601. package/lib/rules/overlay1/index.js.map +0 -1
  602. package/lib/rules/respect/no-criteria-xpath.d.ts.map +0 -1
  603. package/lib/rules/respect/no-criteria-xpath.js.map +0 -1
  604. package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
  605. package/lib/rules/respect/respect-supported-versions.js.map +0 -1
  606. package/lib/rules/utils.d.ts.map +0 -1
  607. package/lib/rules/utils.js.map +0 -1
  608. package/lib/types/arazzo.d.ts.map +0 -1
  609. package/lib/types/arazzo.js.map +0 -1
  610. package/lib/types/asyncapi2.d.ts.map +0 -1
  611. package/lib/types/asyncapi2.js.map +0 -1
  612. package/lib/types/asyncapi3.d.ts.map +0 -1
  613. package/lib/types/asyncapi3.js.map +0 -1
  614. package/lib/types/index.d.ts.map +0 -1
  615. package/lib/types/index.js.map +0 -1
  616. package/lib/types/json-schema-adapter.d.ts.map +0 -1
  617. package/lib/types/json-schema-adapter.js.map +0 -1
  618. package/lib/types/oas2.d.ts.map +0 -1
  619. package/lib/types/oas2.js.map +0 -1
  620. package/lib/types/oas3.d.ts.map +0 -1
  621. package/lib/types/oas3.js.map +0 -1
  622. package/lib/types/oas3_1.d.ts.map +0 -1
  623. package/lib/types/oas3_1.js.map +0 -1
  624. package/lib/types/overlay.d.ts.map +0 -1
  625. package/lib/types/overlay.js.map +0 -1
  626. package/lib/types/redocly-yaml.d.ts.map +0 -1
  627. package/lib/types/redocly-yaml.js.map +0 -1
  628. package/lib/typings/arazzo.d.ts.map +0 -1
  629. package/lib/typings/arazzo.js.map +0 -1
  630. package/lib/typings/asyncapi.d.ts.map +0 -1
  631. package/lib/typings/asyncapi.js.map +0 -1
  632. package/lib/typings/asyncapi3.d.ts.map +0 -1
  633. package/lib/typings/asyncapi3.js.map +0 -1
  634. package/lib/typings/common.d.ts.map +0 -1
  635. package/lib/typings/common.js.map +0 -1
  636. package/lib/typings/openapi.d.ts.map +0 -1
  637. package/lib/typings/openapi.js.map +0 -1
  638. package/lib/typings/overlay.d.ts.map +0 -1
  639. package/lib/typings/overlay.js.map +0 -1
  640. package/lib/typings/swagger.d.ts.map +0 -1
  641. package/lib/typings/swagger.js.map +0 -1
  642. package/lib/utils/error.d.ts +0 -3
  643. package/lib/utils/error.d.ts.map +0 -1
  644. package/lib/utils/error.js +0 -3
  645. package/lib/utils/error.js.map +0 -1
  646. package/lib/utils.d.ts.map +0 -1
  647. package/lib/utils.js.map +0 -1
  648. package/lib/visitors.d.ts.map +0 -1
  649. package/lib/visitors.js.map +0 -1
  650. package/lib/walk.d.ts.map +0 -1
  651. package/lib/walk.js.map +0 -1
@@ -1,25 +1,28 @@
1
- import * as fs from 'node:fs';
2
- import * as path from 'node:path';
3
- import { parseYaml, stringifyYaml } from '../js-yaml/index.js';
4
- import { slash, doesYamlFileExist, isPlainObject, showWarningForDeprecatedField, } from '../utils.js';
5
- import { SpecVersion, SpecMajorVersion } from '../oas-types.js';
6
- import { isBrowser } from '../env.js';
7
- import { getResolveConfig } from './utils.js';
8
- import { isAbsoluteUrl } from '../ref-utils.js';
9
- export const IGNORE_FILE = '.redocly.lint-ignore.yaml';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = exports.StyleguideConfig = exports.IGNORE_FILE = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const js_yaml_1 = require("../js-yaml");
7
+ const utils_1 = require("../utils");
8
+ const oas_types_1 = require("../oas-types");
9
+ const env_1 = require("../env");
10
+ const utils_2 = require("./utils");
11
+ const ref_utils_1 = require("../ref-utils");
12
+ exports.IGNORE_FILE = '.redocly.lint-ignore.yaml';
10
13
  const IGNORE_BANNER = `# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.\n` +
11
14
  `# See https://redocly.com/docs/cli/ for more information.\n`;
12
15
  function getIgnoreFilePath(configFile) {
13
16
  if (configFile) {
14
- return doesYamlFileExist(configFile)
15
- ? path.join(path.dirname(configFile), IGNORE_FILE)
16
- : path.join(configFile, IGNORE_FILE);
17
+ return (0, utils_1.doesYamlFileExist)(configFile)
18
+ ? path.join(path.dirname(configFile), exports.IGNORE_FILE)
19
+ : path.join(configFile, exports.IGNORE_FILE);
17
20
  }
18
21
  else {
19
- return isBrowser ? undefined : path.join(process.cwd(), IGNORE_FILE);
22
+ return env_1.isBrowser ? undefined : path.join(process.cwd(), exports.IGNORE_FILE);
20
23
  }
21
24
  }
22
- export class StyleguideConfig {
25
+ class StyleguideConfig {
23
26
  constructor(rawConfig, configFile) {
24
27
  this.rawConfig = rawConfig;
25
28
  this.configFile = configFile;
@@ -41,67 +44,67 @@ export class StyleguideConfig {
41
44
  ];
42
45
  replaceSpecWithStruct(ruleGroups, rawConfig);
43
46
  this.rules = {
44
- [SpecVersion.OAS2]: { ...rawConfig.rules, ...rawConfig.oas2Rules },
45
- [SpecVersion.OAS3_0]: { ...rawConfig.rules, ...rawConfig.oas3_0Rules },
46
- [SpecVersion.OAS3_1]: { ...rawConfig.rules, ...rawConfig.oas3_1Rules },
47
- [SpecVersion.Async2]: { ...rawConfig.rules, ...rawConfig.async2Rules },
48
- [SpecVersion.Async3]: { ...rawConfig.rules, ...rawConfig.async3Rules },
49
- [SpecVersion.Arazzo1]: { ...rawConfig.rules, ...rawConfig.arazzo1Rules },
50
- [SpecVersion.Overlay1]: { ...rawConfig.rules, ...rawConfig.overlay1Rules },
47
+ [oas_types_1.SpecVersion.OAS2]: { ...rawConfig.rules, ...rawConfig.oas2Rules },
48
+ [oas_types_1.SpecVersion.OAS3_0]: { ...rawConfig.rules, ...rawConfig.oas3_0Rules },
49
+ [oas_types_1.SpecVersion.OAS3_1]: { ...rawConfig.rules, ...rawConfig.oas3_1Rules },
50
+ [oas_types_1.SpecVersion.Async2]: { ...rawConfig.rules, ...rawConfig.async2Rules },
51
+ [oas_types_1.SpecVersion.Async3]: { ...rawConfig.rules, ...rawConfig.async3Rules },
52
+ [oas_types_1.SpecVersion.Arazzo1]: { ...rawConfig.rules, ...rawConfig.arazzo1Rules },
53
+ [oas_types_1.SpecVersion.Overlay1]: { ...rawConfig.rules, ...rawConfig.overlay1Rules },
51
54
  };
52
55
  this.preprocessors = {
53
- [SpecVersion.OAS2]: { ...rawConfig.preprocessors, ...rawConfig.oas2Preprocessors },
54
- [SpecVersion.OAS3_0]: { ...rawConfig.preprocessors, ...rawConfig.oas3_0Preprocessors },
55
- [SpecVersion.OAS3_1]: { ...rawConfig.preprocessors, ...rawConfig.oas3_1Preprocessors },
56
- [SpecVersion.Async2]: { ...rawConfig.preprocessors, ...rawConfig.async2Preprocessors },
57
- [SpecVersion.Async3]: { ...rawConfig.preprocessors, ...rawConfig.async3Preprocessors },
58
- [SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Preprocessors },
59
- [SpecVersion.Overlay1]: { ...rawConfig.preprocessors, ...rawConfig.overlay1Preprocessors },
56
+ [oas_types_1.SpecVersion.OAS2]: { ...rawConfig.preprocessors, ...rawConfig.oas2Preprocessors },
57
+ [oas_types_1.SpecVersion.OAS3_0]: { ...rawConfig.preprocessors, ...rawConfig.oas3_0Preprocessors },
58
+ [oas_types_1.SpecVersion.OAS3_1]: { ...rawConfig.preprocessors, ...rawConfig.oas3_1Preprocessors },
59
+ [oas_types_1.SpecVersion.Async2]: { ...rawConfig.preprocessors, ...rawConfig.async2Preprocessors },
60
+ [oas_types_1.SpecVersion.Async3]: { ...rawConfig.preprocessors, ...rawConfig.async3Preprocessors },
61
+ [oas_types_1.SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Preprocessors },
62
+ [oas_types_1.SpecVersion.Overlay1]: { ...rawConfig.preprocessors, ...rawConfig.overlay1Preprocessors },
60
63
  };
61
64
  this.decorators = {
62
- [SpecVersion.OAS2]: { ...rawConfig.decorators, ...rawConfig.oas2Decorators },
63
- [SpecVersion.OAS3_0]: { ...rawConfig.decorators, ...rawConfig.oas3_0Decorators },
64
- [SpecVersion.OAS3_1]: { ...rawConfig.decorators, ...rawConfig.oas3_1Decorators },
65
- [SpecVersion.Async2]: { ...rawConfig.decorators, ...rawConfig.async2Decorators },
66
- [SpecVersion.Async3]: { ...rawConfig.decorators, ...rawConfig.async3Decorators },
67
- [SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Decorators },
68
- [SpecVersion.Overlay1]: { ...rawConfig.decorators, ...rawConfig.overlay1Decorators },
65
+ [oas_types_1.SpecVersion.OAS2]: { ...rawConfig.decorators, ...rawConfig.oas2Decorators },
66
+ [oas_types_1.SpecVersion.OAS3_0]: { ...rawConfig.decorators, ...rawConfig.oas3_0Decorators },
67
+ [oas_types_1.SpecVersion.OAS3_1]: { ...rawConfig.decorators, ...rawConfig.oas3_1Decorators },
68
+ [oas_types_1.SpecVersion.Async2]: { ...rawConfig.decorators, ...rawConfig.async2Decorators },
69
+ [oas_types_1.SpecVersion.Async3]: { ...rawConfig.decorators, ...rawConfig.async3Decorators },
70
+ [oas_types_1.SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Decorators },
71
+ [oas_types_1.SpecVersion.Overlay1]: { ...rawConfig.decorators, ...rawConfig.overlay1Decorators },
69
72
  };
70
73
  this.extendPaths = rawConfig.extendPaths || [];
71
74
  this.pluginPaths = rawConfig.pluginPaths || [];
72
75
  this.resolveIgnore(getIgnoreFilePath(configFile));
73
76
  }
74
77
  resolveIgnore(ignoreFile) {
75
- if (!ignoreFile || !doesYamlFileExist(ignoreFile))
78
+ if (!ignoreFile || !(0, utils_1.doesYamlFileExist)(ignoreFile))
76
79
  return;
77
80
  this.ignore =
78
- parseYaml(fs.readFileSync(ignoreFile, 'utf-8')) || {};
79
- replaceSpecWithStruct(Object.keys(this.ignore), this.ignore); // FIXME: remove this
81
+ (0, js_yaml_1.parseYaml)(fs.readFileSync(ignoreFile, 'utf-8')) || {};
82
+ replaceSpecWithStruct(Object.keys(this.ignore), this.ignore);
80
83
  // resolve ignore paths
81
84
  for (const fileName of Object.keys(this.ignore)) {
82
- this.ignore[isAbsoluteUrl(fileName) ? fileName : path.resolve(path.dirname(ignoreFile), fileName)] = this.ignore[fileName];
85
+ this.ignore[(0, ref_utils_1.isAbsoluteUrl)(fileName) ? fileName : path.resolve(path.dirname(ignoreFile), fileName)] = this.ignore[fileName];
83
86
  for (const ruleId of Object.keys(this.ignore[fileName])) {
84
87
  this.ignore[fileName][ruleId] = new Set(this.ignore[fileName][ruleId]);
85
88
  }
86
- if (!isAbsoluteUrl(fileName)) {
89
+ if (!(0, ref_utils_1.isAbsoluteUrl)(fileName)) {
87
90
  delete this.ignore[fileName];
88
91
  }
89
92
  }
90
93
  }
91
94
  saveIgnore() {
92
95
  const dir = this.configFile ? path.dirname(this.configFile) : process.cwd();
93
- const ignoreFile = path.join(dir, IGNORE_FILE);
96
+ const ignoreFile = path.join(dir, exports.IGNORE_FILE);
94
97
  const mapped = {};
95
98
  for (const absFileName of Object.keys(this.ignore)) {
96
- const mappedDefinitionName = isAbsoluteUrl(absFileName)
99
+ const mappedDefinitionName = (0, ref_utils_1.isAbsoluteUrl)(absFileName)
97
100
  ? absFileName
98
- : slash(path.relative(dir, absFileName));
101
+ : (0, utils_1.slash)(path.relative(dir, absFileName));
99
102
  const ignoredRules = (mapped[mappedDefinitionName] = this.ignore[absFileName]);
100
103
  for (const ruleId of Object.keys(ignoredRules)) {
101
104
  ignoredRules[ruleId] = Array.from(ignoredRules[ruleId]);
102
105
  }
103
106
  }
104
- fs.writeFileSync(ignoreFile, IGNORE_BANNER + stringifyYaml(mapped));
107
+ fs.writeFileSync(ignoreFile, IGNORE_BANNER + (0, js_yaml_1.stringifyYaml)(mapped));
105
108
  }
106
109
  addIgnore(problem) {
107
110
  const ignore = this.ignore;
@@ -131,33 +134,33 @@ export class StyleguideConfig {
131
134
  for (const plugin of this.plugins) {
132
135
  if (plugin.typeExtension !== undefined) {
133
136
  switch (version) {
134
- case SpecVersion.OAS3_0:
135
- case SpecVersion.OAS3_1:
137
+ case oas_types_1.SpecVersion.OAS3_0:
138
+ case oas_types_1.SpecVersion.OAS3_1:
136
139
  if (!plugin.typeExtension.oas3)
137
140
  continue;
138
141
  extendedTypes = plugin.typeExtension.oas3(extendedTypes, version);
139
142
  break;
140
- case SpecVersion.OAS2:
143
+ case oas_types_1.SpecVersion.OAS2:
141
144
  if (!plugin.typeExtension.oas2)
142
145
  continue;
143
146
  extendedTypes = plugin.typeExtension.oas2(extendedTypes, version);
144
147
  break;
145
- case SpecVersion.Async2:
148
+ case oas_types_1.SpecVersion.Async2:
146
149
  if (!plugin.typeExtension.async2)
147
150
  continue;
148
151
  extendedTypes = plugin.typeExtension.async2(extendedTypes, version);
149
152
  break;
150
- case SpecVersion.Async3:
153
+ case oas_types_1.SpecVersion.Async3:
151
154
  if (!plugin.typeExtension.async3)
152
155
  continue;
153
156
  extendedTypes = plugin.typeExtension.async3(extendedTypes, version);
154
157
  break;
155
- case SpecVersion.Arazzo1:
158
+ case oas_types_1.SpecVersion.Arazzo1:
156
159
  if (!plugin.typeExtension.arazzo1)
157
160
  continue;
158
161
  extendedTypes = plugin.typeExtension.arazzo1(extendedTypes, version);
159
162
  break;
160
- case SpecVersion.Overlay1:
163
+ case oas_types_1.SpecVersion.Overlay1:
161
164
  if (!plugin.typeExtension.overlay1)
162
165
  continue;
163
166
  extendedTypes = plugin.typeExtension.overlay1(extendedTypes, version);
@@ -225,42 +228,42 @@ export class StyleguideConfig {
225
228
  }
226
229
  getRulesForSpecVersion(version) {
227
230
  switch (version) {
228
- case SpecMajorVersion.OAS3:
231
+ case oas_types_1.SpecMajorVersion.OAS3:
229
232
  // eslint-disable-next-line no-case-declarations
230
233
  const oas3Rules = [];
231
234
  this.plugins.forEach((p) => p.preprocessors?.oas3 && oas3Rules.push(p.preprocessors.oas3));
232
235
  this.plugins.forEach((p) => p.rules?.oas3 && oas3Rules.push(p.rules.oas3));
233
236
  this.plugins.forEach((p) => p.decorators?.oas3 && oas3Rules.push(p.decorators.oas3));
234
237
  return oas3Rules;
235
- case SpecMajorVersion.OAS2:
238
+ case oas_types_1.SpecMajorVersion.OAS2:
236
239
  // eslint-disable-next-line no-case-declarations
237
240
  const oas2Rules = [];
238
241
  this.plugins.forEach((p) => p.preprocessors?.oas2 && oas2Rules.push(p.preprocessors.oas2));
239
242
  this.plugins.forEach((p) => p.rules?.oas2 && oas2Rules.push(p.rules.oas2));
240
243
  this.plugins.forEach((p) => p.decorators?.oas2 && oas2Rules.push(p.decorators.oas2));
241
244
  return oas2Rules;
242
- case SpecMajorVersion.Async2:
245
+ case oas_types_1.SpecMajorVersion.Async2:
243
246
  // eslint-disable-next-line no-case-declarations
244
247
  const asyncApi2Rules = [];
245
248
  this.plugins.forEach((p) => p.preprocessors?.async2 && asyncApi2Rules.push(p.preprocessors.async2));
246
249
  this.plugins.forEach((p) => p.rules?.async2 && asyncApi2Rules.push(p.rules.async2));
247
250
  this.plugins.forEach((p) => p.decorators?.async2 && asyncApi2Rules.push(p.decorators.async2));
248
251
  return asyncApi2Rules;
249
- case SpecMajorVersion.Async3:
252
+ case oas_types_1.SpecMajorVersion.Async3:
250
253
  // eslint-disable-next-line no-case-declarations
251
254
  const asyncApi3Rules = [];
252
255
  this.plugins.forEach((p) => p.preprocessors?.async3 && asyncApi3Rules.push(p.preprocessors.async3));
253
256
  this.plugins.forEach((p) => p.rules?.async3 && asyncApi3Rules.push(p.rules.async3));
254
257
  this.plugins.forEach((p) => p.decorators?.async3 && asyncApi3Rules.push(p.decorators.async3));
255
258
  return asyncApi3Rules;
256
- case SpecMajorVersion.Arazzo1:
259
+ case oas_types_1.SpecMajorVersion.Arazzo1:
257
260
  // eslint-disable-next-line no-case-declarations
258
261
  const arazzo1Rules = [];
259
262
  this.plugins.forEach((p) => p.preprocessors?.arazzo1 && arazzo1Rules.push(p.preprocessors.arazzo1));
260
263
  this.plugins.forEach((p) => p.rules?.arazzo1 && arazzo1Rules.push(p.rules.arazzo1));
261
264
  this.plugins.forEach((p) => p.decorators?.arazzo1 && arazzo1Rules.push(p.decorators.arazzo1));
262
265
  return arazzo1Rules;
263
- case SpecMajorVersion.Overlay1:
266
+ case oas_types_1.SpecMajorVersion.Overlay1:
264
267
  // eslint-disable-next-line no-case-declarations
265
268
  const overlay1Rules = [];
266
269
  this.plugins.forEach((p) => p.preprocessors?.overlay1 && overlay1Rules.push(p.preprocessors.overlay1));
@@ -271,7 +274,7 @@ export class StyleguideConfig {
271
274
  }
272
275
  skipRules(rules) {
273
276
  for (const ruleId of rules || []) {
274
- for (const version of Object.values(SpecVersion)) {
277
+ for (const version of Object.values(oas_types_1.SpecVersion)) {
275
278
  if (this.rules[version][ruleId]) {
276
279
  this.rules[version][ruleId] = 'off';
277
280
  }
@@ -288,7 +291,7 @@ export class StyleguideConfig {
288
291
  }
289
292
  skipPreprocessors(preprocessors) {
290
293
  for (const preprocessorId of preprocessors || []) {
291
- for (const version of Object.values(SpecVersion)) {
294
+ for (const version of Object.values(oas_types_1.SpecVersion)) {
292
295
  if (this.preprocessors[version][preprocessorId]) {
293
296
  this.preprocessors[version][preprocessorId] = 'off';
294
297
  }
@@ -297,7 +300,7 @@ export class StyleguideConfig {
297
300
  }
298
301
  skipDecorators(decorators) {
299
302
  for (const decoratorId of decorators || []) {
300
- for (const version of Object.values(SpecVersion)) {
303
+ for (const version of Object.values(oas_types_1.SpecVersion)) {
301
304
  if (this.decorators[version][decoratorId]) {
302
305
  this.decorators[version][decoratorId] = 'off';
303
306
  }
@@ -305,25 +308,29 @@ export class StyleguideConfig {
305
308
  }
306
309
  }
307
310
  }
311
+ exports.StyleguideConfig = StyleguideConfig;
308
312
  // To support backwards compatibility with the old `spec` key we rename it to `struct`.
309
313
  function replaceSpecWithStruct(ruleGroups, config) {
310
314
  for (const ruleGroup of ruleGroups) {
311
- if (config[ruleGroup] && isPlainObject(config[ruleGroup]) && 'spec' in config[ruleGroup]) {
312
- showWarningForDeprecatedField('spec', 'struct');
315
+ if (config[ruleGroup] && (0, utils_1.isPlainObject)(config[ruleGroup]) && 'spec' in config[ruleGroup]) {
316
+ (0, utils_1.showWarningForDeprecatedField)('spec', 'struct');
313
317
  config[ruleGroup].struct = config[ruleGroup].spec;
314
318
  delete config[ruleGroup].spec;
315
319
  }
316
320
  }
317
321
  }
318
- export class Config {
322
+ class Config {
319
323
  constructor(rawConfig, configFile) {
320
324
  this.rawConfig = rawConfig;
321
325
  this.configFile = configFile;
322
326
  this.apis = rawConfig.apis || {};
323
327
  this.styleguide = new StyleguideConfig(rawConfig.styleguide || {}, configFile);
324
- this.theme = rawConfig.theme || {}; // FIXME: theme is deprecated
325
- this.resolve = getResolveConfig(rawConfig?.resolve);
328
+ this.theme = rawConfig.theme || {};
329
+ this.resolve = (0, utils_2.getResolveConfig)(rawConfig?.resolve);
330
+ this.region = rawConfig.region;
331
+ this.organization = rawConfig.organization;
332
+ this.files = rawConfig.files || [];
326
333
  this.telemetry = rawConfig.telemetry;
327
334
  }
328
335
  }
329
- //# sourceMappingURL=config.js.map
336
+ exports.Config = Config;
@@ -1,8 +1,7 @@
1
- export * from './config.js';
2
- export * from './types.js';
3
- export * from './rules.js';
4
- export * from './builtIn.js';
5
- export * from './load.js';
6
- export * from './utils.js';
7
- export * from './config-resolvers.js';
8
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './config';
2
+ export * from './types';
3
+ export * from './rules';
4
+ export * from './builtIn';
5
+ export * from './load';
6
+ export * from './utils';
7
+ export * from './config-resolvers';
@@ -1,8 +1,23 @@
1
- export * from './config.js';
2
- export * from './types.js';
3
- export * from './rules.js';
4
- export * from './builtIn.js';
5
- export * from './load.js';
6
- export * from './utils.js';
7
- export * from './config-resolvers.js';
8
- //# sourceMappingURL=index.js.map
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./config"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ __exportStar(require("./rules"), exports);
20
+ __exportStar(require("./builtIn"), exports);
21
+ __exportStar(require("./load"), exports);
22
+ __exportStar(require("./utils"), exports);
23
+ __exportStar(require("./config-resolvers"), exports);
@@ -1,7 +1,8 @@
1
- import { BaseResolver } from '../resolve.js';
2
- import type { Config } from './config.js';
3
- import type { Document, ResolvedRefMap } from '../resolve.js';
4
- import type { RawConfig, RawUniversalConfig } from './types.js';
1
+ import { BaseResolver } from '../resolve';
2
+ import type { Config } from './config';
3
+ import type { Document, ResolvedRefMap } from '../resolve';
4
+ import type { RegionalTokenWithValidity } from '../redocly/redocly-client-types';
5
+ import type { RawConfig, RawUniversalConfig, Region } from './types';
5
6
  export type RawConfigProcessor = (params: {
6
7
  document: Document;
7
8
  resolvedRefMap: ResolvedRefMap;
@@ -13,6 +14,8 @@ export declare function loadConfig(options?: {
13
14
  customExtends?: string[];
14
15
  processRawConfig?: RawConfigProcessor;
15
16
  externalRefResolver?: BaseResolver;
17
+ files?: string[];
18
+ region?: Region;
16
19
  }): Promise<Config>;
17
20
  export declare const CONFIG_FILE_NAMES: string[];
18
21
  export declare function findConfig(dir?: string): string | undefined;
@@ -27,9 +30,9 @@ export declare function getConfig(options?: {
27
30
  }>;
28
31
  type CreateConfigOptions = {
29
32
  extends?: string[];
33
+ tokens?: RegionalTokenWithValidity[];
30
34
  configPath?: string;
31
35
  externalRefResolver?: BaseResolver;
32
36
  };
33
37
  export declare function createConfig(config: string | RawUniversalConfig, options?: CreateConfigOptions): Promise<Config>;
34
38
  export {};
35
- //# sourceMappingURL=load.d.ts.map
@@ -1,35 +1,81 @@
1
- import * as fs from 'node:fs';
2
- import * as path from 'node:path';
3
- import { isEmptyObject } from '../utils.js';
4
- import { parseYaml } from '../js-yaml/index.js';
5
- import { ConfigValidationError, transformConfig, deepCloneMapWithJSON } from './utils.js';
6
- import { resolveConfig, resolveConfigFileAndRefs } from './config-resolvers.js';
7
- import { bundleConfig } from '../bundle.js';
8
- import { BaseResolver } from '../resolve.js';
9
- async function addConfigMetadata({ rawConfig, customExtends, configPath, externalRefResolver, }) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONFIG_FILE_NAMES = void 0;
4
+ exports.loadConfig = loadConfig;
5
+ exports.findConfig = findConfig;
6
+ exports.getConfig = getConfig;
7
+ exports.createConfig = createConfig;
8
+ const fs = require("fs");
9
+ const path = require("path");
10
+ const redocly_1 = require("../redocly");
11
+ const utils_1 = require("../utils");
12
+ const js_yaml_1 = require("../js-yaml");
13
+ const utils_2 = require("./utils");
14
+ const config_resolvers_1 = require("./config-resolvers");
15
+ const bundle_1 = require("../bundle");
16
+ const resolve_1 = require("../resolve");
17
+ const env_1 = require("../env");
18
+ const domains_1 = require("../redocly/domains");
19
+ async function addConfigMetadata({ rawConfig, customExtends, configPath, tokens, files, region, externalRefResolver, }) {
10
20
  if (customExtends !== undefined) {
11
21
  rawConfig.styleguide = rawConfig.styleguide || {};
12
22
  rawConfig.styleguide.extends = customExtends;
13
23
  }
14
- else if (isEmptyObject(rawConfig)) {
24
+ else if ((0, utils_1.isEmptyObject)(rawConfig)) {
15
25
  rawConfig.styleguide = { extends: ['recommended'], recommendedFallback: true };
16
26
  }
17
- return resolveConfig({
18
- rawConfig,
27
+ if (tokens?.length) {
28
+ if (!rawConfig.resolve)
29
+ rawConfig.resolve = {};
30
+ if (!rawConfig.resolve.http)
31
+ rawConfig.resolve.http = {};
32
+ rawConfig.resolve.http.headers = [...(rawConfig.resolve.http.headers ?? [])];
33
+ for (const item of tokens) {
34
+ const domain = domains_1.DOMAINS[item.region];
35
+ rawConfig.resolve.http.headers.push({
36
+ matches: `https://api.${domain}/registry/**`,
37
+ name: 'Authorization',
38
+ envVariable: undefined,
39
+ value: item.token,
40
+ },
41
+ //support redocly.com domain for future compatibility
42
+ ...(item.region === 'us'
43
+ ? [
44
+ {
45
+ matches: `https://api.redoc.ly/registry/**`,
46
+ name: 'Authorization',
47
+ envVariable: undefined,
48
+ value: item.token,
49
+ },
50
+ ]
51
+ : []));
52
+ }
53
+ }
54
+ return (0, config_resolvers_1.resolveConfig)({
55
+ rawConfig: {
56
+ ...rawConfig,
57
+ files: files ?? rawConfig.files,
58
+ region: region ?? rawConfig.region,
59
+ },
19
60
  configPath,
20
61
  externalRefResolver,
21
62
  });
22
63
  }
23
- export async function loadConfig(options = {}) {
24
- const { configPath = findConfig(), customExtends, processRawConfig, externalRefResolver, } = options;
64
+ async function loadConfig(options = {}) {
65
+ const { configPath = findConfig(), customExtends, processRawConfig, files, region, externalRefResolver, } = options;
25
66
  const { rawConfig, document, parsed, resolvedRefMap } = await getConfig({
26
67
  configPath,
27
68
  externalRefResolver,
28
69
  });
70
+ const redoclyClient = env_1.isBrowser ? undefined : new redocly_1.RedoclyClient();
71
+ const tokens = redoclyClient && redoclyClient.hasTokens() ? redoclyClient.getAllTokens() : [];
29
72
  const config = await addConfigMetadata({
30
73
  rawConfig,
31
74
  customExtends,
32
75
  configPath,
76
+ tokens,
77
+ files,
78
+ region,
33
79
  externalRefResolver,
34
80
  });
35
81
  if (document && parsed && resolvedRefMap && typeof processRawConfig === 'function') {
@@ -42,7 +88,7 @@ export async function loadConfig(options = {}) {
42
88
  });
43
89
  }
44
90
  catch (e) {
45
- if (e instanceof ConfigValidationError) {
91
+ if (e instanceof utils_2.ConfigValidationError) {
46
92
  throw e;
47
93
  }
48
94
  throw new Error(`Error parsing config file at '${configPath}': ${e.message}`);
@@ -50,11 +96,11 @@ export async function loadConfig(options = {}) {
50
96
  }
51
97
  return config;
52
98
  }
53
- export const CONFIG_FILE_NAMES = ['redocly.yaml', 'redocly.yml', '.redocly.yaml', '.redocly.yml'];
54
- export function findConfig(dir) {
55
- if (!fs?.existsSync)
99
+ exports.CONFIG_FILE_NAMES = ['redocly.yaml', 'redocly.yml', '.redocly.yaml', '.redocly.yml'];
100
+ function findConfig(dir) {
101
+ if (!fs?.hasOwnProperty?.('existsSync'))
56
102
  return;
57
- const existingConfigFiles = CONFIG_FILE_NAMES.map((name) => dir ? path.resolve(dir, name) : name).filter(fs.existsSync);
103
+ const existingConfigFiles = exports.CONFIG_FILE_NAMES.map((name) => dir ? path.resolve(dir, name) : name).filter(fs.existsSync);
58
104
  if (existingConfigFiles.length > 1) {
59
105
  throw new Error(`
60
106
  Multiple configuration files are not allowed.
@@ -64,19 +110,19 @@ export function findConfig(dir) {
64
110
  }
65
111
  return existingConfigFiles[0];
66
112
  }
67
- export async function getConfig(options = {}) {
68
- const { configPath = findConfig(), externalRefResolver = new BaseResolver() } = options;
113
+ async function getConfig(options = {}) {
114
+ const { configPath = findConfig(), externalRefResolver = new resolve_1.BaseResolver() } = options;
69
115
  if (!configPath)
70
116
  return { rawConfig: {} };
71
117
  try {
72
- const { document, resolvedRefMap } = await resolveConfigFileAndRefs({
118
+ const { document, resolvedRefMap } = await (0, config_resolvers_1.resolveConfigFileAndRefs)({
73
119
  configPath,
74
120
  externalRefResolver,
75
121
  });
76
- const bundledRefMap = deepCloneMapWithJSON(resolvedRefMap);
77
- const parsed = await bundleConfig(JSON.parse(JSON.stringify(document)), bundledRefMap);
122
+ const bundledRefMap = (0, utils_2.deepCloneMapWithJSON)(resolvedRefMap);
123
+ const parsed = await (0, bundle_1.bundleConfig)(JSON.parse(JSON.stringify(document)), bundledRefMap);
78
124
  return {
79
- rawConfig: transformConfig(parsed),
125
+ rawConfig: (0, utils_2.transformConfig)(parsed),
80
126
  document,
81
127
  parsed,
82
128
  resolvedRefMap,
@@ -86,10 +132,9 @@ export async function getConfig(options = {}) {
86
132
  throw new Error(`Error parsing config file at '${configPath}': ${e.message}`);
87
133
  }
88
134
  }
89
- export async function createConfig(config, options) {
135
+ async function createConfig(config, options) {
90
136
  return addConfigMetadata({
91
- rawConfig: transformConfig(typeof config === 'string' ? parseYaml(config) : config),
137
+ rawConfig: (0, utils_2.transformConfig)(typeof config === 'string' ? (0, js_yaml_1.parseYaml)(config) : config),
92
138
  ...options,
93
139
  });
94
140
  }
95
- //# sourceMappingURL=load.js.map
@@ -1,4 +1,3 @@
1
- import type { PluginStyleguideConfig } from './types.js';
1
+ import type { PluginStyleguideConfig } from './types';
2
2
  declare const minimal: PluginStyleguideConfig<'built-in'>;
3
3
  export default minimal;
4
- //# sourceMappingURL=minimal.d.ts.map
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const minimal = {
2
4
  rules: {
3
5
  struct: 'error',
@@ -204,5 +206,4 @@ const minimal = {
204
206
  'info-contact': 'off',
205
207
  },
206
208
  };
207
- export default minimal;
208
- //# sourceMappingURL=minimal.js.map
209
+ exports.default = minimal;
@@ -1,4 +1,3 @@
1
- import type { PluginStyleguideConfig } from './types.js';
1
+ import type { PluginStyleguideConfig } from './types';
2
2
  declare const recommendedStrict: PluginStyleguideConfig<'built-in'>;
3
3
  export default recommendedStrict;
4
- //# sourceMappingURL=recommended-strict.d.ts.map
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const recommendedStrict = {
2
4
  rules: {
3
5
  struct: 'error',
@@ -204,5 +206,4 @@ const recommendedStrict = {
204
206
  'info-contact': 'off',
205
207
  },
206
208
  };
207
- export default recommendedStrict;
208
- //# sourceMappingURL=recommended-strict.js.map
209
+ exports.default = recommendedStrict;
@@ -1,4 +1,3 @@
1
- import type { PluginStyleguideConfig } from './types.js';
1
+ import type { PluginStyleguideConfig } from './types';
2
2
  declare const recommended: PluginStyleguideConfig<'built-in'>;
3
3
  export default recommended;
4
- //# sourceMappingURL=recommended.d.ts.map
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const recommended = {
2
4
  rules: {
3
5
  struct: 'error',
@@ -204,5 +206,4 @@ const recommended = {
204
206
  'info-contact': 'off',
205
207
  },
206
208
  };
207
- export default recommended;
208
- //# sourceMappingURL=recommended.js.map
209
+ exports.default = recommended;
@@ -1,6 +1,6 @@
1
- import type { Arazzo1RuleSet, Async2RuleSet, Async3RuleSet, Oas2RuleSet, Oas3RuleSet, Overlay1RuleSet, SpecVersion } from '../oas-types.js';
2
- import type { StyleguideConfig } from './config.js';
3
- import type { ProblemSeverity } from '../walk.js';
1
+ import type { Arazzo1RuleSet, Async2RuleSet, Async3RuleSet, Oas2RuleSet, Oas3RuleSet, Overlay1RuleSet, SpecVersion } from '../oas-types';
2
+ import type { StyleguideConfig } from './config';
3
+ import type { ProblemSeverity } from '../walk';
4
4
  type InitializedRule = {
5
5
  severity: ProblemSeverity;
6
6
  ruleId: string;
@@ -8,4 +8,3 @@ type InitializedRule = {
8
8
  };
9
9
  export declare function initRules(rules: (Oas3RuleSet | Oas2RuleSet | Async2RuleSet | Async3RuleSet | Arazzo1RuleSet | Overlay1RuleSet)[], config: StyleguideConfig, type: 'rules' | 'preprocessors' | 'decorators', oasVersion: SpecVersion): InitializedRule[];
10
10
  export {};
11
- //# sourceMappingURL=rules.d.ts.map
@@ -1,5 +1,8 @@
1
- import { isDefined } from '../utils.js';
2
- export function initRules(rules, config, type, oasVersion) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initRules = initRules;
4
+ const utils_1 = require("../utils");
5
+ function initRules(rules, config, type, oasVersion) {
3
6
  return rules
4
7
  .flatMap((ruleset) => Object.keys(ruleset).map((ruleId) => {
5
8
  const rule = ruleset[ruleId];
@@ -30,6 +33,5 @@ export function initRules(rules, config, type, oasVersion) {
30
33
  };
31
34
  }))
32
35
  .flatMap((visitor) => visitor)
33
- .filter(isDefined);
36
+ .filter(utils_1.isDefined);
34
37
  }
35
- //# sourceMappingURL=rules.js.map
@@ -1,4 +1,3 @@
1
- import type { PluginStyleguideConfig } from './types.js';
1
+ import type { PluginStyleguideConfig } from './types';
2
2
  declare const spec: PluginStyleguideConfig<'built-in'>;
3
3
  export default spec;
4
- //# sourceMappingURL=spec.d.ts.map