@redocly/client-generator 0.3.7 → 0.4.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 (617) hide show
  1. package/README.md +32 -54
  2. package/eject-assets/AGENTS.md +137 -0
  3. package/eject-assets/generators/cli/docs.ts +224 -0
  4. package/eject-assets/generators/cli/engine-source.ts +21 -0
  5. package/eject-assets/generators/cli/index.ts +90 -0
  6. package/eject-assets/generators/cli/render.ts +348 -0
  7. package/eject-assets/generators/go/client.ts +57 -0
  8. package/eject-assets/generators/go/descriptor.ts +41 -0
  9. package/eject-assets/generators/go/index.ts +336 -0
  10. package/eject-assets/generators/go/models.ts +179 -0
  11. package/eject-assets/generators/go/naming.ts +49 -0
  12. package/eject-assets/generators/go/operations.ts +296 -0
  13. package/eject-assets/generators/go/pagination.ts +194 -0
  14. package/eject-assets/generators/go/types.ts +60 -0
  15. package/eject-assets/generators/mock/faker.ts +214 -0
  16. package/eject-assets/generators/mock/index.ts +35 -0
  17. package/eject-assets/generators/mock/render.ts +282 -0
  18. package/eject-assets/generators/mock/sample.ts +316 -0
  19. package/eject-assets/generators/mock/values.ts +63 -0
  20. package/eject-assets/generators/php/client.ts +63 -0
  21. package/eject-assets/generators/php/descriptor.ts +58 -0
  22. package/eject-assets/generators/php/index.ts +237 -0
  23. package/eject-assets/generators/php/models.ts +275 -0
  24. package/eject-assets/generators/php/naming.ts +51 -0
  25. package/eject-assets/generators/php/operations.ts +232 -0
  26. package/eject-assets/generators/php/pagination.ts +133 -0
  27. package/eject-assets/generators/php/types.ts +148 -0
  28. package/eject-assets/generators/python/client.ts +123 -0
  29. package/eject-assets/generators/python/descriptor.ts +52 -0
  30. package/eject-assets/generators/python/index.ts +251 -0
  31. package/eject-assets/generators/python/models.ts +242 -0
  32. package/eject-assets/generators/python/naming.ts +46 -0
  33. package/eject-assets/generators/python/operations.ts +147 -0
  34. package/eject-assets/generators/python/pagination.ts +128 -0
  35. package/eject-assets/generators/python/types.ts +54 -0
  36. package/eject-assets/generators/swr/index.ts +37 -0
  37. package/eject-assets/generators/swr/render.ts +78 -0
  38. package/eject-assets/generators/tanstack-query/index.ts +48 -0
  39. package/eject-assets/generators/tanstack-query/render.ts +346 -0
  40. package/eject-assets/generators/transformers/index.ts +46 -0
  41. package/eject-assets/generators/transformers/render.ts +506 -0
  42. package/eject-assets/generators/typescript/banner.ts +35 -0
  43. package/eject-assets/generators/typescript/client.ts +254 -0
  44. package/eject-assets/generators/typescript/descriptor.ts +137 -0
  45. package/eject-assets/generators/typescript/index.ts +101 -0
  46. package/eject-assets/generators/typescript/inline-runtime.ts +135 -0
  47. package/eject-assets/generators/typescript/operation-signature.ts +62 -0
  48. package/eject-assets/generators/typescript/operation-types.ts +17 -0
  49. package/eject-assets/generators/typescript/operations.ts +524 -0
  50. package/eject-assets/generators/typescript/response-headers.ts +74 -0
  51. package/eject-assets/generators/typescript/type-guards.ts +159 -0
  52. package/eject-assets/generators/typescript/types.ts +172 -0
  53. package/eject-assets/generators/zod/index.ts +32 -0
  54. package/eject-assets/generators/zod/schemas.ts +456 -0
  55. package/eject-assets/skills/cli-generator/SKILL.md +121 -0
  56. package/eject-assets/skills/client-generators/SKILL.md +142 -0
  57. package/eject-assets/skills/go-generator/SKILL.md +96 -0
  58. package/eject-assets/skills/mock-generator/SKILL.md +50 -0
  59. package/eject-assets/skills/php-generator/SKILL.md +112 -0
  60. package/eject-assets/skills/python-generator/SKILL.md +110 -0
  61. package/eject-assets/skills/swr-generator/SKILL.md +50 -0
  62. package/eject-assets/skills/tanstack-query-generator/SKILL.md +55 -0
  63. package/eject-assets/skills/transformers-generator/SKILL.md +47 -0
  64. package/eject-assets/skills/typescript-generator/SKILL.md +95 -0
  65. package/eject-assets/skills/zod-generator/SKILL.md +54 -0
  66. package/lib/authoring/index.d.ts +11 -0
  67. package/lib/authoring/index.d.ts.map +1 -0
  68. package/lib/authoring/index.js +42 -0
  69. package/lib/authoring/index.js.map +1 -0
  70. package/lib/authoring/naming.d.ts +34 -0
  71. package/lib/authoring/naming.d.ts.map +1 -0
  72. package/lib/authoring/naming.js +104 -0
  73. package/lib/authoring/naming.js.map +1 -0
  74. package/lib/authoring/operation.d.ts +47 -0
  75. package/lib/authoring/operation.d.ts.map +1 -0
  76. package/lib/authoring/operation.js +86 -0
  77. package/lib/authoring/operation.js.map +1 -0
  78. package/lib/authoring/options.d.ts +9 -0
  79. package/lib/authoring/options.d.ts.map +1 -0
  80. package/lib/authoring/options.js +5 -0
  81. package/lib/authoring/options.js.map +1 -0
  82. package/lib/authoring/pagination.d.ts +19 -0
  83. package/lib/authoring/pagination.d.ts.map +1 -0
  84. package/lib/authoring/pagination.js +45 -0
  85. package/lib/authoring/pagination.js.map +1 -0
  86. package/lib/authoring/printer.d.ts +16 -0
  87. package/lib/authoring/printer.d.ts.map +1 -0
  88. package/lib/authoring/printer.js +36 -0
  89. package/lib/authoring/printer.js.map +1 -0
  90. package/lib/authoring/reference-page.d.ts +31 -0
  91. package/lib/authoring/reference-page.d.ts.map +1 -0
  92. package/lib/authoring/reference-page.js +160 -0
  93. package/lib/authoring/reference-page.js.map +1 -0
  94. package/lib/authoring/schema.d.ts +51 -0
  95. package/lib/authoring/schema.d.ts.map +1 -0
  96. package/lib/authoring/schema.js +190 -0
  97. package/lib/authoring/schema.js.map +1 -0
  98. package/lib/cli-contract.d.ts +126 -0
  99. package/lib/cli-contract.d.ts.map +1 -0
  100. package/lib/cli-contract.js +25 -0
  101. package/lib/cli-contract.js.map +1 -0
  102. package/lib/{emitters/wrapper-support.d.ts → contracts/typescript.d.ts} +13 -24
  103. package/lib/contracts/typescript.d.ts.map +1 -0
  104. package/lib/contracts/typescript.js +87 -0
  105. package/lib/contracts/typescript.js.map +1 -0
  106. package/lib/generate.d.ts +10 -10
  107. package/lib/generate.d.ts.map +1 -1
  108. package/lib/generate.js +25 -106
  109. package/lib/generate.js.map +1 -1
  110. package/lib/generators/cli/docs.d.ts +19 -0
  111. package/lib/generators/cli/docs.d.ts.map +1 -0
  112. package/lib/generators/cli/docs.js +187 -0
  113. package/lib/generators/cli/docs.js.map +1 -0
  114. package/lib/generators/cli/engine-source.d.ts +5 -0
  115. package/lib/generators/cli/engine-source.d.ts.map +1 -0
  116. package/lib/generators/cli/engine-source.js +12 -0
  117. package/lib/generators/cli/engine-source.js.map +1 -0
  118. package/lib/generators/cli/index.d.ts +18 -0
  119. package/lib/generators/cli/index.d.ts.map +1 -0
  120. package/lib/generators/cli/index.js +67 -0
  121. package/lib/generators/cli/index.js.map +1 -0
  122. package/lib/generators/cli/render.d.ts +39 -0
  123. package/lib/generators/cli/render.d.ts.map +1 -0
  124. package/lib/generators/cli/render.js +281 -0
  125. package/lib/generators/cli/render.js.map +1 -0
  126. package/lib/generators/cli/runtime/cli.d.ts +42 -0
  127. package/lib/generators/cli/runtime/cli.d.ts.map +1 -0
  128. package/lib/generators/cli/runtime/cli.js +582 -0
  129. package/lib/generators/cli/runtime/cli.js.map +1 -0
  130. package/lib/generators/compatibility.d.ts +10 -0
  131. package/lib/generators/compatibility.d.ts.map +1 -0
  132. package/lib/generators/compatibility.js +45 -0
  133. package/lib/generators/compatibility.js.map +1 -0
  134. package/lib/generators/go/client.d.ts +5 -0
  135. package/lib/generators/go/client.d.ts.map +1 -0
  136. package/lib/generators/go/client.js +34 -0
  137. package/lib/generators/go/client.js.map +1 -0
  138. package/lib/generators/go/descriptor.d.ts +6 -0
  139. package/lib/generators/go/descriptor.d.ts.map +1 -0
  140. package/lib/generators/go/descriptor.js +26 -0
  141. package/lib/generators/go/descriptor.js.map +1 -0
  142. package/lib/generators/go/index.d.ts +14 -0
  143. package/lib/generators/go/index.d.ts.map +1 -0
  144. package/lib/generators/go/index.js +240 -0
  145. package/lib/generators/go/index.js.map +1 -0
  146. package/lib/generators/go/models.d.ts +4 -0
  147. package/lib/generators/go/models.d.ts.map +1 -0
  148. package/lib/generators/go/models.js +125 -0
  149. package/lib/generators/go/models.js.map +1 -0
  150. package/lib/generators/go/naming.d.ts +15 -0
  151. package/lib/generators/go/naming.d.ts.map +1 -0
  152. package/lib/generators/go/naming.js +36 -0
  153. package/lib/generators/go/naming.js.map +1 -0
  154. package/lib/generators/go/operations.d.ts +16 -0
  155. package/lib/generators/go/operations.d.ts.map +1 -0
  156. package/lib/generators/go/operations.js +200 -0
  157. package/lib/generators/go/operations.js.map +1 -0
  158. package/lib/generators/go/pagination.d.ts +5 -0
  159. package/lib/generators/go/pagination.d.ts.map +1 -0
  160. package/lib/generators/go/pagination.js +93 -0
  161. package/lib/generators/go/pagination.js.map +1 -0
  162. package/lib/generators/go/types.d.ts +4 -0
  163. package/lib/generators/go/types.d.ts.map +1 -0
  164. package/lib/generators/go/types.js +48 -0
  165. package/lib/generators/go/types.js.map +1 -0
  166. package/lib/generators/index.d.ts +2 -3
  167. package/lib/generators/index.d.ts.map +1 -1
  168. package/lib/generators/index.js +31 -53
  169. package/lib/generators/index.js.map +1 -1
  170. package/lib/generators/meta.d.ts +13 -0
  171. package/lib/generators/meta.d.ts.map +1 -0
  172. package/lib/generators/meta.js +157 -0
  173. package/lib/generators/meta.js.map +1 -0
  174. package/lib/{emitters → generators/mock}/faker.d.ts +4 -5
  175. package/lib/generators/mock/faker.d.ts.map +1 -0
  176. package/lib/generators/mock/faker.js +180 -0
  177. package/lib/generators/mock/faker.js.map +1 -0
  178. package/lib/generators/{mock.d.ts → mock/index.d.ts} +2 -2
  179. package/lib/generators/mock/index.d.ts.map +1 -0
  180. package/lib/generators/{mock.js → mock/index.js} +8 -8
  181. package/lib/generators/mock/index.js.map +1 -0
  182. package/lib/{emitters/mock.d.ts → generators/mock/render.d.ts} +2 -3
  183. package/lib/generators/mock/render.d.ts.map +1 -0
  184. package/lib/generators/mock/render.js +228 -0
  185. package/lib/generators/mock/render.js.map +1 -0
  186. package/lib/{emitters → generators/mock}/sample.d.ts +1 -2
  187. package/lib/generators/mock/sample.d.ts.map +1 -0
  188. package/lib/generators/mock/sample.js.map +1 -0
  189. package/lib/generators/mock/values.d.ts +33 -0
  190. package/lib/generators/mock/values.d.ts.map +1 -0
  191. package/lib/generators/mock/values.js +46 -0
  192. package/lib/generators/mock/values.js.map +1 -0
  193. package/lib/generators/options.d.ts +7 -0
  194. package/lib/generators/options.d.ts.map +1 -0
  195. package/lib/generators/options.js +74 -0
  196. package/lib/generators/options.js.map +1 -0
  197. package/lib/generators/php/client.d.ts +5 -0
  198. package/lib/generators/php/client.d.ts.map +1 -0
  199. package/lib/generators/php/client.js +38 -0
  200. package/lib/generators/php/client.js.map +1 -0
  201. package/lib/generators/php/descriptor.d.ts +7 -0
  202. package/lib/generators/php/descriptor.d.ts.map +1 -0
  203. package/lib/generators/php/descriptor.js +42 -0
  204. package/lib/generators/php/descriptor.js.map +1 -0
  205. package/lib/generators/php/index.d.ts +14 -0
  206. package/lib/generators/php/index.d.ts.map +1 -0
  207. package/lib/generators/php/index.js +166 -0
  208. package/lib/generators/php/index.js.map +1 -0
  209. package/lib/generators/php/models.d.ts +8 -0
  210. package/lib/generators/php/models.d.ts.map +1 -0
  211. package/lib/generators/php/models.js +200 -0
  212. package/lib/generators/php/models.js.map +1 -0
  213. package/lib/generators/php/naming.d.ts +16 -0
  214. package/lib/generators/php/naming.d.ts.map +1 -0
  215. package/lib/generators/php/naming.js +31 -0
  216. package/lib/generators/php/naming.js.map +1 -0
  217. package/lib/generators/php/operations.d.ts +21 -0
  218. package/lib/generators/php/operations.d.ts.map +1 -0
  219. package/lib/generators/php/operations.js +156 -0
  220. package/lib/generators/php/operations.js.map +1 -0
  221. package/lib/generators/php/pagination.d.ts +5 -0
  222. package/lib/generators/php/pagination.d.ts.map +1 -0
  223. package/lib/generators/php/pagination.js +68 -0
  224. package/lib/generators/php/pagination.js.map +1 -0
  225. package/lib/generators/php/types.d.ts +27 -0
  226. package/lib/generators/php/types.d.ts.map +1 -0
  227. package/lib/generators/php/types.js +128 -0
  228. package/lib/generators/php/types.js.map +1 -0
  229. package/lib/generators/python/client.d.ts +6 -0
  230. package/lib/generators/python/client.d.ts.map +1 -0
  231. package/lib/generators/python/client.js +80 -0
  232. package/lib/generators/python/client.js.map +1 -0
  233. package/lib/generators/python/descriptor.d.ts +9 -0
  234. package/lib/generators/python/descriptor.d.ts.map +1 -0
  235. package/lib/generators/python/descriptor.js +38 -0
  236. package/lib/generators/python/descriptor.js.map +1 -0
  237. package/lib/generators/python/index.d.ts +15 -0
  238. package/lib/generators/python/index.d.ts.map +1 -0
  239. package/lib/generators/python/index.js +197 -0
  240. package/lib/generators/python/index.js.map +1 -0
  241. package/lib/generators/python/models.d.ts +31 -0
  242. package/lib/generators/python/models.d.ts.map +1 -0
  243. package/lib/generators/python/models.js +203 -0
  244. package/lib/generators/python/models.js.map +1 -0
  245. package/lib/generators/python/naming.d.ts +22 -0
  246. package/lib/generators/python/naming.d.ts.map +1 -0
  247. package/lib/generators/python/naming.js +28 -0
  248. package/lib/generators/python/naming.js.map +1 -0
  249. package/lib/generators/python/operations.d.ts +4 -0
  250. package/lib/generators/python/operations.d.ts.map +1 -0
  251. package/lib/generators/python/operations.js +108 -0
  252. package/lib/generators/python/operations.js.map +1 -0
  253. package/lib/generators/python/pagination.d.ts +5 -0
  254. package/lib/generators/python/pagination.d.ts.map +1 -0
  255. package/lib/generators/python/pagination.js +95 -0
  256. package/lib/generators/python/pagination.js.map +1 -0
  257. package/lib/generators/python/types.d.ts +4 -0
  258. package/lib/generators/python/types.d.ts.map +1 -0
  259. package/lib/generators/python/types.js +45 -0
  260. package/lib/generators/python/types.js.map +1 -0
  261. package/lib/generators/resolve.d.ts.map +1 -1
  262. package/lib/generators/resolve.js +92 -13
  263. package/lib/generators/resolve.js.map +1 -1
  264. package/lib/generators/{swr.d.ts → swr/index.d.ts} +3 -3
  265. package/lib/generators/swr/index.d.ts.map +1 -0
  266. package/lib/generators/{swr.js → swr/index.js} +7 -10
  267. package/lib/generators/swr/index.js.map +1 -0
  268. package/lib/{emitters/swr.d.ts → generators/swr/render.d.ts} +2 -4
  269. package/lib/generators/swr/render.d.ts.map +1 -0
  270. package/lib/generators/swr/render.js +57 -0
  271. package/lib/generators/swr/render.js.map +1 -0
  272. package/lib/generators/{tanstack-query.d.ts → tanstack-query/index.d.ts} +3 -3
  273. package/lib/generators/tanstack-query/index.d.ts.map +1 -0
  274. package/lib/generators/{tanstack-query.js → tanstack-query/index.js} +11 -10
  275. package/lib/generators/tanstack-query/index.js.map +1 -0
  276. package/lib/{emitters/tanstack-query.d.ts → generators/tanstack-query/render.d.ts} +6 -5
  277. package/lib/generators/tanstack-query/render.d.ts.map +1 -0
  278. package/lib/{emitters/tanstack-query.js → generators/tanstack-query/render.js} +33 -21
  279. package/lib/generators/tanstack-query/render.js.map +1 -0
  280. package/lib/generators/{transformers.d.ts → transformers/index.d.ts} +2 -2
  281. package/lib/generators/transformers/index.d.ts.map +1 -0
  282. package/lib/generators/{transformers.js → transformers/index.js} +11 -8
  283. package/lib/generators/transformers/index.js.map +1 -0
  284. package/lib/{emitters/transformers.d.ts → generators/transformers/render.d.ts} +2 -2
  285. package/lib/generators/transformers/render.d.ts.map +1 -0
  286. package/lib/{emitters/transformers.js → generators/transformers/render.js} +125 -165
  287. package/lib/generators/transformers/render.js.map +1 -0
  288. package/lib/generators/types.d.ts +190 -12
  289. package/lib/generators/types.d.ts.map +1 -1
  290. package/lib/generators/typescript/banner.d.ts +12 -0
  291. package/lib/generators/typescript/banner.d.ts.map +1 -0
  292. package/lib/{emitters/emit-options.js → generators/typescript/banner.js} +2 -3
  293. package/lib/generators/typescript/banner.js.map +1 -0
  294. package/lib/generators/typescript/client.d.ts +25 -0
  295. package/lib/generators/typescript/client.d.ts.map +1 -0
  296. package/lib/generators/typescript/client.js +207 -0
  297. package/lib/generators/typescript/client.js.map +1 -0
  298. package/lib/generators/typescript/descriptor.d.ts +11 -0
  299. package/lib/generators/typescript/descriptor.d.ts.map +1 -0
  300. package/lib/generators/typescript/descriptor.js +97 -0
  301. package/lib/generators/typescript/descriptor.js.map +1 -0
  302. package/lib/generators/typescript/index.d.ts +20 -0
  303. package/lib/generators/typescript/index.d.ts.map +1 -0
  304. package/lib/generators/typescript/index.js +80 -0
  305. package/lib/generators/typescript/index.js.map +1 -0
  306. package/lib/generators/typescript/inline-runtime.d.ts +21 -0
  307. package/lib/generators/typescript/inline-runtime.d.ts.map +1 -0
  308. package/lib/generators/typescript/inline-runtime.js +114 -0
  309. package/lib/generators/typescript/inline-runtime.js.map +1 -0
  310. package/lib/generators/typescript/operation-signature.d.ts +23 -0
  311. package/lib/generators/typescript/operation-signature.d.ts.map +1 -0
  312. package/lib/generators/typescript/operation-signature.js +41 -0
  313. package/lib/generators/typescript/operation-signature.js.map +1 -0
  314. package/lib/generators/typescript/operation-types.d.ts +9 -0
  315. package/lib/generators/typescript/operation-types.d.ts.map +1 -0
  316. package/lib/generators/typescript/operation-types.js +11 -0
  317. package/lib/generators/typescript/operation-types.js.map +1 -0
  318. package/lib/generators/typescript/operations.d.ts +60 -0
  319. package/lib/generators/typescript/operations.d.ts.map +1 -0
  320. package/lib/generators/typescript/operations.js +386 -0
  321. package/lib/generators/typescript/operations.js.map +1 -0
  322. package/lib/generators/typescript/response-headers.d.ts +12 -0
  323. package/lib/generators/typescript/response-headers.d.ts.map +1 -0
  324. package/lib/generators/typescript/response-headers.js +40 -0
  325. package/lib/generators/typescript/response-headers.js.map +1 -0
  326. package/lib/generators/typescript/runtime/auth.d.ts.map +1 -0
  327. package/lib/generators/typescript/runtime/auth.js.map +1 -0
  328. package/lib/{runtime → generators/typescript/runtime}/create-client.d.ts +7 -2
  329. package/lib/generators/typescript/runtime/create-client.d.ts.map +1 -0
  330. package/lib/{runtime → generators/typescript/runtime}/create-client.js +84 -30
  331. package/lib/generators/typescript/runtime/create-client.js.map +1 -0
  332. package/lib/generators/typescript/runtime/errors.d.ts.map +1 -0
  333. package/lib/generators/typescript/runtime/errors.js.map +1 -0
  334. package/lib/generators/typescript/runtime/index.d.ts.map +1 -0
  335. package/lib/generators/typescript/runtime/index.js.map +1 -0
  336. package/lib/generators/typescript/runtime/multipart.d.ts.map +1 -0
  337. package/lib/generators/typescript/runtime/multipart.js.map +1 -0
  338. package/lib/{runtime → generators/typescript/runtime}/paginate.d.ts +2 -2
  339. package/lib/generators/typescript/runtime/paginate.d.ts.map +1 -0
  340. package/lib/{runtime → generators/typescript/runtime}/paginate.js +12 -12
  341. package/lib/generators/typescript/runtime/paginate.js.map +1 -0
  342. package/lib/generators/typescript/runtime/parse.d.ts.map +1 -0
  343. package/lib/generators/typescript/runtime/parse.js.map +1 -0
  344. package/lib/generators/typescript/runtime/retry.d.ts.map +1 -0
  345. package/lib/generators/typescript/runtime/retry.js.map +1 -0
  346. package/lib/generators/typescript/runtime/send.d.ts.map +1 -0
  347. package/lib/generators/typescript/runtime/send.js.map +1 -0
  348. package/lib/generators/typescript/runtime/setup.d.ts.map +1 -0
  349. package/lib/generators/typescript/runtime/setup.js.map +1 -0
  350. package/lib/generators/typescript/runtime/sse.d.ts.map +1 -0
  351. package/lib/generators/typescript/runtime/sse.js.map +1 -0
  352. package/lib/{runtime → generators/typescript/runtime}/types.d.ts +17 -95
  353. package/lib/generators/typescript/runtime/types.d.ts.map +1 -0
  354. package/lib/generators/typescript/runtime/types.js.map +1 -0
  355. package/lib/generators/typescript/runtime/url.d.ts.map +1 -0
  356. package/lib/generators/typescript/runtime/url.js.map +1 -0
  357. package/lib/generators/typescript/type-guards.d.ts +4 -0
  358. package/lib/generators/typescript/type-guards.d.ts.map +1 -0
  359. package/lib/{emitters → generators/typescript}/type-guards.js +18 -52
  360. package/lib/generators/typescript/type-guards.js.map +1 -0
  361. package/lib/generators/typescript/types.d.ts +8 -0
  362. package/lib/generators/typescript/types.d.ts.map +1 -0
  363. package/lib/generators/typescript/types.js +132 -0
  364. package/lib/generators/typescript/types.js.map +1 -0
  365. package/lib/generators/{zod.d.ts → zod/index.d.ts} +2 -2
  366. package/lib/generators/zod/index.d.ts.map +1 -0
  367. package/lib/generators/{zod.js → zod/index.js} +5 -7
  368. package/lib/generators/zod/index.js.map +1 -0
  369. package/lib/{emitters/zod.d.ts → generators/zod/schemas.d.ts} +4 -5
  370. package/lib/generators/zod/schemas.d.ts.map +1 -0
  371. package/lib/{emitters/zod.js → generators/zod/schemas.js} +118 -154
  372. package/lib/generators/zod/schemas.js.map +1 -0
  373. package/lib/index.d.ts +8 -3
  374. package/lib/index.d.ts.map +1 -1
  375. package/lib/index.js +18 -11
  376. package/lib/index.js.map +1 -1
  377. package/lib/intermediate-representation/build.d.ts +8 -1
  378. package/lib/intermediate-representation/build.d.ts.map +1 -1
  379. package/lib/intermediate-representation/build.js +59 -4
  380. package/lib/intermediate-representation/build.js.map +1 -1
  381. package/lib/intermediate-representation/model.d.ts +26 -1
  382. package/lib/intermediate-representation/model.d.ts.map +1 -1
  383. package/lib/intermediate-representation/model.js.map +1 -1
  384. package/lib/intermediate-representation/sanitize-identifiers.d.ts +1 -10
  385. package/lib/intermediate-representation/sanitize-identifiers.d.ts.map +1 -1
  386. package/lib/intermediate-representation/sanitize-identifiers.js +37 -38
  387. package/lib/intermediate-representation/sanitize-identifiers.js.map +1 -1
  388. package/lib/{emitters/pagination.d.ts → pagination.d.ts} +39 -15
  389. package/lib/pagination.d.ts.map +1 -0
  390. package/lib/{emitters/pagination.js → pagination.js} +13 -52
  391. package/lib/pagination.js.map +1 -0
  392. package/lib/pipeline.d.ts +17 -0
  393. package/lib/pipeline.d.ts.map +1 -0
  394. package/lib/pipeline.js +244 -0
  395. package/lib/pipeline.js.map +1 -0
  396. package/lib/plugin.d.ts +4 -4
  397. package/lib/plugin.d.ts.map +1 -1
  398. package/lib/plugin.js +12 -9
  399. package/lib/plugin.js.map +1 -1
  400. package/lib/printers/go.d.ts +33 -0
  401. package/lib/printers/go.d.ts.map +1 -0
  402. package/lib/printers/go.js +209 -0
  403. package/lib/printers/go.js.map +1 -0
  404. package/lib/printers/index.d.ts +5 -0
  405. package/lib/printers/index.d.ts.map +1 -0
  406. package/lib/printers/index.js +9 -0
  407. package/lib/printers/index.js.map +1 -0
  408. package/lib/printers/php.d.ts +21 -0
  409. package/lib/printers/php.d.ts.map +1 -0
  410. package/lib/printers/php.js +68 -0
  411. package/lib/printers/php.js.map +1 -0
  412. package/lib/printers/python.d.ts +31 -0
  413. package/lib/printers/python.d.ts.map +1 -0
  414. package/lib/printers/python.js +101 -0
  415. package/lib/printers/python.js.map +1 -0
  416. package/lib/printers/typescript.d.ts +82 -0
  417. package/lib/printers/typescript.d.ts.map +1 -0
  418. package/lib/printers/typescript.js +268 -0
  419. package/lib/printers/typescript.js.map +1 -0
  420. package/lib/reserved-names.d.ts +8 -0
  421. package/lib/reserved-names.d.ts.map +1 -0
  422. package/lib/{emitters/reserved-names.js → reserved-names.js} +16 -27
  423. package/lib/reserved-names.js.map +1 -0
  424. package/lib/runtime-contract.d.ts +62 -2
  425. package/lib/runtime-contract.d.ts.map +1 -1
  426. package/lib/runtime-contract.js +3 -3
  427. package/lib/runtime-contract.js.map +1 -1
  428. package/lib/runtime-sources/go.d.ts +2 -0
  429. package/lib/runtime-sources/go.d.ts.map +1 -0
  430. package/lib/runtime-sources/go.js +3 -0
  431. package/lib/runtime-sources/go.js.map +1 -0
  432. package/lib/runtime-sources/php.d.ts +2 -0
  433. package/lib/runtime-sources/php.d.ts.map +1 -0
  434. package/lib/runtime-sources/php.js +3 -0
  435. package/lib/runtime-sources/php.js.map +1 -0
  436. package/lib/runtime-sources/python.d.ts +12 -0
  437. package/lib/runtime-sources/python.d.ts.map +1 -0
  438. package/lib/runtime-sources/python.js +12 -0
  439. package/lib/runtime-sources/python.js.map +1 -0
  440. package/lib/runtime-sources/typescript.d.ts +36 -0
  441. package/lib/runtime-sources/typescript.d.ts.map +1 -0
  442. package/lib/runtime-sources/typescript.js +152 -0
  443. package/lib/runtime-sources/typescript.js.map +1 -0
  444. package/lib/runtime-sources.d.ts +5 -0
  445. package/lib/runtime-sources.d.ts.map +1 -0
  446. package/lib/runtime-sources.js +10 -0
  447. package/lib/runtime-sources.js.map +1 -0
  448. package/lib/setup-bake.d.ts.map +1 -0
  449. package/lib/{emitters/setup-bake.js → setup-bake.js} +11 -2
  450. package/lib/setup-bake.js.map +1 -0
  451. package/lib/types.d.ts +38 -8
  452. package/lib/types.d.ts.map +1 -1
  453. package/package.json +40 -4
  454. package/lib/emitters/auth.d.ts +0 -14
  455. package/lib/emitters/auth.d.ts.map +0 -1
  456. package/lib/emitters/auth.js +0 -30
  457. package/lib/emitters/auth.js.map +0 -1
  458. package/lib/emitters/client-assembly.d.ts +0 -15
  459. package/lib/emitters/client-assembly.d.ts.map +0 -1
  460. package/lib/emitters/client-assembly.js +0 -358
  461. package/lib/emitters/client-assembly.js.map +0 -1
  462. package/lib/emitters/descriptor.d.ts +0 -22
  463. package/lib/emitters/descriptor.d.ts.map +0 -1
  464. package/lib/emitters/descriptor.js +0 -199
  465. package/lib/emitters/descriptor.js.map +0 -1
  466. package/lib/emitters/emit-options.d.ts +0 -67
  467. package/lib/emitters/emit-options.d.ts.map +0 -1
  468. package/lib/emitters/emit-options.js.map +0 -1
  469. package/lib/emitters/faker.d.ts.map +0 -1
  470. package/lib/emitters/faker.js +0 -221
  471. package/lib/emitters/faker.js.map +0 -1
  472. package/lib/emitters/identifier.d.ts +0 -34
  473. package/lib/emitters/identifier.d.ts.map +0 -1
  474. package/lib/emitters/identifier.js +0 -104
  475. package/lib/emitters/identifier.js.map +0 -1
  476. package/lib/emitters/inline-runtime.d.ts +0 -11
  477. package/lib/emitters/inline-runtime.d.ts.map +0 -1
  478. package/lib/emitters/inline-runtime.js +0 -99
  479. package/lib/emitters/inline-runtime.js.map +0 -1
  480. package/lib/emitters/jsdoc.d.ts +0 -9
  481. package/lib/emitters/jsdoc.d.ts.map +0 -1
  482. package/lib/emitters/jsdoc.js +0 -83
  483. package/lib/emitters/jsdoc.js.map +0 -1
  484. package/lib/emitters/mock.d.ts.map +0 -1
  485. package/lib/emitters/mock.js +0 -265
  486. package/lib/emitters/mock.js.map +0 -1
  487. package/lib/emitters/operation-aliases.d.ts +0 -27
  488. package/lib/emitters/operation-aliases.d.ts.map +0 -1
  489. package/lib/emitters/operation-aliases.js +0 -150
  490. package/lib/emitters/operation-aliases.js.map +0 -1
  491. package/lib/emitters/operation-signature.d.ts +0 -24
  492. package/lib/emitters/operation-signature.d.ts.map +0 -1
  493. package/lib/emitters/operation-signature.js +0 -42
  494. package/lib/emitters/operation-signature.js.map +0 -1
  495. package/lib/emitters/operation-types.d.ts +0 -32
  496. package/lib/emitters/operation-types.d.ts.map +0 -1
  497. package/lib/emitters/operation-types.js +0 -117
  498. package/lib/emitters/operation-types.js.map +0 -1
  499. package/lib/emitters/operations.d.ts +0 -41
  500. package/lib/emitters/operations.d.ts.map +0 -1
  501. package/lib/emitters/operations.js +0 -35
  502. package/lib/emitters/operations.js.map +0 -1
  503. package/lib/emitters/pagination.d.ts.map +0 -1
  504. package/lib/emitters/pagination.js.map +0 -1
  505. package/lib/emitters/reserved-names.d.ts +0 -5
  506. package/lib/emitters/reserved-names.d.ts.map +0 -1
  507. package/lib/emitters/reserved-names.js.map +0 -1
  508. package/lib/emitters/response-headers.d.ts +0 -14
  509. package/lib/emitters/response-headers.d.ts.map +0 -1
  510. package/lib/emitters/response-headers.js +0 -91
  511. package/lib/emitters/response-headers.js.map +0 -1
  512. package/lib/emitters/runtime-sources.d.ts +0 -16
  513. package/lib/emitters/runtime-sources.d.ts.map +0 -1
  514. package/lib/emitters/runtime-sources.js +0 -16
  515. package/lib/emitters/runtime-sources.js.map +0 -1
  516. package/lib/emitters/sample.d.ts.map +0 -1
  517. package/lib/emitters/sample.js.map +0 -1
  518. package/lib/emitters/setup-bake.d.ts.map +0 -1
  519. package/lib/emitters/setup-bake.js.map +0 -1
  520. package/lib/emitters/sse.d.ts +0 -10
  521. package/lib/emitters/sse.d.ts.map +0 -1
  522. package/lib/emitters/sse.js +0 -46
  523. package/lib/emitters/sse.js.map +0 -1
  524. package/lib/emitters/support.d.ts +0 -18
  525. package/lib/emitters/support.d.ts.map +0 -1
  526. package/lib/emitters/support.js +0 -37
  527. package/lib/emitters/support.js.map +0 -1
  528. package/lib/emitters/swr.d.ts.map +0 -1
  529. package/lib/emitters/swr.js +0 -88
  530. package/lib/emitters/swr.js.map +0 -1
  531. package/lib/emitters/tanstack-query.d.ts.map +0 -1
  532. package/lib/emitters/tanstack-query.js.map +0 -1
  533. package/lib/emitters/transformers.d.ts.map +0 -1
  534. package/lib/emitters/transformers.js.map +0 -1
  535. package/lib/emitters/ts.d.ts +0 -42
  536. package/lib/emitters/ts.d.ts.map +0 -1
  537. package/lib/emitters/ts.js +0 -116
  538. package/lib/emitters/ts.js.map +0 -1
  539. package/lib/emitters/type-guards.d.ts +0 -21
  540. package/lib/emitters/type-guards.d.ts.map +0 -1
  541. package/lib/emitters/type-guards.js.map +0 -1
  542. package/lib/emitters/types.d.ts +0 -15
  543. package/lib/emitters/types.d.ts.map +0 -1
  544. package/lib/emitters/types.js +0 -125
  545. package/lib/emitters/types.js.map +0 -1
  546. package/lib/emitters/wrapper-support.d.ts.map +0 -1
  547. package/lib/emitters/wrapper-support.js +0 -127
  548. package/lib/emitters/wrapper-support.js.map +0 -1
  549. package/lib/emitters/zod.d.ts.map +0 -1
  550. package/lib/emitters/zod.js.map +0 -1
  551. package/lib/generators/anchor.d.ts +0 -9
  552. package/lib/generators/anchor.d.ts.map +0 -1
  553. package/lib/generators/anchor.js +0 -10
  554. package/lib/generators/anchor.js.map +0 -1
  555. package/lib/generators/mock.d.ts.map +0 -1
  556. package/lib/generators/mock.js.map +0 -1
  557. package/lib/generators/sdk.d.ts +0 -12
  558. package/lib/generators/sdk.d.ts.map +0 -1
  559. package/lib/generators/sdk.js +0 -26
  560. package/lib/generators/sdk.js.map +0 -1
  561. package/lib/generators/swr.d.ts.map +0 -1
  562. package/lib/generators/swr.js.map +0 -1
  563. package/lib/generators/tanstack-query.d.ts.map +0 -1
  564. package/lib/generators/tanstack-query.js.map +0 -1
  565. package/lib/generators/transformers.d.ts.map +0 -1
  566. package/lib/generators/transformers.js.map +0 -1
  567. package/lib/generators/zod.d.ts.map +0 -1
  568. package/lib/generators/zod.js.map +0 -1
  569. package/lib/runtime/auth.d.ts.map +0 -1
  570. package/lib/runtime/auth.js.map +0 -1
  571. package/lib/runtime/create-client.d.ts.map +0 -1
  572. package/lib/runtime/create-client.js.map +0 -1
  573. package/lib/runtime/errors.d.ts.map +0 -1
  574. package/lib/runtime/errors.js.map +0 -1
  575. package/lib/runtime/index.d.ts.map +0 -1
  576. package/lib/runtime/index.js.map +0 -1
  577. package/lib/runtime/multipart.d.ts.map +0 -1
  578. package/lib/runtime/multipart.js.map +0 -1
  579. package/lib/runtime/paginate.d.ts.map +0 -1
  580. package/lib/runtime/paginate.js.map +0 -1
  581. package/lib/runtime/parse.d.ts.map +0 -1
  582. package/lib/runtime/parse.js.map +0 -1
  583. package/lib/runtime/retry.d.ts.map +0 -1
  584. package/lib/runtime/retry.js.map +0 -1
  585. package/lib/runtime/send.d.ts.map +0 -1
  586. package/lib/runtime/send.js.map +0 -1
  587. package/lib/runtime/setup.d.ts.map +0 -1
  588. package/lib/runtime/setup.js.map +0 -1
  589. package/lib/runtime/sse.d.ts.map +0 -1
  590. package/lib/runtime/sse.js.map +0 -1
  591. package/lib/runtime/types.d.ts.map +0 -1
  592. package/lib/runtime/types.js.map +0 -1
  593. package/lib/runtime/url.d.ts.map +0 -1
  594. package/lib/runtime/url.js.map +0 -1
  595. /package/lib/{emitters → generators/mock}/sample.js +0 -0
  596. /package/lib/{runtime → generators/typescript/runtime}/auth.d.ts +0 -0
  597. /package/lib/{runtime → generators/typescript/runtime}/auth.js +0 -0
  598. /package/lib/{runtime → generators/typescript/runtime}/errors.d.ts +0 -0
  599. /package/lib/{runtime → generators/typescript/runtime}/errors.js +0 -0
  600. /package/lib/{runtime → generators/typescript/runtime}/index.d.ts +0 -0
  601. /package/lib/{runtime → generators/typescript/runtime}/index.js +0 -0
  602. /package/lib/{runtime → generators/typescript/runtime}/multipart.d.ts +0 -0
  603. /package/lib/{runtime → generators/typescript/runtime}/multipart.js +0 -0
  604. /package/lib/{runtime → generators/typescript/runtime}/parse.d.ts +0 -0
  605. /package/lib/{runtime → generators/typescript/runtime}/parse.js +0 -0
  606. /package/lib/{runtime → generators/typescript/runtime}/retry.d.ts +0 -0
  607. /package/lib/{runtime → generators/typescript/runtime}/retry.js +0 -0
  608. /package/lib/{runtime → generators/typescript/runtime}/send.d.ts +0 -0
  609. /package/lib/{runtime → generators/typescript/runtime}/send.js +0 -0
  610. /package/lib/{runtime → generators/typescript/runtime}/setup.d.ts +0 -0
  611. /package/lib/{runtime → generators/typescript/runtime}/setup.js +0 -0
  612. /package/lib/{runtime → generators/typescript/runtime}/sse.d.ts +0 -0
  613. /package/lib/{runtime → generators/typescript/runtime}/sse.js +0 -0
  614. /package/lib/{runtime → generators/typescript/runtime}/types.js +0 -0
  615. /package/lib/{runtime → generators/typescript/runtime}/url.d.ts +0 -0
  616. /package/lib/{runtime → generators/typescript/runtime}/url.js +0 -0
  617. /package/lib/{emitters/setup-bake.d.ts → setup-bake.d.ts} +0 -0
