@redocly/cli 2.25.4 → 2.27.0

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 (278) hide show
  1. package/lib/commands/join/index.d.ts.map +1 -1
  2. package/lib/commands/join/index.js +2 -2
  3. package/lib/commands/join/index.js.map +1 -1
  4. package/lib/commands/join/utils/add-components-prefix.d.ts.map +1 -0
  5. package/lib/commands/join/utils/add-components-prefix.js.map +1 -0
  6. package/lib/commands/join/utils/add-info-section.d.ts.map +1 -0
  7. package/lib/commands/join/{helpers → utils}/add-info-section.js +1 -1
  8. package/lib/commands/join/utils/add-info-section.js.map +1 -0
  9. package/lib/commands/join/utils/add-prefix.d.ts.map +1 -0
  10. package/lib/commands/join/utils/add-prefix.js.map +1 -0
  11. package/lib/commands/join/utils/add-security-prefix.d.ts.map +1 -0
  12. package/lib/commands/join/utils/add-security-prefix.js.map +1 -0
  13. package/lib/commands/join/utils/collect-components.d.ts.map +1 -0
  14. package/lib/commands/join/{helpers → utils}/collect-components.js +1 -1
  15. package/lib/commands/join/utils/collect-components.js.map +1 -0
  16. package/lib/commands/join/utils/collect-external-docs.d.ts.map +1 -0
  17. package/lib/commands/join/utils/collect-external-docs.js.map +1 -0
  18. package/lib/commands/join/utils/collect-paths.d.ts.map +1 -0
  19. package/lib/commands/join/{helpers → utils}/collect-paths.js +1 -1
  20. package/lib/commands/join/utils/collect-paths.js.map +1 -0
  21. package/lib/commands/join/utils/collect-webhooks.d.ts.map +1 -0
  22. package/lib/commands/join/utils/collect-webhooks.js.map +1 -0
  23. package/lib/commands/join/utils/duplicate-tag-description-warning.d.ts.map +1 -0
  24. package/lib/commands/join/utils/duplicate-tag-description-warning.js.map +1 -0
  25. package/lib/commands/join/utils/filter-conflicts.d.ts.map +1 -0
  26. package/lib/commands/join/utils/filter-conflicts.js.map +1 -0
  27. package/lib/commands/join/utils/format-tags.d.ts.map +1 -0
  28. package/lib/commands/join/utils/format-tags.js.map +1 -0
  29. package/lib/commands/join/utils/get-api-filename.d.ts.map +1 -0
  30. package/lib/commands/join/utils/get-api-filename.js.map +1 -0
  31. package/lib/commands/join/utils/get-info-prefix.d.ts.map +1 -0
  32. package/lib/commands/join/utils/get-info-prefix.js.map +1 -0
  33. package/lib/commands/join/{helpers/index.js.map → utils/index.d.ts.map} +1 -1
  34. package/lib/commands/join/utils/index.js.map +1 -0
  35. package/lib/commands/join/utils/iterate-potential-conflicts.d.ts.map +1 -0
  36. package/lib/commands/join/{helpers → utils}/iterate-potential-conflicts.js +1 -1
  37. package/lib/commands/join/utils/iterate-potential-conflicts.js.map +1 -0
  38. package/lib/commands/join/utils/populate-tags.d.ts.map +1 -0
  39. package/lib/commands/join/utils/populate-tags.js.map +1 -0
  40. package/lib/commands/join/utils/prefix-tag-suggestion.d.ts.map +1 -0
  41. package/lib/commands/join/utils/prefix-tag-suggestion.js.map +1 -0
  42. package/lib/commands/join/utils/replace-$-refs.d.ts.map +1 -0
  43. package/lib/commands/join/{helpers → utils}/replace-$-refs.js +2 -1
  44. package/lib/commands/join/utils/replace-$-refs.js.map +1 -0
  45. package/lib/commands/join/utils/show-conflicts.d.ts.map +1 -0
  46. package/lib/commands/join/utils/show-conflicts.js.map +1 -0
  47. package/lib/commands/lint.d.ts.map +1 -1
  48. package/lib/commands/lint.js +2 -4
  49. package/lib/commands/lint.js.map +1 -1
  50. package/lib/commands/scorecard-classic/formatters/json-formatter.d.ts.map +1 -1
  51. package/lib/commands/scorecard-classic/formatters/json-formatter.js +1 -4
  52. package/lib/commands/scorecard-classic/formatters/json-formatter.js.map +1 -1
  53. package/lib/commands/scorecard-classic/formatters/junit-formatter.d.ts +3 -0
  54. package/lib/commands/scorecard-classic/formatters/junit-formatter.d.ts.map +1 -0
  55. package/lib/commands/scorecard-classic/formatters/junit-formatter.js +67 -0
  56. package/lib/commands/scorecard-classic/formatters/junit-formatter.js.map +1 -0
  57. package/lib/commands/scorecard-classic/index.d.ts.map +1 -1
  58. package/lib/commands/scorecard-classic/index.js +4 -0
  59. package/lib/commands/scorecard-classic/index.js.map +1 -1
  60. package/lib/commands/scorecard-classic/types.d.ts +2 -1
  61. package/lib/commands/scorecard-classic/types.d.ts.map +1 -1
  62. package/lib/commands/split/asyncapi/constants.d.ts +6 -0
  63. package/lib/commands/split/asyncapi/constants.d.ts.map +1 -0
  64. package/lib/commands/split/asyncapi/constants.js +71 -0
  65. package/lib/commands/split/asyncapi/constants.js.map +1 -0
  66. package/lib/commands/split/asyncapi/find-asyncapi-component-types.d.ts +2 -0
  67. package/lib/commands/split/asyncapi/find-asyncapi-component-types.d.ts.map +1 -0
  68. package/lib/commands/split/asyncapi/find-asyncapi-component-types.js +8 -0
  69. package/lib/commands/split/asyncapi/find-asyncapi-component-types.js.map +1 -0
  70. package/lib/commands/split/asyncapi/gather-asyncapi-component-files.d.ts +9 -0
  71. package/lib/commands/split/asyncapi/gather-asyncapi-component-files.d.ts.map +1 -0
  72. package/lib/commands/split/asyncapi/gather-asyncapi-component-files.js +28 -0
  73. package/lib/commands/split/asyncapi/gather-asyncapi-component-files.js.map +1 -0
  74. package/lib/commands/split/asyncapi/iterate-asyncapi-channels.d.ts +10 -0
  75. package/lib/commands/split/asyncapi/iterate-asyncapi-channels.d.ts.map +1 -0
  76. package/lib/commands/split/asyncapi/iterate-asyncapi-channels.js +27 -0
  77. package/lib/commands/split/asyncapi/iterate-asyncapi-channels.js.map +1 -0
  78. package/lib/commands/split/asyncapi/iterate-asyncapi-components.d.ts +10 -0
  79. package/lib/commands/split/asyncapi/iterate-asyncapi-components.d.ts.map +1 -0
  80. package/lib/commands/split/asyncapi/iterate-asyncapi-components.js +41 -0
  81. package/lib/commands/split/asyncapi/iterate-asyncapi-components.js.map +1 -0
  82. package/lib/commands/split/asyncapi/iterate-asyncapi-operations.d.ts +11 -0
  83. package/lib/commands/split/asyncapi/iterate-asyncapi-operations.d.ts.map +1 -0
  84. package/lib/commands/split/asyncapi/iterate-asyncapi-operations.js +26 -0
  85. package/lib/commands/split/asyncapi/iterate-asyncapi-operations.js.map +1 -0
  86. package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.d.ts +3 -0
  87. package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.d.ts.map +1 -0
  88. package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.js +13 -0
  89. package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.js.map +1 -0
  90. package/lib/commands/split/asyncapi/split-asyncapi-definition.d.ts +9 -0
  91. package/lib/commands/split/asyncapi/split-asyncapi-definition.d.ts.map +1 -0
  92. package/lib/commands/split/asyncapi/split-asyncapi-definition.js +51 -0
  93. package/lib/commands/split/asyncapi/split-asyncapi-definition.js.map +1 -0
  94. package/lib/commands/split/constants.d.ts +7 -0
  95. package/lib/commands/split/constants.d.ts.map +1 -0
  96. package/lib/commands/split/constants.js +7 -0
  97. package/lib/commands/split/constants.js.map +1 -0
  98. package/lib/commands/split/index.d.ts +2 -10
  99. package/lib/commands/split/index.d.ts.map +1 -1
  100. package/lib/commands/split/index.js +33 -245
  101. package/lib/commands/split/index.js.map +1 -1
  102. package/lib/commands/split/oas/constants.d.ts +3 -0
  103. package/lib/commands/split/oas/constants.d.ts.map +1 -0
  104. package/lib/commands/split/oas/constants.js +23 -0
  105. package/lib/commands/split/oas/constants.js.map +1 -0
  106. package/lib/commands/split/oas/split-oas-definition.d.ts +3 -0
  107. package/lib/commands/split/oas/split-oas-definition.d.ts.map +1 -0
  108. package/lib/commands/split/oas/split-oas-definition.js +19 -0
  109. package/lib/commands/split/oas/split-oas-definition.js.map +1 -0
  110. package/lib/commands/split/types.d.ts +19 -8
  111. package/lib/commands/split/types.d.ts.map +1 -1
  112. package/lib/commands/split/types.js +1 -26
  113. package/lib/commands/split/types.js.map +1 -1
  114. package/lib/commands/split/utils/crawl.d.ts +2 -0
  115. package/lib/commands/split/utils/crawl.d.ts.map +1 -0
  116. package/lib/commands/split/utils/crawl.js +15 -0
  117. package/lib/commands/split/utils/crawl.js.map +1 -0
  118. package/lib/commands/split/utils/create-component-dir.d.ts +2 -0
  119. package/lib/commands/split/utils/create-component-dir.d.ts.map +1 -0
  120. package/lib/commands/split/utils/create-component-dir.js +8 -0
  121. package/lib/commands/split/utils/create-component-dir.js.map +1 -0
  122. package/lib/commands/split/utils/does-file-differ.d.ts +2 -0
  123. package/lib/commands/split/utils/does-file-differ.d.ts.map +1 -0
  124. package/lib/commands/split/utils/does-file-differ.js +7 -0
  125. package/lib/commands/split/utils/does-file-differ.js.map +1 -0
  126. package/lib/commands/split/utils/extract-filename-from-path.d.ts +2 -0
  127. package/lib/commands/split/utils/extract-filename-from-path.d.ts.map +1 -0
  128. package/lib/commands/split/utils/extract-filename-from-path.js +5 -0
  129. package/lib/commands/split/utils/extract-filename-from-path.js.map +1 -0
  130. package/lib/commands/split/utils/find-component-type.d.ts +3 -0
  131. package/lib/commands/split/utils/find-component-type.d.ts.map +1 -0
  132. package/lib/commands/split/utils/find-component-type.js +8 -0
  133. package/lib/commands/split/utils/find-component-type.js.map +1 -0
  134. package/lib/commands/split/utils/gather-components-files.d.ts +4 -0
  135. package/lib/commands/split/utils/gather-components-files.d.ts.map +1 -0
  136. package/lib/commands/split/utils/gather-components-files.js +12 -0
  137. package/lib/commands/split/utils/gather-components-files.js.map +1 -0
  138. package/lib/commands/split/utils/get-file-name-path.d.ts +2 -0
  139. package/lib/commands/split/utils/get-file-name-path.d.ts.map +1 -0
  140. package/lib/commands/split/utils/get-file-name-path.js +5 -0
  141. package/lib/commands/split/utils/get-file-name-path.js.map +1 -0
  142. package/lib/commands/split/utils/implicitly-reference-discriminator.d.ts +2 -0
  143. package/lib/commands/split/utils/implicitly-reference-discriminator.d.ts.map +1 -0
  144. package/lib/commands/split/utils/implicitly-reference-discriminator.js +31 -0
  145. package/lib/commands/split/utils/implicitly-reference-discriminator.js.map +1 -0
  146. package/lib/commands/split/utils/is-not-security-component-type.d.ts +2 -0
  147. package/lib/commands/split/utils/is-not-security-component-type.d.ts.map +1 -0
  148. package/lib/commands/split/utils/is-not-security-component-type.js +4 -0
  149. package/lib/commands/split/utils/is-not-security-component-type.js.map +1 -0
  150. package/lib/commands/split/utils/is-supported-extension.d.ts +2 -0
  151. package/lib/commands/split/utils/is-supported-extension.d.ts.map +1 -0
  152. package/lib/commands/split/utils/is-supported-extension.js +4 -0
  153. package/lib/commands/split/utils/is-supported-extension.js.map +1 -0
  154. package/lib/commands/split/utils/iterate-components.d.ts +3 -0
  155. package/lib/commands/split/utils/iterate-components.d.ts.map +1 -0
  156. package/lib/commands/split/utils/iterate-components.js +55 -0
  157. package/lib/commands/split/utils/iterate-components.js.map +1 -0
  158. package/lib/commands/split/utils/iterate-path-items.d.ts +3 -0
  159. package/lib/commands/split/utils/iterate-path-items.d.ts.map +1 -0
  160. package/lib/commands/split/utils/iterate-path-items.js +42 -0
  161. package/lib/commands/split/utils/iterate-path-items.js.map +1 -0
  162. package/lib/commands/split/utils/remove-empty-components.d.ts +4 -0
  163. package/lib/commands/split/utils/remove-empty-components.d.ts.map +1 -0
  164. package/lib/commands/split/utils/remove-empty-components.js +10 -0
  165. package/lib/commands/split/utils/remove-empty-components.js.map +1 -0
  166. package/lib/commands/split/utils/replace-$-refs.d.ts +3 -0
  167. package/lib/commands/split/utils/replace-$-refs.d.ts.map +1 -0
  168. package/lib/commands/split/utils/replace-$-refs.js +34 -0
  169. package/lib/commands/split/utils/replace-$-refs.js.map +1 -0
  170. package/lib/commands/split/utils/replace-channel-refs.d.ts +3 -0
  171. package/lib/commands/split/utils/replace-channel-refs.d.ts.map +1 -0
  172. package/lib/commands/split/utils/replace-channel-refs.js +30 -0
  173. package/lib/commands/split/utils/replace-channel-refs.js.map +1 -0
  174. package/lib/commands/split/utils/starts-with-components.d.ts +2 -0
  175. package/lib/commands/split/utils/starts-with-components.d.ts.map +1 -0
  176. package/lib/commands/split/utils/starts-with-components.js +5 -0
  177. package/lib/commands/split/utils/starts-with-components.js.map +1 -0
  178. package/lib/commands/split/utils/traverse-directory-deep.d.ts +3 -0
  179. package/lib/commands/split/utils/traverse-directory-deep.d.ts.map +1 -0
  180. package/lib/commands/split/utils/traverse-directory-deep.js +27 -0
  181. package/lib/commands/split/utils/traverse-directory-deep.js.map +1 -0
  182. package/lib/commands/stats/index.d.ts.map +1 -1
  183. package/lib/commands/stats/index.js +3 -45
  184. package/lib/commands/stats/index.js.map +1 -1
  185. package/lib/commands/stats/print-stats/index.d.ts +3 -0
  186. package/lib/commands/stats/print-stats/index.d.ts.map +1 -0
  187. package/lib/commands/stats/print-stats/index.js +22 -0
  188. package/lib/commands/stats/print-stats/index.js.map +1 -0
  189. package/lib/commands/stats/print-stats/json.d.ts +3 -0
  190. package/lib/commands/stats/print-stats/json.d.ts.map +1 -0
  191. package/lib/commands/stats/print-stats/json.js +13 -0
  192. package/lib/commands/stats/print-stats/json.js.map +1 -0
  193. package/lib/commands/stats/print-stats/markdown.d.ts +3 -0
  194. package/lib/commands/stats/print-stats/markdown.d.ts.map +1 -0
  195. package/lib/commands/stats/print-stats/markdown.js +10 -0
  196. package/lib/commands/stats/print-stats/markdown.js.map +1 -0
  197. package/lib/commands/stats/print-stats/stylish.d.ts +3 -0
  198. package/lib/commands/stats/print-stats/stylish.d.ts.map +1 -0
  199. package/lib/commands/stats/print-stats/stylish.js +11 -0
  200. package/lib/commands/stats/print-stats/stylish.js.map +1 -0
  201. package/lib/index.js +6 -1
  202. package/lib/index.js.map +1 -1
  203. package/lib/types.d.ts +1 -1
  204. package/lib/utils/strip-ansi-codes.d.ts +2 -0
  205. package/lib/utils/strip-ansi-codes.d.ts.map +1 -0
  206. package/lib/utils/strip-ansi-codes.js +6 -0
  207. package/lib/utils/strip-ansi-codes.js.map +1 -0
  208. package/package.json +3 -3
  209. package/lib/commands/join/helpers/add-components-prefix.d.ts.map +0 -1
  210. package/lib/commands/join/helpers/add-components-prefix.js.map +0 -1
  211. package/lib/commands/join/helpers/add-info-section.d.ts.map +0 -1
  212. package/lib/commands/join/helpers/add-info-section.js.map +0 -1
  213. package/lib/commands/join/helpers/add-prefix.d.ts.map +0 -1
  214. package/lib/commands/join/helpers/add-prefix.js.map +0 -1
  215. package/lib/commands/join/helpers/add-security-prefix.d.ts.map +0 -1
  216. package/lib/commands/join/helpers/add-security-prefix.js.map +0 -1
  217. package/lib/commands/join/helpers/collect-components.d.ts.map +0 -1
  218. package/lib/commands/join/helpers/collect-components.js.map +0 -1
  219. package/lib/commands/join/helpers/collect-external-docs.d.ts.map +0 -1
  220. package/lib/commands/join/helpers/collect-external-docs.js.map +0 -1
  221. package/lib/commands/join/helpers/collect-paths.d.ts.map +0 -1
  222. package/lib/commands/join/helpers/collect-paths.js.map +0 -1
  223. package/lib/commands/join/helpers/collect-webhooks.d.ts.map +0 -1
  224. package/lib/commands/join/helpers/collect-webhooks.js.map +0 -1
  225. package/lib/commands/join/helpers/duplicate-tag-description-warning.d.ts.map +0 -1
  226. package/lib/commands/join/helpers/duplicate-tag-description-warning.js.map +0 -1
  227. package/lib/commands/join/helpers/filter-conflicts.d.ts.map +0 -1
  228. package/lib/commands/join/helpers/filter-conflicts.js.map +0 -1
  229. package/lib/commands/join/helpers/format-tags.d.ts.map +0 -1
  230. package/lib/commands/join/helpers/format-tags.js.map +0 -1
  231. package/lib/commands/join/helpers/get-api-filename.d.ts.map +0 -1
  232. package/lib/commands/join/helpers/get-api-filename.js.map +0 -1
  233. package/lib/commands/join/helpers/get-info-prefix.d.ts.map +0 -1
  234. package/lib/commands/join/helpers/get-info-prefix.js.map +0 -1
  235. package/lib/commands/join/helpers/index.d.ts.map +0 -1
  236. package/lib/commands/join/helpers/iterate-potential-conflicts.d.ts.map +0 -1
  237. package/lib/commands/join/helpers/iterate-potential-conflicts.js.map +0 -1
  238. package/lib/commands/join/helpers/populate-tags.d.ts.map +0 -1
  239. package/lib/commands/join/helpers/populate-tags.js.map +0 -1
  240. package/lib/commands/join/helpers/prefix-tag-suggestion.d.ts.map +0 -1
  241. package/lib/commands/join/helpers/prefix-tag-suggestion.js.map +0 -1
  242. package/lib/commands/join/helpers/replace-$-refs.d.ts.map +0 -1
  243. package/lib/commands/join/helpers/replace-$-refs.js.map +0 -1
  244. package/lib/commands/join/helpers/show-conflicts.d.ts.map +0 -1
  245. package/lib/commands/join/helpers/show-conflicts.js.map +0 -1
  246. /package/lib/commands/join/{helpers → utils}/add-components-prefix.d.ts +0 -0
  247. /package/lib/commands/join/{helpers → utils}/add-components-prefix.js +0 -0
  248. /package/lib/commands/join/{helpers → utils}/add-info-section.d.ts +0 -0
  249. /package/lib/commands/join/{helpers → utils}/add-prefix.d.ts +0 -0
  250. /package/lib/commands/join/{helpers → utils}/add-prefix.js +0 -0
  251. /package/lib/commands/join/{helpers → utils}/add-security-prefix.d.ts +0 -0
  252. /package/lib/commands/join/{helpers → utils}/add-security-prefix.js +0 -0
  253. /package/lib/commands/join/{helpers → utils}/collect-components.d.ts +0 -0
  254. /package/lib/commands/join/{helpers → utils}/collect-external-docs.d.ts +0 -0
  255. /package/lib/commands/join/{helpers → utils}/collect-external-docs.js +0 -0
  256. /package/lib/commands/join/{helpers → utils}/collect-paths.d.ts +0 -0
  257. /package/lib/commands/join/{helpers → utils}/collect-webhooks.d.ts +0 -0
  258. /package/lib/commands/join/{helpers → utils}/collect-webhooks.js +0 -0
  259. /package/lib/commands/join/{helpers → utils}/duplicate-tag-description-warning.d.ts +0 -0
  260. /package/lib/commands/join/{helpers → utils}/duplicate-tag-description-warning.js +0 -0
  261. /package/lib/commands/join/{helpers → utils}/filter-conflicts.d.ts +0 -0
  262. /package/lib/commands/join/{helpers → utils}/filter-conflicts.js +0 -0
  263. /package/lib/commands/join/{helpers → utils}/format-tags.d.ts +0 -0
  264. /package/lib/commands/join/{helpers → utils}/format-tags.js +0 -0
  265. /package/lib/commands/join/{helpers → utils}/get-api-filename.d.ts +0 -0
  266. /package/lib/commands/join/{helpers → utils}/get-api-filename.js +0 -0
  267. /package/lib/commands/join/{helpers → utils}/get-info-prefix.d.ts +0 -0
  268. /package/lib/commands/join/{helpers → utils}/get-info-prefix.js +0 -0
  269. /package/lib/commands/join/{helpers → utils}/index.d.ts +0 -0
  270. /package/lib/commands/join/{helpers → utils}/index.js +0 -0
  271. /package/lib/commands/join/{helpers → utils}/iterate-potential-conflicts.d.ts +0 -0
  272. /package/lib/commands/join/{helpers → utils}/populate-tags.d.ts +0 -0
  273. /package/lib/commands/join/{helpers → utils}/populate-tags.js +0 -0
  274. /package/lib/commands/join/{helpers → utils}/prefix-tag-suggestion.d.ts +0 -0
  275. /package/lib/commands/join/{helpers → utils}/prefix-tag-suggestion.js +0 -0
  276. /package/lib/commands/join/{helpers → utils}/replace-$-refs.d.ts +0 -0
  277. /package/lib/commands/join/{helpers → utils}/show-conflicts.d.ts +0 -0
  278. /package/lib/commands/join/{helpers → utils}/show-conflicts.js +0 -0
