keq 2.8.14 → 2.9.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 (844) hide show
  1. package/.claude/settings.local.json +26 -0
  2. package/CHANGELOG.md +7 -0
  3. package/dist/esm/src/create-request.js +2 -0
  4. package/dist/esm/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
  5. package/dist/esm/src/middlewares/mutex-flow-control-middleware.js +22 -0
  6. package/dist/esm/src/types/keq-flow-control.d.ts +1 -1
  7. package/dist/esm/src/types/keq-global.d.ts +1 -0
  8. package/dist/umd/src/create-request.js +3 -1
  9. package/dist/umd/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
  10. package/dist/umd/src/middlewares/mutex-flow-control-middleware.js +36 -0
  11. package/dist/umd/src/types/keq-flow-control.d.ts +1 -1
  12. package/dist/umd/src/types/keq-global.d.ts +1 -0
  13. package/package.json +1 -1
  14. package/packages/cache/.turbo/turbo-build.log +26 -11
  15. package/packages/cache/dist/index.d.mts +354 -0
  16. package/packages/cache/dist/index.d.mts.map +1 -0
  17. package/packages/cache/dist/index.d.ts +352 -5
  18. package/packages/cache/dist/index.d.ts.map +1 -1
  19. package/packages/cache/dist/index.js +1211 -1276
  20. package/packages/cache/dist/index.js.map +1 -1
  21. package/packages/cache/dist/index.mjs +1183 -1251
  22. package/packages/cache/dist/index.mjs.map +1 -1
  23. package/packages/cli/.turbo/turbo-build.log +89 -9
  24. package/packages/cli/dist/cli.cjs +1333 -2937
  25. package/packages/cli/dist/cli.cjs.map +1 -1
  26. package/packages/cli/dist/cli.d.cts +1 -0
  27. package/packages/cli/dist/cli.d.mts +1 -0
  28. package/packages/cli/dist/cli.mjs +1359 -0
  29. package/packages/cli/dist/cli.mjs.map +1 -0
  30. package/packages/cli/dist/compiler-0Kli6UCr.cjs +738 -0
  31. package/packages/cli/dist/compiler-0Kli6UCr.cjs.map +1 -0
  32. package/packages/cli/dist/compiler-C3AE8j54.mjs +715 -0
  33. package/packages/cli/dist/compiler-C3AE8j54.mjs.map +1 -0
  34. package/packages/cli/dist/index.cjs +17 -2896
  35. package/packages/cli/dist/index.cjs.map +1 -1
  36. package/packages/cli/dist/index.d.cts +17 -0
  37. package/packages/cli/dist/index.d.cts.map +1 -0
  38. package/packages/cli/dist/index.d.mts +17 -0
  39. package/packages/cli/dist/index.d.mts.map +1 -0
  40. package/packages/cli/dist/index.mjs +10 -0
  41. package/packages/cli/dist/index.mjs.map +1 -0
  42. package/packages/cli/dist/init-BNhD2oCI.mjs +168 -0
  43. package/packages/cli/dist/init-BNhD2oCI.mjs.map +1 -0
  44. package/packages/cli/dist/init-DqxLcRSQ.cjs +170 -0
  45. package/packages/cli/dist/init-DqxLcRSQ.cjs.map +1 -0
  46. package/packages/cli/dist/logger-D7PyVZo3.cjs +46 -0
  47. package/packages/cli/dist/logger-D7PyVZo3.cjs.map +1 -0
  48. package/packages/cli/dist/logger-QLBHySQ3.mjs +12 -0
  49. package/packages/cli/dist/logger-QLBHySQ3.mjs.map +1 -0
  50. package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs +16 -0
  51. package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs.map +1 -0
  52. package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs +11 -0
  53. package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs.map +1 -0
  54. package/packages/cli/dist/mock-command-Bp1LxSls.mjs +350 -0
  55. package/packages/cli/dist/mock-command-Bp1LxSls.mjs.map +1 -0
  56. package/packages/cli/dist/mock-command-WZcfy5Iq.cjs +353 -0
  57. package/packages/cli/dist/mock-command-WZcfy5Iq.cjs.map +1 -0
  58. package/packages/cli/dist/plugins-CgMhaNZq.cjs +3558 -0
  59. package/packages/cli/dist/plugins-CgMhaNZq.cjs.map +1 -0
  60. package/packages/cli/dist/plugins-DCvJ8iHR.mjs +3280 -0
  61. package/packages/cli/dist/plugins-DCvJ8iHR.mjs.map +1 -0
  62. package/packages/cli/dist/plugins.cjs +36 -2438
  63. package/packages/cli/dist/plugins.d.cts +2 -0
  64. package/packages/cli/dist/plugins.d.mts +2 -0
  65. package/packages/cli/dist/plugins.mjs +2 -0
  66. package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts +780 -0
  67. package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts.map +1 -0
  68. package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts +780 -0
  69. package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts.map +1 -0
  70. package/packages/cli/dist/translators.cjs +14 -0
  71. package/packages/cli/dist/translators.cjs.map +1 -0
  72. package/packages/cli/dist/translators.d.cts +14 -0
  73. package/packages/cli/dist/translators.d.cts.map +1 -0
  74. package/packages/cli/dist/translators.d.mts +14 -0
  75. package/packages/cli/dist/translators.d.mts.map +1 -0
  76. package/packages/cli/dist/translators.mjs +12 -0
  77. package/packages/cli/dist/translators.mjs.map +1 -0
  78. package/packages/cli/node_modules/.bin/eslint +2 -2
  79. package/packages/cli/node_modules/.bin/jiti +2 -2
  80. package/packages/cli/node_modules/.bin/js-yaml +2 -2
  81. package/packages/cli/node_modules/.bin/jsf +21 -0
  82. package/packages/cli/node_modules/.bin/jsonpath +2 -2
  83. package/packages/cli/node_modules/.bin/jsonpath-plus +2 -2
  84. package/packages/cli/node_modules/.bin/semver +2 -2
  85. package/packages/cli/node_modules/.bin/tsc +4 -4
  86. package/packages/cli/node_modules/.bin/tsserver +4 -4
  87. package/packages/exception/.turbo/turbo-build.log +26 -31
  88. package/packages/exception/dist/index.d.mts +21 -0
  89. package/packages/exception/dist/index.d.mts.map +1 -0
  90. package/packages/exception/dist/index.d.ts +20 -3
  91. package/packages/exception/dist/index.d.ts.map +1 -1
  92. package/packages/exception/dist/index.js +97 -105
  93. package/packages/exception/dist/index.js.map +1 -1
  94. package/packages/exception/dist/index.mjs +92 -104
  95. package/packages/exception/dist/index.mjs.map +1 -1
  96. package/packages/headers/.turbo/turbo-build.log +26 -18
  97. package/packages/headers/dist/index.d.mts +46 -0
  98. package/packages/headers/dist/index.d.mts.map +1 -0
  99. package/packages/headers/dist/index.d.ts +11 -7
  100. package/packages/headers/dist/index.d.ts.map +1 -1
  101. package/packages/headers/dist/index.js +68 -64
  102. package/packages/headers/dist/index.js.map +1 -1
  103. package/packages/headers/dist/index.mjs +62 -43
  104. package/packages/headers/dist/index.mjs.map +1 -1
  105. package/packages/keq/.turbo/turbo-build.log +26 -16
  106. package/packages/keq/dist/index.d.mts +962 -0
  107. package/packages/keq/dist/index.d.mts.map +1 -0
  108. package/packages/keq/dist/index.d.ts +961 -7
  109. package/packages/keq/dist/index.d.ts.map +1 -1
  110. package/packages/keq/dist/index.js +1727 -1842
  111. package/packages/keq/dist/index.js.map +1 -1
  112. package/packages/keq/dist/index.mjs +1671 -1817
  113. package/packages/keq/dist/index.mjs.map +1 -1
  114. package/packages/nestjs/.turbo/turbo-build.log +26 -11
  115. package/packages/nestjs/dist/index.d.mts +52 -0
  116. package/packages/nestjs/dist/index.d.mts.map +1 -0
  117. package/packages/nestjs/dist/index.d.ts +51 -2
  118. package/packages/nestjs/dist/index.d.ts.map +1 -1
  119. package/packages/nestjs/dist/index.js +156 -60
  120. package/packages/nestjs/dist/index.js.map +1 -1
  121. package/packages/nestjs/dist/index.mjs +133 -42
  122. package/packages/nestjs/dist/index.mjs.map +1 -1
  123. package/packages/test/.turbo/turbo-build.log +1 -1
  124. package/packages/url/.turbo/turbo-build.log +26 -18
  125. package/packages/url/dist/index.d.mts +9 -0
  126. package/packages/url/dist/index.d.mts.map +1 -0
  127. package/packages/url/dist/index.d.ts +8 -4
  128. package/packages/url/dist/index.d.ts.map +1 -1
  129. package/packages/url/dist/index.js +36 -60
  130. package/packages/url/dist/index.js.map +1 -1
  131. package/packages/url/dist/index.mjs +33 -39
  132. package/packages/url/dist/index.mjs.map +1 -1
  133. package/packages/cache/dist/cache-entry/cache-entry.d.ts +0 -17
  134. package/packages/cache/dist/cache-entry/cache-entry.d.ts.map +0 -1
  135. package/packages/cache/dist/cache-entry/index.d.ts +0 -4
  136. package/packages/cache/dist/cache-entry/index.d.ts.map +0 -1
  137. package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts +0 -8
  138. package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts.map +0 -1
  139. package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts +0 -7
  140. package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts.map +0 -1
  141. package/packages/cache/dist/cache.d.ts +0 -44
  142. package/packages/cache/dist/cache.d.ts.map +0 -1
  143. package/packages/cache/dist/constants/eviction.enum.d.ts +0 -7
  144. package/packages/cache/dist/constants/eviction.enum.d.ts.map +0 -1
  145. package/packages/cache/dist/constants/index.d.ts +0 -5
  146. package/packages/cache/dist/constants/index.d.ts.map +0 -1
  147. package/packages/cache/dist/constants/max-expired-at.d.ts +0 -2
  148. package/packages/cache/dist/constants/max-expired-at.d.ts.map +0 -1
  149. package/packages/cache/dist/constants/size.enum.d.ts +0 -7
  150. package/packages/cache/dist/constants/size.enum.d.ts.map +0 -1
  151. package/packages/cache/dist/constants/strategy.enum.d.ts +0 -7
  152. package/packages/cache/dist/constants/strategy.enum.d.ts.map +0 -1
  153. package/packages/cache/dist/exceptions/cache-exception.d.ts +0 -5
  154. package/packages/cache/dist/exceptions/cache-exception.d.ts.map +0 -1
  155. package/packages/cache/dist/exceptions/index.d.ts +0 -2
  156. package/packages/cache/dist/exceptions/index.d.ts.map +0 -1
  157. package/packages/cache/dist/request-cache-handler/index.d.ts +0 -2
  158. package/packages/cache/dist/request-cache-handler/index.d.ts.map +0 -1
  159. package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts +0 -23
  160. package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts.map +0 -1
  161. package/packages/cache/dist/storage/index.d.ts +0 -6
  162. package/packages/cache/dist/storage/index.d.ts.map +0 -1
  163. package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts +0 -22
  164. package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts.map +0 -1
  165. package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts +0 -2
  166. package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts.map +0 -1
  167. package/packages/cache/dist/storage/indexed-db-storage/index.d.ts +0 -3
  168. package/packages/cache/dist/storage/indexed-db-storage/index.d.ts.map +0 -1
  169. package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts +0 -12
  170. package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts.map +0 -1
  171. package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts +0 -11
  172. package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts.map +0 -1
  173. package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts +0 -11
  174. package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts.map +0 -1
  175. package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts +0 -11
  176. package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts.map +0 -1
  177. package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts +0 -11
  178. package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts.map +0 -1
  179. package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts +0 -7
  180. package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts.map +0 -1
  181. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts +0 -12
  182. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts.map +0 -1
  183. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts +0 -8
  184. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts.map +0 -1
  185. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts +0 -14
  186. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts.map +0 -1
  187. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts +0 -29
  188. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts.map +0 -1
  189. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts +0 -14
  190. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts.map +0 -1
  191. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts +0 -13
  192. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts.map +0 -1
  193. package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts +0 -16
  194. package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts.map +0 -1
  195. package/packages/cache/dist/storage/internal-storage/types/events.d.ts +0 -16
  196. package/packages/cache/dist/storage/internal-storage/types/events.d.ts.map +0 -1
  197. package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts +0 -20
  198. package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts.map +0 -1
  199. package/packages/cache/dist/storage/keq-cache-storage.d.ts +0 -20
  200. package/packages/cache/dist/storage/keq-cache-storage.d.ts.map +0 -1
  201. package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts +0 -31
  202. package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts.map +0 -1
  203. package/packages/cache/dist/storage/memory-storage/index.d.ts +0 -3
  204. package/packages/cache/dist/storage/memory-storage/index.d.ts.map +0 -1
  205. package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts +0 -11
  206. package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts.map +0 -1
  207. package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts +0 -11
  208. package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts.map +0 -1
  209. package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts +0 -13
  210. package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts.map +0 -1
  211. package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts +0 -11
  212. package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts.map +0 -1
  213. package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts +0 -11
  214. package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts.map +0 -1
  215. package/packages/cache/dist/storage/memory-storage/types/index.d.ts +0 -3
  216. package/packages/cache/dist/storage/memory-storage/types/index.d.ts.map +0 -1
  217. package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts +0 -9
  218. package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts.map +0 -1
  219. package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts +0 -13
  220. package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts.map +0 -1
  221. package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts +0 -6
  222. package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts.map +0 -1
  223. package/packages/cache/dist/storage/memory-storage/utils/index.d.ts +0 -3
  224. package/packages/cache/dist/storage/memory-storage/utils/index.d.ts.map +0 -1
  225. package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts +0 -6
  226. package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts.map +0 -1
  227. package/packages/cache/dist/storage/multi-tier-storage/index.d.ts +0 -3
  228. package/packages/cache/dist/storage/multi-tier-storage/index.d.ts.map +0 -1
  229. package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts +0 -36
  230. package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts.map +0 -1
  231. package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts +0 -2
  232. package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts.map +0 -1
  233. package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts +0 -5
  234. package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts.map +0 -1
  235. package/packages/cache/dist/storage/tier-storage/index.d.ts +0 -3
  236. package/packages/cache/dist/storage/tier-storage/index.d.ts.map +0 -1
  237. package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts +0 -15
  238. package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts.map +0 -1
  239. package/packages/cache/dist/storage/tier-storage/types/index.d.ts +0 -2
  240. package/packages/cache/dist/storage/tier-storage/types/index.d.ts.map +0 -1
  241. package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts +0 -21
  242. package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts.map +0 -1
  243. package/packages/cache/dist/strategies/cache-first.d.ts +0 -3
  244. package/packages/cache/dist/strategies/cache-first.d.ts.map +0 -1
  245. package/packages/cache/dist/strategies/index.d.ts +0 -5
  246. package/packages/cache/dist/strategies/index.d.ts.map +0 -1
  247. package/packages/cache/dist/strategies/network-first.d.ts +0 -3
  248. package/packages/cache/dist/strategies/network-first.d.ts.map +0 -1
  249. package/packages/cache/dist/strategies/network-only.d.ts +0 -3
  250. package/packages/cache/dist/strategies/network-only.d.ts.map +0 -1
  251. package/packages/cache/dist/strategies/stale-while-revalidate.d.ts +0 -3
  252. package/packages/cache/dist/strategies/stale-while-revalidate.d.ts.map +0 -1
  253. package/packages/cache/dist/types/index.d.ts +0 -6
  254. package/packages/cache/dist/types/index.d.ts.map +0 -1
  255. package/packages/cache/dist/types/keq-cache-key.d.ts +0 -4
  256. package/packages/cache/dist/types/keq-cache-key.d.ts.map +0 -1
  257. package/packages/cache/dist/types/keq-cache-pattern.d.ts +0 -3
  258. package/packages/cache/dist/types/keq-cache-pattern.d.ts.map +0 -1
  259. package/packages/cache/dist/types/keq-cache-rule.d.ts +0 -6
  260. package/packages/cache/dist/types/keq-cache-rule.d.ts.map +0 -1
  261. package/packages/cache/dist/types/keq-cache-strategy.d.ts +0 -6
  262. package/packages/cache/dist/types/keq-cache-strategy.d.ts.map +0 -1
  263. package/packages/cache/dist/types/request-cache-options.d.ts +0 -45
  264. package/packages/cache/dist/types/request-cache-options.d.ts.map +0 -1
  265. package/packages/cache/dist/utils/get-response-bytes.d.ts +0 -2
  266. package/packages/cache/dist/utils/get-response-bytes.d.ts.map +0 -1
  267. package/packages/cache/dist/utils/index.d.ts +0 -4
  268. package/packages/cache/dist/utils/index.d.ts.map +0 -1
  269. package/packages/cache/dist/utils/logger.d.ts +0 -5
  270. package/packages/cache/dist/utils/logger.d.ts.map +0 -1
  271. package/packages/cache/dist/utils/random.d.ts +0 -2
  272. package/packages/cache/dist/utils/random.d.ts.map +0 -1
  273. package/packages/cli/dist/cli.d.ts +0 -3
  274. package/packages/cli/dist/cli.d.ts.map +0 -1
  275. package/packages/cli/dist/cli.js +0 -2945
  276. package/packages/cli/dist/cli.js.map +0 -1
  277. package/packages/cli/dist/compiler/compiler.d.ts +0 -17
  278. package/packages/cli/dist/compiler/compiler.d.ts.map +0 -1
  279. package/packages/cli/dist/compiler/index.d.ts +0 -4
  280. package/packages/cli/dist/compiler/index.d.ts.map +0 -1
  281. package/packages/cli/dist/compiler/intercepter/index.d.ts +0 -3
  282. package/packages/cli/dist/compiler/intercepter/index.d.ts.map +0 -1
  283. package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts +0 -3
  284. package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts.map +0 -1
  285. package/packages/cli/dist/compiler/intercepter/print-information.d.ts +0 -5
  286. package/packages/cli/dist/compiler/intercepter/print-information.d.ts.map +0 -1
  287. package/packages/cli/dist/compiler/tasks/compile/index.d.ts +0 -6
  288. package/packages/cli/dist/compiler/tasks/compile/index.d.ts.map +0 -1
  289. package/packages/cli/dist/compiler/tasks/download/index.d.ts +0 -10
  290. package/packages/cli/dist/compiler/tasks/download/index.d.ts.map +0 -1
  291. package/packages/cli/dist/compiler/tasks/index.d.ts +0 -6
  292. package/packages/cli/dist/compiler/tasks/index.d.ts.map +0 -1
  293. package/packages/cli/dist/compiler/tasks/persist/index.d.ts +0 -5
  294. package/packages/cli/dist/compiler/tasks/persist/index.d.ts.map +0 -1
  295. package/packages/cli/dist/compiler/tasks/setup/index.d.ts +0 -15
  296. package/packages/cli/dist/compiler/tasks/setup/index.d.ts.map +0 -1
  297. package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts +0 -6
  298. package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts.map +0 -1
  299. package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts +0 -5
  300. package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts.map +0 -1
  301. package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts +0 -3
  302. package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts.map +0 -1
  303. package/packages/cli/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts +0 -3
  304. package/packages/cli/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts.map +0 -1
  305. package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts +0 -6
  306. package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts.map +0 -1
  307. package/packages/cli/dist/compiler/tasks/types/index.d.ts +0 -3
  308. package/packages/cli/dist/compiler/tasks/types/index.d.ts.map +0 -1
  309. package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts +0 -4
  310. package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts.map +0 -1
  311. package/packages/cli/dist/compiler/types/compiler-context.d.ts +0 -11
  312. package/packages/cli/dist/compiler/types/compiler-context.d.ts.map +0 -1
  313. package/packages/cli/dist/compiler/types/compiler-hooks.d.ts +0 -19
  314. package/packages/cli/dist/compiler/types/compiler-hooks.d.ts.map +0 -1
  315. package/packages/cli/dist/compiler/types/index.d.ts +0 -3
  316. package/packages/cli/dist/compiler/types/index.d.ts.map +0 -1
  317. package/packages/cli/dist/constants/file-naming-style.d.ts +0 -14
  318. package/packages/cli/dist/constants/file-naming-style.d.ts.map +0 -1
  319. package/packages/cli/dist/constants/index.d.ts +0 -4
  320. package/packages/cli/dist/constants/index.d.ts.map +0 -1
  321. package/packages/cli/dist/constants/qs-array-format.d.ts +0 -9
  322. package/packages/cli/dist/constants/qs-array-format.d.ts.map +0 -1
  323. package/packages/cli/dist/constants/supported-methods.d.ts +0 -2
  324. package/packages/cli/dist/constants/supported-methods.d.ts.map +0 -1
  325. package/packages/cli/dist/define-config.d.ts +0 -3
  326. package/packages/cli/dist/define-config.d.ts.map +0 -1
  327. package/packages/cli/dist/exception.d.ts +0 -6
  328. package/packages/cli/dist/exception.d.ts.map +0 -1
  329. package/packages/cli/dist/generators/index.d.ts +0 -2
  330. package/packages/cli/dist/generators/index.d.ts.map +0 -1
  331. package/packages/cli/dist/index.d.ts +0 -6
  332. package/packages/cli/dist/index.d.ts.map +0 -1
  333. package/packages/cli/dist/index.js +0 -2853
  334. package/packages/cli/dist/index.js.map +0 -1
  335. package/packages/cli/dist/models/anchor.d.ts +0 -20
  336. package/packages/cli/dist/models/anchor.d.ts.map +0 -1
  337. package/packages/cli/dist/models/api-document_v3_1.d.ts +0 -16
  338. package/packages/cli/dist/models/api-document_v3_1.d.ts.map +0 -1
  339. package/packages/cli/dist/models/artifact.d.ts +0 -17
  340. package/packages/cli/dist/models/artifact.d.ts.map +0 -1
  341. package/packages/cli/dist/models/asset.d.ts +0 -5
  342. package/packages/cli/dist/models/asset.d.ts.map +0 -1
  343. package/packages/cli/dist/models/index.d.ts +0 -8
  344. package/packages/cli/dist/models/index.d.ts.map +0 -1
  345. package/packages/cli/dist/models/module-definition.d.ts +0 -8
  346. package/packages/cli/dist/models/module-definition.d.ts.map +0 -1
  347. package/packages/cli/dist/models/operation-definition.d.ts +0 -23
  348. package/packages/cli/dist/models/operation-definition.d.ts.map +0 -1
  349. package/packages/cli/dist/models/schema-definition.d.ts +0 -20
  350. package/packages/cli/dist/models/schema-definition.d.ts.map +0 -1
  351. package/packages/cli/dist/models/utils/to-comment.d.ts +0 -2
  352. package/packages/cli/dist/models/utils/to-comment.d.ts.map +0 -1
  353. package/packages/cli/dist/plugins/body-fallback/index.d.ts +0 -6
  354. package/packages/cli/dist/plugins/body-fallback/index.d.ts.map +0 -1
  355. package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts +0 -5
  356. package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts.map +0 -1
  357. package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts +0 -2
  358. package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts.map +0 -1
  359. package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts +0 -8
  360. package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts.map +0 -1
  361. package/packages/cli/dist/plugins/download-http-file/index.d.ts +0 -2
  362. package/packages/cli/dist/plugins/download-http-file/index.d.ts.map +0 -1
  363. package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts +0 -6
  364. package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts.map +0 -1
  365. package/packages/cli/dist/plugins/download-local-file/index.d.ts +0 -2
  366. package/packages/cli/dist/plugins/download-local-file/index.d.ts.map +0 -1
  367. package/packages/cli/dist/plugins/eslint/index.d.ts +0 -15
  368. package/packages/cli/dist/plugins/eslint/index.d.ts.map +0 -1
  369. package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts +0 -2
  370. package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts.map +0 -1
  371. package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts +0 -12
  372. package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts.map +0 -1
  373. package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts +0 -15
  374. package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts.map +0 -1
  375. package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts +0 -3
  376. package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts.map +0 -1
  377. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts +0 -2
  378. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts.map +0 -1
  379. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts +0 -15
  380. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts.map +0 -1
  381. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts +0 -2
  382. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts.map +0 -1
  383. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts +0 -15
  384. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts.map +0 -1
  385. package/packages/cli/dist/plugins/generate-declaration/index.d.ts +0 -3
  386. package/packages/cli/dist/plugins/generate-declaration/index.d.ts.map +0 -1
  387. package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts +0 -2
  388. package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts.map +0 -1
  389. package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts +0 -11
  390. package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts.map +0 -1
  391. package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts +0 -11
  392. package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts.map +0 -1
  393. package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts +0 -3
  394. package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts.map +0 -1
  395. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts +0 -2
  396. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts.map +0 -1
  397. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts +0 -15
  398. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts.map +0 -1
  399. package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts +0 -2
  400. package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts.map +0 -1
  401. package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts +0 -11
  402. package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts.map +0 -1
  403. package/packages/cli/dist/plugins/generate-micro-function/index.d.ts +0 -3
  404. package/packages/cli/dist/plugins/generate-micro-function/index.d.ts.map +0 -1
  405. package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts +0 -2
  406. package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts.map +0 -1
  407. package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts +0 -10
  408. package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts.map +0 -1
  409. package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts +0 -10
  410. package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts.map +0 -1
  411. package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts +0 -2
  412. package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts.map +0 -1
  413. package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts +0 -14
  414. package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts.map +0 -1
  415. package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts +0 -3
  416. package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts.map +0 -1
  417. package/packages/cli/dist/plugins/index.d.ts +0 -15
  418. package/packages/cli/dist/plugins/index.d.ts.map +0 -1
  419. package/packages/cli/dist/plugins/initialize/index.d.ts +0 -2
  420. package/packages/cli/dist/plugins/initialize/index.d.ts.map +0 -1
  421. package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts +0 -15
  422. package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts.map +0 -1
  423. package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts +0 -2
  424. package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts.map +0 -1
  425. package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts +0 -20
  426. package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts.map +0 -1
  427. package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts +0 -2
  428. package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts.map +0 -1
  429. package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts +0 -18
  430. package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts.map +0 -1
  431. package/packages/cli/dist/plugins/prettier/index.d.ts +0 -2
  432. package/packages/cli/dist/plugins/prettier/index.d.ts.map +0 -1
  433. package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts +0 -6
  434. package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts.map +0 -1
  435. package/packages/cli/dist/plugins/shaking/index.d.ts +0 -2
  436. package/packages/cli/dist/plugins/shaking/index.d.ts.map +0 -1
  437. package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts +0 -8
  438. package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts.map +0 -1
  439. package/packages/cli/dist/plugins/terminal-select/index.d.ts +0 -2
  440. package/packages/cli/dist/plugins/terminal-select/index.d.ts.map +0 -1
  441. package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts +0 -18
  442. package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts.map +0 -1
  443. package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts +0 -2
  444. package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts.map +0 -1
  445. package/packages/cli/dist/plugins/terminal-select/types/index.d.ts +0 -2
  446. package/packages/cli/dist/plugins/terminal-select/types/index.d.ts.map +0 -1
  447. package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts +0 -2
  448. package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts.map +0 -1
  449. package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts +0 -5
  450. package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts.map +0 -1
  451. package/packages/cli/dist/plugins.cjs.map +0 -1
  452. package/packages/cli/dist/plugins.js +0 -2378
  453. package/packages/cli/dist/plugins.js.map +0 -1
  454. package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts +0 -8
  455. package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts.map +0 -1
  456. package/packages/cli/dist/transformers/api-document/index.d.ts +0 -2
  457. package/packages/cli/dist/transformers/api-document/index.d.ts.map +0 -1
  458. package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts +0 -14
  459. package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts.map +0 -1
  460. package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts +0 -12
  461. package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts.map +0 -1
  462. package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts +0 -10
  463. package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts.map +0 -1
  464. package/packages/cli/dist/transformers/entrypoint/index.d.ts +0 -2
  465. package/packages/cli/dist/transformers/entrypoint/index.d.ts.map +0 -1
  466. package/packages/cli/dist/transformers/index.d.ts +0 -6
  467. package/packages/cli/dist/transformers/index.d.ts.map +0 -1
  468. package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts +0 -8
  469. package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts.map +0 -1
  470. package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts +0 -26
  471. package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts.map +0 -1
  472. package/packages/cli/dist/transformers/json-schema/index.d.ts +0 -4
  473. package/packages/cli/dist/transformers/json-schema/index.d.ts.map +0 -1
  474. package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts +0 -7
  475. package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts.map +0 -1
  476. package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts +0 -5
  477. package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts.map +0 -1
  478. package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts +0 -5
  479. package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts.map +0 -1
  480. package/packages/cli/dist/transformers/json-schema/types/index.d.ts +0 -3
  481. package/packages/cli/dist/transformers/json-schema/types/index.d.ts.map +0 -1
  482. package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts +0 -7
  483. package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts.map +0 -1
  484. package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts +0 -8
  485. package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts.map +0 -1
  486. package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts +0 -20
  487. package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts.map +0 -1
  488. package/packages/cli/dist/transformers/operation-definition/index.d.ts +0 -3
  489. package/packages/cli/dist/transformers/operation-definition/index.d.ts.map +0 -1
  490. package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts +0 -19
  491. package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts.map +0 -1
  492. package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts +0 -15
  493. package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts.map +0 -1
  494. package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts +0 -11
  495. package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts.map +0 -1
  496. package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts +0 -22
  497. package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts.map +0 -1
  498. package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts +0 -2
  499. package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts.map +0 -1
  500. package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts +0 -4
  501. package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts.map +0 -1
  502. package/packages/cli/dist/transformers/schema-definition/index.d.ts +0 -2
  503. package/packages/cli/dist/transformers/schema-definition/index.d.ts.map +0 -1
  504. package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts +0 -10
  505. package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts.map +0 -1
  506. package/packages/cli/dist/transformers/types/renderer.d.ts +0 -4
  507. package/packages/cli/dist/transformers/types/renderer.d.ts.map +0 -1
  508. package/packages/cli/dist/types/address.d.ts +0 -8
  509. package/packages/cli/dist/types/address.d.ts.map +0 -1
  510. package/packages/cli/dist/types/build-cli-options.d.ts +0 -19
  511. package/packages/cli/dist/types/build-cli-options.d.ts.map +0 -1
  512. package/packages/cli/dist/types/generator.d.ts +0 -7
  513. package/packages/cli/dist/types/generator.d.ts.map +0 -1
  514. package/packages/cli/dist/types/index.d.ts +0 -7
  515. package/packages/cli/dist/types/index.d.ts.map +0 -1
  516. package/packages/cli/dist/types/plugin.d.ts +0 -5
  517. package/packages/cli/dist/types/plugin.d.ts.map +0 -1
  518. package/packages/cli/dist/types/runtime-config.d.ts +0 -41
  519. package/packages/cli/dist/types/runtime-config.d.ts.map +0 -1
  520. package/packages/cli/dist/types/to-code-options.d.ts +0 -4
  521. package/packages/cli/dist/types/to-code-options.d.ts.map +0 -1
  522. package/packages/cli/dist/utils/debugger.d.ts +0 -7
  523. package/packages/cli/dist/utils/debugger.d.ts.map +0 -1
  524. package/packages/cli/dist/utils/ignore-matcher.d.ts +0 -18
  525. package/packages/cli/dist/utils/ignore-matcher.d.ts.map +0 -1
  526. package/packages/cli/dist/utils/indent.d.ts +0 -2
  527. package/packages/cli/dist/utils/indent.d.ts.map +0 -1
  528. package/packages/cli/dist/utils/is-keywords.d.ts +0 -2
  529. package/packages/cli/dist/utils/is-keywords.d.ts.map +0 -1
  530. package/packages/cli/dist/utils/is-reserved-word.d.ts +0 -2
  531. package/packages/cli/dist/utils/is-reserved-word.d.ts.map +0 -1
  532. package/packages/cli/dist/utils/is-valid-url.d.ts +0 -16
  533. package/packages/cli/dist/utils/is-valid-url.d.ts.map +0 -1
  534. package/packages/cli/dist/utils/json-schema-utils/index.d.ts +0 -11
  535. package/packages/cli/dist/utils/json-schema-utils/index.d.ts.map +0 -1
  536. package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts +0 -3
  537. package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts.map +0 -1
  538. package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts +0 -4
  539. package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts.map +0 -1
  540. package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts +0 -3
  541. package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts.map +0 -1
  542. package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts +0 -3
  543. package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts.map +0 -1
  544. package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts +0 -5
  545. package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts.map +0 -1
  546. package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts +0 -7
  547. package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts.map +0 -1
  548. package/packages/cli/dist/utils/logger.d.ts +0 -6
  549. package/packages/cli/dist/utils/logger.d.ts.map +0 -1
  550. package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts +0 -3
  551. package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts.map +0 -1
  552. package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts +0 -4
  553. package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts.map +0 -1
  554. package/packages/cli/dist/utils/openapi-utils/dereference.d.ts +0 -3
  555. package/packages/cli/dist/utils/openapi-utils/dereference.d.ts.map +0 -1
  556. package/packages/cli/dist/utils/openapi-utils/index.d.ts +0 -19
  557. package/packages/cli/dist/utils/openapi-utils/index.d.ts.map +0 -1
  558. package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts +0 -3
  559. package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts.map +0 -1
  560. package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts +0 -4
  561. package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts.map +0 -1
  562. package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts +0 -4
  563. package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts.map +0 -1
  564. package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts +0 -3
  565. package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts.map +0 -1
  566. package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts +0 -3
  567. package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts.map +0 -1
  568. package/packages/exception/dist/catch-exception.d.ts +0 -4
  569. package/packages/exception/dist/catch-exception.d.ts.map +0 -1
  570. package/packages/exception/dist/plugins/index.d.mts +0 -12
  571. package/packages/exception/dist/plugins/index.d.ts +0 -12
  572. package/packages/exception/dist/plugins/index.js +0 -95
  573. package/packages/exception/dist/plugins/index.mjs +0 -68
  574. package/packages/exception/dist/throw-exception.d.ts +0 -5
  575. package/packages/exception/dist/throw-exception.d.ts.map +0 -1
  576. package/packages/exception/dist/validate-status-code.d.ts +0 -3
  577. package/packages/exception/dist/validate-status-code.d.ts.map +0 -1
  578. package/packages/exception/node_modules/.bin/keq +0 -21
  579. package/packages/keq/dist/context/execution-context.d.ts +0 -26
  580. package/packages/keq/dist/context/execution-context.d.ts.map +0 -1
  581. package/packages/keq/dist/context/index.d.ts +0 -5
  582. package/packages/keq/dist/context/index.d.ts.map +0 -1
  583. package/packages/keq/dist/context/middleware-context.d.ts +0 -11
  584. package/packages/keq/dist/context/middleware-context.d.ts.map +0 -1
  585. package/packages/keq/dist/context/orchestrator-context.d.ts +0 -18
  586. package/packages/keq/dist/context/orchestrator-context.d.ts.map +0 -1
  587. package/packages/keq/dist/context/shared-context.d.ts +0 -43
  588. package/packages/keq/dist/context/shared-context.d.ts.map +0 -1
  589. package/packages/keq/dist/context/types/index.d.ts +0 -6
  590. package/packages/keq/dist/context/types/index.d.ts.map +0 -1
  591. package/packages/keq/dist/context/types/keq-context-data.d.ts +0 -7
  592. package/packages/keq/dist/context/types/keq-context-data.d.ts.map +0 -1
  593. package/packages/keq/dist/context/types/keq-context-emitter.d.ts +0 -35
  594. package/packages/keq/dist/context/types/keq-context-emitter.d.ts.map +0 -1
  595. package/packages/keq/dist/context/types/keq-context-options/index.d.ts +0 -6
  596. package/packages/keq/dist/context/types/keq-context-options/index.d.ts.map +0 -1
  597. package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts +0 -5
  598. package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts.map +0 -1
  599. package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts +0 -33
  600. package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts.map +0 -1
  601. package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts +0 -5
  602. package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts.map +0 -1
  603. package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts +0 -2
  604. package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts.map +0 -1
  605. package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts +0 -9
  606. package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts.map +0 -1
  607. package/packages/keq/dist/context/types/keq-context.d.ts +0 -17
  608. package/packages/keq/dist/context/types/keq-context.d.ts.map +0 -1
  609. package/packages/keq/dist/context/types/keq-global.d.ts +0 -12
  610. package/packages/keq/dist/context/types/keq-global.d.ts.map +0 -1
  611. package/packages/keq/dist/context/utils/assign-shared-context.d.ts +0 -3
  612. package/packages/keq/dist/context/utils/assign-shared-context.d.ts.map +0 -1
  613. package/packages/keq/dist/context/utils/clone-shared-context.d.ts +0 -3
  614. package/packages/keq/dist/context/utils/clone-shared-context.d.ts.map +0 -1
  615. package/packages/keq/dist/context/utils/create-proxy-response.d.ts +0 -2
  616. package/packages/keq/dist/context/utils/create-proxy-response.d.ts.map +0 -1
  617. package/packages/keq/dist/context/utils/fork.d.ts +0 -6
  618. package/packages/keq/dist/context/utils/fork.d.ts.map +0 -1
  619. package/packages/keq/dist/context/utils/index.d.ts +0 -5
  620. package/packages/keq/dist/context/utils/index.d.ts.map +0 -1
  621. package/packages/keq/dist/context/utils/watch-object.d.ts +0 -5
  622. package/packages/keq/dist/context/utils/watch-object.d.ts.map +0 -1
  623. package/packages/keq/dist/exception/abort.exception.d.ts +0 -4
  624. package/packages/keq/dist/exception/abort.exception.d.ts.map +0 -1
  625. package/packages/keq/dist/exception/exception.d.ts +0 -5
  626. package/packages/keq/dist/exception/exception.d.ts.map +0 -1
  627. package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts +0 -5
  628. package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts.map +0 -1
  629. package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts +0 -5
  630. package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts.map +0 -1
  631. package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts +0 -5
  632. package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts.map +0 -1
  633. package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts +0 -5
  634. package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts.map +0 -1
  635. package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts +0 -5
  636. package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts.map +0 -1
  637. package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts +0 -5
  638. package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts.map +0 -1
  639. package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts +0 -5
  640. package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts.map +0 -1
  641. package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts +0 -5
  642. package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts.map +0 -1
  643. package/packages/keq/dist/exception/http-exceptions/index.d.ts +0 -22
  644. package/packages/keq/dist/exception/http-exceptions/index.d.ts.map +0 -1
  645. package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts +0 -5
  646. package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts.map +0 -1
  647. package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts +0 -5
  648. package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts.map +0 -1
  649. package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts +0 -5
  650. package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts.map +0 -1
  651. package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts +0 -5
  652. package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts.map +0 -1
  653. package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts +0 -5
  654. package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts.map +0 -1
  655. package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts +0 -5
  656. package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts.map +0 -1
  657. package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts +0 -5
  658. package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts.map +0 -1
  659. package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts +0 -5
  660. package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts.map +0 -1
  661. package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts +0 -12
  662. package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts.map +0 -1
  663. package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts +0 -5
  664. package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts.map +0 -1
  665. package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts +0 -5
  666. package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts.map +0 -1
  667. package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts +0 -5
  668. package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts.map +0 -1
  669. package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts +0 -5
  670. package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts.map +0 -1
  671. package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts +0 -5
  672. package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts.map +0 -1
  673. package/packages/keq/dist/exception/index.d.ts +0 -6
  674. package/packages/keq/dist/exception/index.d.ts.map +0 -1
  675. package/packages/keq/dist/exception/timeout.exception.d.ts +0 -5
  676. package/packages/keq/dist/exception/timeout.exception.d.ts.map +0 -1
  677. package/packages/keq/dist/exception/type.exception.d.ts +0 -5
  678. package/packages/keq/dist/exception/type.exception.d.ts.map +0 -1
  679. package/packages/keq/dist/middleware/index.d.ts +0 -3
  680. package/packages/keq/dist/middleware/index.d.ts.map +0 -1
  681. package/packages/keq/dist/middleware/types/index.d.ts +0 -3
  682. package/packages/keq/dist/middleware/types/index.d.ts.map +0 -1
  683. package/packages/keq/dist/middleware/types/keq-middleware.d.ts +0 -8
  684. package/packages/keq/dist/middleware/types/keq-middleware.d.ts.map +0 -1
  685. package/packages/keq/dist/middleware/types/keq-next.d.ts +0 -2
  686. package/packages/keq/dist/middleware/types/keq-next.d.ts.map +0 -1
  687. package/packages/keq/dist/middleware/utils/compose-middleware.d.ts +0 -7
  688. package/packages/keq/dist/middleware/utils/compose-middleware.d.ts.map +0 -1
  689. package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts +0 -3
  690. package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts.map +0 -1
  691. package/packages/keq/dist/middleware/utils/index.d.ts +0 -3
  692. package/packages/keq/dist/middleware/utils/index.d.ts.map +0 -1
  693. package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts +0 -6
  694. package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts.map +0 -1
  695. package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts +0 -3
  696. package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts.map +0 -1
  697. package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts +0 -4
  698. package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts.map +0 -1
  699. package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts +0 -3
  700. package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts.map +0 -1
  701. package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts +0 -9
  702. package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts.map +0 -1
  703. package/packages/keq/dist/middlewares/index.d.ts +0 -4
  704. package/packages/keq/dist/middlewares/index.d.ts.map +0 -1
  705. package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts +0 -6
  706. package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts.map +0 -1
  707. package/packages/keq/dist/orchestrator/executor.d.ts +0 -13
  708. package/packages/keq/dist/orchestrator/executor.d.ts.map +0 -1
  709. package/packages/keq/dist/orchestrator/index.d.ts +0 -3
  710. package/packages/keq/dist/orchestrator/index.d.ts.map +0 -1
  711. package/packages/keq/dist/orchestrator/orchestrator.d.ts +0 -25
  712. package/packages/keq/dist/orchestrator/orchestrator.d.ts.map +0 -1
  713. package/packages/keq/dist/request/core.d.ts +0 -48
  714. package/packages/keq/dist/request/core.d.ts.map +0 -1
  715. package/packages/keq/dist/request/create-request.d.ts +0 -7
  716. package/packages/keq/dist/request/create-request.d.ts.map +0 -1
  717. package/packages/keq/dist/request/index.d.ts +0 -6
  718. package/packages/keq/dist/request/index.d.ts.map +0 -1
  719. package/packages/keq/dist/request/keq.d.ts +0 -120
  720. package/packages/keq/dist/request/keq.d.ts.map +0 -1
  721. package/packages/keq/dist/request/request.d.ts +0 -79
  722. package/packages/keq/dist/request/request.d.ts.map +0 -1
  723. package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts +0 -42
  724. package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts.map +0 -1
  725. package/packages/keq/dist/request/types/api-schema/api-schema.d.ts +0 -8
  726. package/packages/keq/dist/request/types/api-schema/api-schema.d.ts.map +0 -1
  727. package/packages/keq/dist/request/types/api-schema/default-operation.d.ts +0 -18
  728. package/packages/keq/dist/request/types/api-schema/default-operation.d.ts.map +0 -1
  729. package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts +0 -31
  730. package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts.map +0 -1
  731. package/packages/keq/dist/request/types/api-schema/index.d.ts +0 -6
  732. package/packages/keq/dist/request/types/api-schema/index.d.ts.map +0 -1
  733. package/packages/keq/dist/request/types/api-schema/operation.d.ts +0 -17
  734. package/packages/keq/dist/request/types/api-schema/operation.d.ts.map +0 -1
  735. package/packages/keq/dist/request/types/content-type.d.ts +0 -3
  736. package/packages/keq/dist/request/types/content-type.d.ts.map +0 -1
  737. package/packages/keq/dist/request/types/index.d.ts +0 -8
  738. package/packages/keq/dist/request/types/index.d.ts.map +0 -1
  739. package/packages/keq/dist/request/types/keq-attachable-file.d.ts +0 -2
  740. package/packages/keq/dist/request/types/keq-attachable-file.d.ts.map +0 -1
  741. package/packages/keq/dist/request/types/keq-param-value.d.ts +0 -3
  742. package/packages/keq/dist/request/types/keq-param-value.d.ts.map +0 -1
  743. package/packages/keq/dist/request/types/keq-query-options.d.ts +0 -7
  744. package/packages/keq/dist/request/types/keq-query-options.d.ts.map +0 -1
  745. package/packages/keq/dist/request/types/keq-query-value.d.ts +0 -8
  746. package/packages/keq/dist/request/types/keq-query-value.d.ts.map +0 -1
  747. package/packages/keq/dist/request/types/server-sent-event.d.ts +0 -3
  748. package/packages/keq/dist/request/types/server-sent-event.d.ts.map +0 -1
  749. package/packages/keq/dist/request/utils/fix-content-type.d.ts +0 -4
  750. package/packages/keq/dist/request/utils/fix-content-type.d.ts.map +0 -1
  751. package/packages/keq/dist/request/utils/get-location-id.d.ts +0 -2
  752. package/packages/keq/dist/request/utils/get-location-id.d.ts.map +0 -1
  753. package/packages/keq/dist/request/utils/index.d.ts +0 -7
  754. package/packages/keq/dist/request/utils/index.d.ts.map +0 -1
  755. package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts +0 -2
  756. package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts.map +0 -1
  757. package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts +0 -3
  758. package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts.map +0 -1
  759. package/packages/keq/dist/request/utils/query-stringify.d.ts +0 -3
  760. package/packages/keq/dist/request/utils/query-stringify.d.ts.map +0 -1
  761. package/packages/keq/dist/request/utils/resolve-with.d.ts +0 -3
  762. package/packages/keq/dist/request/utils/resolve-with.d.ts.map +0 -1
  763. package/packages/keq/dist/request-init/index.d.ts +0 -4
  764. package/packages/keq/dist/request-init/index.d.ts.map +0 -1
  765. package/packages/keq/dist/request-init/request-init.d.ts +0 -42
  766. package/packages/keq/dist/request-init/request-init.d.ts.map +0 -1
  767. package/packages/keq/dist/request-init/types/index.d.ts +0 -3
  768. package/packages/keq/dist/request-init/types/index.d.ts.map +0 -1
  769. package/packages/keq/dist/request-init/types/keq-body-init.d.ts +0 -2
  770. package/packages/keq/dist/request-init/types/keq-body-init.d.ts.map +0 -1
  771. package/packages/keq/dist/request-init/types/keq-request-method.d.ts +0 -2
  772. package/packages/keq/dist/request-init/types/keq-request-method.d.ts.map +0 -1
  773. package/packages/keq/dist/request-init/utils/assign-request-init.d.ts +0 -3
  774. package/packages/keq/dist/request-init/utils/assign-request-init.d.ts.map +0 -1
  775. package/packages/keq/dist/request-init/utils/clone-body.d.ts +0 -2
  776. package/packages/keq/dist/request-init/utils/clone-body.d.ts.map +0 -1
  777. package/packages/keq/dist/request-init/utils/clone-headers.d.ts +0 -2
  778. package/packages/keq/dist/request-init/utils/clone-headers.d.ts.map +0 -1
  779. package/packages/keq/dist/request-init/utils/clone-request-init.d.ts +0 -3
  780. package/packages/keq/dist/request-init/utils/clone-request-init.d.ts.map +0 -1
  781. package/packages/keq/dist/request-init/utils/compile-url.d.ts +0 -3
  782. package/packages/keq/dist/request-init/utils/compile-url.d.ts.map +0 -1
  783. package/packages/keq/dist/request-init/utils/index.d.ts +0 -7
  784. package/packages/keq/dist/request-init/utils/index.d.ts.map +0 -1
  785. package/packages/keq/dist/request-init/utils/to-form-data.d.ts +0 -2
  786. package/packages/keq/dist/request-init/utils/to-form-data.d.ts.map +0 -1
  787. package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts +0 -2
  788. package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts.map +0 -1
  789. package/packages/keq/dist/router/index.d.ts +0 -4
  790. package/packages/keq/dist/router/index.d.ts.map +0 -1
  791. package/packages/keq/dist/router/keq-host-route.d.ts +0 -3
  792. package/packages/keq/dist/router/keq-host-route.d.ts.map +0 -1
  793. package/packages/keq/dist/router/keq-location-route.d.ts +0 -3
  794. package/packages/keq/dist/router/keq-location-route.d.ts.map +0 -1
  795. package/packages/keq/dist/router/keq-method-route.d.ts +0 -3
  796. package/packages/keq/dist/router/keq-method-route.d.ts.map +0 -1
  797. package/packages/keq/dist/router/keq-module-route.d.ts +0 -3
  798. package/packages/keq/dist/router/keq-module-route.d.ts.map +0 -1
  799. package/packages/keq/dist/router/keq-pathname-route.d.ts +0 -3
  800. package/packages/keq/dist/router/keq-pathname-route.d.ts.map +0 -1
  801. package/packages/keq/dist/router/keq-router.d.ts +0 -32
  802. package/packages/keq/dist/router/keq-router.d.ts.map +0 -1
  803. package/packages/keq/dist/router/types/index.d.ts +0 -2
  804. package/packages/keq/dist/router/types/index.d.ts.map +0 -1
  805. package/packages/keq/dist/router/types/keq-route.d.ts +0 -7
  806. package/packages/keq/dist/router/types/keq-route.d.ts.map +0 -1
  807. package/packages/keq/dist/router/utils/compose-route.d.ts +0 -3
  808. package/packages/keq/dist/router/utils/compose-route.d.ts.map +0 -1
  809. package/packages/keq/dist/router/utils/index.d.ts +0 -2
  810. package/packages/keq/dist/router/utils/index.d.ts.map +0 -1
  811. package/packages/keq/dist/types/enabled-if-string-index.d.ts +0 -24
  812. package/packages/keq/dist/types/enabled-if-string-index.d.ts.map +0 -1
  813. package/packages/keq/dist/types/exclude-unknown-properties.d.ts +0 -19
  814. package/packages/keq/dist/types/exclude-unknown-properties.d.ts.map +0 -1
  815. package/packages/keq/dist/types/index-keys.d.ts +0 -18
  816. package/packages/keq/dist/types/index-keys.d.ts.map +0 -1
  817. package/packages/keq/dist/types/index.d.ts +0 -7
  818. package/packages/keq/dist/types/index.d.ts.map +0 -1
  819. package/packages/keq/dist/types/literal-keys.d.ts +0 -18
  820. package/packages/keq/dist/types/literal-keys.d.ts.map +0 -1
  821. package/packages/keq/dist/types/loose-nested-like.d.ts +0 -11
  822. package/packages/keq/dist/types/loose-nested-like.d.ts.map +0 -1
  823. package/packages/keq/dist/types/string-index-value-of.d.ts +0 -18
  824. package/packages/keq/dist/types/string-index-value-of.d.ts.map +0 -1
  825. package/packages/keq/dist/utils/base64.d.ts +0 -3
  826. package/packages/keq/dist/utils/base64.d.ts.map +0 -1
  827. package/packages/keq/dist/utils/index.d.ts +0 -4
  828. package/packages/keq/dist/utils/index.d.ts.map +0 -1
  829. package/packages/keq/dist/utils/shallow-clone.d.ts +0 -5
  830. package/packages/keq/dist/utils/shallow-clone.d.ts.map +0 -1
  831. package/packages/keq/dist/utils/sleep.d.ts +0 -2
  832. package/packages/keq/dist/utils/sleep.d.ts.map +0 -1
  833. package/packages/keq/dist/validator/index.d.ts +0 -2
  834. package/packages/keq/dist/validator/index.d.ts.map +0 -1
  835. package/packages/keq/dist/validator/validator.d.ts +0 -65
  836. package/packages/keq/dist/validator/validator.d.ts.map +0 -1
  837. package/packages/nestjs/dist/keq.module-definition.d.ts +0 -3
  838. package/packages/nestjs/dist/keq.module-definition.d.ts.map +0 -1
  839. package/packages/nestjs/dist/keq.module.d.ts +0 -7
  840. package/packages/nestjs/dist/keq.module.d.ts.map +0 -1
  841. package/packages/nestjs/dist/types/index.d.ts +0 -2
  842. package/packages/nestjs/dist/types/index.d.ts.map +0 -1
  843. package/packages/nestjs/dist/types/keq-module-options.d.ts +0 -5
  844. package/packages/nestjs/dist/types/keq-module-options.d.ts.map +0 -1