@@ -0,0 +1,126 @@
1
+ /** One flag derived from a query parameter. */
2
+ export type CliFlag = {
3
+ /** Kebab-cased flag name (`--page-size`). */
4
+ name: string;
5
+ /** Original wire parameter name. */
6
+ param: string;
7
+ type: 'string' | 'number' | 'boolean' | 'array';
8
+ required: boolean;
9
+ enum?: string[];
10
+ description?: string;
11
+ };
12
+ /** One executable command, derived from the IR at generate time. Pure data. */
13
+ export type CliCommand = {
14
+ /** Tag; absent = flat/untagged. */
15
+ group?: string;
16
+ name: string;
17
+ summary?: string;
18
+ method: string;
19
+ path: string;
20
+ /** Path params, in path-template order. Always required — that is what a path is. */
21
+ positionals: Array<{
22
+ name: string;
23
+ type?: CliFlag['type'];
24
+ description?: string;
25
+ }>;
26
+ flags: CliFlag[];
27
+ /**
28
+ * Present when the operation takes a JSON request body. `merged` marks a body whose own
29
+ * properties a flat-style call spells at the top level (the generator decides this from
30
+ * the schema, so the CLI and the client can never disagree).
31
+ */
32
+ body?: {
33
+ required: boolean;
34
+ merged?: boolean;
35
+ };
36
+ /**
37
+ * The content type of a request body that is NOT JSON (multipart, url-encoded, binary).
38
+ * `--json` cannot build one, so the command is reported as library-only rather than
39
+ * offered as if it were runnable.
40
+ */
41
+ unsupportedBody?: string;
42
+ paginated?: boolean;
43
+ /** `'grouped'` marks a command whose client method takes namespaced inputs even on a
44
+ * flat-style client, because its merged names would collide. */
45
+ argsStyle?: 'grouped';
46
+ sse?: boolean;
47
+ blob?: boolean;
48
+ /** IR schemas for the `schema` command, serialized verbatim. */
49
+ schemas?: {
50
+ request?: unknown;
51
+ response?: unknown;
52
+ };
53
+ };
54
+ export type CliAuthScheme = {
55
+ key: string;
56
+ kind: 'bearer' | 'basic' | 'apiKey';
57
+ };
58
+ export type CliWiring = {
59
+ /** The name the CLI is invoked as, for help output only. The generated entry reads it
60
+ * from `process.argv[1]`, so help never names a command that is not installed. */
61
+ name: string;
62
+ /** Credential variable prefix, constant-cased: `CAFE` gives `CAFE_TOKEN`. Fixed at
63
+ * generation from the output file name, so renaming the binary keeps the variables
64
+ * a published CLI already documents. A composed entry sets one per api alias. */
65
+ envPrefix: string;
66
+ /** The generated instance client. */
67
+ client: Record<string, unknown>;
68
+ /** How that client takes its inputs. Defaults to `'grouped'`, the generated default. */
69
+ argsStyle?: 'grouped' | 'flat';
70
+ configure: (config: Record<string, unknown>) => void;
71
+ /** Security schemes of the API — drives env-var credential resolution. */
72
+ schemes?: CliAuthScheme[];
73
+ env?: Record<string, string | undefined>;
74
+ stdin?: () => string;
75
+ readFile?: (path: string) => string;
76
+ writeFile?: (path: string, data: Uint8Array) => void;
77
+ stdout: (line: string) => void;
78
+ stderr: (line: string) => void;
79
+ };
80
+ export type CliGlobals = {
81
+ serverUrl?: string;
82
+ format?: 'json' | 'ndjson';
83
+ dryRun?: boolean;
84
+ pageAll?: boolean;
85
+ output?: string;
86
+ token?: string;
87
+ json?: string;
88
+ };
89
+ /**
90
+ * A hand-written command composed NEXT TO the generated ones: the same data shape plus a
91
+ * `handler`, so it inherits help, parsing, `schema`, and the exit-code contract. This is
92
+ * how behavior that is not in the description (a `login`, a doctor command) joins the
93
+ * binary without the generator ever learning what it does.
94
+ */
95
+ export type CustomCommand = {
96
+ name: string;
97
+ group?: string;
98
+ summary?: string;
99
+ positionals?: CliCommand['positionals'];
100
+ flags?: CliFlag[];
101
+ /** Returns the process exit code; throwing exits 1 with the standard error JSON. */
102
+ handler: (context: CommandContext) => number | Promise<number>;
103
+ };
104
+ export type CommandContext = {
105
+ positionals: Record<string, string>;
106
+ params: Record<string, unknown>;
107
+ globals: CliGlobals;
108
+ wiring: CliWiring;
109
+ };
110
+ /** One API's contribution to a composed binary: its commands behind a namespace, with its
111
+ * OWN wiring (base URL, schemes, credentials). A namespace-less source sits at the root. */
112
+ export type CommandSource = {
113
+ namespace?: string;
114
+ commands: Array<CliCommand | CustomCommand>;
115
+ /** Absent = inherit the first wired source's — a root `login` shares the binary's identity. */
116
+ wiring?: CliWiring;
117
+ };
118
+ /**
119
+ * The shell-typable form of a group name: an OpenAPI tag can contain spaces ("Some
120
+ * multi-word tag"), which only resolves if the user quotes it. Commands are addressed by
121
+ * this slug; help still shows the original tag.
122
+ */
123
+ export declare function groupSlug(group: string): string;
124
+ /** `cafe-api` → `CAFE_API`: the casing of every credential variable this CLI reads. */
125
+ export declare function constantCase(value: string): string;
126
+ //# sourceMappingURL=cli-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-contract.d.ts","sourceRoot":"","sources":["../src/cli-contract.ts"],"names":[],"mappings":"AAMA,+CAA+C;AAC/C,MAAM,MAAM,OAAO,GAAG;IACpB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,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KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,oFAAoF;IACpF,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF;4FAC4F;AAC5F,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,GAAG,aAAa,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD"}
@@ -0,0 +1,25 @@
1
+ // The generated-CLI authoring contract: the command/wiring shapes a wrapper around a
2
+ // generated or composed CLI is written against, plus the two casing helpers the cli
3
+ // generator shares with the engine. Defined at package level (ADR-0022: contracts own
4
+ // their types); the engine re-exports them, and the prepare-time snapshot splices the
5
+ // definitions back into the embedded module so generated CLIs stay self-contained.
6
+ /**
7
+ * The shell-typable form of a group name: an OpenAPI tag can contain spaces ("Some
8
+ * multi-word tag"), which only resolves if the user quotes it. Commands are addressed by
9
+ * this slug; help still shows the original tag.
10
+ */
11
+ export function groupSlug(group) {
12
+ return group
13
+ .toLowerCase()
14
+ .split(/[^a-z0-9]+/)
15
+ .filter(Boolean)
16
+ .join('-');
17
+ }
18
+ /** `cafe-api` → `CAFE_API`: the casing of every credential variable this CLI reads. */
19
+ export function constantCase(value) {
20
+ return value
21
+ .replace(/[^A-Za-z0-9]+/g, '_')
22
+ .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
23
+ .toUpperCase();
24
+ }
25
+ //# sourceMappingURL=cli-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-contract.js","sourceRoot":"","sources":["../src/cli-contract.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,oFAAoF;AACpF,sFAAsF;AACtF,sFAAsF;AACtF,mFAAmF;AAsHnF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,KAAK,CAAC,YAAY,CAAC;SACnB,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,WAAW,EAAE,CAAC;AACnB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import type { ApiModel, OperationModel } from '../intermediate-representation/model.js';
2
- import { ts } from './ts.js';
3
2
  /**
4
3
  * The operations a wrapper generator can wrap, with skips reported to the user under
5
4
  * `label` (the generator name). Two kinds are dropped:
@@ -18,27 +17,17 @@ export declare function isQuery(op: OperationModel): boolean;
18
17
  export declare function hasInputs(op: OperationModel): boolean;
19
18
  /** The operation's `<Op>Variables` type name (the sdk's grouped-input alias). */