@@ -1,258 +1,46 @@
1
- import { parseYaml, slash, isRef, isTruthy, dequal, logger, isEmptyObject, isPlainObject, } from '@redocly/openapi-core';
2
- import { red, blue, green } from 'colorette';
1
+ import { logger, detectSpec } from '@redocly/openapi-core';
2
+ import { blue, green } from 'colorette';
3
3
  import * as fs from 'node:fs';
4
- import * as path from 'node:path';
5
4
  import { performance } from 'perf_hooks';
6
5
  import { exitWithError } from '../../utils/error.js';
7
- import { printExecutionTime, pathToFilename, readYaml, escapeLanguageName, langToExt, writeToFileByExtension, getAndValidateFileExtension, } from '../../utils/miscellaneous.js';
8
- import { COMPONENTS, OPENAPI3_METHOD_NAMES, OPENAPI3_COMPONENT_NAMES, } from './types.js';
6
+ import { printExecutionTime, readYaml, getAndValidateFileExtension, } from '../../utils/miscellaneous.js';
7
+ import { splitAsyncApiDefinition } from './asyncapi/split-asyncapi-definition.js';
8
+ import { splitOASDefinition } from './oas/split-oas-definition.js';
9
+ import { iteratePathItems } from './utils/iterate-path-items.js';
9
10
  export async function handleSplit({ argv, collectSpecData }) {
10
11
  const startedAt = performance.now();
11
12
  const { api, outDir, separator } = argv;
12
- validateDefinitionFileName(api);
13
13
  const ext = getAndValidateFileExtension(api);
14
- const openapi = readYaml(api);
15
- collectSpecData?.(openapi);
16
- splitDefinition(openapi, outDir, separator, ext);
14
+ if (!fs.existsSync(api))
15
+ exitWithError(`File ${blue(api)} does not exist.`);
16
+ const definition = readYaml(api);
17
+ collectSpecData?.(definition);
18
+ const specVersion = detectSpec(definition);
19
+ switch (specVersion) {
20
+ case 'async2':
21
+ case 'async3':
22
+ splitAsyncApiDefinition({
23
+ asyncapi: definition,
24
+ asyncapiDir: outDir,
25
+ pathSeparator: separator,
26
+ ext,
27
+ specVersion,
28
+ });
29
+ break;
30
+ case 'oas3_0':
31
+ case 'oas3_1':
32
+ case 'oas3_2':
33
+ splitOASDefinition(definition, outDir, separator, ext);
34
+ break;
35
+ case 'oas2':
36
+ exitWithError('OpenAPI 2 is not supported by this command.');
37
+ break;
38
+ default:
39
+ exitWithError('File does not conform to the OpenAPI or AsyncAPI Specification. Version is not specified.');
40
+ }
17
41
  logger.info(`🪓 Document: ${blue(api)} ${green('is successfully split')}
18
42
  and all related files are saved to the directory: ${blue(outDir)} \n`);
19
43
  printExecutionTime('split', startedAt, api);
20
44
  }
