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