20
19
  export declare function variablesName(op: OperationModel): string;
21
- /** A `vars: <Op>Variables` parameter. */
22
- export declare function varsParam(op: OperationModel): ts.ParameterDeclaration;
23
- /**
24
- * An `init?: Omit<RequestOptions, "envelope">` parameter. The wrappers cache the
25
- * fetched body, so the throw-only `envelope` option is excluded from the type and
26
- * stripped at runtime by `sdkCall`.
27
- */
28
- export declare function initParam(): ts.ParameterDeclaration;
29
- /**
30
- * The forwarding call to the sdk operation function; argument order comes from the
31
- * shared `operationSignature`. `grouped` passes the source object — `{}` for a
20
+ /** The forwarding-call ARGUMENT LIST to the sdk operation function, as text. Argument
21
+ * order comes from the shared `operationSignature`, so it lines up with the sdk's
22
+ * parameter list by construction. `grouped` passes the source object — `{}` for a
32
23
  * no-input op with an init, which must not land in the `(args?, init?)` args slot;
33
- * `flat` spreads `<source>.<pathIdent>`, then `.params` / `.body` / `.headers`.
34
- * `withInit` appends `{ ...init, envelope: undefined }` — a runtime strip, since
35
- * `initParam`'s `Omit` is type-only.
36
- */
37
- export declare function sdkCall(op: OperationModel, argsStyle: 'flat' | 'grouped', source: string, withInit: boolean): ts.Expression;
38
- /**
39
- * The named import from the sdk module: the wrapped opFns as value specifiers, then
40
- * the referenced `<Op>Variables` types + `RequestOptions` (when any query op) as
41
- * `type` specifiers, each group sorted.
42
- */
43
- export declare function sdkNamedImport(ops: OperationModel[], sdkModule: string, hasQuery: boolean): ts.Statement;
44
- //# sourceMappingURL=wrapper-support.d.ts.map
24
+ * `flat` spreads `<source>.<pathIdent>` (URL-template order), then the slots the op
25
+ * has. `withInit` appends `{ ...init, envelope: undefined }` — a runtime strip, since
26
+ * the wrappers cache the fetched body and their `Omit`-typed init is type-only. */
27
+ export declare function sdkCallText(op: OperationModel, source: string, withInit: boolean): string;
28
+ /** The named import from the sdk module: wrapped opFns, then the referenced
29
+ * `<Op>Variables` types + `RequestOptions` (when any query op) as `type` specifiers. */
30
+ export declare function sdkNamedImportText(ops: OperationModel[], sdkModule: string, hasQuery: boolean): string;
31
+ export { operationSignature, templatePathParams, type OperationSignature, } from '../generators/typescript/operation-signature.js';
32
+ export { flatInputShape } from '../generators/typescript/operations.js';
33
+ //# sourceMappingURL=typescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/contracts/typescript.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAExF;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoBpF;AAQD,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAEnD;AAED,4FAA4F;AAC5F,wBAAgB,SAAS,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAErD;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,CAExD;AAED;;;;;;mFAMmF;AACnF,wBAAgB,WAAW,CAAC,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAQzF;AAED;wFACwF;AACxF,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EAAE,EACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAMR;AAKD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,87 @@
1
+ // The published output ABI of the `typescript` generator — what its emitted SDK
2
+ // exports and how a call is spelled. Importable ONLY along a declared `requires`
3
+ // edge (`swr`, `tanstack-query`, and `cli` require `typescript`): duplicating these
4
+ // answers in each wrapper would put the SDK's calling convention in several places,
5
+ // which is exactly the drift this module exists to prevent.
6
+ import { logger } from '@redocly/openapi-core';
7
+ import { operationSignature } from '../generators/typescript/operation-signature.js';
8
+ /**
9
+ * The operations a wrapper generator can wrap, with skips reported to the user under
10
+ * `label` (the generator name). Two kinds are dropped:
11
+ *
12
+ * - **SSE operations** — the sdk exposes these as async generators (streams), not
13
+ * request/response functions, so a query/mutation hook cannot wrap them.
14
+ * - **`<Op>Variables` name collisions** — a wrapper types its inputs as the sdk's
15
+ * `<Op>Variables`; when that name collides with a schema the sdk suppresses the alias,
16
+ * so the import would resolve to the schema (a wrong/broken type). The sdk function still
17
+ * works; renaming the schema or the operation restores the wrapper.
18
+ */
19
+ export function wrappableOperations(model, label) {
20
+ const all = model.services.flatMap((s) => s.operations);
21
+ const sse = all.filter((op) => op.sse !== undefined);
22
+ if (sse.length > 0) {
23
+ logger.warn(`generate-client: ${label} skipped ${sse.length} server-sent-events operation(s) — iterate the sdk's exported async generators directly: ${sse
24
+ .map((op) => op.name)
25
+ .join(', ')}.\n`);
26
+ }
27
+ const schemaNames = new Set(model.schemas.map((s) => s.name));
28
+ const clashing = all.filter((op) => op.sse === undefined && collides(op, schemaNames));
29
+ if (clashing.length > 0) {
30
+ logger.warn(`generate-client: ${label} skipped ${clashing.length} operation(s) whose variables type name collides with a schema — rename the schema or the operation: ${clashing
31
+ .map((op) => op.name)
32
+ .join(', ')}.\n`);
33
+ }
34
+ return all.filter((op) => op.sse === undefined && !collides(op, schemaNames));
35
+ }
36
+ /** Whether the operation's `<Op>Variables` type name collides with a named schema. */
37
+ function collides(op, schemaNames) {
38
+ const sig = operationSignature(op);
39
+ return sig.hasInputs && schemaNames.has(sig.variablesTypeName);
40
+ }
41
+ /** Query operations are the safe, cacheable methods. Everything else is a mutation. */
42
+ export function isQuery(op) {
43
+ return op.method === 'get' || op.method === 'head';
44
+ }
45
+ /** Whether the operation has any inputs — i.e. a `<Op>Variables` type exists in the sdk. */
46
+ export function hasInputs(op) {
47
+ return operationSignature(op).hasInputs;
48
+ }
49
+ /** The operation's `<Op>Variables` type name (the sdk's grouped-input alias). */
50
+ export function variablesName(op) {
51
+ return operationSignature(op).variablesTypeName;
52
+ }
53
+ /** The forwarding-call ARGUMENT LIST to the sdk operation function, as text. Argument
54
+ * order comes from the shared `operationSignature`, so it lines up with the sdk's
55
+ * parameter list by construction. `grouped` passes the source object — `{}` for a
56
+ * no-input op with an init, which must not land in the `(args?, init?)` args slot;
57
+ * `flat` spreads `<source>.<pathIdent>` (URL-template order), then the slots the op
58
+ * has. `withInit` appends `{ ...init, envelope: undefined }` — a runtime strip, since
59
+ * the wrappers cache the fetched body and their `Omit`-typed init is type-only. */
60
+ export function sdkCallText(op, source, withInit) {
61
+ const args = [];
62
+ // Every style takes ONE input object, so a wrapper forwards its `<Op>Variables` verbatim
63
+ // and never has to know which style the sdk was generated with.
64
+ if (operationSignature(op).hasInputs)
65
+ args.push(source);
66
+ else if (withInit)
67
+ args.push('{}');
68
+ if (withInit)
69
+ args.push('{ ...init, envelope: undefined }');
70
+ return `${op.name}(${args.join(', ')})`;
71
+ }
72
+ /** The named import from the sdk module: wrapped opFns, then the referenced
73
+ * `<Op>Variables` types + `RequestOptions` (when any query op) as `type` specifiers. */
74
+ export function sdkNamedImportText(ops, sdkModule, hasQuery) {
75
+ const values = ops.map((op) => op.name).sort();
76
+ const types = ops.filter(hasInputs).map(variablesName).sort();
77
+ if (hasQuery)
78
+ types.push('RequestOptions');
79
+ const specifiers = [...values, ...types.map((name) => `type ${name}`)].join(', ');
80
+ return `import { ${specifiers} } from ${JSON.stringify(sdkModule)};`;
81
+ }
82
+ // The pieces the typescript generator decides itself, published for the generators
83
+ // that must agree with it: the per-operation signature facts and whether an
84
+ // operation's inputs merge into one flat object (`cli` renders the same call shape).
85
+ export { operationSignature, templatePathParams, } from '../generators/typescript/operation-signature.js';
86
+ export { flatInputShape } from '../generators/typescript/operations.js';
87
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/contracts/typescript.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iFAAiF;AACjF,oFAAoF;AACpF,oFAAoF;AACpF,4DAA4D;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAGrF;;;;;;;;;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,GAAqB,EACrB,SAAiB,EACjB,QAAiB;IAEjB,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClF,OAAO,YAAY,UAAU,WAAW,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;AACvE,CAAC;AAED,mFAAmF;AACnF,4EAA4E;AAC5E,qFAAqF;AACrF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
package/lib/generate.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- import type { EmitOptions } from './emitters/emit-options.js';
2
- import type { GeneratedFile, GeneratorDescriptor, OutputMode } from './generators/types.js';
1
+ import type { EmitOptions, GeneratedFile, GeneratorDescriptor, OutputMode } from './generators/types.js';
3
2
  import type { ApiModel } from './intermediate-representation/model.js';