21
- function splitDefinition(openapi, openapiDir, pathSeparator, ext) {
22
- fs.mkdirSync(openapiDir, { recursive: true });
23
- const componentsFiles = {};
24
- iterateComponents(openapi, openapiDir, componentsFiles, ext);
25
- iteratePathItems(openapi.paths, openapiDir, path.join(openapiDir, 'paths'), componentsFiles, pathSeparator, undefined, ext);
26
- const webhooks = openapi.webhooks ||
27
- openapi['x-webhooks'];
28
- // use webhook_ prefix for code samples to prevent potential name-clashes with paths samples
29
- iteratePathItems(webhooks, openapiDir, path.join(openapiDir, 'webhooks'), componentsFiles, pathSeparator, 'webhook_', ext);
30
- replace$Refs(openapi, openapiDir, componentsFiles);
31
- writeToFileByExtension(openapi, path.join(openapiDir, `openapi.${ext}`));
32
- }
33
- export function startsWithComponents(node) {
34
- return node.startsWith(`#/${COMPONENTS}/`);
35
- }
36
- function isSupportedExtension(filename) {
37
- return filename.endsWith('.yaml') || filename.endsWith('.yml') || filename.endsWith('.json');
38
- }
39
- function loadFile(fileName) {
40
- try {
41
- return parseYaml(fs.readFileSync(fileName, 'utf8'));
42
- }
43
- catch (e) {
44
- return exitWithError(e.message);
45
- }
46
- }
47
- function validateDefinitionFileName(fileName) {
48
- if (!fs.existsSync(fileName))
49
- exitWithError(`File ${blue(fileName)} does not exist.`);
50
- const file = loadFile(fileName);
51
- if (file.swagger)
52
- exitWithError('OpenAPI 2 is not supported by this command.');
53
- if (!file.openapi)
54
- exitWithError('File does not conform to the OpenAPI Specification. OpenAPI version is not specified.');
55
- return true;
56
- }
57
- function traverseDirectoryDeep(directory, callback, componentsFiles) {
58
- if (!fs.existsSync(directory) || !fs.statSync(directory).isDirectory())
59
- return;
60
- const files = fs.readdirSync(directory);
61
- for (const f of files) {
62
- const filename = path.join(directory, f);
63
- if (fs.statSync(filename).isDirectory()) {
64
- traverseDirectoryDeep(filename, callback, componentsFiles);
65
- }
66
- else {
67
- callback(filename, directory, componentsFiles);
68
- }
69
- }
70
- }
71
- function traverseDirectoryDeepCallback(filename, directory, componentsFiles) {
72
- if (!isSupportedExtension(filename))
73
- return;
74
- const pathData = readYaml(filename);
75
- replace$Refs(pathData, directory, componentsFiles);
76
- writeToFileByExtension(pathData, filename);
77
- }
78
- export function crawl(object, visitor) {
79
- if (isPlainObject(object)) {
80
- visitor(object);
81
- for (const key of Object.keys(object)) {
82
- crawl(object[key], visitor);
83
- }
84
- }
85
- else if (Array.isArray(object)) {
86
- for (const item of object) {
87
- crawl(item, visitor);
88
- }
89
- }
90
- }
91
- function replace$Refs(obj, relativeFrom, componentFiles = {}) {
92
- crawl(obj, (node) => {
93
- if (isRef(node) && startsWithComponents(node.$ref)) {
94
- replace(node, '$ref');
95
- }
96
- else if (isPlainObject(node.discriminator) && isPlainObject(node.discriminator.mapping)) {
97
- const { mapping } = node.discriminator;
98
- for (const name of Object.keys(mapping)) {
99
- const mappingPointer = mapping[name];
100
- if (typeof mappingPointer === 'string' && startsWithComponents(mappingPointer)) {
101
- replace(node.discriminator.mapping, name);
102
- }
103
- }
104
- }
105
- });
106
- function replace(node, key) {
107
- const splittedNode = node[key].split('/');
108
- const name = splittedNode.pop();
109
- const groupName = splittedNode[2];
110
- const filesGroupName = componentFiles[groupName];
111
- if (!filesGroupName || !filesGroupName[name])
112
- return;
113
- let filename = slash(path.relative(relativeFrom, filesGroupName[name].filename));
114
- if (!filename.startsWith('.')) {
115
- filename = './' + filename;
116
- }
117
- node[key] = filename;
118
- }
119
- }
120
- function implicitlyReferenceDiscriminator(obj, defName, filename, schemaFiles) {
121
- if (!obj.discriminator)
122
- return;
123
- const defPtr = `#/${COMPONENTS}/${'schemas'}/${defName}`;
124
- const implicitMapping = {};
125
- for (const [name, { inherits, filename: parentFilename }] of Object.entries(schemaFiles)) {
126
- if (inherits.indexOf(defPtr) > -1) {
127
- const res = slash(path.relative(path.dirname(filename), parentFilename));
128
- implicitMapping[name] = res.startsWith('.') ? res : './' + res;
129
- }
130
- }
131
- if (isEmptyObject(implicitMapping))
132
- return;
133
- const discriminatorPropSchema = obj.properties[obj.discriminator.propertyName];
134
- const discriminatorEnum = discriminatorPropSchema && discriminatorPropSchema.enum;
135
- const mapping = (obj.discriminator.mapping = obj.discriminator.mapping || {});
136
- for (const name of Object.keys(implicitMapping)) {
137
- if (discriminatorEnum && !discriminatorEnum.includes(name)) {
138
- continue;
139
- }
140
- if (mapping[name] && mapping[name] !== implicitMapping[name]) {
141
- logger.warn(`warning: explicit mapping overlaps with local mapping entry ${red(name)} at ${blue(filename)}. Please check it.`);
142
- }
143
- mapping[name] = implicitMapping[name];
144
- }
145
- }
146
- function isNotSecurityComponentType(componentType) {
147
- return componentType !== 'securitySchemes';
148
- }
149
- function findComponentTypes(components) {
150
- return OPENAPI3_COMPONENT_NAMES.filter((item) => isNotSecurityComponentType(item) && Object.keys(components).includes(item));
151
- }
152
- function doesFileDiffer(filename, componentData) {
153
- return fs.existsSync(filename) && !dequal(readYaml(filename), componentData);
154
- }
155
- function removeEmptyComponents(openapi, componentType) {
156
- if (openapi.components && isEmptyObject(openapi.components[componentType])) {
157
- delete openapi.components[componentType];
158
- }
159
- if (isEmptyObject(openapi.components)) {
160
- delete openapi.components;
161
- }
162
- }
163
- function createComponentDir(componentDirPath, componentType) {
164
- if (isNotSecurityComponentType(componentType)) {
165
- fs.mkdirSync(componentDirPath, { recursive: true });
166
- }
167
- }
168
- function extractFileNameFromPath(filename) {
169
- return path.basename(filename, path.extname(filename));
170
- }
171
- function getFileNamePath(componentDirPath, componentName, ext) {
172
- return path.join(componentDirPath, componentName) + `.${ext}`;
173
- }
174
- function gatherComponentsFiles(components, componentsFiles, componentType, componentName, filename) {
175
- let inherits = [];
176
- if (componentType === 'schemas') {
177
- inherits = (components?.[componentType]?.[componentName]?.allOf || [])
178
- .map(({ $ref }) => $ref)
179
- .filter(isTruthy);
180
- }
181
- componentsFiles[componentType] = componentsFiles[componentType] || {};
182
- componentsFiles[componentType][componentName] = { inherits, filename };
183
- }
184
- function iteratePathItems(pathItems, openapiDir, outDir, componentsFiles, pathSeparator, codeSamplesPathPrefix = '', ext) {
185
- if (!pathItems)
186
- return;
187
- fs.mkdirSync(outDir, { recursive: true });
188
- for (const pathName of Object.keys(pathItems)) {
189
- const pathFile = `${path.join(outDir, pathToFilename(pathName, pathSeparator))}.${ext}`;
190
- const pathData = pathItems[pathName];
191
- if (isRef(pathData))
192
- continue;
193
- for (const method of OPENAPI3_METHOD_NAMES) {
194
- const methodData = pathData[method];
195
- const methodDataXCode = methodData?.['x-code-samples'] || methodData?.['x-codeSamples'];
196
- if (!methodDataXCode || !Array.isArray(methodDataXCode)) {
197
- continue;
198
- }
199
- for (const sample of methodDataXCode) {
200
- if (sample.source && sample.source.$ref)
201
- continue;
202
- const sampleFileName = path.join(openapiDir, 'code_samples', escapeLanguageName(sample.lang), codeSamplesPathPrefix + pathToFilename(pathName, pathSeparator), method + langToExt(sample.lang));
203
- fs.mkdirSync(path.dirname(sampleFileName), { recursive: true });
204
- fs.writeFileSync(sampleFileName, sample.source);
205
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
206
- // @ts-ignore
207
- sample.source = {
208
- $ref: slash(path.relative(outDir, sampleFileName)),
209
- };
210
- }
211
- }
212
- writeToFileByExtension(pathData, pathFile);
213
- pathItems[pathName] = {
214
- $ref: slash(path.relative(openapiDir, pathFile)),
215
- };
216
- traverseDirectoryDeep(outDir, traverseDirectoryDeepCallback, componentsFiles);
217
- }
218
- }
219
- function iterateComponents(openapi, openapiDir, componentsFiles, ext) {
220
- const { components } = openapi;
221
- if (components) {
222
- const componentsDir = path.join(openapiDir, COMPONENTS);
223
- fs.mkdirSync(componentsDir, { recursive: true });
224
- const componentTypes = findComponentTypes(components);
225
- componentTypes.forEach(iterateAndGatherComponentsFiles);
226
- componentTypes.forEach(iterateComponentTypes);
227
- function iterateAndGatherComponentsFiles(componentType) {
228
- const componentDirPath = path.join(componentsDir, componentType);
229
- for (const componentName of Object.keys(components?.[componentType] || {})) {
230
- const filename = getFileNamePath(componentDirPath, componentName, ext);
231
- gatherComponentsFiles(components, componentsFiles, componentType, componentName, filename);
232
- }
233
- }
234
- function iterateComponentTypes(componentType) {
235
- const componentDirPath = path.join(componentsDir, componentType);
236
- createComponentDir(componentDirPath, componentType);
237
- for (const componentName of Object.keys(components?.[componentType] || {})) {
238
- const filename = getFileNamePath(componentDirPath, componentName, ext);
239
- const componentData = components?.[componentType]?.[componentName];
240
- replace$Refs(componentData, path.dirname(filename), componentsFiles);
241
- implicitlyReferenceDiscriminator(componentData, extractFileNameFromPath(filename), filename, componentsFiles.schemas || {});
242
- if (doesFileDiffer(filename, componentData)) {
243
- logger.warn(`warning: conflict for ${componentName} - file already exists with different content: ${blue(filename)} ... Skip.\n`);
244
- }
245
- else {
246
- writeToFileByExtension(componentData, filename);
247
- }
248
- if (isNotSecurityComponentType(componentType)) {
249
- // security schemas must referenced from components
250
- delete openapi.components?.[componentType]?.[componentName];
251
- }
252
- }
253
- removeEmptyComponents(openapi, componentType);
254
- }
255
- }
256
- }
257
45
  export { iteratePathItems };
