@redocly/cli 1.34.4 → 2.0.0-next.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 (321) hide show
  1. package/README.md +34 -3
  2. package/bin/cli.js +1 -1
  3. package/lib/auth/device-flow.d.ts +1 -0
  4. package/lib/auth/device-flow.d.ts.map +1 -0
  5. package/lib/auth/device-flow.js +15 -17
  6. package/lib/auth/device-flow.js.map +1 -0
  7. package/lib/auth/oauth-client.d.ts +1 -0
  8. package/lib/auth/oauth-client.d.ts.map +1 -0
  9. package/lib/auth/oauth-client.js +21 -23
  10. package/lib/auth/oauth-client.js.map +1 -0
  11. package/lib/commands/auth.d.ts +3 -5
  12. package/lib/commands/auth.d.ts.map +1 -0
  13. package/lib/commands/auth.js +19 -44
  14. package/lib/commands/auth.js.map +1 -0
  15. package/lib/commands/build-docs/index.d.ts +4 -3
  16. package/lib/commands/build-docs/index.d.ts.map +1 -0
  17. package/lib/commands/build-docs/index.js +23 -24
  18. package/lib/commands/build-docs/index.js.map +1 -0
  19. package/lib/commands/build-docs/types.d.ts +2 -1
  20. package/lib/commands/build-docs/types.d.ts.map +1 -0
  21. package/lib/commands/build-docs/types.js +2 -2
  22. package/lib/commands/build-docs/types.js.map +1 -0
  23. package/lib/commands/build-docs/utils.d.ts +3 -2
  24. package/lib/commands/build-docs/utils.d.ts.map +1 -0
  25. package/lib/commands/build-docs/utils.js +35 -37
  26. package/lib/commands/build-docs/utils.js.map +1 -0
  27. package/lib/commands/bundle.d.ts +6 -3
  28. package/lib/commands/bundle.d.ts.map +1 -0
  29. package/lib/commands/bundle.js +34 -38
  30. package/lib/commands/bundle.js.map +1 -0
  31. package/lib/commands/eject.d.ts +3 -2
  32. package/lib/commands/eject.d.ts.map +1 -0
  33. package/lib/commands/eject.js +11 -13
  34. package/lib/commands/eject.js.map +1 -0
  35. package/lib/commands/join.d.ts +4 -3
  36. package/lib/commands/join.d.ts.map +1 -0
  37. package/lib/commands/join.js +79 -81
  38. package/lib/commands/join.js.map +1 -0
  39. package/lib/commands/lint.d.ts +8 -6
  40. package/lib/commands/lint.d.ts.map +1 -0
  41. package/lib/commands/lint.js +53 -62
  42. package/lib/commands/lint.js.map +1 -0
  43. package/lib/commands/preview-project/constants.d.ts +2 -1
  44. package/lib/commands/preview-project/constants.d.ts.map +1 -0
  45. package/lib/commands/preview-project/constants.js +4 -6
  46. package/lib/commands/preview-project/constants.js.map +1 -0
  47. package/lib/commands/preview-project/index.d.ts +3 -2
  48. package/lib/commands/preview-project/index.d.ts.map +1 -0
  49. package/lib/commands/preview-project/index.js +21 -23
  50. package/lib/commands/preview-project/index.js.map +1 -0
  51. package/lib/commands/preview-project/types.d.ts +3 -2
  52. package/lib/commands/preview-project/types.d.ts.map +1 -0
  53. package/lib/commands/preview-project/types.js +2 -2
  54. package/lib/commands/preview-project/types.js.map +1 -0
  55. package/lib/commands/split/index.d.ts +4 -3
  56. package/lib/commands/split/index.d.ts.map +1 -0
  57. package/lib/commands/split/index.js +53 -57
  58. package/lib/commands/split/index.js.map +1 -0
  59. package/lib/commands/split/types.d.ts +2 -2
  60. package/lib/commands/split/types.d.ts.map +1 -0
  61. package/lib/commands/split/types.js +11 -13
  62. package/lib/commands/split/types.js.map +1 -0
  63. package/lib/commands/stats.d.ts +3 -2
  64. package/lib/commands/stats.d.ts.map +1 -0
  65. package/lib/commands/stats.js +21 -24
  66. package/lib/commands/stats.js.map +1 -0
  67. package/lib/commands/translations.d.ts +3 -2
  68. package/lib/commands/translations.d.ts.map +1 -0
  69. package/lib/commands/translations.js +11 -13
  70. package/lib/commands/translations.js.map +1 -0
  71. package/lib/index.d.ts +2 -1
  72. package/lib/index.d.ts.map +1 -0
  73. package/lib/index.js +109 -239
  74. package/lib/index.js.map +1 -0
  75. package/lib/otel.d.ts +2 -1
  76. package/lib/otel.d.ts.map +1 -0
  77. package/lib/otel.js +22 -23
  78. package/lib/otel.js.map +1 -0
  79. package/lib/reunite/api/api-client.d.ts +4 -3
  80. package/lib/reunite/api/api-client.d.ts.map +1 -0
  81. package/lib/reunite/api/api-client.js +14 -20
  82. package/lib/reunite/api/api-client.js.map +1 -0
  83. package/lib/reunite/api/api-keys.d.ts +2 -1
  84. package/lib/reunite/api/api-keys.d.ts.map +1 -0
  85. package/lib/reunite/api/api-keys.js +4 -20
  86. package/lib/reunite/api/api-keys.js.map +1 -0
  87. package/lib/reunite/api/domains.d.ts +5 -2
  88. package/lib/reunite/api/domains.d.ts.map +1 -0
  89. package/lib/reunite/api/domains.js +6 -15
  90. package/lib/reunite/api/domains.js.map +1 -0
  91. package/lib/reunite/api/index.d.ts +4 -3
  92. package/lib/reunite/api/index.d.ts.map +1 -0
  93. package/lib/reunite/api/index.js +4 -19
  94. package/lib/reunite/api/index.js.map +1 -0
  95. package/lib/reunite/api/types.d.ts +1 -0
  96. package/lib/reunite/api/types.d.ts.map +1 -0
  97. package/lib/reunite/api/types.js +2 -2
  98. package/lib/reunite/api/types.js.map +1 -0
  99. package/lib/reunite/commands/push-status.d.ts +6 -5
  100. package/lib/reunite/commands/push-status.d.ts.map +1 -0
  101. package/lib/reunite/commands/push-status.js +31 -37
  102. package/lib/reunite/commands/push-status.js.map +1 -0
  103. package/lib/reunite/commands/push.d.ts +6 -6
  104. package/lib/reunite/commands/push.d.ts.map +1 -0
  105. package/lib/reunite/commands/push.js +31 -40
  106. package/lib/reunite/commands/push.js.map +1 -0
  107. package/lib/reunite/commands/utils.d.ts +4 -3
  108. package/lib/reunite/commands/utils.d.ts.map +1 -0
  109. package/lib/reunite/commands/utils.js +9 -12
  110. package/lib/reunite/commands/utils.js.map +1 -0
  111. package/lib/reunite/utils.d.ts +1 -0
  112. package/lib/reunite/utils.d.ts.map +1 -0
  113. package/lib/reunite/utils.js +2 -5
  114. package/lib/reunite/utils.js.map +1 -0
  115. package/lib/types.d.ts +15 -27
  116. package/lib/types.d.ts.map +1 -0
  117. package/lib/types.js +2 -5
  118. package/lib/types.js.map +1 -0
  119. package/lib/utils/assert-node-version.d.ts +1 -0
  120. package/lib/utils/assert-node-version.d.ts.map +1 -0
  121. package/lib/utils/assert-node-version.js +8 -10
  122. package/lib/utils/assert-node-version.js.map +1 -0
  123. package/lib/utils/error.d.ts +4 -0
  124. package/lib/utils/error.d.ts.map +1 -0
  125. package/lib/utils/error.js +8 -0
  126. package/lib/utils/error.js.map +1 -0
  127. package/lib/utils/fetch-with-timeout.d.ts +1 -0
  128. package/lib/utils/fetch-with-timeout.d.ts.map +1 -0
  129. package/lib/utils/fetch-with-timeout.js +6 -8
  130. package/lib/utils/fetch-with-timeout.js.map +1 -0
  131. package/lib/utils/{getCommandNameFromArgs.d.ts → get-command-name-from-args.d.ts} +1 -0
  132. package/lib/utils/get-command-name-from-args.d.ts.map +1 -0
  133. package/lib/utils/get-command-name-from-args.js +4 -0
  134. package/lib/utils/get-command-name-from-args.js.map +1 -0
  135. package/lib/utils/js-utils.d.ts +1 -0
  136. package/lib/utils/js-utils.d.ts.map +1 -0
  137. package/lib/utils/js-utils.js +8 -12
  138. package/lib/utils/js-utils.js.map +1 -0
  139. package/lib/utils/miscellaneous.d.ts +9 -48
  140. package/lib/utils/miscellaneous.d.ts.map +1 -0
  141. package/lib/utils/miscellaneous.js +131 -269
  142. package/lib/utils/miscellaneous.js.map +1 -0
  143. package/lib/utils/package.d.ts +2 -0
  144. package/lib/utils/package.d.ts.map +1 -0
  145. package/lib/utils/package.js +4 -0
  146. package/lib/utils/package.js.map +1 -0
  147. package/lib/utils/platform.d.ts +1 -0
  148. package/lib/utils/platform.d.ts.map +1 -0
  149. package/lib/utils/platform.js +5 -9
  150. package/lib/utils/platform.js.map +1 -0
  151. package/lib/utils/proxy-agent.d.ts +3 -0
  152. package/lib/utils/proxy-agent.d.ts.map +1 -0
  153. package/lib/utils/proxy-agent.js +6 -0
  154. package/lib/utils/proxy-agent.js.map +1 -0
  155. package/lib/utils/spinner.d.ts +1 -0
  156. package/lib/utils/spinner.d.ts.map +1 -0
  157. package/lib/utils/spinner.js +8 -10
  158. package/lib/utils/spinner.js.map +1 -0
  159. package/lib/utils/telemetry.d.ts +40 -0
  160. package/lib/utils/telemetry.d.ts.map +1 -0
  161. package/lib/utils/telemetry.js +138 -0
  162. package/lib/utils/telemetry.js.map +1 -0
  163. package/lib/utils/update-version-notifier.d.ts +1 -1
  164. package/lib/utils/update-version-notifier.d.ts.map +1 -0
  165. package/lib/utils/update-version-notifier.js +35 -38
  166. package/lib/utils/update-version-notifier.js.map +1 -0
  167. package/lib/utils/validate-positive-number.d.ts +2 -0
  168. package/lib/utils/validate-positive-number.d.ts.map +1 -0
  169. package/lib/utils/validate-positive-number.js +13 -0
  170. package/lib/utils/validate-positive-number.js.map +1 -0
  171. package/lib/wrapper.d.ts +3 -3
  172. package/lib/wrapper.d.ts.map +1 -0
  173. package/lib/wrapper.js +39 -26
  174. package/lib/wrapper.js.map +1 -0
  175. package/package.json +16 -17
  176. package/CHANGELOG.md +0 -777
  177. package/lib/__mocks__/@redocly/openapi-core.d.ts +0 -99
  178. package/lib/__mocks__/@redocly/openapi-core.js +0 -84
  179. package/lib/__mocks__/documents.d.ts +0 -150
  180. package/lib/__mocks__/documents.js +0 -123
  181. package/lib/__mocks__/fs.d.ts +0 -8
  182. package/lib/__mocks__/fs.js +0 -9
  183. package/lib/__mocks__/perf_hooks.d.ts +0 -3
  184. package/lib/__mocks__/perf_hooks.js +0 -6
  185. package/lib/__mocks__/redoc.d.ts +0 -6
  186. package/lib/__mocks__/redoc.js +0 -5
  187. package/lib/__tests__/commands/build-docs.test.d.ts +0 -1
  188. package/lib/__tests__/commands/build-docs.test.js +0 -54
  189. package/lib/__tests__/commands/bundle.test.d.ts +0 -1
  190. package/lib/__tests__/commands/bundle.test.js +0 -235
  191. package/lib/__tests__/commands/join.test.d.ts +0 -1
  192. package/lib/__tests__/commands/join.test.js +0 -274
  193. package/lib/__tests__/commands/lint.test.d.ts +0 -1
  194. package/lib/__tests__/commands/lint.test.js +0 -149
  195. package/lib/__tests__/commands/push-region.test.d.ts +0 -1
  196. package/lib/__tests__/commands/push-region.test.js +0 -90
  197. package/lib/__tests__/commands/push.test.d.ts +0 -1
  198. package/lib/__tests__/commands/push.test.js +0 -496
  199. package/lib/__tests__/fetch-with-timeout.test.d.ts +0 -1
  200. package/lib/__tests__/fetch-with-timeout.test.js +0 -64
  201. package/lib/__tests__/fixtures/config.d.ts +0 -21
  202. package/lib/__tests__/fixtures/config.js +0 -24
  203. package/lib/__tests__/spinner.test.d.ts +0 -1
  204. package/lib/__tests__/spinner.test.js +0 -43
  205. package/lib/__tests__/utils.test.d.ts +0 -1
  206. package/lib/__tests__/utils.test.js +0 -651
  207. package/lib/__tests__/wrapper.test.d.ts +0 -1
  208. package/lib/__tests__/wrapper.test.js +0 -76
  209. package/lib/auth/__tests__/device-flow.test.d.ts +0 -1
  210. package/lib/auth/__tests__/device-flow.test.js +0 -62
  211. package/lib/auth/__tests__/oauth-client.test.d.ts +0 -1
  212. package/lib/auth/__tests__/oauth-client.test.js +0 -93
  213. package/lib/commands/preview-docs/index.d.ts +0 -12
  214. package/lib/commands/preview-docs/index.js +0 -127
  215. package/lib/commands/preview-docs/preview-server/default.hbs +0 -24
  216. package/lib/commands/preview-docs/preview-server/hot.js +0 -59
  217. package/lib/commands/preview-docs/preview-server/oauth2-redirect.html +0 -21
  218. package/lib/commands/preview-docs/preview-server/preview-server.d.ts +0 -5
  219. package/lib/commands/preview-docs/preview-server/preview-server.js +0 -113
  220. package/lib/commands/preview-docs/preview-server/server.d.ts +0 -22
  221. package/lib/commands/preview-docs/preview-server/server.js +0 -85
  222. package/lib/commands/push.d.ts +0 -44
  223. package/lib/commands/push.js +0 -301
  224. package/lib/commands/split/__tests__/index.test.d.ts +0 -1
  225. package/lib/commands/split/__tests__/index.test.js +0 -91
  226. package/lib/reunite/api/__tests__/api-keys.test.d.ts +0 -1
  227. package/lib/reunite/api/__tests__/api-keys.test.js +0 -26
  228. package/lib/reunite/api/__tests__/api.client.test.d.ts +0 -1
  229. package/lib/reunite/api/__tests__/api.client.test.js +0 -337
  230. package/lib/reunite/api/__tests__/domains.test.d.ts +0 -1
  231. package/lib/reunite/api/__tests__/domains.test.js +0 -32
  232. package/lib/reunite/commands/__tests__/push-status.test.d.ts +0 -1
  233. package/lib/reunite/commands/__tests__/push-status.test.js +0 -563
  234. package/lib/reunite/commands/__tests__/push.test.d.ts +0 -1
  235. package/lib/reunite/commands/__tests__/push.test.js +0 -315
  236. package/lib/reunite/commands/__tests__/utils.test.d.ts +0 -1
  237. package/lib/reunite/commands/__tests__/utils.test.js +0 -51
  238. package/lib/utils/__mocks__/miscellaneous.d.ts +0 -43
  239. package/lib/utils/__mocks__/miscellaneous.js +0 -24
  240. package/lib/utils/getCommandNameFromArgs.js +0 -6
  241. package/src/__mocks__/@redocly/openapi-core.ts +0 -88
  242. package/src/__mocks__/documents.ts +0 -124
  243. package/src/__mocks__/fs.ts +0 -6
  244. package/src/__mocks__/perf_hooks.ts +0 -3
  245. package/src/__mocks__/redoc.ts +0 -2
  246. package/src/__tests__/commands/build-docs.test.ts +0 -59
  247. package/src/__tests__/commands/bundle.test.ts +0 -285
  248. package/src/__tests__/commands/join.test.ts +0 -334
  249. package/src/__tests__/commands/lint.test.ts +0 -190
  250. package/src/__tests__/commands/push-region.test.ts +0 -104
  251. package/src/__tests__/commands/push.test.ts +0 -553
  252. package/src/__tests__/fetch-with-timeout.test.ts +0 -81
  253. package/src/__tests__/fixtures/config.ts +0 -21
  254. package/src/__tests__/fixtures/openapi.json +0 -0
  255. package/src/__tests__/fixtures/openapi.yaml +0 -0
  256. package/src/__tests__/fixtures/redocly.yaml +0 -0
  257. package/src/__tests__/spinner.test.ts +0 -51
  258. package/src/__tests__/utils.test.ts +0 -781
  259. package/src/__tests__/wrapper.test.ts +0 -91
  260. package/src/auth/__tests__/device-flow.test.ts +0 -73
  261. package/src/auth/__tests__/oauth-client.test.ts +0 -117
  262. package/src/auth/device-flow.ts +0 -175
  263. package/src/auth/oauth-client.ts +0 -111
  264. package/src/commands/auth.ts +0 -66
  265. package/src/commands/build-docs/index.ts +0 -55
  266. package/src/commands/build-docs/template.hbs +0 -23
  267. package/src/commands/build-docs/types.ts +0 -25
  268. package/src/commands/build-docs/utils.ts +0 -110
  269. package/src/commands/bundle.ts +0 -154
  270. package/src/commands/eject.ts +0 -42
  271. package/src/commands/join.ts +0 -794
  272. package/src/commands/lint.ts +0 -169
  273. package/src/commands/preview-docs/index.ts +0 -183
  274. package/src/commands/preview-docs/preview-server/default.hbs +0 -24
  275. package/src/commands/preview-docs/preview-server/hot.js +0 -59
  276. package/src/commands/preview-docs/preview-server/oauth2-redirect.html +0 -21
  277. package/src/commands/preview-docs/preview-server/preview-server.ts +0 -159
  278. package/src/commands/preview-docs/preview-server/server.ts +0 -92
  279. package/src/commands/preview-project/constants.ts +0 -23
  280. package/src/commands/preview-project/index.ts +0 -71
  281. package/src/commands/preview-project/types.ts +0 -12
  282. package/src/commands/push.ts +0 -470
  283. package/src/commands/split/__tests__/fixtures/samples.json +0 -61
  284. package/src/commands/split/__tests__/fixtures/spec.json +0 -70
  285. package/src/commands/split/__tests__/fixtures/webhooks.json +0 -85
  286. package/src/commands/split/__tests__/index.test.ts +0 -156
  287. package/src/commands/split/index.ts +0 -397
  288. package/src/commands/split/types.ts +0 -60
  289. package/src/commands/stats.ts +0 -140
  290. package/src/commands/translations.ts +0 -32
  291. package/src/custom.d.ts +0 -1
  292. package/src/index.ts +0 -970
  293. package/src/otel.ts +0 -59
  294. package/src/reunite/api/__tests__/api-keys.test.ts +0 -37
  295. package/src/reunite/api/__tests__/api.client.test.ts +0 -452
  296. package/src/reunite/api/__tests__/domains.test.ts +0 -41
  297. package/src/reunite/api/api-client.ts +0 -381
  298. package/src/reunite/api/api-keys.ts +0 -26
  299. package/src/reunite/api/domains.ts +0 -23
  300. package/src/reunite/api/index.ts +0 -3
  301. package/src/reunite/api/types.ts +0 -108
  302. package/src/reunite/commands/__tests__/push-status.test.ts +0 -653
  303. package/src/reunite/commands/__tests__/push.test.ts +0 -385
  304. package/src/reunite/commands/__tests__/utils.test.ts +0 -62
  305. package/src/reunite/commands/push-status.ts +0 -325
  306. package/src/reunite/commands/push.ts +0 -235
  307. package/src/reunite/commands/utils.ts +0 -66
  308. package/src/reunite/utils.ts +0 -1
  309. package/src/types.ts +0 -64
  310. package/src/utils/__mocks__/miscellaneous.ts +0 -24
  311. package/src/utils/assert-node-version.ts +0 -19
  312. package/src/utils/fetch-with-timeout.ts +0 -30
  313. package/src/utils/getCommandNameFromArgs.ts +0 -5
  314. package/src/utils/js-utils.ts +0 -24
  315. package/src/utils/miscellaneous.ts +0 -729
  316. package/src/utils/platform.ts +0 -31
  317. package/src/utils/spinner.ts +0 -50
  318. package/src/utils/update-version-notifier.ts +0 -115
  319. package/src/wrapper.ts +0 -77
  320. package/tsconfig.json +0 -9
  321. package/tsconfig.tsbuildinfo +0 -1