4
- import type { GenerateClientOptions, GenerateClientResult } from './types.js';
5
- export { arrow, constArray, exportConstStatement, jsdoc, parseStatements, printNodes, printStatements, ts, } from './emitters/ts.js';
6
- export { operationSignature } from './emitters/operation-signature.js';
7
- export type { OperationSignature } from './emitters/operation-signature.js';
8
- export { schemaToTypeNode } from './emitters/types.js';
9
- export { pascalCase } from './emitters/support.js';
10
- export { safeIdent } from './emitters/identifier.js';
3
+ export { tsJsdoc, tsType } from './generators/typescript/types.js';
4
+ export { codeLiteral } from './printers/typescript.js';
5
+ export * from './authoring/index.js';
6
+ export { operationSignature } from './contracts/typescript.js';
7
+ export type { OperationSignature } from './contracts/typescript.js';
8
+ export { pascalCase } from './printers/typescript.js';
9
+ export { safeIdent } from './printers/typescript.js';
11
10
  /**
12
11
  * Validate the generator selection (see `validateGenerators`), then run each
13
12
  * configured generator against the IR and concatenate their files. Throws on a
@@ -21,5 +20,6 @@ export declare function collectGeneratedFiles(model: ApiModel, options: {
21
20
  /** The resolved registry (built-ins + custom). Defaults to the built-ins. */