258
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/split/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,GAad,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,wBAAwB,GAKzB,MAAM,YAAY,CAAC;AAUpB,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,eAAe,EAA0B;IACjF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACxC,0BAA0B,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAsB,CAAC;IACnD,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3B,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,G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;IAE9B,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAC3C,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,uBAAuB,CAAC;gBACtB,QAAQ,EAAE,UAAmC;gBAC7C,WAAW,EAAE,MAAM;gBACnB,aAAa,EAAE,SAAS;gBACxB,GAAG;gBACH,WAAW;aACZ,CAAC,CAAC;YACH,MAAM;QACR,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,kBAAkB,CAAC,UAA+B,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YAC5E,MAAM;QACR,KAAK,MAAM;YACT,aAAa,CAAC,6CAA6C,CAAC,CAAC;YAC7D,MAAM;QACR;YACE,aAAa,CACX,2FAA2F,CAC5F,CAAC;IACN,CAAC;IAED,MAAM,CAAC,IAAI,CACT,gBAAgB,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC;wDACP,IAAI,CAAC,MAAM,CAAC,KAAK,CACtE,CAAC;IACF,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const OPENAPI3_METHOD_NAMES: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
2
+ export declare const OPENAPI3_COMPONENT_NAMES: readonly ["schemas", "responses", "parameters", "examples", "headers", "requestBodies", "links", "callbacks", "securitySchemes"];
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/oas/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,yFAUxB,CAAC;AAEX,eAAO,MAAM,wBAAwB,kIAU3B,CAAC"}
@@ -0,0 +1,23 @@
1
+ export const OPENAPI3_METHOD_NAMES = [
2
+ 'get',
3
+ 'put',
4
+ 'post',
5
+ 'delete',
6
+ 'options',
7
+ 'head',
8
+ 'patch',
9
+ 'trace',
10
+ 'query',
11
+ ];
12
+ export const OPENAPI3_COMPONENT_NAMES = [
13
+ 'schemas',
14
+ 'responses',
15
+ 'parameters',
16
+ 'examples',
17
+ 'headers',
18
+ 'requestBodies',
19
+ 'links',
20
+ 'callbacks',
21
+ 'securitySchemes',
22
+ ];
23
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/commands/split/oas/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;CACC,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,eAAe;IACf,OAAO;IACP,WAAW;IACX,iBAAiB;CACT,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AnyOas3Definition } from '../types.js';
2
+ export declare function splitOASDefinition(openapi: AnyOas3Definition, openapiDir: string, pathSeparator: string, ext: string): void;
3
+ //# sourceMappingURL=split-oas-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-oas-definition.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/oas/split-oas-definition.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,aAAa,CAAC;AAKtE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,QA+BZ"}
@@ -0,0 +1,19 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { writeToFileByExtension } from '../../../utils/miscellaneous.js';
4
+ import { iterateComponents } from '../utils/iterate-components.js';
5
+ import { iteratePathItems } from '../utils/iterate-path-items.js';
6
+ import { replace$Refs } from '../utils/replace-$-refs.js';
7
+ export function splitOASDefinition(openapi, openapiDir, pathSeparator, ext) {
8
+ fs.mkdirSync(openapiDir, { recursive: true });
9
+ const componentsFiles = {};
10
+ iterateComponents(openapi, openapiDir, componentsFiles, ext);
11
+ iteratePathItems(openapi.paths, openapiDir, path.join(openapiDir, 'paths'), componentsFiles, pathSeparator, undefined, ext);
12
+ const webhooks = openapi.webhooks ||
13
+ openapi['x-webhooks'];
14
+ // use webhook_ prefix for code samples to prevent potential name-clashes with paths samples
15
+ iteratePathItems(webhooks, openapiDir, path.join(openapiDir, 'webhooks'), componentsFiles, pathSeparator, 'webhook_', ext);
16
+ replace$Refs(openapi, openapiDir, componentsFiles);
17
+ writeToFileByExtension(openapi, path.join(openapiDir, `openapi.${ext}`));
18
+ }
19
+ //# sourceMappingURL=split-oas-definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-oas-definition.js","sourceRoot":"","sources":["../../../../src/commands/split/oas/split-oas-definition.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,UAAU,kBAAkB,CAChC,OAA0B,EAC1B,UAAkB,EAClB,aAAqB,EACrB,GAAW;IAEX,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE9C,MAAM,eAAe,GAAoB,EAAE,CAAC;IAC5C,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;IAC7D,gBAAgB,CACd,OAAO,CAAC,KAAK,EACb,UAAU,EACV,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,EAC9B,eAAe,EACf,aAAa,EACb,SAAS,EACT,GAAG,CACJ,CAAC;IACF,MAAM,QAAQ,GACX,OAA+C,CAAC,QAAQ;QACxD,OAA0B,CAAC,YAAY,CAAC,CAAC;IAC5C,4FAA4F;IAC5F,gBAAgB,CACd,QAAQ,EACR,UAAU,EACV,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EACjC,eAAe,EACf,aAAa,EACb,UAAU,EACV,GAAG,CACJ,CAAC;IAEF,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IACnD,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC"}
@@ -1,17 +1,28 @@
1
- import type { Oas2Definition, Oas3Definition, Oas3_1Definition, Oas3_2Definition } from '@redocly/openapi-core';
2
- export type Definition = Oas2Definition | Oas3Definition | Oas3_1Definition | Oas3_2Definition;
1
+ import type { Oas2Definition, Oas3Definition, Oas3_1Definition, Oas3_2Definition, Async2Definition, Async3Definition } from '@redocly/openapi-core';
2
+ import type { VerifyConfigOptions } from '../../types.js';
3
+ import type { ASYNCAPI2_COMPONENT_NAMES, ASYNCAPI2_SPLITTABLE_COMPONENT_NAMES, ASYNCAPI3_COMPONENT_NAMES, ASYNCAPI3_SPLITTABLE_COMPONENT_NAMES, ASYNCAPI_ACTION_NAMES } from './asyncapi/constants.js';
4
+ import type { OPENAPI3_METHOD_NAMES, OPENAPI3_COMPONENT_NAMES } from './oas/constants.js';
5
+ export type Definition = Oas2Definition | Oas3Definition | Oas3_1Definition | Oas3_2Definition | Async2Definition | Async3Definition;
3
6
  export interface ComponentsFiles {
4
7
  [schemas: string]: any;
5
8
  }