@@ -1,2438 +1,36 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/plugins/index.ts
31
- var plugins_exports = {};
32
- __export(plugins_exports, {
33
- BodyFallbackPlugin: () => BodyFallbackPlugin,
34
- ChineseToPinyinPlugin: () => ChineseToPinyinPlugin,
35
- DECLARATION_GENERATOR: () => DECLARATION_GENERATOR,
36
- DownloadHttpFilePlugin: () => DownloadHttpFilePlugin,
37
- DownloadLocalFilePlugin: () => DownloadLocalFilePlugin,
38
- EslintPlugin: () => EslintPlugin,
39
- GenerateDeclarationPlugin: () => GenerateDeclarationPlugin,
40
- GenerateMicroFunctionPlugin: () => GenerateMicroFunctionPlugin,
41
- GenerateNestjsModulePlugin: () => GenerateNestjsModulePlugin,
42
- InitializePlugin: () => InitializePlugin,
43
- MICRO_FUNCTION_GENERATOR: () => MICRO_FUNCTION_GENERATOR,
44
- MICRO_FUNCTION_REQUEST_GENERATOR: () => MICRO_FUNCTION_REQUEST_GENERATOR,
45
- MicroFunctionGenerator: () => MicroFunctionGenerator,
46
- NestjsModuleGenerator: () => NestjsModuleGenerator,
47
- OPERATION_GENERATOR: () => OPERATION_GENERATOR,
48
- OperationDeclarationGenerator: () => OperationDeclarationGenerator,
49
- OverwriteOperationIdPlugin: () => OverwriteOperationIdPlugin,
50
- OverwriteQueryOptionsPlugin: () => OverwriteQueryOptionsPlugin,
51
- PrettierPlugin: () => PrettierPlugin,
52
- RequestGenerator: () => RequestGenerator,
53
- SCHEMA_GENERATOR: () => SCHEMA_GENERATOR,
54
- SchemaDeclarationGenerator: () => SchemaDeclarationGenerator,
55
- ShakingPlugin: () => ShakingPlugin,
56
- TerminalSelectPlugin: () => TerminalSelectPlugin
57
- });
58
- module.exports = __toCommonJS(plugins_exports);
59
-
60
- // src/plugins/eslint/index.ts
61
- var import_eslint = require("eslint");
62
- var EslintPlugin = class _EslintPlugin {
63
- constructor(options = {}) {
64
- this.options = options;
65
- }
66
- apply(compiler) {
67
- if (!compiler.options.build) return;
68
- if (this.options.disable && this.options.disable.length > 0) {
69
- const $rules = [
70
- ...this.options.disable.map((rule) => `/* eslint-disable ${rule} */`)
71
- ].join("\n");
72
- compiler.hooks.afterCompile.tap(_EslintPlugin.name, () => {
73
- const artifacts = compiler.context.artifacts || [];
74
- for (const artifact of artifacts) {
75
- artifact.anchor.append("file:start", $rules);
76
- }
77
- });
78
- }
79
- compiler.hooks.afterPersist.tapPromise(_EslintPlugin.name, async (task) => {
80
- const files = compiler.context.assets || [];
81
- if (files.length === 0) return;
82
- const eslint = new import_eslint.ESLint({ fix: true });
83
- const results = await eslint.lintFiles(files.map((file) => file.path));
84
- await import_eslint.ESLint.outputFixes(results);
85
- });
86
- }
87
- };
88
-
89
- // src/plugins/prettier/prettier.plugin.ts
90
- var import_child_process = require("child_process");
91
- var import_util = require("util");
92
- var execAsync = (0, import_util.promisify)(import_child_process.exec);
93
- var PrettierPlugin = class _PrettierPlugin {
94
- apply(compiler) {
95
- if (!compiler.options.build) return;
96
- compiler.hooks.afterPersist.tapPromise(_PrettierPlugin.name, async () => {
97
- const files = compiler.context.assets || [];
98
- if (files.length === 0) return;
99
- const filePaths = files.map((file) => file.path).join(" ");
100
- await execAsync(`prettier --write ${filePaths}`);
101
- });
102
- }
103
- };
104
-
105
- // src/plugins/body-fallback/index.ts
106
- var R19 = __toESM(require("ramda"), 1);
107
-
108
- // src/utils/json-schema-utils/is-array.ts
109
- function isArray(schema) {
110
- return schema.type === "array";
111
- }
112
-
113
- // src/utils/json-schema-utils/is-mixed.ts
114
- function isMixed(schema) {
115
- return Array.isArray(schema.type);
116
- }
117
-
118
- // src/utils/json-schema-utils/is-non-array.ts
119
- function isNonArray(schema) {
120
- return typeof schema.type === "string" && schema.type !== "array";
121
- }
122
-
123
- // src/utils/json-schema-utils/is-ref.ts
124
- function isRef(schema) {
125
- return "$ref" in schema;
126
- }
127
-
128
- // src/utils/json-schema-utils/index.ts
129
- var JsonSchemaUtils = class {
130
- static isRef = isRef;
131
- static isArray = isArray;
132
- static isNonArray = isNonArray;
133
- static isMixed = isMixed;
134
- };
135
-
136
- // src/plugins/generate-micro-function/generate-micro-function.plugin.ts
137
- var import_tapable2 = require("tapable");
138
-
139
- // src/plugins/generate-micro-function/constants/metadata-storage.ts
140
- var MetadataStorage = /* @__PURE__ */ new WeakMap();
141
-
142
- // src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts
143
- var R18 = __toESM(require("ramda"), 1);
144
- var path7 = __toESM(require("path"), 1);
145
- var changeCase6 = __toESM(require("change-case"), 1);
146
-
147
- // src/models/artifact.ts
148
- var path = __toESM(require("path"), 1);
149
-
150
- // src/models/anchor.ts
151
- var AnchorBlock = class {
152
- constructor(artifact) {
153
- this.artifact = artifact;
154
- }
155
- /**
156
- * Append content to the end of the anchor block.
157
- */
158
- append(anchorName, content) {
159
- const lines = this.artifact.content.split("\n");
160
- const anchor = `@anchor:${anchorName}:end`;
161
- const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
162
- if (anchorIndex === -1) {
163
- throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
164
- }
165
- lines.splice(anchorIndex, 0, content);
166
- this.artifact.content = lines.join("\n");
167
- }
168
- prepend(anchorName, content) {
169
- const lines = this.artifact.content.split("\n");
170
- const anchor = `@anchor:${anchorName}:start`;
171
- const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
172
- if (anchorIndex === -1) {
173
- throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
174
- }
175
- lines.splice(anchorIndex + 1, 0, content);
176
- this.artifact.content = lines.join("\n");
177
- }
178
- replace(anchorName, content) {
179
- const lines = this.artifact.content.split("\n");
180
- const startIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:start */`));
181
- const endIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:end */`));
182
- if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
183
- throw new Error(`"@anchor:${anchorName}:start" or "@anchor:${anchorName}:end" not found in artifact "${this.artifact.filepath}".`);
184
- }
185
- lines.splice(startIndex + 1, endIndex - startIndex - 1, content);
186
- this.artifact.content = lines.join("\n");
187
- }
188
- };
189
- var Anchor = class {
190
- constructor(artifact) {
191
- this.artifact = artifact;
192
- this.block = new AnchorBlock(artifact);
193
- }
194
- block;
195
- append(anchorName, content) {
196
- const lines = this.artifact.content.split("\n");
197
- const anchor = `@anchor:${anchorName}`;
198
- const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
199
- if (anchorIndex === -1) {
200
- throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
201
- }
202
- lines.splice(anchorIndex + 1, 0, content);
203
- this.artifact.content = lines.join("\n");
204
- }
205
- prepend(anchorName, content) {
206
- const lines = this.artifact.content.split("\n");
207
- const anchor = `@anchor:${anchorName}`;
208
- const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
209
- if (anchorIndex === -1) {
210
- throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
211
- }
212
- lines.splice(anchorIndex, 0, content);
213
- this.artifact.content = lines.join("\n");
214
- }
215
- };
216
-
217
- // src/models/artifact.ts
218
- var HeaderComment = [
219
- "// Code generated by keq-cli. DO NOT EDIT.",
220
- "// Code generated by keq-cli. DO NOT EDIT.",
221
- "// Code generated by keq-cli. DO NOT EDIT.",
222
- "",
223
- ""
224
- ].join("\n");
225
- var Artifact = class {
226
- id;
227
- filepath;
228
- content;
229
- extensionName;
230
- anchor = new Anchor(this);
231
- constructor(options) {
232
- this.id = options.id;
233
- this.filepath = options.filepath;
234
- this.extensionName = options.extensionName || path.extname(options.filepath);
235
- this.content = options.content;
236
- }
237
- get dirname() {
238
- return path.dirname(this.filepath);
239
- }
240
- renderer() {
241
- return `${HeaderComment}${this.content}`;
242
- }
243
- };
244
-
245
- // src/models/api-document_v3_1.ts
246
- var R3 = __toESM(require("ramda"), 1);
247
-
248
- // src/models/module-definition.ts
249
- var ModuleDefinition = class _ModuleDefinition {
250
- name;
251
- address;
252
- constructor(name, address) {
253
- this.name = name;
254
- if (typeof address === "string") {
255
- this.address = { url: address, headers: {}, encoding: "utf8" };
256
- } else {
257
- this.address = address;
258
- }
259
- }
260
- static unknown() {
261
- return new _ModuleDefinition("", { url: "", headers: {}, encoding: "utf8" });
262
- }
263
- };
264
-
265
- // src/constants/supported-methods.ts
266
- var SupportedMethods = [
267
- "get",
268
- "post",
269
- "put",
270
- "delete",
271
- "patch",
272
- "head",
273
- "options"
274
- ];
275
-
276
- // src/models/operation-definition.ts
277
- var R2 = __toESM(require("ramda"), 1);
278
-
279
- // src/utils/is-keywords.ts
280
- var keywords = [
281
- "break",
282
- "case",
283
- "catch",
284
- "continue",
285
- "default",
286
- "delete",
287
- "do",
288
- "else",
289
- "finally",
290
- "for",
291
- "function",
292
- "if",
293
- "in",
294
- "instanceof",
295
- "new",
296
- "return",
297
- "switch",
298
- "this",
299
- "throw",
300
- "try",
301
- "typeof",
302
- "var",
303
- "void",
304
- "while",
305
- "with"
306
- ];
307
- function isKeywords(str) {
308
- return keywords.includes(str);
309
- }
310
-
311
- // src/utils/is-reserved-word.ts
312
- var reservedWords = [
313
- "abstract",
314
- "boolean",
315
- "byte",
316
- "char",
317
- "class",
318
- "const",
319
- "debugger",
320
- "double",
321
- "enum",
322
- "export",
323
- "extends",
324
- "final",
325
- "float",
326
- "goto",
327
- "implements",
328
- "import",
329
- "int",
330
- "interface",
331
- "long",
332
- "native",
333
- "package",
334
- "private",
335
- "protected",
336
- "public",
337
- "short",
338
- "static",
339
- "super",
340
- "synchronized",
341
- "throws",
342
- "transient",
343
- "volatile"
344
- ];
345
- function isReservedWord(str) {
346
- return reservedWords.includes(str);
347
- }
348
-
349
- // src/models/operation-definition.ts
350
- var import_jsonpath_plus2 = require("jsonpath-plus");
351
-
352
- // src/models/schema-definition.ts
353
- var R = __toESM(require("ramda"), 1);
354
- var import_jsonpath_plus = require("jsonpath-plus");
355
- var SchemaDefinition = class _SchemaDefinition {
356
- name;
357
- schema;
358
- module;
359
- document;
360
- get id() {
361
- return `${this.module.address}#/components/schemas/${this.name}`;
362
- }
363
- constructor(args) {
364
- this.module = args.module;
365
- this.name = args.name;
366
- this.schema = args.schema;
367
- this.document = args.document;
368
- }
369
- getDependencies() {
370
- const refs = R.uniq((0, import_jsonpath_plus.JSONPath)({
371
- path: "$..*['$ref']",
372
- json: this.schema
373
- }));
374
- return refs.filter((ref) => typeof ref === "string" && !!ref.trim()).map((ref) => {
375
- const definition = this.document.dereference(ref);
376
- if (definition) return definition;
377
- return _SchemaDefinition.unknown();
378
- });
379
- }
380
- static unknown() {
381
- return new _SchemaDefinition({
382
- name: "",
383
- schema: {},
384
- module: ModuleDefinition.unknown(),
385
- document: ApiDocumentV3_1.unknown()
386
- });
387
- }
388
- static isUnknown(definition) {
389
- return definition.name === "";
390
- }
391
- };
392
-
393
- // src/models/operation-definition.ts
394
- var OperationDefinition = class {
395
- module;
396
- operationId;
397
- method;
398
- pathname;
399
- operation;
400
- document;
401
- get id() {
402
- return `${this.module.address}#/paths/${this.pathname}/${this.method}`;
403
- }
404
- constructor(args) {
405
- this.module = args.module;
406
- this.method = args.method.toLowerCase();
407
- this.pathname = args.pathname;
408
- this.document = args.document;
409
- this.operationId = this.formatOperationId(args.method, args.pathname, args.operation);
410
- this.operation = {
411
- ...args.operation,
412
- operationId: this.operationId
413
- };
414
- }
415
- formatOperationId(method, pathname, operation) {
416
- const operationId = operation.operationId;
417
- if (operationId && operationId !== "index" && !isKeywords(operationId) && !isReservedWord(operationId)) {
418
- return operationId;
419
- }
420
- return `${method}_${pathname}`.replace(/\//g, "_").replace(/-/g, "_").replace(/:/g, "$$").replace(/{(.+)}/, "$$$1");
421
- }
422
- getDependencies() {
423
- const refs = R2.uniq([
424
- ...(0, import_jsonpath_plus2.JSONPath)({
425
- path: "$.requestBody.content..schema..$ref",
426
- json: this.operation
427
- }),
428
- ...(0, import_jsonpath_plus2.JSONPath)({
429
- path: "$.responses..content..schema..$ref",
430
- json: this.operation
431
- }),
432
- ...(0, import_jsonpath_plus2.JSONPath)({
433
- path: "$.parameters..schema..$ref",
434
- json: this.operation
435
- })
436
- ]);
437
- const dependencies = refs.filter((ref) => typeof ref === "string" && ref).map((ref) => {
438
- const schemaDefinition = this.document.dereference(ref);
439
- if (schemaDefinition) return schemaDefinition;
440
- return SchemaDefinition.unknown();
441
- });
442
- return dependencies;
443
- }
444
- };
445
-
446
- // src/utils/logger.ts
447
- var import_chalk = __toESM(require("chalk"), 1);
448
- var logger = {
449
- log: (str) => console.log(import_chalk.default.green(str)),
450
- warn: (str) => console.warn(import_chalk.default.yellow(str)),
451
- error: (str) => console.error(import_chalk.default.red(str))
452
- };
453
-
454
- // src/models/api-document_v3_1.ts
455
- var ApiDocumentV3_1 = class _ApiDocumentV3_1 {
456
- module;
457
- specification;
458
- constructor(specification, module2) {
459
- this.module = module2;
460
- this.specification = specification;
461
- }
462
- get schemas() {
463
- const module2 = this.module;
464
- return Object.entries(this.specification.components?.schemas || {}).map(([name, schema]) => new SchemaDefinition({
465
- name,
466
- schema,
467
- module: module2,
468
- document: this
469
- }));
470
- }
471
- get operations() {
472
- const module2 = this.module;
473
- return Object.entries(this.specification.paths || {}).flatMap(([pathname, pathItem]) => Object.entries(pathItem || {}).filter(([method]) => SupportedMethods.includes(method.toLowerCase())).map(([method, operation]) => new OperationDefinition({
474
- method,
475
- pathname,
476
- operation,
477
- module: module2,
478
- document: this
479
- })));
480
- }
481
- isEmpty() {
482
- return R3.isEmpty(this.specification.paths);
483
- }
484
- dereference($ref) {
485
- if ($ref.startsWith("#/")) {
486
- return this.schemas.find((schema) => schema.id.endsWith($ref));
487
- }
488
- logger.warn(`The $ref(${$ref}) is not defined in ${this.module.name} openapi/swagger.`);
489
- }
490
- isRefDefined($ref) {
491
- if ($ref.startsWith("#/")) {
492
- const path10 = $ref.replace("#/", "").split("/");
493
- return R3.path(path10, this.specification) !== void 0;
494
- }
495
- return false;
496
- }
497
- static unknown() {
498
- return new _ApiDocumentV3_1({}, ModuleDefinition.unknown());
499
- }
500
- };
501
-
502
- // src/plugins/generate-declaration/generate-declaration.plugin.ts
503
- var import_tapable = require("tapable");
504
-
505
- // src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts
506
- var path6 = __toESM(require("path"), 1);
507
- var changeCase5 = __toESM(require("change-case"), 1);
508
-
509
- // src/transformers/json-schema/comment.renderer.ts
510
- var CommentRenderer = class {
511
- constructor(schema) {
512
- this.schema = schema;
513
- }
514
- render() {
515
- const schema = this.schema;
516
- const lines = ["/**"];
517
- if (schema.description) {
518
- const description = schema.description.replace("*/", "*\\/");
519
- lines.push(...description.split("\n").map((line) => ` * ${line}`));
520
- }
521
- if (schema.deprecated) {
522
- lines.push(" * @deprecated");
523
- }
524
- if (schema.readOnly) {
525
- lines.push(" * @readonly");
526
- }
527
- if (schema.format) {
528
- lines.push(` * @format ${schema.format}`);
529
- }
530
- lines.push(" */");
531
- if (lines.length === 2) return "";
532
- return lines.join("\n");
533
- }
534
- };
535
-
536
- // src/transformers/json-schema/declaration.renderer.ts
537
- var R5 = __toESM(require("ramda"), 1);
538
-
539
- // src/utils/indent.ts
540
- function indent(space, text) {
541
- if (text === "") return "";
542
- const indentation = " ".repeat(space);
543
- return text.split("\n").map((line) => line ? `${indentation}${line}` : line).join("\n");
544
- }
545
-
546
- // src/transformers/json-schema/reference.transformer.ts
547
- var R4 = __toESM(require("ramda"), 1);
548
- var ReferenceTransformer = class {
549
- static toDeclaration(schema, alias2 = R4.identity) {
550
- if (!schema.$ref || !schema.$ref.startsWith("#")) return `unknown /* ${schema.$ref.replace("*/", "*\\/")} */`;
551
- const parts = schema.$ref.split("/");
552
- return alias2(parts[parts.length - 1]) || "unknown";
553
- }
554
- };
555
-
556
- // src/transformers/json-schema/declaration.renderer.ts
557
- var DeclarationRenderer = class {
558
- constructor(schema, options = {}) {
559
- this.schema = schema;
560
- this.options = options;
561
- }
562
- render() {
563
- return this.renderSchema(this.schema);
564
- }
565
- renderSchema(schema) {
566
- if (typeof schema === "boolean") return "unknown";
567
- if (JsonSchemaUtils.isRef(schema)) return this.renderReference(schema);
568
- if (JsonSchemaUtils.isMixed(schema)) return this.renderMixed(schema);
569
- if (JsonSchemaUtils.isArray(schema)) return this.renderArray(schema);
570
- if (schema.type === "object") return this.renderObject(schema);
571
- if (schema.enum) return this.renderEnum(schema);
572
- if (schema.oneOf) return this.renderOneOf(schema);
573
- if (schema.anyOf) return this.renderAnyOf(schema);
574
- if (schema.allOf) return this.renderAllOf(schema);
575
- if (schema.type === "string") return this.renderString(schema);
576
- if (schema.type === "number") return this.renderNumber(schema);
577
- if (schema.type === "boolean") return this.renderBoolean(schema);
578
- if (schema.type === "null") return this.renderNull(schema);
579
- if (schema.type === "integer") return this.renderInteger(schema);
580
- return "unknown";
581
- }
582
- renderMixed(schema) {
583
- if (Array.isArray(schema.type)) {
584
- schema.type.map((type) => ({ ...schema, type })).map((schema2) => this.renderSchema(schema2)).join(" | ");
585
- }
586
- return "unknown";
587
- }
588
- renderReference(schema) {
589
- if (!this.options.referenceTransformer) {
590
- return ReferenceTransformer.toDeclaration(schema);
591
- }
592
- return this.options.referenceTransformer(schema);
593
- }
594
- renderArray(schema) {
595
- if (schema.items && Array.isArray(schema.items)) {
596
- const items = schema.items.map((s) => this.renderSchema(s)).join(", ");
597
- return `[${items}]`;
598
- }
599
- if (schema.items && typeof schema.items === "object") {
600
- return `${this.renderSchema(schema.items)}[]`;
601
- }
602
- return "any[]";
603
- }
604
- renderObject(schema) {
605
- if ((!schema.properties || R5.isEmpty(schema.properties)) && (!schema.additionalProperties || R5.isEmpty(schema.additionalProperties))) {
606
- return "object";
607
- }
608
- const $properties = Object.entries(schema.properties || {}).map(([propertyName, propertySchema]) => {
609
- let $comment = new CommentRenderer(propertySchema).render();
610
- if ($comment) $comment += "\n";
611
- const $key = `"${propertyName}"${schema.required?.includes(propertyName) ? "" : "?"}`;
612
- const $value = this.renderSchema(propertySchema);
613
- return indent(2, `${$comment}${$key}: ${$value}`);
614
- });
615
- if (schema.additionalProperties) {
616
- const $value = schema.additionalProperties === true ? "any" : this.renderSchema(schema.additionalProperties);
617
- $properties.push(indent(2, `[key: string]: ${$value}`));
618
- }
619
- return [
620
- "{",
621
- ...$properties,
622
- "}"
623
- ].join("\n");
624
- }
625
- renderOneOf(schema) {
626
- if (!schema.oneOf) return "unknown";
627
- return schema.oneOf.map((s) => this.renderSchema(s)).join(" | ");
628
- }
629
- renderAnyOf(schema) {
630
- if (!schema.anyOf) return "unknown";
631
- return schema.anyOf.map((s) => this.renderSchema(s)).join(" | ");
632
- }
633
- renderAllOf(schema) {
634
- if (!schema.allOf) return "unknown";
635
- return schema.allOf.map((s) => this.renderSchema(s)).join(" & ");
636
- }
637
- renderEnum(schema) {
638
- if (!schema.enum) return "unknown";
639
- return schema.enum.map((v) => JSON.stringify(v)).join(" | ");
640
- }
641
- renderString(schema) {
642
- if (schema.contentMediaType === "application/octet-stream") return "Blob | Buffer";
643
- if (schema.format === "binary") return "Blob | Buffer";
644
- return "string";
645
- }
646
- renderNumber(schema) {
647
- return "number";
648
- }
649
- renderBoolean(schema) {
650
- return "boolean";
651
- }
652
- renderNull(schema) {
653
- return "null";
654
- }
655
- renderInteger(schema) {
656
- return "number";
657
- }
658
- };
659
-
660
- // src/transformers/json-schema/json-schema.transformer.ts
661
- var JsonSchemaTransformer = class {
662
- static toComment(schema) {
663
- return new CommentRenderer(schema).render();
664
- }
665
- static toDeclaration(schema, options) {
666
- return new DeclarationRenderer(schema, options).render();
667
- }
668
- };
669
-
670
- // src/transformers/schema-definition/schema-definition.transformer.ts
671
- var R6 = __toESM(require("ramda"), 1);
672
- var SchemaDefinitionTransformer = class {
673
- static toDeclaration(schemaDefinition, options) {
674
- const dependencies = schemaDefinition.getDependencies();
675
- let $dependencies = dependencies.filter((dep) => !SchemaDefinition.isUnknown(dep)).map((dep) => {
676
- const filepath = options.getDependentSchemaDefinitionFilepath(dep);
677
- return `import type { ${dep.name} } from "${filepath}"`;
678
- }).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, options.esm ? ' from "$1.js"' : ' from "$1"')).join("\n");
679
- if ($dependencies) $dependencies += "\n";
680
- let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema);
681
- if ($comment) $comment += "\n";
682
- if (typeof schemaDefinition.schema === "boolean") {
683
- return [
684
- "/* @anchor:file:start */",
685
- "",
686
- $dependencies,
687
- $comment || void 0,
688
- `type ${schemaDefinition.name} = unknown`,
689
- "",
690
- "/* @anchor:file:end */"
691
- ].filter(R6.isNotNil).join("\n");
692
- }
693
- if (JsonSchemaUtils.isNonArray(schemaDefinition.schema) && schemaDefinition.schema.type === "object") {
694
- const $schema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema);
695
- const $declaration = $schema.startsWith("{") ? `export interface ${schemaDefinition.name} ${$schema}` : `export type ${schemaDefinition.name} = ${$schema}`;
696
- return [
697
- "/* @anchor:file:start */",
698
- "",
699
- $dependencies,
700
- $comment || void 0,
701
- $declaration,
702
- "",
703
- "/* @anchor:file:end */"
704
- ].filter(R6.isNotNil).join("\n");
705
- }
706
- return [
707
- "/* @anchor:file:start */",
708
- "",
709
- $dependencies,
710
- $comment || void 0,
711
- `export type ${schemaDefinition.name} = ${JsonSchemaTransformer.toDeclaration(schemaDefinition.schema)}`,
712
- "",
713
- "/* @anchor:file:end */"
714
- ].filter(R6.isNotNil).join("\n");
715
- }
716
- };
717
-
718
- // src/transformers/operation-definition/comment.renderer.ts
719
- var R7 = __toESM(require("ramda"), 1);
720
- var CommentRenderer2 = class {
721
- constructor(operationDefinition) {
722
- this.operationDefinition = operationDefinition;
723
- }
724
- render() {
725
- const operation = this.operationDefinition.operation;
726
- if (!operation.summary && !operation.description) return "";
727
- const lines = ["/**"];
728
- if (operation.summary && typeof operation.summary === "string") {
729
- lines.push(` * ${R7.trim(operation.summary)}`);
730
- lines.push(" *");
731
- }
732
- if (operation.description && typeof operation.description === "string") {
733
- lines.push(` * @description ${R7.trim(operation.description)}`);
734
- }
735
- lines.push(" */");
736
- return lines.join("\n");
737
- }
738
- };
739
-
740
- // src/transformers/operation-definition/declaration.renderer.ts
741
- var R12 = __toESM(require("ramda"), 1);
742
-
743
- // src/transformers/operation-definition/utils/type-name-factory.ts
744
- var changeCase = __toESM(require("change-case"), 1);
745
- function typeNameFactory(operationDefinition) {
746
- const pascalCaseOperationId = changeCase.pascalCase(operationDefinition.operationId);
747
- return (name) => `${pascalCaseOperationId}${name}`;
748
- }
749
-
750
- // src/utils/openapi-utils/dereference.ts
751
- function dereference($ref, swagger) {
752
- let value;
753
- for (const key of $ref.split("/")) {
754
- if (key === "#") {
755
- value = swagger;
756
- } else {
757
- value = value[key];
758
- }
759
- if (!value) break;
760
- }
761
- return value;
762
- }
763
-
764
- // src/utils/openapi-utils/dereference-operation.ts
765
- var R10 = __toESM(require("ramda"), 1);
766
- var import_jsonpointer2 = __toESM(require("jsonpointer"), 1);
767
- var import_jsonpath_plus4 = require("jsonpath-plus");
768
-
769
- // src/utils/openapi-utils/remove-undefined-ref.ts
770
- var R9 = __toESM(require("ramda"), 1);
771
- var import_jsonpointer = __toESM(require("jsonpointer"), 1);
772
- var import_jsonpath_plus3 = require("jsonpath-plus");
773
-
774
- // src/utils/openapi-utils/is-ref-defined.ts
775
- var R8 = __toESM(require("ramda"), 1);
776
- function isRefDefined($ref, swagger) {
777
- if ($ref.startsWith("#/")) {
778
- const path10 = $ref.replace("#/", "").split("/");
779
- return R8.path(path10, swagger) !== void 0;
780
- }
781
- return false;
782
- }
783
-
784
- // src/utils/openapi-utils/remove-undefined-ref.ts
785
- function removeUndefinedRef(swagger) {
786
- const shadow = R9.clone(swagger);
787
- const matches = (0, import_jsonpath_plus3.JSONPath)({
788
- path: "$..*['$ref']^",
789
- json: swagger,
790
- resultType: "all"
791
- });
792
- for (const match of matches) {
793
- if (match.value.$ref && !isRefDefined(match.value.$ref, swagger)) {
794
- import_jsonpointer.default.set(shadow, match.pointer, R9.omit(["$ref"], match.value));
795
- }
796
- }
797
- return shadow;
798
- }
799
-
800
- // src/utils/openapi-utils/dereference-operation.ts
801
- function dereferencePathObject(swagger) {
802
- const matches = (0, import_jsonpath_plus4.JSONPath)({
803
- path: "$.paths.*.$ref^",
804
- json: swagger,
805
- resultType: "all"
806
- });
807
- for (const match of matches) {
808
- const value = dereference(match.value.$ref, swagger);
809
- import_jsonpointer2.default.set(swagger, match.pointer, value);
810
- }
811
- }
812
- function dereferenceRequestBody(swagger) {
813
- const matches = (0, import_jsonpath_plus4.JSONPath)({
814
- path: "$.paths.*.*.requestBody.$ref^",
815
- json: swagger,
816
- resultType: "all"
817
- });
818
- for (const match of matches) {
819
- const value = dereference(match.value.$ref, swagger);
820
- import_jsonpointer2.default.set(swagger, match.pointer, value);
821
- }
822
- }
823
- function dereferenceResponses(swagger) {
824
- const matches = [
825
- ...(0, import_jsonpath_plus4.JSONPath)({
826
- path: "$.paths.*.*.responses.*.$ref^",
827
- json: swagger,
828
- resultType: "all"
829
- }),
830
- ...(0, import_jsonpath_plus4.JSONPath)({
831
- path: "$.paths.*.*.responses.*.headers.*.$ref^",
832
- json: swagger,
833
- resultType: "all"
834
- })
835
- ];
836
- for (const match of matches) {
837
- const value = dereference(match.value.$ref, swagger);
838
- import_jsonpointer2.default.set(swagger, match.pointer, value);
839
- }
840
- }
841
- function dereferenceParameters(swagger) {
842
- const matches = (0, import_jsonpath_plus4.JSONPath)({
843
- path: "$.paths.*.*.parameters.*.$ref^",
844
- json: swagger,
845
- resultType: "all"
846
- });
847
- for (const match of matches) {
848
- const value = dereference(match.value.$ref, swagger);
849
- import_jsonpointer2.default.set(swagger, match.pointer, value);
850
- }
851
- }
852
- function dereferenceOperation(swagger) {
853
- const shadow = R10.clone(swagger);
854
- dereferencePathObject(shadow);
855
- dereferenceRequestBody(shadow);
856
- dereferenceResponses(shadow);
857
- dereferenceParameters(shadow);
858
- return removeUndefinedRef(shadow);
859
- }
860
-
861
- // src/utils/openapi-utils/dereference-deep.ts
862
- function dereferenceDeep($ref, swagger) {
863
- const stack = [$ref];
864
- let value;
865
- while (true) {
866
- const last = stack[stack.length - 1];
867
- value = dereference(last, swagger);
868
- if (JsonSchemaUtils.isRef(value)) {
869
- if (!stack.includes(value.$ref)) {
870
- stack.push(value.$ref);
871
- continue;
872
- } else {
873
- throw new Error(`Circular reference detected: ${stack.join(" -> ")} -> ${value.$ref}`);
874
- }
875
- }
876
- break;
877
- }
878
- return value;
879
- }
880
-
881
- // src/utils/openapi-utils/to-3_1.ts
882
- var import_openapi_parser = require("@scalar/openapi-parser");
883
- function To3_1(openapi) {
884
- const { specification } = (0, import_openapi_parser.upgrade)(openapi);
885
- return specification;
886
- }
887
-
888
- // src/utils/openapi-utils/map-operation.ts
889
- var R11 = __toESM(require("ramda"), 1);
890
- function mapOperation(specification, mapper) {
891
- const shadow = R11.clone(specification);
892
- for (const [pathname, pathItem] of Object.entries(shadow.paths || {})) {
893
- for (const m in pathItem) {
894
- const method = m.toLowerCase();
895
- if (!SupportedMethods.includes(method)) continue;
896
- if (typeof pathItem[m] !== "object" || Array.isArray(pathItem[m]) || pathItem[m] === null) continue;
897
- const operation = pathItem[m];
898
- pathItem[m] = mapper(method, pathname, operation);
899
- }
900
- }
901
- return shadow;
902
- }
903
-
904
- // src/utils/openapi-utils/map-parameter.ts
905
- function mapParameter(specification, mapper) {
906
- return mapOperation(specification, (method, pathname, operation) => {
907
- if (!operation.parameters) return operation;
908
- operation.parameters = operation.parameters.map((parameter) => mapper(method, pathname, operation, parameter));
909
- return operation;
910
- });
911
- }
912
-
913
- // src/utils/openapi-utils/index.ts
914
- var OpenapiUtils = class {
915
- static isRefDefined = isRefDefined;
916
- static dereference = dereference;
917
- static dereferenceDeep = dereferenceDeep;
918
- static removeUndefinedRef = removeUndefinedRef;
919
- static dereferenceOperation = dereferenceOperation;
920
- static mapOperation = mapOperation;
921
- static mapParameter = mapParameter;
922
- // static updateOperationId = updateOperationId
923
- static to3_1 = To3_1;
924
- };
925
-
926
- // src/transformers/operation-definition/declaration.renderer.ts
927
- var alias = (name) => `${name}Schema`;
928
- var DeclarationRenderer2 = class {
929
- constructor(operationDefinition, options) {
930
- this.operationDefinition = operationDefinition;
931
- this.options = options;
932
- this.typeName = typeNameFactory(operationDefinition);
933
- }
934
- typeName;
935
- renderResponseBodies(operation, options) {
936
- if (!operation.responses || R12.isEmpty(operation.responses)) {
937
- return `export interface ${this.typeName("ResponseBodies")} {}`;
938
- }
939
- const $responses = Object.entries(operation.responses).map(([statusCode, response]) => {
940
- if (!JsonSchemaUtils.isRef(response)) {
941
- const $value = Object.entries(response.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schema]) => {
942
- if (mediaType.includes("text/event-stream")) return "ReadableStream<ServerSentEvent>";
943
- if (mediaType.includes("multipart/form-data")) return "FormData";
944
- if (!schema) return "unknown";
945
- return JsonSchemaTransformer.toDeclaration(schema, options);
946
- }).join(" | ");
947
- return indent(2, `${statusCode}: ${$value || "void"}`);
948
- }
949
- }).join("\n");
950
- return [
951
- `export interface ${this.typeName("ResponseBodies")} {`,
952
- $responses,
953
- "}"
954
- ].join("\n");
955
- }
956
- renderRequestBodies(operation, options) {
957
- let $requestBodies = `export interface ${this.typeName("RequestBodies")} {}`;
958
- if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {
959
- const $mediaTypes = Object.entries(operation.requestBody.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schema]) => {
960
- if (!schema) return `${JSON.stringify(mediaType)}: unknown`;
961
- return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schema, options)}`;
962
- }).map((pair) => indent(2, pair));
963
- $requestBodies = [
964
- `export interface ${this.typeName("RequestBodies")} {`,
965
- ...$mediaTypes,
966
- "}"
967
- ].join("\n");
968
- }
969
- return $requestBodies;
970
- }
971
- renderParameterBodies(operationDefinition, options) {
972
- const { operation } = operationDefinition;
973
- let parameterBodies = "";
974
- if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {
975
- const $mediaTypes = Object.entries(operation.requestBody.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schemaOrRef]) => {
976
- if (!schemaOrRef) return `${JSON.stringify(mediaType)}: unknown`;
977
- const schema = JsonSchemaUtils.isRef(schemaOrRef) ? OpenapiUtils.dereferenceDeep(schemaOrRef.$ref, operationDefinition.document.specification) : schemaOrRef;
978
- if (schema.type === "object" || schema.properties) {
979
- return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schemaOrRef, options)} & { [key: string]: any }`;
980
- }
981
- return `${JSON.stringify(mediaType)}: { [key: string]: any }`;
982
- }).map((pair) => indent(2, pair));
983
- parameterBodies = [
984
- `interface ${this.typeName("ParameterBodies")} {`,
985
- ...$mediaTypes,
986
- "}",
987
- ""
988
- ].join("\n");
989
- }
990
- return parameterBodies;
991
- }
992
- renderRequestParameters(operation, options) {
993
- const mediaTypes = operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody) ? Object.keys(operation.requestBody.content || {}) : [];
994
- const base = `${this.typeName("RequestQuery")} & ${this.typeName("RouteParameters")} & ${this.typeName("RequestHeaders")}`;
995
- if (mediaTypes.length === 1) {
996
- return `export type ${this.typeName("RequestParameters")} = ${base} & ${this.typeName("RequestBodies")}[${JSON.stringify(mediaTypes[0])}]`;
997
- }
998
- if (mediaTypes.length > 1) {
999
- const unions = mediaTypes.map((mediaType) => `(${base} & ${this.typeName("RequestBodies")}[${JSON.stringify(mediaType)}] & { "content-type": ${JSON.stringify(mediaType)} })`).join("\n| ");
1000
- return `export type ${this.typeName("RequestParameters")} = ${unions}`;
1001
- }
1002
- return `export type ${this.typeName("RequestParameters")} = ${base}`;
1003
- }
1004
- rendererParameters(name, parameters, options) {
1005
- if (parameters.length === 0) {
1006
- return `export type ${name} = {}`;
1007
- }
1008
- const $parameters = parameters.map((parameter) => {
1009
- const parameterName = `"${parameter.name}"`;
1010
- const $key = parameter.required ? parameterName : `${parameterName}?`;
1011
- const $value = JsonSchemaTransformer.toDeclaration(parameter.schema || { type: "any" }, options);
1012
- return indent(2, `${$key}: ${$value}`);
1013
- }).join("\n");
1014
- return [
1015
- `export type ${name} = {`,
1016
- $parameters,
1017
- "}"
1018
- ].filter(Boolean).join("\n");
1019
- }
1020
- renderDependencies() {
1021
- const schemaDefinitions = this.operationDefinition.getDependencies().filter((schemaDefinition) => !SchemaDefinition.isUnknown(schemaDefinition));
1022
- const $schemaDefinitions = schemaDefinitions.map((schemaDefinition) => {
1023
- const filepath = this.options.getDependentSchemaDefinitionFilepath(schemaDefinition);
1024
- const schemaName = schemaDefinition.name;
1025
- return `import type { ${schemaName} as ${alias(schemaName)} } from "${filepath}"`;
1026
- }).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"'));
1027
- return [
1028
- 'import type { KeqOperation, KeqPathParameterInit, KeqQueryInit, ServerSentEvent } from "keq"',
1029
- ...$schemaDefinitions
1030
- ].join("\n");
1031
- }
1032
- render() {
1033
- const { operation } = this.operationDefinition;
1034
- if (!operation.responses) return "";
1035
- const jsonSchemaDeclarationRendererOptions = {
1036
- referenceTransformer: (schema) => {
1037
- return ReferenceTransformer.toDeclaration(schema, alias);
1038
- }
1039
- };
1040
- const $dependencies = this.renderDependencies();
1041
- const $responseBodies = this.renderResponseBodies(operation, jsonSchemaDeclarationRendererOptions);
1042
- const $requestBodies = this.renderRequestBodies(operation, jsonSchemaDeclarationRendererOptions);
1043
- const $parameterBodies = this.renderParameterBodies(this.operationDefinition, jsonSchemaDeclarationRendererOptions);
1044
- const $requestParameters = this.renderRequestParameters(operation, jsonSchemaDeclarationRendererOptions);
1045
- const $requestQuery = this.rendererParameters(
1046
- `${this.typeName("RequestQuery")}`,
1047
- operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "query") || [],
1048
- jsonSchemaDeclarationRendererOptions
1049
- );
1050
- const $routeParameters = this.rendererParameters(
1051
- `${this.typeName("RouteParameters")}`,
1052
- operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "path") || [],
1053
- jsonSchemaDeclarationRendererOptions
1054
- );
1055
- const $requestHeaders = this.rendererParameters(
1056
- `${this.typeName("RequestHeaders")}`,
1057
- operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "header") || [],
1058
- jsonSchemaDeclarationRendererOptions
1059
- );
1060
- return [
1061
- "/* @anchor:file:start */",
1062
- "",
1063
- $dependencies,
1064
- "",
1065
- $responseBodies,
1066
- "",
1067
- $requestBodies,
1068
- "",
1069
- $requestQuery,
1070
- "",
1071
- $routeParameters,
1072
- "",
1073
- $requestHeaders,
1074
- "",
1075
- $parameterBodies || void 0,
1076
- $requestParameters,
1077
- "",
1078
- `export interface ${this.typeName("Operation")}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${$parameterBodies ? `keyof ${this.typeName("ParameterBodies")}` : "string"} > extends KeqOperation {`,
1079
- ` requestParams: ${this.typeName("RouteParameters")} & { [key: string]: KeqPathParameterInit }`,
1080
- ` requestQuery: ${this.typeName("RequestQuery")} & { [key: string]: KeqQueryInit }`,
1081
- ` requestHeaders: ${this.typeName("RequestHeaders")} & { [key: string]: string | number }`,
1082
- ` requestBody: ${$parameterBodies ? `${this.typeName("ParameterBodies")}[CONTENT_TYPE] | ` : "object | "}BodyInit`,
1083
- ` responseBody: ${this.typeName("ResponseBodies")}[STATUS]`,
1084
- "}",
1085
- "",
1086
- "/* @anchor:file:end */"
1087
- ].filter(R12.isNotNil).join("\n");
1088
- }
1089
- };
1090
-
1091
- // src/transformers/operation-definition/micro-function.renderer.ts
1092
- var R14 = __toESM(require("ramda"), 1);
1093
-
1094
- // src/exception.ts
1095
- var import_ts_custom_error = require("ts-custom-error");
1096
- var import_word_wrap = __toESM(require("word-wrap"), 1);
1097
- var Exception = class extends import_ts_custom_error.CustomError {
1098
- constructor(module2, message) {
1099
- const moduleName = typeof module2 === "string" ? module2 : module2.name;
1100
- const msg = (0, import_word_wrap.default)(message, { width: 60, indent: " " });
1101
- super(`${moduleName} module failed to compile:
1102
- ${msg}`);
1103
- Object.defineProperty(this, "name", { value: "KeqCLI_Exception" });
1104
- }
1105
- };
1106
-
1107
- // src/transformers/operation-definition/typescript-snippet.ts
1108
- var R13 = __toESM(require("ramda"), 1);
1109
-
1110
- // src/constants/qs-array-format.ts
1111
- var QsArrayFormat = /* @__PURE__ */ ((QsArrayFormat2) => {
1112
- QsArrayFormat2["brackets"] = "brackets";
1113
- QsArrayFormat2["indices"] = "indices";
1114
- QsArrayFormat2["repeat"] = "repeat";
1115
- QsArrayFormat2["comma"] = "comma";
1116
- QsArrayFormat2["space"] = "space";
1117
- QsArrayFormat2["pipe"] = "pipe";
1118
- return QsArrayFormat2;
1119
- })(QsArrayFormat || {});
1120
-
1121
- // src/transformers/operation-definition/typescript-snippet.ts
1122
- var OperationDefinitionSnippet = class {
1123
- constructor(operationDefinition, options) {
1124
- this.operationDefinition = operationDefinition;
1125
- this.options = options;
1126
- this.typeName = typeNameFactory(operationDefinition);
1127
- }
1128
- typeName;
1129
- getQsParameters(parameter) {
1130
- let arrayFormat;
1131
- let allowDots;
1132
- let indices;
1133
- const style = parameter.style || "form";
1134
- const explode = parameter.explode ?? true;
1135
- if ("x-qs-array-format" in parameter) {
1136
- arrayFormat = parameter["x-qs-array-format"];
1137
- } else {
1138
- if (style === "deepObject") {
1139
- arrayFormat = "brackets" /* brackets */;
1140
- } else if (explode) {
1141
- arrayFormat = "repeat" /* repeat */;
1142
- } else {
1143
- if (style === "form") {
1144
- arrayFormat = "comma" /* comma */;
1145
- } else if (style === "spaceDelimited") {
1146
- arrayFormat = "space" /* space */;
1147
- } else if (style === "pipeDelimited") {
1148
- arrayFormat = "pipe" /* pipe */;
1149
- }
1150
- }
1151
- }
1152
- if ("x-qs-allow-dots" in parameter) {
1153
- allowDots = Boolean(parameter["x-qs-allow-dots"]);
1154
- }
1155
- if ("x-qs-indices" in parameter) {
1156
- indices = Boolean(parameter["x-qs-indices"]);
1157
- }
1158
- if (arrayFormat || allowDots !== void 0 || indices !== void 0) {
1159
- return {
1160
- ...arrayFormat ? { arrayFormat } : {},
1161
- ...allowDots !== void 0 ? { allowDots } : {},
1162
- ...indices !== void 0 ? { indices } : {}
1163
- };
1164
- }
1165
- return void 0;
1166
- }
1167
- // render: "if (args && 'Authorization' in args) req.header('Authorization', args['Authorization'])"
1168
- renderRequestHeaders() {
1169
- const { operation } = this.operationDefinition;
1170
- const $headers = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "header").map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.header(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`).join("\n");
1171
- return $headers;
1172
- }
1173
- // render: "if (args && 'id' in args) req.query('id', args['id'], options)"
1174
- renderRequestQuery() {
1175
- const { operation } = this.operationDefinition;
1176
- const $query = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "query").map((p) => {
1177
- const option = this.getQsParameters(p);
1178
- const $option = !option || R13.isEmpty(option) ? "" : `, ${JSON.stringify(option)}`;
1179
- return `if (args && ${JSON.stringify(p.name)} in args) req.query(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}]${$option})`;
1180
- }).join("\n");
1181
- return $query;
1182
- }
1183
- // render: "if (args && 'id' in args) req.params('id', args['id'])"
1184
- renderRequestPathParameters() {
1185
- const { operation } = this.operationDefinition;
1186
- const $pathParameters = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "path").map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.params(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`).join("\n");
1187
- return $pathParameters;
1188
- }
1189
- getRequestMediaTypes() {
1190
- const { operation } = this.operationDefinition;
1191
- const requestBodyContent = operation.requestBody?.content || {};
1192
- return Object.keys(requestBodyContent);
1193
- }
1194
- // render "req.type("application/json")"
1195
- renderMediaType() {
1196
- const mediaTypes = this.getRequestMediaTypes();
1197
- if (mediaTypes.length === 1 && !mediaTypes[0].endsWith("/*")) {
1198
- return `req.type("${mediaTypes[0]}")
1199
- `;
1200
- } else if (mediaTypes.some((mediaType) => mediaType === "*/*")) {
1201
- } else if (mediaTypes.some((mediaType) => mediaType.endsWith("/*"))) {
1202
- return 'if(args?.["content-type"]) req.type(args["content-type"])\n';
1203
- } else if (mediaTypes.length > 1) {
1204
- return 'if(args?.["content-type"]) req.type(args["content-type"])\n';
1205
- }
1206
- return "";
1207
- }
1208
- // render body
1209
- requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType) {
1210
- try {
1211
- const $propertyName = JSON.stringify(propertyName);
1212
- const schema = JsonSchemaUtils.isRef(propertySchema) ? OpenapiUtils.dereferenceDeep(propertySchema.$ref, this.operationDefinition.document.specification) : propertySchema;
1213
- if (schema.type === "string" && schema.format === "binary" || schema.contentMediaType === "application/octet-stream") {
1214
- return `if (args && ${$propertyName} in args && args[${$propertyName}]) req.attach(${$propertyName}, args[${$propertyName}])`;
1215
- } else if (schema.type === "string" || schema.type === "array" && schema.items && schema.items.type === "string") {
1216
- return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, args[${$propertyName}])`;
1217
- } else if (schema.type === "number" || schema.type === "integer") {
1218
- return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, String(args[${$propertyName}]))`;
1219
- }
1220
- return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, String(args[${$propertyName}]) /* type is non-string in schema; triggers type coercion here */)`;
1221
- } catch (err) {
1222
- return this.renderErrorComment(err, mediaType);
1223
- }
1224
- }
1225
- requestBodyPropertyRenderer(propertyName, propertySchema, mediaType) {
1226
- if (mediaType === "application/json") {
1227
- const $propertyName = JSON.stringify(propertyName);
1228
- return `if (args && ${$propertyName} in args) req.send({ ${$propertyName}: args[${$propertyName}] })`;
1229
- } else if (mediaType === "multipart/form-data") {
1230
- return this.requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType);
1231
- } else {
1232
- throw new Error(`Unsupported media type: ${mediaType}`);
1233
- }
1234
- }
1235
- renderRequestBody() {
1236
- const { operation } = this.operationDefinition;
1237
- const requestBodyContent = operation.requestBody?.content || {};
1238
- const $requestBody = Object.entries(requestBodyContent).map(([mediaType, mediaTypeObject]) => {
1239
- if (!mediaTypeObject.schema) return;
1240
- try {
1241
- const schema = JsonSchemaUtils.isRef(mediaTypeObject.schema) ? OpenapiUtils.dereferenceDeep(mediaTypeObject.schema.$ref, this.operationDefinition.document.specification) : mediaTypeObject.schema;
1242
- if (schema.type !== "object") return;
1243
- const properties = schema.properties || {};
1244
- return Object.entries(properties).map(([propertyName, propertySchema]) => this.requestBodyPropertyRenderer(propertyName, propertySchema, mediaType)).join("\n");
1245
- } catch (err) {
1246
- return this.renderErrorComment(err, mediaType);
1247
- }
1248
- }).filter(R13.isNotNil).join("\n");
1249
- return $requestBody;
1250
- }
1251
- renderErrorComment(err, mediaType) {
1252
- const $err = String(err).split("\n").map(((line) => ` * ${line}`)).join("\n");
1253
- return [
1254
- "/**",
1255
- ` * Unable to dereference schema for media type ${mediaType}`,
1256
- $err,
1257
- " */"
1258
- ].join("\n");
1259
- }
1260
- };
1261
-
1262
- // src/transformers/operation-definition/micro-function.renderer.ts
1263
- var OperationDefinitionMicroFunctionRenderer = class {
1264
- constructor(operationDefinition, options) {
1265
- this.operationDefinition = operationDefinition;
1266
- this.options = options;
1267
- this.typeName = typeNameFactory(operationDefinition);
1268
- this.helper = new OperationDefinitionSnippet(operationDefinition, options);
1269
- }
1270
- helper;
1271
- typeName;
1272
- render() {
1273
- const { operation, operationId, method, pathname } = this.operationDefinition;
1274
- if (!operation.responses) return "";
1275
- const $dependencies = this.renderDependencies();
1276
- const $comment = new CommentRenderer2(this.operationDefinition).render();
1277
- const moduleName = this.operationDefinition.module.name;
1278
- const $method = method.toLowerCase();
1279
- const $queryParameters = this.helper.renderRequestQuery();
1280
- const $headerParameters = this.helper.renderRequestHeaders();
1281
- const $pathParameters = this.helper.renderRequestPathParameters();
1282
- const $mediaType = this.helper.renderMediaType();
1283
- const $requestBody = this.helper.renderRequestBody();
1284
- const $operationDeclaration = this.renderOperationDeclaration();
1285
- return [
1286
- "/* @anchor:file:start */",
1287
- "",
1288
- $dependencies,
1289
- "",
1290
- `const moduleName = "${moduleName}"`,
1291
- `const method = "${method}"`,
1292
- `const pathname = "${pathname}"`,
1293
- "",
1294
- $comment || void 0,
1295
- `export ${$operationDeclaration} {`,
1296
- ` const req = request.${$method}<${this.typeName("ResponseBodies")}[STATUS]>("${pathname}")`,
1297
- " .option('module', { name: moduleName, pathname, method })",
1298
- "",
1299
- $mediaType ? indent(2, $mediaType) : void 0,
1300
- " /* @anchor:query:start */",
1301
- $queryParameters ? indent(2, $queryParameters) : void 0,
1302
- " /* @anchor:query:end */",
1303
- "",
1304
- " /* @anchor:headers:start */",
1305
- $headerParameters ? indent(2, $headerParameters) : void 0,
1306
- " /* @anchor:headers:end */",
1307
- "",
1308
- " /* @anchor:path-parameters:start */",
1309
- $pathParameters ? indent(2, $pathParameters) : void 0,
1310
- " /* @anchor:path-parameters:end */",
1311
- "",
1312
- " /* @anchor:body:start */",
1313
- $requestBody ? indent(2, $requestBody) : void 0,
1314
- " /* @anchor:body:end */",
1315
- "",
1316
- " /* @anchor:operation-return */",
1317
- ` return req as ReturnType<typeof ${operationId}<STATUS${$operationDeclaration.includes("CONTENT_TYPE") ? ", CONTENT_TYPE" : ""}>>`,
1318
- "}",
1319
- "",
1320
- `${operationId}.pathname = pathname`,
1321
- `${operationId}.method = method`,
1322
- "/* @anchor:file:end */"
1323
- ].filter(R14.isNotNil).join("\n");
1324
- }
1325
- renderDependencies() {
1326
- const declarationFilepath = this.options.getOperationDefinitionDeclarationFilepath(this.operationDefinition);
1327
- const requestFilepath = this.options.getRequestFilepath();
1328
- return [
1329
- 'import { Keq } from "keq"',
1330
- `import { request } from "${requestFilepath}"`,
1331
- `import type { ${this.typeName("Operation")}, ${this.typeName("ResponseBodies")}, ${this.typeName("RequestParameters")} } from "${declarationFilepath}"`,
1332
- `export type { ${this.typeName("RequestQuery")}, ${this.typeName("RequestHeaders")}, ${this.typeName("RequestBodies")} } from "${declarationFilepath}"`
1333
- ].map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"')).join("\n");
1334
- }
1335
- renderOperationDeclaration() {
1336
- const { operationId } = this.operationDefinition;
1337
- const mediaTypes = this.helper.getRequestMediaTypes();
1338
- if (mediaTypes.length === 0) {
1339
- return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends never = never>(args?: ${this.typeName("RequestParameters")}): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1340
- } else if (mediaTypes.length === 1) {
1341
- return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${this.typeName("RequestParameters")}): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1342
- } else if (mediaTypes.length > 1) {
1343
- return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${this.typeName("RequestParameters")}["content-type"]>(args?: Extract<${this.typeName("RequestParameters")}, { "content-type": CONTENT_TYPE }>): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1344
- }
1345
- throw new Exception(this.operationDefinition.module, "[operationDeclarationRenderer] Unreachable");
1346
- }
1347
- };
1348
-
1349
- // src/transformers/operation-definition/nestjs-method.renderer.ts
1350
- var R15 = __toESM(require("ramda"), 1);
1351
- var OperationDefinitionNestjsMethodRenderer = class {
1352
- constructor(operationDefinition, options) {
1353
- this.operationDefinition = operationDefinition;
1354
- this.options = options;
1355
- this.typeName = typeNameFactory(operationDefinition);
1356
- this.helper = new OperationDefinitionSnippet(operationDefinition, options);
1357
- }
1358
- helper;
1359
- typeName;
1360
- render() {
1361
- const pathname = this.operationDefinition.pathname;
1362
- const $comment = new CommentRenderer2(this.operationDefinition).render();
1363
- const $method = this.operationDefinition.method.toLowerCase();
1364
- const $mediaType = this.helper.renderMediaType();
1365
- const $operationDeclaration = this.renderOperationDeclaration(this.operationDefinition);
1366
- const $queryParameters = this.helper.renderRequestQuery();
1367
- const $headerParameters = this.helper.renderRequestHeaders();
1368
- const $pathParameters = this.helper.renderRequestPathParameters();
1369
- const $requestBody = this.helper.renderRequestBody();
1370
- return [
1371
- $comment,
1372
- `${$operationDeclaration} {`,
1373
- ` const req = this.request.${$method}<${this.typeName("ResponseBodies")}[STATUS]>(${JSON.stringify(pathname)})`,
1374
- " .option(",
1375
- ' "module",',
1376
- " {",
1377
- ` name: ${JSON.stringify(this.operationDefinition.module.name)},`,
1378
- ` pathname: ${JSON.stringify(pathname)},`,
1379
- ` method: ${JSON.stringify($method)},`,
1380
- " },",
1381
- " )",
1382
- "",
1383
- $mediaType ? indent(2, $mediaType) : void 0,
1384
- "",
1385
- " /* @anchor:query:start */",
1386
- $queryParameters ? indent(2, $queryParameters) : void 0,
1387
- " /* @anchor:query:end */",
1388
- "",
1389
- " /* @anchor:headers:start */",
1390
- $headerParameters ? indent(2, $headerParameters) : void 0,
1391
- " /* @anchor:headers:end */",
1392
- "",
1393
- " /* @anchor:path-parameters:start */",
1394
- $pathParameters ? indent(2, $pathParameters) : void 0,
1395
- " /* @anchor:path-parameters:end */",
1396
- "",
1397
- " /* @anchor:body:start */",
1398
- $requestBody ? indent(2, $requestBody) : void 0,
1399
- " /* @anchor:body:end */",
1400
- "",
1401
- " return req",
1402
- "}"
1403
- ].filter(R15.isNotNil).join("\n");
1404
- }
1405
- renderOperationDeclaration(operationDefinition) {
1406
- const { operationId } = operationDefinition;
1407
- const typeName = typeNameFactory(operationDefinition);
1408
- const mediaTypes = this.helper.getRequestMediaTypes();
1409
- if (mediaTypes.length === 0) {
1410
- return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends never = never>(args?: ${typeName("RequestParameters")}): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1411
- } else if (mediaTypes.length === 1) {
1412
- return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${typeName("RequestParameters")}): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1413
- } else if (mediaTypes.length > 1) {
1414
- return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends ${typeName("RequestParameters")}["content-type"]>(args?: Extract<${typeName("RequestParameters")}, { "content-type": CONTENT_TYPE }>): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
1415
- }
1416
- throw new Exception(operationDefinition.module, "[operationDeclarationRenderer] Unreachable");
1417
- }
1418
- };
1419
-
1420
- // src/transformers/operation-definition/operation-definition.transformer.ts
1421
- var OperationDefinitionTransformer = class {
1422
- static toDeclaration(operationDefinition, options) {
1423
- return new DeclarationRenderer2(operationDefinition, options).render();
1424
- }
1425
- static toMicroFunction(operationDefinition, options) {
1426
- return new OperationDefinitionMicroFunctionRenderer(operationDefinition, options).render();
1427
- }
1428
- static toNestjsMethod(operationDefinition, options) {
1429
- return new OperationDefinitionNestjsMethodRenderer(operationDefinition, options).render();
1430
- }
1431
- static toComment(operationDefinition) {
1432
- return new CommentRenderer2(operationDefinition).render();
1433
- }
1434
- };
1435
-
1436
- // src/transformers/entrypoint/entrypoint.transformer.ts
1437
- var path4 = __toESM(require("path"), 1);
1438
- var EntrypointTransformer = class {
1439
- static toTypescript(exports2, options) {
1440
- const $exports = exports2.map((exportArtifact) => {
1441
- const relativePath = path4.relative(
1442
- options.dirpath,
1443
- exportArtifact.filepath
1444
- ).replace(/(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?$/, options.esm ? ".js" : "");
1445
- return relativePath.startsWith(".") ? `export * from '${relativePath}'` : `export * from './${relativePath}'`;
1446
- });
1447
- return [
1448
- "/* @anchor:file:start */",
1449
- "",
1450
- ...$exports,
1451
- "",
1452
- "/* @anchor:file:end */"
1453
- ].join("\n");
1454
- }
1455
- };
1456
-
1457
- // src/transformers/api-document/nestjs-client.renderer.ts
1458
- var R16 = __toESM(require("ramda"), 1);
1459
- var changeCase2 = __toESM(require("change-case"), 1);
1460
- var NestjsClientRenderer = class {
1461
- constructor(document, options) {
1462
- this.document = document;
1463
- this.options = options;
1464
- }
1465
- renderDependencies() {
1466
- const $operations = this.document.operations.map((operationDefinition) => {
1467
- const filepath = this.options.getOperationDefinitionDeclarationFilepath(operationDefinition);
1468
- const typeName = typeNameFactory(operationDefinition);
1469
- return `import type { ${typeName("Operation")}, ${typeName("ResponseBodies")}, ${typeName("RequestParameters")} } from "${filepath}"`;
1470
- }).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"'));
1471
- return [
1472
- 'import { Injectable, Logger } from "@nestjs/common"',
1473
- 'import { Keq, KeqRequest } from "keq"',
1474
- ...$operations
1475
- ].join("\n");
1476
- }
1477
- render() {
1478
- const moduleName = changeCase2.pascalCase(this.document.module.name);
1479
- const $dependencies = this.renderDependencies();
1480
- const $operations = this.document.operations.map((operation) => OperationDefinitionTransformer.toNestjsMethod(operation, {
1481
- esm: this.options.esm
1482
- })).join("\n\n");
1483
- return [
1484
- "/* @anchor:file:start */",
1485
- "",
1486
- $dependencies,
1487
- "",
1488
- "@Injectable()",
1489
- `export class ${moduleName}Client {`,
1490
- ` private readonly logger = new Logger(${moduleName}Client.name)`,
1491
- "",
1492
- " constructor(",
1493
- " // @anchor:client-constructor-parameters:start",
1494
- " private readonly request: KeqRequest,",
1495
- " // @anchor:client-constructor-parameters:end",
1496
- " ) {}",
1497
- "",
1498
- indent(2, $operations),
1499
- "}",
1500
- "",
1501
- "/* @anchor:file:end */"
1502
- ].filter(R16.isNotNil).join("\n");
1503
- }
1504
- };
1505
-
1506
- // src/transformers/api-document/nestjs-module.renderer.ts
1507
- var changeCase3 = __toESM(require("change-case"), 1);
1508
- var NestjsModuleRenderer = class {
1509
- constructor(document, options) {
1510
- this.document = document;
1511
- this.options = options;
1512
- }
1513
- render() {
1514
- const moduleName = changeCase3.pascalCase(this.document.module.name);
1515
- const clientFilepath = this.options.getNestjsClientFilepath(this.document).replace(/(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?$/, this.options.esm ? ".js" : "");
1516
- return [
1517
- "/* @anchor:file:start */",
1518
- 'import { Module, Inject, ConfigurableModuleBuilder, Global } from "@nestjs/common"',
1519
- 'import { KeqRequest } from "keq"',
1520
- 'import { KeqModuleOptions } from "@keq-request/nestjs"',
1521
- `import { ${moduleName}Client } from "${clientFilepath}"`,
1522
- "",
1523
- "",
1524
- "const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } = new ConfigurableModuleBuilder<KeqModuleOptions>().build()",
1525
- "",
1526
- "@Global()",
1527
- "@Module({",
1528
- " imports: [],",
1529
- " controllers: [],",
1530
- ` providers: [${moduleName}Client],`,
1531
- ` exports: [${moduleName}Client],`,
1532
- "})",
1533
- `export class ${moduleName}Module extends ConfigurableModuleClass {`,
1534
- "",
1535
- " constructor(",
1536
- " @Inject(MODULE_OPTIONS_TOKEN) private readonly options: KeqModuleOptions,",
1537
- " private readonly request: KeqRequest,",
1538
- " ) {",
1539
- " super()",
1540
- " }",
1541
- "",
1542
- " onModuleInit() {",
1543
- " if (this.options.middlewares) {",
1544
- " for (const middleware of this.options.middlewares) {",
1545
- " this.request.use(middleware)",
1546
- " }",
1547
- " }",
1548
- " }",
1549
- "}",
1550
- "",
1551
- "/* @anchor:file:end */"
1552
- ].join("\n");
1553
- }
1554
- };
1555
-
1556
- // src/transformers/api-document/api-document.transformer.ts
1557
- var ApiDocumentTransformer = class {
1558
- static toNestjsModule(document, options) {
1559
- return new NestjsModuleRenderer(document, options).render();
1560
- }
1561
- static toNestjsClient(document, options) {
1562
- return new NestjsClientRenderer(document, options).render();
1563
- }
1564
- };
1565
-
1566
- // src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts
1567
- var R17 = __toESM(require("ramda"), 1);
1568
- var path5 = __toESM(require("path"), 1);
1569
- var changeCase4 = __toESM(require("change-case"), 1);
1570
-
1571
- // src/plugins/generate-declaration/constants/metadata-storage.ts
1572
- var MetadataStorage2 = /* @__PURE__ */ new WeakMap();
1573
-
1574
- // src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts
1575
- var SCHEMA_GENERATOR = "schemaGenerator";
1576
- var SchemaDeclarationGenerator = class _SchemaDeclarationGenerator {
1577
- async compile(compiler, task) {
1578
- const context = compiler.context;
1579
- const metadata = MetadataStorage2.get(compiler);
1580
- const rc = context.rc;
1581
- const documents = context.documents;
1582
- const schemaDefinitions = documents.flatMap((document) => document.schemas);
1583
- const artifactMap = new Map(
1584
- await Promise.all(
1585
- schemaDefinitions.map(async (schemaDefinition) => [
1586
- schemaDefinition,
1587
- await metadata.hooks.afterSchemaDeclarationArtifactGenerated.promise(
1588
- this.generateSchemaDefinitionsArtifact(schemaDefinition, rc),
1589
- schemaDefinition,
1590
- task
1591
- )
1592
- ])
1593
- )
1594
- );
1595
- const entrypoints = R17.collectBy(
1596
- (schemaDefinition) => schemaDefinition.module.name,
1597
- schemaDefinitions
1598
- ).map((schemaDefinitions2) => [
1599
- schemaDefinitions2[0].module,
1600
- schemaDefinitions2.map((schemaDefinition) => artifactMap.get(schemaDefinition)).filter((artifact) => Boolean(artifact))
1601
- ]).map(([moduleDefinition, artifacts]) => this.generateEntrypointArtifact(
1602
- moduleDefinition,
1603
- artifacts,
1604
- rc
1605
- ));
1606
- return [...artifactMap.values(), ...entrypoints];
1607
- }
1608
- generateSchemaDefinitionsArtifact(schemaDefinition, rc) {
1609
- const filepath = _SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(schemaDefinition, rc.fileNamingStyle);
1610
- const dirpath = path5.dirname(filepath);
1611
- const artifact = new Artifact({
1612
- id: _SchemaDeclarationGenerator.getSchemaDefinitionArtifactId(schemaDefinition),
1613
- filepath,
1614
- content: SchemaDefinitionTransformer.toDeclaration(
1615
- schemaDefinition,
1616
- {
1617
- esm: rc.esm,
1618
- getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {
1619
- const relativePath = path5.relative(
1620
- dirpath,
1621
- _SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle)
1622
- );
1623
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
1624
- }
1625
- }
1626
- ),
1627
- extensionName: ".schema.ts"
1628
- });
1629
- return artifact;
1630
- }
1631
- generateEntrypointArtifact(moduleDefinition, exports2, rc) {
1632
- const filepath = _SchemaDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
1633
- const dirpath = path5.dirname(filepath);
1634
- const artifact = new Artifact({
1635
- id: _SchemaDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),
1636
- filepath,
1637
- content: EntrypointTransformer.toTypescript(exports2, { dirpath })
1638
- });
1639
- return artifact;
1640
- }
1641
- static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
1642
- return [
1643
- ".",
1644
- changeCase4[fileNamingStyle](moduleDefinition.name),
1645
- "types",
1646
- "components",
1647
- "schemas",
1648
- "index.ts"
1649
- ].join("/");
1650
- }
1651
- static getEntrypointArtifactId(moduleDefinition) {
1652
- return `${moduleDefinition.address}/components/schemas/entrypoint?generator=${SCHEMA_GENERATOR}`;
1653
- }
1654
- static getSchemaDefinitionArtifactFilepath(schemaDefinition, fileNamingStyle) {
1655
- const filename = `${changeCase4[fileNamingStyle](schemaDefinition.name)}.schema.ts`;
1656
- return [
1657
- ".",
1658
- changeCase4[fileNamingStyle](schemaDefinition.module.name),
1659
- "types",
1660
- "components",
1661
- "schemas",
1662
- filename
1663
- ].join("/");
1664
- }
1665
- static getSchemaDefinitionArtifactId(schemaDefinition) {
1666
- return `${schemaDefinition.id}?generator=${SCHEMA_GENERATOR}`;
1667
- }
1668
- };
1669
-
1670
- // src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts
1671
- var OPERATION_GENERATOR = "operationDeclarationGenerator";
1672
- var OperationDeclarationGenerator = class _OperationDeclarationGenerator {
1673
- async compile(compiler, task) {
1674
- const context = compiler.context;
1675
- const metadata = MetadataStorage2.get(compiler);
1676
- const rc = context.rc;
1677
- const documents = context.documents;
1678
- const operationDefinitions = documents.flatMap((document) => document.operations);
1679
- const artifactMap = new Map(
1680
- await Promise.all(
1681
- operationDefinitions.map(async (operationDefinition) => [
1682
- operationDefinition,
1683
- await metadata.hooks.afterOperationDeclarationArtifactGenerated.promise(
1684
- this.generateOperationDefinitionArtifact(operationDefinition, rc),
1685
- operationDefinition,
1686
- task
1687
- )
1688
- ])
1689
- )
1690
- );
1691
- return Array.from(artifactMap.values());
1692
- }
1693
- generateOperationDefinitionArtifact(operationDefinition, rc) {
1694
- const filepath = _OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle);
1695
- const dirpath = path6.dirname(filepath);
1696
- const artifact = new Artifact({
1697
- id: _OperationDeclarationGenerator.getOperationDefinitionArtifactId(operationDefinition),
1698
- filepath,
1699
- content: OperationDefinitionTransformer.toDeclaration(
1700
- operationDefinition,
1701
- {
1702
- esm: rc.esm,
1703
- getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {
1704
- const relativePath = path6.relative(
1705
- dirpath,
1706
- SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle)
1707
- );
1708
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
1709
- }
1710
- }
1711
- ),
1712
- extensionName: ".type.ts"
1713
- });
1714
- return artifact;
1715
- }
1716
- generateEntrypointArtifact(moduleDefinition, exports2, rc) {
1717
- const filepath = _OperationDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
1718
- const dirpath = path6.dirname(filepath);
1719
- const artifact = new Artifact({
1720
- id: _OperationDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),
1721
- filepath,
1722
- content: EntrypointTransformer.toTypescript(exports2, { dirpath })
1723
- });
1724
- return artifact;
1725
- }
1726
- static getOperationDefinitionArtifactFilepath(operationDefinition, fileNamingStyle) {
1727
- const filename = `${changeCase5[fileNamingStyle](operationDefinition.operationId)}.type.ts`;
1728
- const filepath = [
1729
- ".",
1730
- changeCase5[fileNamingStyle](operationDefinition.module.name),
1731
- "types",
1732
- "operations",
1733
- filename
1734
- ].join("/");
1735
- return filepath;
1736
- }
1737
- static getOperationDefinitionArtifactId(operationDefinition) {
1738
- return `${operationDefinition.id}?generator=${OPERATION_GENERATOR}`;
1739
- }
1740
- static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
1741
- return [
1742
- ".",
1743
- changeCase5[fileNamingStyle](moduleDefinition.name),
1744
- "types",
1745
- "operations",
1746
- "index.ts"
1747
- ].join("/");
1748
- }
1749
- static getEntrypointArtifactId(moduleDefinition) {
1750
- return `${moduleDefinition.address}/paths/entrypoint?generator=${OPERATION_GENERATOR}`;
1751
- }
1752
- };
1753
-
1754
- // src/plugins/generate-declaration/generate-declaration.plugin.ts
1755
- var DECLARATION_GENERATOR = "declarationGenerator";
1756
- var GenerateDeclarationPlugin = class _GenerateDeclarationPlugin {
1757
- name = DECLARATION_GENERATOR;
1758
- operationGenerator = new OperationDeclarationGenerator();
1759
- schemaGenerator = new SchemaDeclarationGenerator();
1760
- constructor() {
1761
- }
1762
- apply(compiler) {
1763
- _GenerateDeclarationPlugin.register(compiler);
1764
- compiler.hooks.compile.tapPromise(_GenerateDeclarationPlugin.name, async (task) => {
1765
- compiler.context.artifacts?.push(
1766
- ...await this.schemaGenerator.compile(compiler, task),
1767
- ...await this.operationGenerator.compile(compiler, task)
1768
- );
1769
- });
1770
- }
1771
- static register(compiler) {
1772
- if (!MetadataStorage2.has(compiler)) {
1773
- MetadataStorage2.set(compiler, {
1774
- hooks: {
1775
- afterEntrypointArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "task"]),
1776
- afterSchemaDeclarationArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "schemaDefinition", "task"]),
1777
- afterOperationDeclarationArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "operationDefinition", "task"])
1778
- }
1779
- });
1780
- }
1781
- return MetadataStorage2.get(compiler);
1782
- }
1783
- static of(compiler) {
1784
- return this.register(compiler);
1785
- }
1786
- };
1787
-
1788
- // src/plugins/generate-micro-function/generators/request/request.generator.ts
1789
- var MICRO_FUNCTION_REQUEST_GENERATOR = "microFunctionRequestGenerator";
1790
- var RequestGenerator = class _RequestGenerator {
1791
- generateRequestArtifact() {
1792
- const content = [
1793
- "/* @anchor:file:start */",
1794
- "",
1795
- 'import { KeqRequest } from "keq"',
1796
- "",
1797
- "/* @anchor:request-declaration */",
1798
- "export const request = new KeqRequest()",
1799
- "",
1800
- "/* @anchor:file:end */"
1801
- ].join("\n");
1802
- return new Artifact({
1803
- id: _RequestGenerator.getRequestArtifactId(),
1804
- filepath: _RequestGenerator.getRequestArtifactFilepath(),
1805
- content
1806
- });
1807
- }
1808
- // eslint-disable-next-line @typescript-eslint/require-await
1809
- async compile(compiler, task) {
1810
- return [
1811
- this.generateRequestArtifact()
1812
- ];
1813
- }
1814
- static getRequestArtifactFilepath() {
1815
- return "./request.ts";
1816
- }
1817
- static getRequestArtifactId() {
1818
- return `request?generator=${MICRO_FUNCTION_REQUEST_GENERATOR}`;
1819
- }
1820
- };
1821
-
1822
- // src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts
1823
- var MICRO_FUNCTION_GENERATOR = "microFunctionGenerator";
1824
- var MicroFunctionGenerator = class _MicroFunctionGenerator {
1825
- async compile(compiler, task) {
1826
- const metadata = MetadataStorage.get(compiler);
1827
- const context = compiler.context;
1828
- const rc = context.rc;
1829
- const documents = context.documents;
1830
- const operationDefinitions = documents.flatMap((document) => document.operations);
1831
- const artifactMap = new Map(
1832
- await Promise.all(
1833
- operationDefinitions.map(async (operationDefinition) => [
1834
- operationDefinition,
1835
- await metadata.hooks.afterMicroFunctionArtifactGenerated.promise(
1836
- this.generateOperationDefinitionArtifact(operationDefinition, rc),
1837
- operationDefinition,
1838
- task
1839
- )
1840
- ])
1841
- )
1842
- );
1843
- const entrypoints = await Promise.all(
1844
- R18.collectBy(
1845
- (operationDefinition) => operationDefinition.module.name,
1846
- operationDefinitions
1847
- ).map((operationDefinitions2) => [
1848
- operationDefinitions2[0].module,
1849
- operationDefinitions2.map((operationDefinition) => artifactMap.get(operationDefinition)).filter((artifact) => Boolean(artifact))
1850
- ]).map(async ([moduleDefinition, artifacts]) => await metadata.hooks.afterEntrypointArtifactGenerated.promise(
1851
- this.generateEntrypointArtifact(
1852
- moduleDefinition,
1853
- artifacts,
1854
- rc
1855
- ),
1856
- task
1857
- ))
1858
- );
1859
- return [...entrypoints, ...artifactMap.values()];
1860
- }
1861
- generateOperationDefinitionArtifact(operationDefinition, rc) {
1862
- const filepath = _MicroFunctionGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle);
1863
- const dirpath = path7.dirname(filepath);
1864
- const artifact = new Artifact({
1865
- id: _MicroFunctionGenerator.getOperationDefinitionArtifactId(operationDefinition),
1866
- filepath,
1867
- content: OperationDefinitionTransformer.toMicroFunction(operationDefinition, {
1868
- esm: rc.esm,
1869
- getOperationDefinitionDeclarationFilepath(operationDefinition2) {
1870
- const relativePath = path7.relative(
1871
- dirpath,
1872
- OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition2, rc.fileNamingStyle)
1873
- );
1874
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
1875
- },
1876
- getRequestFilepath() {
1877
- const relativePath = path7.relative(
1878
- dirpath,
1879
- RequestGenerator.getRequestArtifactFilepath()
1880
- );
1881
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
1882
- }
1883
- }),
1884
- extensionName: ".type.ts"
1885
- });
1886
- return artifact;
1887
- }
1888
- generateEntrypointArtifact(moduleDefinition, exports2, rc) {
1889
- const filepath = _MicroFunctionGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
1890
- const dirpath = filepath.substring(0, filepath.lastIndexOf("/"));
1891
- const artifact = new Artifact({
1892
- id: _MicroFunctionGenerator.getEntrypointArtifactId(moduleDefinition),
1893
- filepath,
1894
- content: EntrypointTransformer.toTypescript(exports2, { dirpath })
1895
- });
1896
- return artifact;
1897
- }
1898
- static getOperationDefinitionArtifactFilepath(operationDefinition, fileNamingStyle) {
1899
- const filename = `${changeCase6[fileNamingStyle](operationDefinition.operationId)}.fn.ts`;
1900
- const filepath = [
1901
- ".",
1902
- changeCase6[fileNamingStyle](operationDefinition.module.name),
1903
- "operations",
1904
- filename
1905
- ].join("/");
1906
- return filepath;
1907
- }
1908
- static getOperationDefinitionArtifactId(operationDefinition) {
1909
- return `${operationDefinition.id}?generator=${MICRO_FUNCTION_GENERATOR}`;
1910
- }
1911
- static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
1912
- return [
1913
- ".",
1914
- changeCase6[fileNamingStyle](moduleDefinition.name),
1915
- "operations",
1916
- "index.ts"
1917
- ].join("/");
1918
- }
1919
- static getEntrypointArtifactId(moduleDefinition) {
1920
- return `${moduleDefinition.address}/paths/entrypoint?generator=${MICRO_FUNCTION_GENERATOR}`;
1921
- }
1922
- };
1923
-
1924
- // src/plugins/generate-micro-function/generate-micro-function.plugin.ts
1925
- var GenerateMicroFunctionPlugin = class _GenerateMicroFunctionPlugin {
1926
- microFunctionGenerator = new MicroFunctionGenerator();
1927
- requestGenerator = new RequestGenerator();
1928
- apply(compiler) {
1929
- _GenerateMicroFunctionPlugin.register(compiler);
1930
- compiler.hooks.compile.tapPromise(_GenerateMicroFunctionPlugin.name, async (task) => {
1931
- const artifacts = [
1932
- ...await this.requestGenerator.compile(compiler, task),
1933
- ...await this.microFunctionGenerator.compile(compiler, task)
1934
- ];
1935
- compiler.context.artifacts.push(...artifacts);
1936
- });
1937
- }
1938
- static register(compiler) {
1939
- if (!MetadataStorage.has(compiler)) {
1940
- MetadataStorage.set(compiler, {
1941
- hooks: {
1942
- afterEntrypointArtifactGenerated: new import_tapable2.AsyncSeriesWaterfallHook(["artifact", "task"]),
1943
- afterMicroFunctionArtifactGenerated: new import_tapable2.AsyncSeriesWaterfallHook(["artifact", "operationDefinition", "task"])
1944
- }
1945
- });
1946
- }
1947
- return MetadataStorage.get(compiler);
1948
- }
1949
- static of(compiler) {
1950
- return this.register(compiler);
1951
- }
1952
- };
1953
-
1954
- // src/plugins/body-fallback/index.ts
1955
- var BodyFallbackPlugin = class _BodyFallbackPlugin {
1956
- apply(compiler) {
1957
- compiler.hooks.setup.tap(_BodyFallbackPlugin.name, () => {
1958
- const generateMicroFunctionPluginMetadata = GenerateMicroFunctionPlugin.of(compiler);
1959
- if (!generateMicroFunctionPluginMetadata) {
1960
- throw new Error("BodyFallbackPlugin requires GenerateMicroFunctionPlugin to be applied first.");
1961
- }
1962
- generateMicroFunctionPluginMetadata.hooks.afterMicroFunctionArtifactGenerated.tap(_BodyFallbackPlugin.name, (artifact, operationDefinition) => {
1963
- const operation = operationDefinition.operation;
1964
- const parameters = operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p)) || [];
1965
- const keys2 = parameters.map((p) => p.name).filter(R19.isNotNil);
1966
- const $acc = !keys2.length ? " acc[key] = args[key]" : [
1967
- ` if (![${keys2.map((k) => JSON.stringify(k)).join(", ")}].includes(key)) {`,
1968
- " acc[key] = args[key]",
1969
- " }"
1970
- ].join("\n");
1971
- artifact.anchor.block.replace("body", [
1972
- // $mediaType ? `${$mediaType}\n` : undefined,
1973
- ' if (typeof args === "object" && args !== null && !Array.isArray(args)) {',
1974
- " const requestBody = Object.keys(args)",
1975
- " .reduce((acc, key) => {",
1976
- $acc,
1977
- " return acc",
1978
- " }, {} as Record<string, unknown>)",
1979
- "",
1980
- " if (Object.keys(requestBody).length > 0) {",
1981
- " req.send(requestBody)",
1982
- " }",
1983
- " }"
1984
- ].filter(R19.isNotNil).join("\n"));
1985
- return artifact;
1986
- });
1987
- });
1988
- }
1989
- };
1990
-
1991
- // src/plugins/generate-nestjs-module/generate-nestjs-module.ts
1992
- var import_tapable3 = require("tapable");
1993
-
1994
- // src/plugins/generate-nestjs-module/constants/metadata-storage.ts
1995
- var MetadataStorage3 = /* @__PURE__ */ new WeakMap();
1996
-
1997
- // src/plugins/generate-nestjs-module/generators/nestjs-module.generator.ts
1998
- var path8 = __toESM(require("path"), 1);
1999
- var changeCase7 = __toESM(require("change-case"), 1);
2000
- var NESTJS_MODULE_GENERATOR = "nestjs-module-generator";
2001
- var NestjsModuleGenerator = class _NestjsModuleGenerator {
2002
- generateNestjsModuleArtifact(document, rc) {
2003
- const filepath = _NestjsModuleGenerator.getNestjsModuleArtifactFilepath(document, rc.fileNamingStyle);
2004
- const dirname6 = path8.dirname(filepath);
2005
- const artifact = new Artifact({
2006
- id: _NestjsModuleGenerator.getNestjsModuleArtifactId(document),
2007
- filepath,
2008
- content: ApiDocumentTransformer.toNestjsModule(document, {
2009
- esm: rc.esm,
2010
- getNestjsClientFilepath(document2) {
2011
- const relativePath = path8.relative(
2012
- dirname6,
2013
- _NestjsModuleGenerator.getNestjsClientArtifactFilepath(document2, rc.fileNamingStyle)
2014
- );
2015
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
2016
- }
2017
- })
2018
- });
2019
- return artifact;
2020
- }
2021
- generateNestjsClientArtifact(document, rc) {
2022
- const filepath = _NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.fileNamingStyle);
2023
- const dirpath = path8.dirname(filepath);
2024
- const artifact = new Artifact({
2025
- id: _NestjsModuleGenerator.getNestjsClientArtifactId(document),
2026
- filepath,
2027
- content: ApiDocumentTransformer.toNestjsClient(document, {
2028
- esm: rc.esm,
2029
- getOperationDefinitionDeclarationFilepath(operationDefinition) {
2030
- const relativePath = path8.relative(
2031
- dirpath,
2032
- OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle)
2033
- );
2034
- return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
2035
- }
2036
- })
2037
- });
2038
- return artifact;
2039
- }
2040
- async compile(compiler, task) {
2041
- const metadata = MetadataStorage3.get(compiler);
2042
- const rc = compiler.context.rc;
2043
- const documents = compiler.context.documents;
2044
- const nestjsModuleArtifacts = await Promise.all(
2045
- documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(
2046
- this.generateNestjsModuleArtifact(document, rc),
2047
- document,
2048
- task
2049
- ))
2050
- );
2051
- const nestjsClientArtifacts = await Promise.all(
2052
- documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(
2053
- this.generateNestjsClientArtifact(document, rc),
2054
- document,
2055
- task
2056
- ))
2057
- );
2058
- return [...nestjsModuleArtifacts, ...nestjsClientArtifacts];
2059
- }
2060
- static getNestjsModuleArtifactFilepath(document, fileNamingStyle) {
2061
- const filename = `${changeCase7[fileNamingStyle](document.module.name)}.module.ts`;
2062
- const filepath = [
2063
- ".",
2064
- changeCase7[fileNamingStyle](document.module.name),
2065
- filename
2066
- ];
2067
- return filepath.join("/");
2068
- }
2069
- static getNestjsModuleArtifactId(document) {
2070
- return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}`;
2071
- }
2072
- static getNestjsClientArtifactFilepath(document, fileNamingStyle) {
2073
- const filename = `${changeCase7[fileNamingStyle](document.module.name)}.client.ts`;
2074
- const filepath = [
2075
- ".",
2076
- changeCase7[fileNamingStyle](document.module.name),
2077
- filename
2078
- ];
2079
- return filepath.join("/");
2080
- }
2081
- static getNestjsClientArtifactId(document) {
2082
- return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}-client`;
2083
- }
2084
- };
2085
-
2086
- // src/plugins/generate-nestjs-module/generate-nestjs-module.ts
2087
- var GenerateNestjsModulePlugin = class _GenerateNestjsModulePlugin {
2088
- nestjsModuleGenerator = new NestjsModuleGenerator();
2089
- apply(compiler) {
2090
- _GenerateNestjsModulePlugin.register(compiler);
2091
- compiler.hooks.compile.tapPromise(_GenerateNestjsModulePlugin.name, async (task) => {
2092
- const artifacts = await this.nestjsModuleGenerator.compile(compiler, task);
2093
- compiler.context.artifacts.push(...artifacts);
2094
- });
2095
- }
2096
- static register(compiler) {
2097
- if (!MetadataStorage3.has(compiler)) {
2098
- MetadataStorage3.set(compiler, {
2099
- hooks: {
2100
- afterNestjsModuleArtifactGenerated: new import_tapable3.AsyncSeriesWaterfallHook(["artifact", "document", "task"])
2101
- }
2102
- });
2103
- }
2104
- return MetadataStorage3.get(compiler);
2105
- }
2106
- static of(compiler) {
2107
- return MetadataStorage3.get(compiler);
2108
- }
2109
- };
2110
-
2111
- // src/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.ts
2112
- var import_swagger_fix = require("swagger-fix");
2113
- var ChineseToPinyinPlugin = class _ChineseToPinyinPlugin {
2114
- apply(compiler) {
2115
- compiler.hooks.afterDownload.tap(_ChineseToPinyinPlugin.name, (task) => {
2116
- const documents = compiler.context.documents;
2117
- compiler.context.documents = documents.map((doc) => {
2118
- return new ApiDocumentV3_1(
2119
- (0, import_swagger_fix.fixSwagger)(doc.specification),
2120
- doc.module
2121
- );
2122
- });
2123
- });
2124
- }
2125
- };
2126
-
2127
- // src/plugins/download-http-file/download-http-file.plugin.ts
2128
- var DownloadHttpFilePlugin = class _DownloadHttpFilePlugin {
2129
- apply(compiler) {
2130
- compiler.hooks.download.tapPromise(_DownloadHttpFilePlugin.name, async (address, task) => {
2131
- const { url } = address;
2132
- if (!url.startsWith("http://") && !url.startsWith("https://")) return void 0;
2133
- const content = await this.download(address);
2134
- const spec = this.deserialize(content);
2135
- return JSON.stringify(spec);
2136
- });
2137
- }
2138
- async download(address) {
2139
- const { url, headers } = address;
2140
- try {
2141
- const res = await fetch(url, { headers });
2142
- if (res.status >= 400) throw new Error(`failed with status code ${res.status}`);
2143
- return await res.text();
2144
- } catch (e) {
2145
- if (e instanceof Error) {
2146
- e.message = `Unable get the openapi/swagger file from ${url}: ${e.message}`;
2147
- }
2148
- throw e;
2149
- }
2150
- }
2151
- deserialize(content) {
2152
- const json = JSON.parse(content);
2153
- const spec = OpenapiUtils.to3_1(json);
2154
- return spec;
2155
- }
2156
- };
2157
-
2158
- // src/plugins/download-local-file/download-local-file.plugin.ts
2159
- var path9 = __toESM(require("path"), 1);
2160
- var fs = __toESM(require("fs/promises"), 1);
2161
- var yaml = __toESM(require("js-yaml"), 1);
2162
- var import_url = require("url");
2163
- var DownloadLocalFilePlugin = class _DownloadLocalFilePlugin {
2164
- apply(compiler) {
2165
- compiler.hooks.download.tapPromise(_DownloadLocalFilePlugin.name, async (address, task) => {
2166
- const { url, encoding } = address;
2167
- if (!url.startsWith("file://")) return void 0;
2168
- const filepath = (0, import_url.fileURLToPath)(url);
2169
- const fileExt = path9.extname(filepath);
2170
- const content = await fs.readFile(filepath, encoding);
2171
- const str = typeof content === "string" ? content : content.toString(encoding);
2172
- if ([".yml", ".yaml"].includes(fileExt)) {
2173
- const value = yaml.load(str);
2174
- return JSON.stringify(OpenapiUtils.to3_1(value));
2175
- } else if (fileExt === ".json") {
2176
- return JSON.stringify(OpenapiUtils.to3_1(JSON.parse(str)));
2177
- }
2178
- });
2179
- }
2180
- };
2181
-
2182
- // src/plugins/shaking/shaking.plugin.ts
2183
- var import_openapi_shaking = require("@opendoc/openapi-shaking");
2184
- var ShakingPlugin = class _ShakingPlugin {
2185
- apply(compiler) {
2186
- compiler.hooks.beforeCompile.tap(_ShakingPlugin.name, (task) => {
2187
- const matcher = compiler.context.matcher;
2188
- const documents = compiler.context.documents;
2189
- compiler.context.documents = documents.map((document) => this.shaking(compiler, document)).filter((document) => !document.isEmpty()).filter((document) => !matcher.isModuleIgnored(document.module));
2190
- });
2191
- }
2192
- shaking(compiler, document) {
2193
- const rc = compiler.context.rc;
2194
- const matcher = compiler.context.matcher;
2195
- const isAccepted = (pathname, method, operation) => {
2196
- if (!SupportedMethods.includes(method)) return false;
2197
- return !matcher.isOperationIgnored(new OperationDefinition({
2198
- method,
2199
- pathname,
2200
- operation,
2201
- module: document.module,
2202
- document
2203
- }));
2204
- };
2205
- const sharkedSwagger = (0, import_openapi_shaking.openapiShakingSync)(
2206
- document.specification,
2207
- isAccepted,
2208
- { tolerant: rc.tolerant }
2209
- );
2210
- return new ApiDocumentV3_1(
2211
- sharkedSwagger,
2212
- new ModuleDefinition(
2213
- document.module.name,
2214
- {
2215
- url: `memory://${document.module.name}.v3_1.sharked.json`,
2216
- headers: {},
2217
- encoding: "utf8"
2218
- }
2219
- )
2220
- );
2221
- }
2222
- };
2223
-
2224
- // src/plugins/terminal-select/utils/select-operation-definitions.ts
2225
- var import_inquirer_select_pro = require("inquirer-select-pro");
2226
- var import_prompt_adapter_inquirer = require("@listr2/prompt-adapter-inquirer");
2227
- async function selectOperationDefinitions(task, operationDefinitions) {
2228
- const selectedOperationDefinitions = await task.prompt(import_prompt_adapter_inquirer.ListrInquirerPromptAdapter).run(
2229
- import_inquirer_select_pro.select,
2230
- {
2231
- message: "Select Pathname",
2232
- defaultValue: [],
2233
- options: (input) => {
2234
- const items = operationDefinitions.map((op) => ({ name: `${op.module.name} ${op.method.toUpperCase()} ${op.pathname}`, value: op }));
2235
- if (!input) return items;
2236
- const keys2 = input.trim().toLowerCase().split(/\s+/);
2237
- return items.filter((i) => {
2238
- const name = i.name.toLowerCase();
2239
- return keys2.every((q) => name.includes(q));
2240
- });
2241
- }
2242
- }
2243
- );
2244
- return selectedOperationDefinitions;
2245
- }
2246
-
2247
- // src/plugins/terminal-select/terminal-select.plugin.ts
2248
- var TerminalSelectPlugin = class _TerminalSelectPlugin {
2249
- constructor(options) {
2250
- this.options = options;
2251
- }
2252
- apply(compiler) {
2253
- compiler.hooks.afterDownload.tapPromise(_TerminalSelectPlugin.name, async (task) => {
2254
- const context = compiler.context;
2255
- const matcher = context.matcher;
2256
- const documents = context.documents;
2257
- const operationDefinitions = documents.flatMap((document) => document.operations);
2258
- const selectedOperationDefinitions = await selectOperationDefinitions(task, operationDefinitions);
2259
- if (this.options.clear) {
2260
- matcher.append({
2261
- persist: false,
2262
- ignore: true,
2263
- moduleName: "*",
2264
- operationMethod: "*",
2265
- operationPathname: "*"
2266
- });
2267
- }
2268
- for (const op of selectedOperationDefinitions) {
2269
- matcher.append({
2270
- persist: !!this.options.persist,
2271
- ignore: this.options.mode === "add",
2272
- moduleName: op.module.name,
2273
- operationMethod: op.method,
2274
- operationPathname: op.pathname
2275
- });
2276
- }
2277
- });
2278
- }
2279
- };
2280
-
2281
- // src/plugins/initialize/initialize.plugin.ts
2282
- var R20 = __toESM(require("ramda"), 1);
2283
- var InitializePlugin = class _InitializePlugin {
2284
- constructor(options) {
2285
- this.options = options;
2286
- }
2287
- apply(compiler) {
2288
- compiler.hooks.setup.tap(_InitializePlugin.name, (task) => {
2289
- new DownloadHttpFilePlugin().apply(compiler);
2290
- new DownloadLocalFilePlugin().apply(compiler);
2291
- new GenerateDeclarationPlugin().apply(compiler);
2292
- if (this.options.build) {
2293
- new ShakingPlugin().apply(compiler);
2294
- }
2295
- if (this.options.interactive) {
2296
- new TerminalSelectPlugin(
2297
- typeof this.options.interactive === "object" ? this.options.interactive : { mode: "except" }
2298
- ).apply(compiler);
2299
- }
2300
- const rc = compiler.context.rc;
2301
- if (rc.mode === "micro-function") {
2302
- new GenerateMicroFunctionPlugin().apply(compiler);
2303
- } else if (rc.mode === "nestjs-module") {
2304
- new GenerateNestjsModulePlugin().apply(compiler);
2305
- }
2306
- if (rc.plugins && rc.plugins.length) {
2307
- for (const plugin of rc.plugins) {
2308
- plugin.apply(compiler);
2309
- }
2310
- }
2311
- });
2312
- if (this.options.includes && this.options.includes.length) {
2313
- const modulesIncludes = this.options.includes;
2314
- compiler.hooks.afterSetup.tap(_InitializePlugin.name, (task) => {
2315
- const rc = compiler.context.rc;
2316
- const matcher = compiler.context.matcher;
2317
- const notExistModules = modulesIncludes.filter((moduleName) => !(moduleName in rc.modules));
2318
- if (notExistModules.length) {
2319
- throw new Error(`Cannot find module(s) ${notExistModules.join(", ")} in config file.`);
2320
- }
2321
- const ignoredModules = R20.difference(R20.keys(rc.modules), modulesIncludes);
2322
- for (const moduleName of ignoredModules) {
2323
- matcher.append({
2324
- persist: false,
2325
- ignore: true,
2326
- moduleName,
2327
- operationMethod: "*",
2328
- operationPathname: "*"
2329
- });
2330
- }
2331
- });
2332
- }
2333
- }
2334
- };
2335
-
2336
- // src/plugins/overwrite-operation-id/overwrite-operation-id.plugin.ts
2337
- var OverwriteOperationIdPlugin = class _OverwriteOperationIdPlugin {
2338
- constructor(factory) {
2339
- this.factory = factory;
2340
- }
2341
- apply(compiler) {
2342
- compiler.hooks.afterDownload.tap(_OverwriteOperationIdPlugin.name, () => {
2343
- const documents = compiler.context.documents;
2344
- const factory = this.factory;
2345
- compiler.context.documents = documents.map((document) => {
2346
- const spec = OpenapiUtils.mapOperation(
2347
- document.specification,
2348
- (method, pathname, operation) => {
2349
- const operationId = factory({ method, pathname, operation, module: document.module });
2350
- if (typeof operationId === "string") {
2351
- if (operationId.length === 0) {
2352
- throw new Exception(document.module, `The generated operationId for [${method.toUpperCase()} ${pathname}] is an empty string.`);
2353
- }
2354
- operation.operationId = operationId;
2355
- return operation;
2356
- }
2357
- return operation;
2358
- }
2359
- );
2360
- return new ApiDocumentV3_1(spec, document.module);
2361
- });
2362
- });
2363
- }
2364
- };
2365
-
2366
- // src/plugins/overwrite-query-options/overwrite-query-options.plugin.ts
2367
- var QsArrayFormatUnion = Object.values(QsArrayFormat);
2368
- var OverwriteQueryOptionsPlugin = class _OverwriteQueryOptionsPlugin {
2369
- constructor(factory) {
2370
- this.factory = factory;
2371
- }
2372
- apply(compiler) {
2373
- compiler.hooks.afterDownload.tap(_OverwriteQueryOptionsPlugin.name, (task) => {
2374
- const documents = compiler.context.documents;
2375
- const factory = this.factory;
2376
- compiler.context.documents = documents.map((document) => {
2377
- const specification = OpenapiUtils.mapParameter(
2378
- document.specification,
2379
- (method, pathname, operation, parameter) => {
2380
- const qsOptions = typeof factory === "function" ? factory({ parameter, operation, pathname, method, module: document.module }) : factory;
2381
- if (!qsOptions) return parameter;
2382
- if (qsOptions.arrayFormat) {
2383
- if (!QsArrayFormatUnion.includes(qsOptions.arrayFormat)) {
2384
- throw new Exception(document.module, `The 'arrayFormat' value '${qsOptions.arrayFormat}' for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] is invalid.`);
2385
- }
2386
- parameter["x-qs-array-format"] = qsOptions.arrayFormat;
2387
- }
2388
- if (qsOptions.allowDots !== void 0) {
2389
- if (typeof qsOptions.allowDots !== "boolean") {
2390
- throw new Exception(document.module, `The 'allowDots' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`);
2391
- }
2392
- parameter["x-qs-allow-dots"] = Boolean(qsOptions.allowDots);
2393
- }
2394
- if (qsOptions.indices !== void 0) {
2395
- if (typeof qsOptions.indices !== "boolean") {
2396
- throw new Exception(document.module, `The 'indices' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`);
2397
- }
2398
- parameter["x-qs-indices"] = Boolean(qsOptions.indices);
2399
- }
2400
- return parameter;
2401
- }
2402
- );
2403
- return new ApiDocumentV3_1(
2404
- specification,
2405
- document.module
2406
- );
2407
- });
2408
- });
2409
- }
2410
- };
2411
- // Annotate the CommonJS export names for ESM import in node:
2412
- 0 && (module.exports = {
2413
- BodyFallbackPlugin,
2414
- ChineseToPinyinPlugin,
2415
- DECLARATION_GENERATOR,
2416
- DownloadHttpFilePlugin,
2417
- DownloadLocalFilePlugin,
2418
- EslintPlugin,
2419
- GenerateDeclarationPlugin,
2420
- GenerateMicroFunctionPlugin,
2421
- GenerateNestjsModulePlugin,
2422
- InitializePlugin,
2423
- MICRO_FUNCTION_GENERATOR,
2424
- MICRO_FUNCTION_REQUEST_GENERATOR,
2425
- MicroFunctionGenerator,
2426
- NestjsModuleGenerator,
2427
- OPERATION_GENERATOR,
2428
- OperationDeclarationGenerator,
2429
- OverwriteOperationIdPlugin,
2430
- OverwriteQueryOptionsPlugin,
2431
- PrettierPlugin,
2432
- RequestGenerator,
2433
- SCHEMA_GENERATOR,
2434
- SchemaDeclarationGenerator,
2435
- ShakingPlugin,
2436
- TerminalSelectPlugin
2437
- });
2438
- //# sourceMappingURL=plugins.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_plugins = require("./plugins-CgMhaNZq.cjs");
3
+ exports.BodyFallbackPlugin = require_plugins.BodyFallbackPlugin;
4
+ exports.ChineseToPinyinPlugin = require_plugins.ChineseToPinyinPlugin;
5
+ exports.CleanPlugin = require_plugins.CleanPlugin;
6
+ exports.DECLARATION_GENERATOR = require_plugins.DECLARATION_GENERATOR;
7
+ exports.DownloadHttpFilePlugin = require_plugins.DownloadHttpFilePlugin;
8
+ exports.DownloadLocalFilePlugin = require_plugins.DownloadLocalFilePlugin;
9
+ exports.EslintPlugin = require_plugins.EslintPlugin;
10
+ exports.GenerateDeclarationPlugin = require_plugins.GenerateDeclarationPlugin;
11
+ exports.GenerateMicroFunctionPlugin = require_plugins.GenerateMicroFunctionPlugin;
12
+ exports.GenerateNestjsModulePlugin = require_plugins.GenerateNestjsModulePlugin;
13
+ exports.InitializePlugin = require_plugins.InitializePlugin;
14
+ exports.LintSchemaPlugin = require_plugins.LintSchemaPlugin;
15
+ exports.MICRO_FUNCTION_GENERATOR = require_plugins.MICRO_FUNCTION_GENERATOR;
16
+ exports.MICRO_FUNCTION_REQUEST_GENERATOR = require_plugins.MICRO_FUNCTION_REQUEST_GENERATOR;
17
+ exports.MicroFunctionGenerator = require_plugins.MicroFunctionGenerator;
18
+ exports.MockPlugin = require_plugins.MockPlugin;
19
+ exports.NestjsModuleGenerator = require_plugins.NestjsModuleGenerator;
20
+ exports.OPERATION_GENERATOR = require_plugins.OPERATION_GENERATOR;
21
+ exports.OperationDeclarationGenerator = require_plugins.OperationDeclarationGenerator;
22
+ exports.OverwriteAdditionalPropertiesPlugin = require_plugins.OverwriteAdditionalPropertiesPlugin;
23
+ exports.OverwriteOperationIdPlugin = require_plugins.OverwriteOperationIdPlugin;
24
+ exports.OverwriteQueryOptionsPlugin = require_plugins.OverwriteQueryOptionsPlugin;
25
+ exports.OverwriteSchemaNamePlugin = require_plugins.OverwriteSchemaNamePlugin;
26
+ exports.PrettierPlugin = require_plugins.PrettierPlugin;
27
+ exports.RESPONSE_GENERATOR = require_plugins.RESPONSE_GENERATOR;
28
+ exports.RequestGenerator = require_plugins.RequestGenerator;
29
+ exports.ResponseDeclarationGenerator = require_plugins.ResponseDeclarationGenerator;
30
+ exports.SCHEMA_GENERATOR = require_plugins.SCHEMA_GENERATOR;
31
+ exports.SchemaDeclarationGenerator = require_plugins.SchemaDeclarationGenerator;
32
+ exports.ShakingPlugin = require_plugins.ShakingPlugin;
33
+ exports.SpringdocCompatPlugin = require_plugins.SpringdocCompatPlugin;
34
+ exports.TerminalSelectPlugin = require_plugins.TerminalSelectPlugin;
35
+ exports.USE_VALIBOT = require_plugins.USE_VALIBOT;
36
+ exports.UseValibotPlugin = require_plugins.UseValibotPlugin;