package/src/index.ts DELETED
@@ -1,970 +0,0 @@
1
- #!/usr/bin/env node
2
- import * as path from 'path';
3
- import * as dotenv from 'dotenv';
4
- import './utils/assert-node-version';
5
- import * as yargs from 'yargs';
6
- import * as colors from 'colorette';
7
- import { outputExtensions, regionChoices } from './types';
8
- import { previewDocs } from './commands/preview-docs';
9
- import { handleStats } from './commands/stats';
10
- import { handleSplit } from './commands/split';
11
- import { handleJoin } from './commands/join';
12
- import { handlePushStatus } from './reunite/commands/push-status';
13
- import { handleLint } from './commands/lint';
14
- import { handleBundle } from './commands/bundle';
15
- import { handleLogin, handleLogout } from './commands/auth';
16
- import { handlerBuildCommand } from './commands/build-docs';
17
- import {
18
- cacheLatestVersion,
19
- notifyUpdateCliVersion,
20
- version,
21
- } from './utils/update-version-notifier';
22
- import { commandWrapper } from './wrapper';
23
- import { previewProject } from './commands/preview-project';
24
- import { handleTranslations } from './commands/translations';
25
- import { handleEject } from './commands/eject';
26
- import { PRODUCT_PLANS } from './commands/preview-project/constants';
27
- import { commonPushHandler } from './commands/push';
28
-
29
- import type { Arguments } from 'yargs';
30
- import type { OutputFormat, RuleSeverity } from '@redocly/openapi-core';
31
- import type { GenerateArazzoFileOptions, RespectOptions } from '@redocly/respect-core';
32
- import type { BuildDocsArgv } from './commands/build-docs/types';
33
- import type { PushStatusOptions } from './reunite/commands/push-status';
34
- import type { PushArguments } from './types';
35
- import type { EjectOptions } from './commands/eject';
36
-
37
- dotenv.config({ path: path.resolve(process.cwd(), './.env') });
38
-
39
- if (!('replaceAll' in String.prototype)) {
40
- require('core-js/actual/string/replace-all');
41
- }
42
-
43
- cacheLatestVersion();
44
-
45
- yargs
46
- .version('version', 'Show version number.', version)
47
- .help('help', 'Show help.')
48
- .parserConfiguration({ 'greedy-arrays': false, 'camel-case-expansion': false })
49
- .command(
50
- 'stats [api]',
51
- 'Show statistics for an API description.',
52
- (yargs) =>
53
- yargs.positional('api', { type: 'string' }).option({
54
- config: { description: 'Path to the config file.', type: 'string' },
55
- 'lint-config': {
56
- description: 'Severity level for config file linting.',
57
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
58
- default: 'warn' as RuleSeverity,
59
- },
60
- format: {
61
- description: 'Use a specific output format.',
62
- choices: ['stylish', 'json', 'markdown'] as ReadonlyArray<OutputFormat>,
63
- default: 'stylish' as OutputFormat,
64
- },
65
- }),
66
- (argv) => {
67
- process.env.REDOCLY_CLI_COMMAND = 'stats';
68
- commandWrapper(handleStats)(argv);
69
- }
70
- )
71
- .command(
72
- 'split [api]',
73
- 'Split an API description into a multi-file structure.',
74
- (yargs) =>
75
- yargs
76
- .positional('api', {
77
- description: 'API description file that you want to split',
78
- type: 'string',
79
- })
80
- .option({
81
- outDir: {
82
- description: 'Output directory where files will be saved.',
83
- required: true,
84
- type: 'string',
85
- },
86
- separator: {
87
- description: 'File path separator used while splitting.',
88
- required: false,
89
- type: 'string',
90
- default: '_',
91
- },
92
- config: {
93
- description: 'Path to the config file.',
94
- requiresArg: true,
95
- type: 'string',
96
- },
97
- 'lint-config': {
98
- description: 'Severity level for config file linting.',
99
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
100
- default: 'warn' as RuleSeverity,
101
- },
102
- })
103
- .demandOption('api'),
104
- (argv) => {
105
- process.env.REDOCLY_CLI_COMMAND = 'split';
106
- commandWrapper(handleSplit)(argv);
107
- }
108
- )
109
- .command(
110
- 'join [apis...]',
111
- 'Join multiple API descriptions into one [experimental].',
112
- (yargs) =>
113
- yargs
114
- .positional('apis', {
115
- array: true,
116
- type: 'string',
117
- demandOption: true,
118
- })
119
- .option({
120
- 'prefix-tags-with-info-prop': {
121
- description: 'Prefix tags with property value from info object.',
122
- requiresArg: true,
123
- type: 'string',
124
- },
125
- 'prefix-tags-with-filename': {
126
- description: 'Prefix tags with property value from file name.',
127
- type: 'boolean',
128
- default: false,
129
- },
130
- 'prefix-components-with-info-prop': {
131
- description: 'Prefix components with property value from info object.',
132
- requiresArg: true,
133
- type: 'string',
134
- },
135
- 'without-x-tag-groups': {
136
- description: 'Skip automated x-tagGroups creation',
137
- type: 'boolean',
138
- },
139
- output: {
140
- description: 'Output file.',
141
- alias: 'o',
142
- type: 'string',
143
- },
144
- config: {
145
- description: 'Path to the config file.',
146
- requiresArg: true,
147
- type: 'string',
148
- },
149
- 'lint-config': {
150
- description: 'Severity level for config file linting.',
151
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
152
- default: 'warn' as RuleSeverity,
153
- },
154
- lint: {
155
- hidden: true,
156
- deprecated: true,
157
- },
158
- decorate: {
159
- hidden: true,
160
- deprecated: true,
161
- },
162
- preprocess: {
163
- hidden: true,
164
- deprecated: true,
165
- },
166
- }),
167
- (argv) => {
168
- const DEPRECATED_OPTIONS = ['lint', 'preprocess', 'decorate'];
169
- const DECORATORS_DOCUMENTATION_LINK = 'https://redocly.com/docs/cli/decorators/#decorators';
170
- const JOIN_COMMAND_DOCUMENTATION_LINK = 'https://redocly.com/docs/cli/commands/join/#join';
171
-
172
- DEPRECATED_OPTIONS.forEach((option) => {
173
- if (argv[option]) {
174
- process.stdout.write(
175
- `${colors.red(
176
- `Option --${option} is no longer supported. Please review join command documentation ${JOIN_COMMAND_DOCUMENTATION_LINK}.`
177
- )}`
178
- );
179
- process.stdout.write('\n\n');
180
-
181
- if (['preprocess', 'decorate'].includes(option)) {
182
- process.stdout.write(
183
- `${colors.red(
184
- `If you are looking for decorators, please review the decorators documentation ${DECORATORS_DOCUMENTATION_LINK}.`
185
- )}`
186
- );
187
- process.stdout.write('\n\n');
188
- }
189
-
190
- yargs.showHelp();
191
- process.exit(1);
192
- }
193
- });
194
-
195
- process.env.REDOCLY_CLI_COMMAND = 'join';
196
- commandWrapper(handleJoin)(argv);
197
- }
198
- )
199
- .command(
200
- 'push-status [pushId]',
201
- false,
202
- (yargs) =>
203
- yargs
204
- .positional('pushId', {
205
- description: 'Push id.',
206
- type: 'string',
207
- required: true,
208
- })
209
- .implies('max-execution-time', 'wait')
210
- .option({
211
- organization: {
212
- description: 'Name of the organization to push to.',
213
- type: 'string',
214
- alias: 'o',
215
- },
216
- project: {
217
- description: 'Name of the project to push to.',
218
- type: 'string',
219
- required: true,
220
- alias: 'p',
221
- },
222
- domain: { description: 'Specify a domain.', alias: 'd', type: 'string', required: false },
223
- wait: {
224
- description: 'Wait for build to finish.',
225
- type: 'boolean',
226
- default: false,
227
- },
228
- 'max-execution-time': {
229
- description: 'Maximum execution time in seconds.',
230
- type: 'number',
231
- },
232
- 'continue-on-deploy-failures': {
233
- description: 'Command does not fail even if the deployment fails.',
234
- type: 'boolean',
235
- default: false,
236
- },
237
- 'lint-config': {
238
- description: 'Severity level for config file linting.',
239
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
240
- default: 'warn' as RuleSeverity,
241
- },
242
- }),
243
- (argv) => {
244
- process.env.REDOCLY_CLI_COMMAND = 'push-status';
245
- commandWrapper(handlePushStatus)(argv as Arguments<PushStatusOptions>);
246
- }
247
- )
248
- .command(
249
- 'push [apis...]',
250
- 'Push an API description to the Redocly API registry.',
251
- (yargs) =>
252
- yargs
253
- .positional('apis', {
254
- type: 'string',
255
- array: true,
256
- required: true,
257
- default: [],
258
- })
259
- .hide('project')
260
- .hide('domain')
261
- .hide('mount-path')
262
- .hide('author')
263
- .hide('message')
264
- .hide('default-branch')
265
- .hide('verbose')
266
- .hide('commit-sha')
267
- .hide('commit-url')
268
- .hide('namespace')
269
- .hide('repository')
270
- .hide('wait-for-deployment')
271
- .hide('created-at')
272
- .hide('max-execution-time')
273
- .deprecateOption('batch-id', 'use --job-id')
274
- .implies('job-id', 'batch-size')
275
- .implies('batch-id', 'batch-size')
276
- .implies('batch-size', 'job-id')
277
- .implies('max-execution-time', 'wait-for-deployment')
278
- .option({
279
- destination: {
280
- description: 'API name and version in the format `name@version`.',
281
- type: 'string',
282
- alias: 'd',
283
- },
284
- branch: {
285
- description: 'Branch name to push to.',
286
- type: 'string',
287
- alias: 'b',
288
- },
289
- upsert: {
290
- description:
291
- "Create the specified API version if it doesn't exist, update if it does exist.",
292
- type: 'boolean',
293
- alias: 'u',
294
- },
295
- 'batch-id': {
296
- description:
297
- 'Specifies the ID of the CI job that the current push will be associated with.',
298
- type: 'string',
299
- requiresArg: true,
300
- deprecated: true,
301
- hidden: true,
302
- },
303
- 'job-id': {
304
- description: 'ID of the CI job that the current push will be associated with.',
305
- type: 'string',
306
- requiresArg: true,
307
- },
308
- 'batch-size': {
309
- description: 'Number of CI pushes to expect in a batch.',
310
- type: 'number',
311
- requiresArg: true,
312
- },
313
- region: { description: 'Specify a region.', alias: 'r', choices: regionChoices },
314
- 'skip-decorator': {
315
- description: 'Ignore certain decorators.',
316
- array: true,
317
- type: 'string',
318
- },
319
- public: {
320
- description: 'Make the API description available to the public',
321
- type: 'boolean',
322
- },
323
- files: {
324
- description: 'List of other folders and files to upload',
325
- array: true,
326
- type: 'string',
327
- },
328
- 'lint-config': {
329
- description: 'Severity level for config file linting.',
330
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
331
- default: 'warn' as RuleSeverity,
332
- },
333
- organization: {
334
- description: 'Name of the organization to push to.',
335
- type: 'string',
336
- alias: 'o',
337
- },
338
- project: {
339
- description: 'Name of the project to push to.',
340
- type: 'string',
341
- alias: 'p',
342
- },
343
- 'mount-path': {
344
- description: 'The path files should be pushed to.',
345
- type: 'string',
346
- alias: 'mp',
347
- },
348
- author: {
349
- description: 'Author of the commit.',
350
- type: 'string',
351
- alias: 'a',
352
- },
353
- message: {
354
- description: 'Commit message.',
355
- type: 'string',
356
- alias: 'm',
357
- },
358
- 'commit-sha': {
359
- description: 'Commit SHA.',
360
- type: 'string',
361
- alias: 'sha',
362
- },
363
- 'commit-url': {
364
- description: 'Commit URL.',
365
- type: 'string',
366
- alias: 'url',
367
- },
368
- namespace: {
369
- description: 'Repository namespace.',
370
- type: 'string',
371
- },
372
- repository: {
373
- description: 'Repository name.',
374
- type: 'string',
375
- },
376
- 'created-at': {
377
- description: 'Commit creation date.',
378
- type: 'string',
379
- },
380
- domain: { description: 'Specify a domain.', alias: 'd', type: 'string' },
381
- config: {
382
- description: 'Path to the config file.',
383
- requiresArg: true,
384
- type: 'string',
385
- },
386
- 'default-branch': {
387
- type: 'string',
388
- default: 'main',
389
- },
390
- 'max-execution-time': {
391
- description: 'Maximum execution time in seconds.',
392
- type: 'number',
393
- },
394
- 'wait-for-deployment': {
395
- description: 'Wait for build to finish.',
396
- type: 'boolean',
397
- default: false,
398
- },
399
- verbose: {
400
- type: 'boolean',
401
- default: false,
402
- },
403
- 'continue-on-deploy-failures': {
404
- description: 'Command does not fail even if the deployment fails.',
405
- type: 'boolean',
406
- default: false,
407
- },
408
- }),
409
- (argv) => {
410
- process.env.REDOCLY_CLI_COMMAND = 'push';
411
- commandWrapper(commonPushHandler(argv))(argv as Arguments<PushArguments>);
412
- }
413
- )
414
- .command(
415
- 'lint [apis...]',
416
- 'Lint an API or Arazzo description.',
417
- (yargs) =>
418
- yargs.positional('apis', { array: true, type: 'string', demandOption: true }).option({
419
- format: {
420
- description: 'Use a specific output format.',
421
- choices: [
422
- 'stylish',
423
- 'codeframe',
424
- 'json',
425
- 'checkstyle',
426
- 'codeclimate',
427
- 'summary',
428
- 'markdown',
429
- 'github-actions',
430
- ] as ReadonlyArray<OutputFormat>,
431
- default: 'codeframe' as OutputFormat,
432
- },
433
- 'max-problems': {
434
- requiresArg: true,
435
- description: 'Reduce output to a maximum of N problems.',
436
- type: 'number',
437
- default: 100,
438
- },
439
- 'generate-ignore-file': {
440
- description: 'Generate an ignore file.',
441
- type: 'boolean',
442
- },
443
- 'skip-rule': {
444
- description: 'Ignore certain rules.',
445
- array: true,
446
- type: 'string',
447
- },
448
- 'skip-preprocessor': {
449
- description: 'Ignore certain preprocessors.',
450
- array: true,
451
- type: 'string',
452
- },
453
- 'lint-config': {
454
- description: 'Severity level for config file linting.',
455
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
456
- default: 'warn' as RuleSeverity,
457
- },
458
- config: {
459
- description: 'Path to the config file.',
460
- requiresArg: true,
461
- type: 'string',
462
- },
463
- extends: {
464
- description: 'Override extends configurations (defaults or config file settings).',
465
- requiresArg: true,
466
- array: true,
467
- type: 'string',
468
- },
469
- }),
470
- (argv) => {
471
- process.env.REDOCLY_CLI_COMMAND = 'lint';
472
- commandWrapper(handleLint)(argv);
473
- }
474
- )
475
- .command(
476
- 'bundle [apis...]',
477
- 'Bundle a multi-file API description to a single file.',
478
- (yargs) =>
479
- yargs
480
- .positional('apis', { array: true, type: 'string', demandOption: true })
481
- .options({
482
- output: {
483
- type: 'string',
484
- description: 'Output file or folder for inline APIs.',
485
- alias: 'o',
486
- },
487
- ext: {
488
- description: 'Bundle file extension.',
489
- requiresArg: true,
490
- choices: outputExtensions,
491
- },
492
- 'skip-preprocessor': {
493
- description: 'Ignore certain preprocessors.',
494
- array: true,
495
- type: 'string',
496
- },
497
- 'skip-decorator': {
498
- description: 'Ignore certain decorators.',
499
- array: true,
500
- type: 'string',
501
- },
502
- dereferenced: {
503
- alias: 'd',
504
- type: 'boolean',
505
- description: 'Produce a fully dereferenced bundle.',
506
- },
507
- force: {
508
- alias: 'f',
509
- type: 'boolean',
510
- description: 'Produce bundle output even when errors occur.',
511
- },
512
- config: {
513
- description: 'Path to the config file.',
514
- type: 'string',
515
- },
516
- metafile: {
517
- description: 'Produce metadata about the bundle',
518
- type: 'string',
519
- },
520
- extends: {
521
- description: 'Override extends configurations (defaults or config file settings).',
522
- requiresArg: true,
523
- array: true,
524
- type: 'string',
525
- hidden: true,
526
- },
527
- 'remove-unused-components': {
528
- description: 'Remove unused components.',
529
- type: 'boolean',
530
- default: false,
531
- },
532
- 'keep-url-references': {
533
- description: 'Keep absolute url references.',
534
- type: 'boolean',
535
- alias: 'k',
536
- },
537
- 'lint-config': {
538
- description: 'Severity level for config file linting.',
539
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
540
- default: 'warn' as RuleSeverity,
541
- },
542
- format: {
543
- hidden: true,
544
- deprecated: true,
545
- },
546
- lint: {
547
- hidden: true,
548
- deprecated: true,
549
- },
550
- 'skip-rule': {
551
- hidden: true,
552
- deprecated: true,
553
- array: true,
554
- type: 'string',
555
- },
556
- 'max-problems': {
557
- hidden: true,
558
- deprecated: true,
559
- },
560
- })
561
- .check((argv) => {
562
- if (argv.output && (!argv.apis || argv.apis.length === 0)) {
563
- throw new Error('At least one inline API must be specified when using --output.');
564
- }
565
- return true;
566
- }),
567
- (argv) => {
568
- const DEPRECATED_OPTIONS = ['lint', 'format', 'skip-rule', 'max-problems'];
569
- const LINT_AND_BUNDLE_DOCUMENTATION_LINK =
570
- 'https://redocly.com/docs/cli/guides/lint-and-bundle/#lint-and-bundle-api-descriptions-with-redocly-cli';
571
-
572
- DEPRECATED_OPTIONS.forEach((option) => {
573
- if (argv[option]) {
574
- process.stdout.write(
575
- `${colors.red(
576
- `Option --${option} is no longer supported. Please use separate commands, as described in the ${LINT_AND_BUNDLE_DOCUMENTATION_LINK}.`
577
- )}`
578
- );
579
- process.stdout.write('\n\n');
580
- yargs.showHelp();
581
- process.exit(1);
582
- }
583
- });
584
-
585
- process.env.REDOCLY_CLI_COMMAND = 'bundle';
586
- commandWrapper(handleBundle)(argv);
587
- }
588
- )
589
- .command(
590
- 'check-config',
591
- 'Lint the Redocly configuration file.',
592
- async (yargs) =>
593
- yargs.option({
594
- config: {
595
- description: 'Path to the config file.',
596
- type: 'string',
597
- },
598
- 'lint-config': {
599
- description: 'Severity level for config file linting.',
600
- choices: ['warn', 'error'] as ReadonlyArray<RuleSeverity>,
601
- default: 'error' as RuleSeverity,
602
- },
603
- }),
604
- (argv) => {
605
- process.env.REDOCLY_CLI_COMMAND = 'check-config';
606
- commandWrapper()(argv);
607
- }
608
- )
609
- .command(
610
- 'login',
611
- 'Log in to Redocly.',
612
- async (yargs) =>
613
- yargs.options({
614
- verbose: {
615
- description: 'Include additional output.',
616
- type: 'boolean',
617
- },
618
- residency: {
619
- description: 'Residency of the application. Defaults to `us`.',
620
- alias: ['r', 'region'],
621
- type: 'string',
622
- },
623
- config: {
624
- description: 'Path to the config file.',
625
- requiresArg: true,
626
- type: 'string',
627
- },
628
- next: {
629
- description: 'Use Reunite application to login.',
630
- type: 'boolean',
631
- },
632
- }),
633
- (argv) => {
634
- process.env.REDOCLY_CLI_COMMAND = 'login';
635
- commandWrapper(handleLogin)(argv);
636
- }
637
- )
638
- .command(
639
- 'logout',
640
- 'Clear your stored credentials for the Redocly API registry.',
641
- (yargs) => yargs,
642
- (argv) => {
643
- process.env.REDOCLY_CLI_COMMAND = 'logout';
644
- commandWrapper(handleLogout)(argv);
645
- }
646
- )
647
- .command(
648
- 'preview',
649
- 'Preview Redocly project using one of the product NPM packages.',
650
- (yargs) =>
651
- yargs.options({
652
- product: {
653
- type: 'string',
654
- choices: ['redoc', 'revel', 'reef', 'realm', 'redoc-revel', 'redoc-reef', 'revel-reef'],
655
- description:
656
- "Product used to launch preview. Default is inferred from project's package.json or 'realm' is used.",
657
- },
658
- plan: {
659
- type: 'string',
660
- choices: PRODUCT_PLANS,
661
- default: 'enterprise',
662
- },
663
- port: {
664
- alias: 'p',
665
- type: 'number',
666
- description: 'Preview port.',
667
- default: 4000,
668
- },
669
- 'project-dir': {
670
- alias: ['d', 'source-dir'],
671
- type: 'string',
672
- description:
673
- 'Specifies the project content directory. The default value is the directory where the command is executed.',
674
- default: '.',
675
- },
676
- 'lint-config': {
677
- description: 'Severity level for config file linting.',
678
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
679
- default: 'warn' as RuleSeverity,
680
- },
681
- }),
682
- (argv) => {
683
- if (process.argv.some((arg) => arg.startsWith('--source-dir'))) {
684
- process.stderr.write(
685
- colors.red(
686
- 'Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.\n'
687
- )
688
- );
689
- }
690
- commandWrapper(previewProject)(argv);
691
- }
692
- )
693
- .command(
694
- 'preview-docs [api]',
695
- 'Preview API reference docs for an API description.',
696
- (yargs) =>
697
- yargs.positional('api', { type: 'string' }).options({
698
- port: {
699
- alias: 'p',
700
- type: 'number',
701
- default: 8080,
702
- description: 'Preview port.',
703
- },
704
- host: {
705
- alias: 'h',
706
- type: 'string',
707
- default: '127.0.0.1',
708
- description: 'Preview host.',
709
- },
710
- 'skip-preprocessor': {
711
- description: 'Ignore certain preprocessors.',
712
- array: true,
713
- type: 'string',
714
- },
715
- 'skip-decorator': {
716
- description: 'Ignore certain decorators.',
717
- array: true,
718
- type: 'string',
719
- },
720
- 'use-community-edition': {
721
- description: 'Use Redoc CE for documentation preview.',
722
- type: 'boolean',
723
- },
724
- force: {
725
- alias: 'f',
726
- type: 'boolean',
727
- description: 'Produce bundle output even when errors occur.',
728
- },
729
- config: {
730
- description: 'Path to the config file.',
731
- type: 'string',
732
- },
733
- 'lint-config': {
734
- description: 'Severity level for config file linting.',
735
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
736
- default: 'warn' as RuleSeverity,
737
- },
738
- }),
739
- (argv) => {
740
- process.env.REDOCLY_CLI_COMMAND = 'preview-docs';
741
- commandWrapper(previewDocs)(argv);
742
- }
743
- )
744
- .command(
745
- 'build-docs [api]',
746
- 'Produce API documentation as an HTML file',
747
- (yargs) =>
748
- yargs
749
- .positional('api', { type: 'string' })
750
- .options({
751
- o: {
752
- describe: 'Output destination file.',
753
- alias: 'output',
754
- type: 'string',
755
- default: 'redoc-static.html',
756
- },
757
- title: {
758
- describe: 'Page title.',
759
- type: 'string',
760
- },
761
- disableGoogleFont: {
762
- describe: 'Disable Google fonts.',
763
- type: 'boolean',
764
- default: false,
765
- },
766
- t: {
767
- alias: 'template',
768
- describe:
769
- 'Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/v1/packages/cli/src/commands/build-docs/template.hbs for the example.',
770
- type: 'string',
771
- },
772
- templateOptions: {
773
- describe:
774
- 'Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription',
775
- },
776
- theme: {
777
- describe:
778
- 'Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars',
779
- },
780
- config: {
781
- describe: 'Path to the config file.',
782
- type: 'string',
783
- },
784
- 'lint-config': {
785
- description: 'Severity level for config file linting.',
786
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
787
- default: 'warn' as RuleSeverity,
788
- },
789
- })
790
- .check((argv: any) => {
791
- if (argv.theme && !argv.theme?.openapi)
792
- throw Error('Invalid option: theme.openapi not set.');
793
- return true;
794
- }),
795
- async (argv) => {
796
- process.env.REDOCLY_CLI_COMMAND = 'build-docs';
797
- commandWrapper(handlerBuildCommand)(argv as Arguments<BuildDocsArgv>);
798
- }
799
- )
800
- .command(
801
- 'translate <locale>',
802
- 'Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.',
803
- (yargs) =>
804
- yargs
805
- .positional('locale', {
806
- description:
807
- 'Locale code to generate translations for, or `all` for all current project locales.',
808
- type: 'string',
809
- demandOption: true,
810
- })
811
- .options({
812
- 'project-dir': {
813
- alias: 'd',
814
- type: 'string',
815
- description:
816
- 'Specifies the project content directory. The default value is the directory where the command is executed.',
817
- default: '.',
818
- },
819
- 'lint-config': {
820
- description: 'Severity level for config file linting.',
821
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
822
- default: 'warn' as RuleSeverity,
823
- },
824
- }),
825
- (argv) => {
826
- process.env.REDOCLY_CLI_COMMAND = 'translate';
827
- commandWrapper(handleTranslations)(argv);
828
- }
829
- )
830
- .command(
831
- 'eject <type> [path]',
832
- 'Helper function to eject project elements for customization.',
833
- (yargs) =>
834
- yargs
835
- .positional('type', {
836
- description:
837
- 'Specifies what type of project element to eject. Currently this value must be `component`.',
838
- demandOption: true,
839
- choices: ['component'],
840
- })
841
- .positional('path', {
842
- description: 'Filepath to a component or filepath with glob pattern.',
843
- type: 'string',
844
- })
845
- .options({
846
- 'project-dir': {
847
- alias: 'd',
848
- type: 'string',
849
- description:
850
- 'Specifies the project content directory. The default value is the directory where the command is executed.',
851
- default: '.',
852
- },
853
- force: {
854
- alias: 'f',
855
- type: 'boolean',
856
- description:
857
- 'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.',
858
- },
859
- 'lint-config': {
860
- description: 'Severity level for config file linting.',
861
- choices: ['warn', 'error', 'off'] as ReadonlyArray<RuleSeverity>,
862
- default: 'warn' as RuleSeverity,
863
- },
864
- }),
865
- (argv) => {
866
- process.env.REDOCLY_CLI_COMMAND = 'eject';
867
- commandWrapper(handleEject)(argv as Arguments<EjectOptions>);
868
- }
869
- )
870
- .command(
871
- 'respect [files...]',
872
- 'Run Arazzo tests.',
873
- (yargs) => {
874
- return yargs
875
- .positional('files', {
876
- describe: 'Test files or glob pattern.',
877
- type: 'string',
878
- array: true,
879
- default: [],
880
- })
881
- .env('REDOCLY_CLI_RESPECT')
882
- .options({
883
- input: {
884
- alias: 'i',
885
- describe: 'Input parameters.',
886
- type: 'string',
887
- },
888
- server: {
889
- alias: 'S',
890
- describe: 'Server parameters.',
891
- type: 'string',
892
- },
893
- workflow: {
894
- alias: 'w',
895
- describe: 'Workflow name.',
896
- type: 'string',
897
- array: true,
898
- },
899
- skip: {
900
- alias: 's',
901
- describe: 'Workflow to skip.',
902
- type: 'string',
903
- array: true,
904
- },
905
- verbose: {
906
- alias: 'v',
907
- describe: 'Apply verbose mode.',
908
- type: 'boolean',
909
- },
910
- 'har-output': {
911
- describe: 'Har file output name.',
912
- type: 'string',
913
- },
914
- 'json-output': {
915
- describe: 'JSON file output name.',
916
- type: 'string',
917
- },
918
- 'client-cert': {
919
- describe: 'Mutual TLS client certificate.',
920
- type: 'string',
921
- },
922
- 'client-key': {
923
- describe: 'Mutual TLS client key.',
924
- type: 'string',
925
- },
926
- 'ca-cert': {
927
- describe: 'Mutual TLS CA certificate.',
928
- type: 'string',
929
- },
930
- severity: {
931
- describe: 'Severity of the check.',
932
- type: 'string',
933
- },
934
- });
935
- },
936
- async (argv) => {
937
- process.env.REDOCLY_CLI_COMMAND = 'respect';
938
- const { handleRun } = await import('@redocly/respect-core');
939
- commandWrapper(handleRun)(argv as Arguments<RespectOptions>);
940
- }
941
- )
942
- .command(
943
- 'generate-arazzo <descriptionPath>',
944
- 'Auto-generate arazzo description file from an API description.',
945
- (yargs) => {
946
- return yargs
947
- .positional('descriptionPath', {
948
- describe: 'Description file path.',
949
- type: 'string',
950
- })
951
- .env('REDOCLY_CLI_RESPECT')
952
- .options({
953
- 'output-file': {
954
- alias: 'o',
955
- describe: 'Output File name.',
956
- type: 'string',
957
- requiresArg: true,
958
- },
959
- });
960
- },
961
- async (argv) => {
962
- process.env.REDOCLY_CLI_COMMAND = 'generate-arazzo';
963
- const { handleGenerate } = await import('@redocly/respect-core');
964
- commandWrapper(handleGenerate)(argv as Arguments<GenerateArazzoFileOptions>);
965
- }
966
- )
967
- .completion('completion', 'Generate autocomplete script for `redocly` command.')
968
- .demandCommand(1)
969
- .middleware([notifyUpdateCliVersion])
970
- .strict().argv;