9
+ export type ChannelsFiles = Record<string, string>;
6
10
  export interface RefObject {
7
11
  [$ref: string]: string;
8
12
  }
9
- export declare const COMPONENTS = "components";
10
- export declare const PATHS = "paths";
11
- export declare const WEBHOOKS = "webhooks";
12
- export declare const xWEBHOOKS = "x-webhooks";
13
13
  export type Oas3Method = (typeof OPENAPI3_METHOD_NAMES)[number];
14
- export declare const OPENAPI3_METHOD_NAMES: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
15
14
  export type Oas3Component = (typeof OPENAPI3_COMPONENT_NAMES)[number];
16
- export declare const OPENAPI3_COMPONENT_NAMES: readonly ["schemas", "responses", "parameters", "examples", "headers", "requestBodies", "links", "callbacks", "securitySchemes"];
15
+ export type AsyncApiAction = (typeof ASYNCAPI_ACTION_NAMES)[number];
16
+ export type AsyncApi2Component = (typeof ASYNCAPI2_COMPONENT_NAMES)[number];
17
+ export type AsyncApi2SplittableComponent = (typeof ASYNCAPI2_SPLITTABLE_COMPONENT_NAMES)[number];
18
+ export type AsyncApi3Component = (typeof ASYNCAPI3_COMPONENT_NAMES)[number];
19
+ export type AsyncApi3SplittableComponent = (typeof ASYNCAPI3_SPLITTABLE_COMPONENT_NAMES)[number];
20
+ export type AnyOas3Definition = Oas3Definition | Oas3_1Definition | Oas3_2Definition;
21
+ export type AnyAsyncApiDefinition = Async2Definition | Async3Definition;
22
+ export type AnyDefinition = AnyOas3Definition | AnyAsyncApiDefinition;
23
+ export type SplitArgv = {
24
+ api: string;
25
+ outDir: string;
26
+ separator: string;
27
+ } & VerifyConfigOptions;
17
28
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/split/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,g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- export const xWEBHOOKS = 'x-webhooks';
5
- export const OPENAPI3_METHOD_NAMES = [
6
- 'get',
7
- 'put',
8
- 'post',
9
- 'delete',
10
- 'options',
11
- 'head',
12
- 'patch',
13
- 'trace',
14
- 'query',
15
- ];
16
- export const OPENAPI3_COMPONENT_NAMES = [
17
- 'schemas',
18
- 'responses',
19
- 'parameters',
20
- 'examples',
21
- 'headers',
22
- 'requestBodies',
23
- 'links',
24
- 'callbacks',
25
- 'securitySchemes',
26
- ];
1
+ export {};
27
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/split/types.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AACnC,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AAGtC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;CACC,CAAC;AAGX,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,eAAe;IACf,OAAO;IACP,WAAW;IACX,iBAAiB;CACT,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/split/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function crawl(object: unknown, visitor: (node: Record<string, unknown>) => void): void;
2
+ //# sourceMappingURL=crawl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/crawl.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,QAWtF"}
@@ -0,0 +1,15 @@
1
+ import { isPlainObject } from '@redocly/openapi-core';
2
+ export function crawl(object, visitor) {
3
+ if (isPlainObject(object)) {
4
+ visitor(object);
5
+ for (const key of Object.keys(object)) {
6
+ crawl(object[key], visitor);
7
+ }
8
+ }
9
+ else if (Array.isArray(object)) {
10
+ for (const item of object) {
11
+ crawl(item, visitor);
12
+ }
13
+ }
14
+ }
15
+ //# sourceMappingURL=crawl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crawl.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/crawl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,UAAU,KAAK,CAAC,MAAe,EAAE,OAAgD;IACrF,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,MAAM,CAAC,CAAC;QAChB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function createComponentDir(componentDirPath: string, componentType: string): void;
2
+ //# sourceMappingURL=create-component-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-component-dir.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/create-component-dir.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAIjF"}
@@ -0,0 +1,8 @@
1
+ import * as fs from 'node:fs';
2
+ import { isNotSecurityComponentType } from './is-not-security-component-type.js';
3
+ export function createComponentDir(componentDirPath, componentType) {
4
+ if (isNotSecurityComponentType(componentType)) {
5
+ fs.mkdirSync(componentDirPath, { recursive: true });
6
+ }
7
+ }
8
+ //# sourceMappingURL=create-component-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-component-dir.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/create-component-dir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,MAAM,UAAU,kBAAkB,CAAC,gBAAwB,EAAE,aAAqB;IAChF,IAAI,0BAA0B,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function doesFileDiffer(filename: string, componentData: any): boolean;
2
+ //# sourceMappingURL=does-file-differ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"does-file-differ.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/does-file-differ.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,WAElE"}
@@ -0,0 +1,7 @@
1
+ import { dequal } from '@redocly/openapi-core';
2
+ import * as fs from 'node:fs';
3
+ import { readYaml } from '../../../utils/miscellaneous.js';
4
+ export function doesFileDiffer(filename, componentData) {
5
+ return fs.existsSync(filename) && !dequal(readYaml(filename), componentData);
6
+ }
7
+ //# sourceMappingURL=does-file-differ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"does-file-differ.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/does-file-differ.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,aAAkB;IACjE,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function extractFileNameFromPath(filename: string): string;
2
+ //# sourceMappingURL=extract-filename-from-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-filename-from-path.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/extract-filename-from-path.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,UAEvD"}
@@ -0,0 +1,5 @@
1
+ import * as path from 'node:path';
2
+ export function extractFileNameFromPath(filename) {
3
+ return path.basename(filename, path.extname(filename));
4
+ }
5
+ //# sourceMappingURL=extract-filename-from-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-filename-from-path.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/extract-filename-from-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Oas3_1Components, Oas3Components } from '@redocly/openapi-core';
2
+ export declare function findComponentTypes(components: Oas3Components | Oas3_1Components | undefined): ("examples" | "links" | "responses" | "headers" | "parameters" | "schemas" | "securitySchemes" | "requestBodies" | "callbacks")[];
3
+ //# sourceMappingURL=find-component-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-component-type.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/find-component-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK9E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,gBAAgB,GAAG,SAAS,qIAK3F"}
@@ -0,0 +1,8 @@
1
+ import { OPENAPI3_COMPONENT_NAMES } from '../oas/constants.js';
2
+ import { isNotSecurityComponentType } from './is-not-security-component-type.js';
3
+ export function findComponentTypes(components) {
4
+ if (!components)
5
+ return [];
6
+ return OPENAPI3_COMPONENT_NAMES.filter((item) => isNotSecurityComponentType(item) && Object.keys(components).includes(item));
7
+ }
8
+ //# sourceMappingURL=find-component-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-component-type.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/find-component-type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,MAAM,UAAU,kBAAkB,CAAC,UAAyD;IAC1F,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAC3B,OAAO,wBAAwB,CAAC,MAAM,CACpC,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CACrF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Oas3ComponentName, type Oas3Components, type Oas3Schema, type Oas3_1Components, type Oas3_1Schema } from '@redocly/openapi-core';
2
+ import type { ComponentsFiles } from '../types.js';
3
+ export declare function gatherComponentsFiles(components: Oas3Components | Oas3_1Components, componentsFiles: ComponentsFiles, componentType: Oas3ComponentName<Oas3Schema | Oas3_1Schema>, componentName: string, filename: string): void;
4
+ //# sourceMappingURL=gather-components-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gather-components-files.d.ts","sourceRoot":"","sources":["../../../../src/commands/split/utils/gather-components-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,GAAG,gBAAgB,EAC7C,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CAAC,EAC3D,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,QAYjB"}
@@ -0,0 +1,12 @@
1
+ import { isTruthy, } from '@redocly/openapi-core';
2
+ export function gatherComponentsFiles(components, componentsFiles, componentType, componentName, filename) {
3
+ let inherits = [];
4
+ if (componentType === 'schemas') {
5
+ inherits = (components?.[componentType]?.[componentName]?.allOf || [])
6
+ .map(({ $ref }) => $ref)
7
+ .filter(isTruthy);
8
+ }
9
+ componentsFiles[componentType] = componentsFiles[componentType] || {};
10
+ componentsFiles[componentType][componentName] = { inherits, filename };
11
+ }
12
+ //# sourceMappingURL=gather-components-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gather-components-files.js","sourceRoot":"","sources":["../../../../src/commands/split/utils/gather-components-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAMT,MAAM,uBAAuB,CAAC;AAI/B,MAAM,UAAU,qBAAqB,CACnC,UAA6C,EAC7C,eAAgC,EAChC,aAA2D,EAC3D,aAAqB,EACrB,QAAgB;IAEhB,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,QAAQ,GAAG,CACR,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAA+B,EAAE,KAAK,IAAI,EAAE,CACzF;aACE,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;aACvB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IACD,eAAe,CAAC,aAAa,CAAC,GAAG,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACtE,eAAe,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACzE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getFileNamePath(componentDirPath: string, componentName: string, ext: string): string;
2
+ //# sourceMappingURL=get-file-name-path.d.ts.map