22
21
  registry?: Map<string, GeneratorDescriptor>;
23
22
  }): GeneratedFile[];
24
- export declare function generateClient(options: GenerateClientOptions): Promise<GenerateClientResult>;
23
+ export { generateClient } from './pipeline.js';
24
+ export { renderComposedCliEntry, type ComposedCliSource } from './generators/cli/render.js';
25
25
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAGvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG9E,OAAO,EACL,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,KAAK,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,EAAE,GACH,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE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U,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC7C,GACA,aAAa,EAAE,CAMjB;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC"}
package/lib/generate.js CHANGED
@@ -1,24 +1,24 @@
1
- // The generate entry (`@redocly/client-generator/generate`): everything that runs at
2
- // GENERATION time `generateClient`, `collectGeneratedFiles`, and the TypeScript-emitting
3
- // toolkit for custom generators. It loads `typescript` and `@redocly/openapi-core`, so it
4
- // must never be reached statically from the package root: package-mode clients import the
5
- // root at app runtime, and the root reaches this module only through the dynamic import
6
- // inside its `generateClient` facade.
7
- import { mkdir, readFile, writeFile } from 'node:fs/promises';
8
- import { dirname, resolve } from 'node:path';
9
- import { bakeSetup } from './emitters/setup-bake.js';
10
- import { NotSupportedError } from './errors.js';
1
+ // The generate entry (`@redocly/client-generator/generate`): the TypeScript-emitting
2
+ // text toolkit for custom generators plus `collectGeneratedFiles` and a `generateClient`
3
+ // re-export. It loads `@redocly/openapi-core` (and, only for `--setup` baking,
4
+ // `typescript` — lazily), so it must never be reached statically from the package
5
+ // root: package-mode clients import the root at app runtime, and the root reaches
6
+ // the pipeline only through a dynamic import.
11
7
  import { builtinGenerators, validateGenerators } from './generators/index.js';
12
- import { resolveGenerators } from './generators/resolve.js';
13
- import { buildApiModel } from './intermediate-representation/build.js';
14
- import { normalizeSwagger2 } from './intermediate-representation/normalize-swagger2.js';
15
- import { loadSpec } from './loader.js';
8
+ import { runGenerators } from './pipeline.js';
16
9
  // --- Codegen toolkit: build TypeScript the same way the built-in generators do -----------------
17
- export { arrow, constArray, exportConstStatement, jsdoc, parseStatements, printNodes, printStatements, ts, } from './emitters/ts.js';
18
- export { operationSignature } from './emitters/operation-signature.js';
19
- export { schemaToTypeNode } from './emitters/types.js';
20
- export { pascalCase } from './emitters/support.js';
21
- export { safeIdent } from './emitters/identifier.js';
10
+ // Source-text templates, not an AST: the `ts.factory`/printer exports were removed
11
+ // when every built-in generator migrated to text (one authoring model for every
12
+ // output language). `tsType`/`tsJsdoc`/`codeLiteral` are the TypeScript-specific
13
+ // text renderers the sdk itself uses.
14
+ export { tsJsdoc, tsType } from './generators/typescript/types.js';
15
+ export { codeLiteral } from './printers/typescript.js';
16
+ // The language-neutral authoring helpers, re-exported here so both toolkit
17
+ // entries offer the full authoring surface (the root offers them TS-free).
18
+ export * from './authoring/index.js';
19
+ export { operationSignature } from './contracts/typescript.js';
20
+ export { pascalCase } from './printers/typescript.js';
21
+ export { safeIdent } from './printers/typescript.js';
22
22
  /**
23
23
  * Validate the generator selection (see `validateGenerators`), then run each
24
24
  * configured generator against the IR and concatenate their files. Throws on a
@@ -28,92 +28,11 @@ export function collectGeneratedFiles(model, options) {
28
28
  const registry = options.registry ?? builtinGenerators();
29
29
  // Fail fast on an incompatible selection (missing prerequisite, unsupported
30
30
  // error-mode/date-type/runtime) before producing any file.
31
- validateGenerators(options.generators, options.emit, registry);
32
- const files = [];
33
- const seen = new Set();
34
- for (const name of options.generators) {
35
- const generator = registry.get(name);
36
- for (const file of generator.run({
37
- model,
38
- outputPath: options.outputPath,
39
- outputMode: options.outputMode,
40
- emit: options.emit,
41
- })) {
42
- if (seen.has(file.path)) {
43
- throw new Error(`Generator conflict: ${file.path} already emitted by an earlier generator`);
44
- }
45
- seen.add(file.path);
46
- files.push(file);
47
- }
48
- }
49
- return files;
50
- }
51
- export async function generateClient(options) {
52
- // A path segment that is literally "undefined"/"null" is the telltale of an
53
- // interpolation bug in the caller (`\`${dir}/client.ts\`` with `dir` unset) — reject
54
- // it instead of silently creating an `undefined/` directory.
55
- if (options.output.split(/[\\/]/).some((segment) => segment === 'undefined' || segment === 'null')) {
56
- throw new Error(`output path "${options.output}" contains a literal "undefined" or "null" segment — this looks like an interpolation bug in the caller`);
57
- }
58
- // Setup is a LOCAL module (its code is baked into the generated client) — reject
59
- // URL-ish specifiers upfront, before any spec loading, instead of failing later as
60
- // an unreadable file path. Two+ letter scheme, so Windows drive paths don't match.
61
- if (options.setup && /^[a-z][a-z0-9+.-]+:/i.test(options.setup)) {
62
- throw new NotSupportedError(`setup must be a local file path — remote setup modules are not supported (got: ${options.setup})`);
63
- }
64
- const outputPath = resolve(options.output);
65
- const { document, version } = await loadSpec(options.api, options.config);
66
- const normalized = version === 'oas2'
67
- ? normalizeSwagger2(document)
68
- : document;
69
- const model = buildApiModel(normalized);
70
- // A publisher `--setup` module is read, validated, and transformed into the neutral setup
71
- // expression baked into the client. Applied across all output modes by the emitter.
72
- let setupBlock;
73
- if (options.setup) {
74
- // A relative setup path resolves against `configDir` (cwd when absent), like
75
- // generator specifiers. The CLI pre-resolves its inputs, so they arrive absolute.
76
- const setupPath = resolve(options.configDir ?? process.cwd(), options.setup);
77
- setupBlock = bakeSetup(await readFile(setupPath, 'utf-8'));
78
- }
79
- // Resolve the selection into a registry: built-in names pass through, inline `customGenerators`
80
- // register, and any other entry is imported as a plugin specifier (path/package).
81
- // An empty list (e.g. `generators: []` in config, or no `--generator` flags) means
82
- // "unspecified" — fall back to the default sdk client rather than emitting nothing.
83
- const requested = options.generators?.length ? options.generators : ['sdk'];
84
- const { selected, registry } = await resolveGenerators(requested, {
85
- customGenerators: options.customGenerators,
86
- configDir: options.configDir,
87
- });
88
- const files = collectGeneratedFiles(model, {
89
- outputPath,
90
- outputMode: options.outputMode ?? 'single',
91
- emit: {
92
- serverUrl: options.serverUrl,
93
- argsStyle: options.argsStyle,
94
- errorMode: options.errorMode,
95
- dateType: options.dateType,
96
- mockData: options.mockData,
97
- mockSeed: options.mockSeed,
98
- queryKeyPrefix: options.queryKeyPrefix,
99
- setup: setupBlock,
100
- runtime: options.runtime,
101
- importExt: options.importExt,
102
- pagination: options.pagination,
103
- },
104
- generators: selected,
105
- registry,
106
- });
107
- const written = [];
108
- for (const file of files) {
109
- await mkdir(dirname(file.path), { recursive: true });
110
- await writeFile(file.path, file.content, 'utf-8');
111
- written.push({ path: file.path, bytes: Buffer.byteLength(file.content, 'utf-8') });
112
- }
113
- return {
114
- outputPath,
115
- bytes: written.reduce((sum, file) => sum + file.bytes, 0),
116
- files: written,
117
- };
31
+ validateGenerators(options.generators, options.emit, registry, options.outputMode);
32
+ return runGenerators(model, { ...options, registry });
118
33
  }
34
+ export { generateClient } from './pipeline.js';
35
+ // The composed-cli entry renderer: consumed by the redocly CLI across apis (it needs the
36
+ // embedded runtime text, which must stay off the runtime-only root barrel).
37
+ export { renderComposedCliEntry } from './generators/cli/render.js';
119
38
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,2FAA2F;AAC3F,0FAA0F;AAC1F,0FAA0F;AAC1F,wFAAwF;AACxF,sCAAsC;AAEtC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,kGAAkG;AAClG,OAAO,EACL,KAAK,EACL,UAAU,EACV,oB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f,OAOC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,iBAAiB,EAAE,CAAC;IACzD,4EAA4E;IAC5E,2DAA2D;IAC3D,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACnF,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,yFAAyF;AACzF,4EAA4E;AAC5E,OAAO,EAAE,sBAAsB,EAA0B,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type CliCommand } from '@redocly/client-generator';
2
+ export type CliDocsOptions = {
3
+ /** Page heading. */
4
+ title: string;
5
+ /** Emit YAML front matter carrying the title, for docs sites that expect it. */
6
+ frontmatter: boolean;
7
+ /** The generated file's stem: what the page calls the command, and what its credential
8
+ * variables derive from. A reader who installs it under another bin name renames only
9
+ * the command — the variables are fixed at generation. */
10
+ name: string;
11
+ /** Auth schemes the description declares, in the order the CLI resolves them. */
12
+ schemes: Array<{
13
+ key: string;
14
+ kind: 'bearer' | 'basic' | 'apiKey';
15
+ }>;
16
+ };
17
+ /** The whole page: heading, global flags, credentials, exit codes, then every command. */
18
+ export declare function renderCliDocs(commands: CliCommand[], options: CliDocsOptions): string;
19
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/generators/cli/docs.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG;IAC3B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;IACrB;;8DAE0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;KAAE,CAAC,CAAC;CACtE,CAAC;AAoFF,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CA8GrF"}