@keq-request/cli 5.0.0-alpha.22 → 5.0.0-alpha.24

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 (319) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cli.cjs +1946 -1468
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +1943 -1465
  5. package/dist/cli.js.map +1 -1
  6. package/dist/compiler/compiler.d.ts +8 -20
  7. package/dist/compiler/compiler.d.ts.map +1 -1
  8. package/dist/compiler/index.d.ts +2 -0
  9. package/dist/compiler/index.d.ts.map +1 -1
  10. package/dist/compiler/intercepter/index.d.ts +3 -0
  11. package/dist/compiler/intercepter/index.d.ts.map +1 -0
  12. package/dist/compiler/intercepter/print-information.d.ts +1 -1
  13. package/dist/compiler/intercepter/print-information.d.ts.map +1 -1
  14. package/dist/compiler/tasks/compile/index.d.ts +6 -0
  15. package/dist/compiler/tasks/compile/index.d.ts.map +1 -0
  16. package/dist/{tasks → compiler/tasks}/download/index.d.ts +3 -3
  17. package/dist/compiler/tasks/download/index.d.ts.map +1 -0
  18. package/dist/compiler/tasks/index.d.ts +6 -0
  19. package/dist/compiler/tasks/index.d.ts.map +1 -0
  20. package/dist/compiler/tasks/persist/index.d.ts +5 -0
  21. package/dist/compiler/tasks/persist/index.d.ts.map +1 -0
  22. package/dist/{tasks → compiler/tasks}/setup/index.d.ts +4 -5
  23. package/dist/compiler/tasks/setup/index.d.ts.map +1 -0
  24. package/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts.map +1 -0
  25. package/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts.map +1 -0
  26. package/dist/compiler/tasks/setup/utils/index.d.ts.map +1 -0
  27. package/dist/compiler/tasks/setup/utils/validate-modules.d.ts.map +1 -0
  28. package/dist/compiler/tasks/types/base-task-options.d.ts +6 -0
  29. package/dist/compiler/tasks/types/base-task-options.d.ts.map +1 -0
  30. package/dist/compiler/tasks/types/index.d.ts +3 -0
  31. package/dist/compiler/tasks/types/index.d.ts.map +1 -0
  32. package/dist/compiler/tasks/types/task-wrapper.d.ts +4 -0
  33. package/dist/compiler/tasks/types/task-wrapper.d.ts.map +1 -0
  34. package/dist/compiler/types/compiler-context.d.ts +11 -0
  35. package/dist/compiler/types/compiler-context.d.ts.map +1 -0
  36. package/dist/compiler/types/compiler-hooks.d.ts +18 -0
  37. package/dist/compiler/types/compiler-hooks.d.ts.map +1 -0
  38. package/dist/compiler/types/index.d.ts +3 -0
  39. package/dist/compiler/types/index.d.ts.map +1 -0
  40. package/dist/constants/index.d.ts +4 -0
  41. package/dist/constants/index.d.ts.map +1 -0
  42. package/dist/exception.d.ts +1 -1
  43. package/dist/exception.d.ts.map +1 -1
  44. package/dist/generators/index.d.ts +2 -0
  45. package/dist/generators/index.d.ts.map +1 -0
  46. package/dist/index.cjs +1901 -1413
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.ts +4 -11
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1895 -1407
  51. package/dist/index.js.map +1 -1
  52. package/dist/models/anchor.d.ts.map +1 -0
  53. package/dist/{tasks/utils → models}/api-document_v3_1.d.ts +1 -1
  54. package/dist/models/api-document_v3_1.d.ts.map +1 -0
  55. package/dist/models/artifact.d.ts +17 -0
  56. package/dist/models/artifact.d.ts.map +1 -0
  57. package/dist/models/asset.d.ts +5 -0
  58. package/dist/models/asset.d.ts.map +1 -0
  59. package/dist/{tasks/utils → models}/index.d.ts +2 -5
  60. package/dist/models/index.d.ts.map +1 -0
  61. package/dist/{tasks/utils → models}/module-definition.d.ts +1 -0
  62. package/dist/models/module-definition.d.ts.map +1 -0
  63. package/dist/{tasks/utils → models}/operation-definition.d.ts +1 -0
  64. package/dist/models/operation-definition.d.ts.map +1 -0
  65. package/dist/{tasks/utils → models}/schema-definition.d.ts +3 -2
  66. package/dist/models/schema-definition.d.ts.map +1 -0
  67. package/dist/models/utils/to-comment.d.ts.map +1 -0
  68. package/dist/plugins/body-fallback/index.d.ts.map +1 -1
  69. package/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts +5 -0
  70. package/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts.map +1 -0
  71. package/dist/plugins/chinese-to-pinyin/index.d.ts +2 -0
  72. package/dist/plugins/chinese-to-pinyin/index.d.ts.map +1 -0
  73. package/dist/plugins/download-http-file/download-http-file.plugin.d.ts +8 -0
  74. package/dist/plugins/download-http-file/download-http-file.plugin.d.ts.map +1 -0
  75. package/dist/plugins/download-http-file/index.d.ts +2 -0
  76. package/dist/plugins/download-http-file/index.d.ts.map +1 -0
  77. package/dist/plugins/download-local-file/download-local-file.plugin.d.ts +6 -0
  78. package/dist/plugins/download-local-file/download-local-file.plugin.d.ts.map +1 -0
  79. package/dist/plugins/download-local-file/index.d.ts +2 -0
  80. package/dist/plugins/download-local-file/index.d.ts.map +1 -0
  81. package/dist/plugins/generate-declaration/constants/index.d.ts +2 -0
  82. package/dist/plugins/generate-declaration/constants/index.d.ts.map +1 -0
  83. package/dist/plugins/generate-declaration/constants/metadata-storage.d.ts +12 -0
  84. package/dist/plugins/generate-declaration/constants/metadata-storage.d.ts.map +1 -0
  85. package/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts +15 -0
  86. package/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts.map +1 -0
  87. package/dist/plugins/generate-declaration/generators/index.d.ts +3 -0
  88. package/dist/plugins/generate-declaration/generators/index.d.ts.map +1 -0
  89. package/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts +2 -0
  90. package/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts.map +1 -0
  91. package/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts +15 -0
  92. package/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts.map +1 -0
  93. package/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts +2 -0
  94. package/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts.map +1 -0
  95. package/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts +15 -0
  96. package/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts.map +1 -0
  97. package/dist/plugins/generate-declaration/index.d.ts +3 -0
  98. package/dist/plugins/generate-declaration/index.d.ts.map +1 -0
  99. package/dist/plugins/generate-micro-function/constants/index.d.ts +2 -0
  100. package/dist/plugins/generate-micro-function/constants/index.d.ts.map +1 -0
  101. package/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts +11 -0
  102. package/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts.map +1 -0
  103. package/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts +11 -0
  104. package/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts.map +1 -0
  105. package/dist/plugins/generate-micro-function/generators/index.d.ts +3 -0
  106. package/dist/plugins/generate-micro-function/generators/index.d.ts.map +1 -0
  107. package/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts +2 -0
  108. package/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts.map +1 -0
  109. package/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts +15 -0
  110. package/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts.map +1 -0
  111. package/dist/plugins/generate-micro-function/generators/request/index.d.ts +2 -0
  112. package/dist/plugins/generate-micro-function/generators/request/index.d.ts.map +1 -0
  113. package/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts +11 -0
  114. package/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts.map +1 -0
  115. package/dist/plugins/generate-micro-function/index.d.ts +3 -0
  116. package/dist/plugins/generate-micro-function/index.d.ts.map +1 -0
  117. package/dist/plugins/generate-nestjs-module/constants/index.d.ts +2 -0
  118. package/dist/plugins/generate-nestjs-module/constants/index.d.ts.map +1 -0
  119. package/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts +10 -0
  120. package/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts.map +1 -0
  121. package/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts +10 -0
  122. package/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts.map +1 -0
  123. package/dist/plugins/generate-nestjs-module/generators/index.d.ts +2 -0
  124. package/dist/plugins/generate-nestjs-module/generators/index.d.ts.map +1 -0
  125. package/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts +14 -0
  126. package/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts.map +1 -0
  127. package/dist/plugins/generate-nestjs-module/index.d.ts +3 -0
  128. package/dist/plugins/generate-nestjs-module/index.d.ts.map +1 -0
  129. package/dist/plugins/index.d.ts +11 -0
  130. package/dist/plugins/index.d.ts.map +1 -1
  131. package/dist/plugins/initialize/index.d.ts +2 -0
  132. package/dist/plugins/initialize/index.d.ts.map +1 -0
  133. package/dist/plugins/initialize/initialize.plugin.d.ts +15 -0
  134. package/dist/plugins/initialize/initialize.plugin.d.ts.map +1 -0
  135. package/dist/plugins/overwrite-operation-id/index.d.ts +2 -0
  136. package/dist/plugins/overwrite-operation-id/index.d.ts.map +1 -0
  137. package/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts +20 -0
  138. package/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts.map +1 -0
  139. package/dist/plugins/overwrite-query-options/index.d.ts +2 -0
  140. package/dist/plugins/overwrite-query-options/index.d.ts.map +1 -0
  141. package/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts +18 -0
  142. package/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts.map +1 -0
  143. package/dist/plugins/prettier/index.d.ts +1 -5
  144. package/dist/plugins/prettier/index.d.ts.map +1 -1
  145. package/dist/plugins/prettier/prettier.plugin.d.ts +6 -0
  146. package/dist/plugins/prettier/prettier.plugin.d.ts.map +1 -0
  147. package/dist/plugins/shaking/index.d.ts +2 -0
  148. package/dist/plugins/shaking/index.d.ts.map +1 -0
  149. package/dist/plugins/shaking/shaking.plugin.d.ts +8 -0
  150. package/dist/plugins/shaking/shaking.plugin.d.ts.map +1 -0
  151. package/dist/plugins/terminal-select/index.d.ts +2 -0
  152. package/dist/plugins/terminal-select/index.d.ts.map +1 -0
  153. package/dist/plugins/terminal-select/terminal-select.plugin.d.ts +18 -0
  154. package/dist/plugins/terminal-select/terminal-select.plugin.d.ts.map +1 -0
  155. package/dist/plugins/terminal-select/types/ignore-mode.d.ts.map +1 -0
  156. package/dist/plugins/terminal-select/types/index.d.ts +2 -0
  157. package/dist/plugins/terminal-select/types/index.d.ts.map +1 -0
  158. package/dist/plugins/terminal-select/utils/index.d.ts +2 -0
  159. package/dist/plugins/terminal-select/utils/index.d.ts.map +1 -0
  160. package/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts +5 -0
  161. package/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts.map +1 -0
  162. package/dist/plugins.cjs +2305 -31
  163. package/dist/plugins.cjs.map +1 -1
  164. package/dist/plugins.js +2283 -30
  165. package/dist/plugins.js.map +1 -1
  166. package/dist/transformers/api-document/api-document.transformer.d.ts +8 -0
  167. package/dist/transformers/api-document/api-document.transformer.d.ts.map +1 -0
  168. package/dist/transformers/api-document/index.d.ts +2 -0
  169. package/dist/transformers/api-document/index.d.ts.map +1 -0
  170. package/dist/transformers/api-document/nestjs-client.renderer.d.ts +14 -0
  171. package/dist/transformers/api-document/nestjs-client.renderer.d.ts.map +1 -0
  172. package/dist/transformers/api-document/nestjs-module.renderer.d.ts +12 -0
  173. package/dist/transformers/api-document/nestjs-module.renderer.d.ts.map +1 -0
  174. package/dist/transformers/entrypoint/entrypoint.transformer.d.ts +10 -0
  175. package/dist/transformers/entrypoint/entrypoint.transformer.d.ts.map +1 -0
  176. package/dist/transformers/entrypoint/index.d.ts +2 -0
  177. package/dist/transformers/entrypoint/index.d.ts.map +1 -0
  178. package/dist/transformers/index.d.ts +6 -0
  179. package/dist/transformers/index.d.ts.map +1 -0
  180. package/dist/transformers/json-schema/comment.renderer.d.ts +8 -0
  181. package/dist/transformers/json-schema/comment.renderer.d.ts.map +1 -0
  182. package/dist/transformers/json-schema/declaration.renderer.d.ts +26 -0
  183. package/dist/transformers/json-schema/declaration.renderer.d.ts.map +1 -0
  184. package/dist/transformers/json-schema/index.d.ts +4 -0
  185. package/dist/transformers/json-schema/index.d.ts.map +1 -0
  186. package/dist/transformers/json-schema/json-schema.transformer.d.ts +7 -0
  187. package/dist/transformers/json-schema/json-schema.transformer.d.ts.map +1 -0
  188. package/dist/transformers/json-schema/reference.transformer.d.ts +5 -0
  189. package/dist/transformers/json-schema/reference.transformer.d.ts.map +1 -0
  190. package/dist/transformers/json-schema/types/any-other-attribute.d.ts.map +1 -0
  191. package/dist/transformers/json-schema/types/index.d.ts +3 -0
  192. package/dist/transformers/json-schema/types/index.d.ts.map +1 -0
  193. package/dist/transformers/json-schema/types/mixed-schema-object.d.ts.map +1 -0
  194. package/dist/transformers/operation-definition/comment.renderer.d.ts +8 -0
  195. package/dist/transformers/operation-definition/comment.renderer.d.ts.map +1 -0
  196. package/dist/transformers/operation-definition/declaration.renderer.d.ts +20 -0
  197. package/dist/transformers/operation-definition/declaration.renderer.d.ts.map +1 -0
  198. package/dist/transformers/operation-definition/index.d.ts +3 -0
  199. package/dist/transformers/operation-definition/index.d.ts.map +1 -0
  200. package/dist/transformers/operation-definition/micro-function.renderer.d.ts +19 -0
  201. package/dist/transformers/operation-definition/micro-function.renderer.d.ts.map +1 -0
  202. package/dist/transformers/operation-definition/nestjs-method.renderer.d.ts +15 -0
  203. package/dist/transformers/operation-definition/nestjs-method.renderer.d.ts.map +1 -0
  204. package/dist/transformers/operation-definition/operation-definition.transformer.d.ts +11 -0
  205. package/dist/transformers/operation-definition/operation-definition.transformer.d.ts.map +1 -0
  206. package/dist/transformers/operation-definition/typescript-snippet.d.ts +22 -0
  207. package/dist/transformers/operation-definition/typescript-snippet.d.ts.map +1 -0
  208. package/dist/transformers/operation-definition/utils/index.d.ts +2 -0
  209. package/dist/transformers/operation-definition/utils/index.d.ts.map +1 -0
  210. package/dist/transformers/operation-definition/utils/type-name-factory.d.ts +4 -0
  211. package/dist/transformers/operation-definition/utils/type-name-factory.d.ts.map +1 -0
  212. package/dist/transformers/schema-definition/index.d.ts +2 -0
  213. package/dist/transformers/schema-definition/index.d.ts.map +1 -0
  214. package/dist/transformers/schema-definition/schema-definition.transformer.d.ts +10 -0
  215. package/dist/transformers/schema-definition/schema-definition.transformer.d.ts.map +1 -0
  216. package/dist/transformers/types/renderer.d.ts +4 -0
  217. package/dist/transformers/types/renderer.d.ts.map +1 -0
  218. package/dist/types/generator.d.ts +7 -0
  219. package/dist/types/generator.d.ts.map +1 -0
  220. package/dist/types/index.d.ts +1 -2
  221. package/dist/types/index.d.ts.map +1 -1
  222. package/dist/types/runtime-config.d.ts +2 -17
  223. package/dist/types/runtime-config.d.ts.map +1 -1
  224. package/dist/utils/ignore-matcher.d.ts +1 -2
  225. package/dist/utils/ignore-matcher.d.ts.map +1 -1
  226. package/dist/utils/indent.d.ts +2 -0
  227. package/dist/utils/indent.d.ts.map +1 -0
  228. package/dist/utils/openapi-utils/index.d.ts +6 -2
  229. package/dist/utils/openapi-utils/index.d.ts.map +1 -1
  230. package/dist/utils/openapi-utils/map-operation.d.ts +4 -0
  231. package/dist/utils/openapi-utils/map-operation.d.ts.map +1 -0
  232. package/dist/utils/openapi-utils/map-parameter.d.ts +4 -0
  233. package/dist/utils/openapi-utils/map-parameter.d.ts.map +1 -0
  234. package/dist/utils/openapi-utils/to-3_1.d.ts +3 -0
  235. package/dist/utils/openapi-utils/to-3_1.d.ts.map +1 -0
  236. package/package.json +3 -3
  237. package/dist/renderer/json-schema/index.d.ts +0 -3
  238. package/dist/renderer/json-schema/index.d.ts.map +0 -1
  239. package/dist/renderer/operation-request/error-to-comment.d.ts +0 -2
  240. package/dist/renderer/operation-request/error-to-comment.d.ts.map +0 -1
  241. package/dist/renderer/operation-request/index.d.ts +0 -8
  242. package/dist/renderer/operation-request/index.d.ts.map +0 -1
  243. package/dist/renderer/operation-request/request-body.d.ts +0 -4
  244. package/dist/renderer/operation-request/request-body.d.ts.map +0 -1
  245. package/dist/renderer/operation-type/index.d.ts +0 -6
  246. package/dist/renderer/operation-type/index.d.ts.map +0 -1
  247. package/dist/renderer/request/index.d.ts +0 -2
  248. package/dist/renderer/request/index.d.ts.map +0 -1
  249. package/dist/renderer/types/any-other-attribute.d.ts.map +0 -1
  250. package/dist/renderer/types/mixed-schema-object.d.ts.map +0 -1
  251. package/dist/renderer/utils/generate-schema.d.ts +0 -6
  252. package/dist/renderer/utils/generate-schema.d.ts.map +0 -1
  253. package/dist/tasks/compile/index.d.ts +0 -6
  254. package/dist/tasks/compile/index.d.ts.map +0 -1
  255. package/dist/tasks/compile/utils/compile-operation-definition.d.ts +0 -15
  256. package/dist/tasks/compile/utils/compile-operation-definition.d.ts.map +0 -1
  257. package/dist/tasks/compile/utils/compile-schema-definition.d.ts +0 -13
  258. package/dist/tasks/compile/utils/compile-schema-definition.d.ts.map +0 -1
  259. package/dist/tasks/download/index.d.ts.map +0 -1
  260. package/dist/tasks/index.d.ts +0 -10
  261. package/dist/tasks/index.d.ts.map +0 -1
  262. package/dist/tasks/interactive/index.d.ts +0 -15
  263. package/dist/tasks/interactive/index.d.ts.map +0 -1
  264. package/dist/tasks/interactive/utils/select-operation-definitions.d.ts +0 -5
  265. package/dist/tasks/interactive/utils/select-operation-definitions.d.ts.map +0 -1
  266. package/dist/tasks/persist/index.d.ts +0 -6
  267. package/dist/tasks/persist/index.d.ts.map +0 -1
  268. package/dist/tasks/setup/index.d.ts.map +0 -1
  269. package/dist/tasks/setup/utils/find-nearest-package-json.d.ts.map +0 -1
  270. package/dist/tasks/setup/utils/get-project-module-system.d.ts.map +0 -1
  271. package/dist/tasks/setup/utils/index.d.ts.map +0 -1
  272. package/dist/tasks/setup/utils/validate-modules.d.ts.map +0 -1
  273. package/dist/tasks/shaking/index.d.ts +0 -10
  274. package/dist/tasks/shaking/index.d.ts.map +0 -1
  275. package/dist/tasks/types/base-task-options.d.ts +0 -6
  276. package/dist/tasks/types/base-task-options.d.ts.map +0 -1
  277. package/dist/tasks/types/file.d.ts +0 -4
  278. package/dist/tasks/types/file.d.ts.map +0 -1
  279. package/dist/tasks/types/ignore-mode.d.ts.map +0 -1
  280. package/dist/tasks/types/index.d.ts +0 -6
  281. package/dist/tasks/types/index.d.ts.map +0 -1
  282. package/dist/tasks/types/task-context.d.ts +0 -28
  283. package/dist/tasks/types/task-context.d.ts.map +0 -1
  284. package/dist/tasks/types/task-wrapper.d.ts +0 -4
  285. package/dist/tasks/types/task-wrapper.d.ts.map +0 -1
  286. package/dist/tasks/utils/anchor.d.ts.map +0 -1
  287. package/dist/tasks/utils/api-document.d.ts +0 -18
  288. package/dist/tasks/utils/api-document.d.ts.map +0 -1
  289. package/dist/tasks/utils/api-document_v3_1.d.ts.map +0 -1
  290. package/dist/tasks/utils/artifact.d.ts +0 -27
  291. package/dist/tasks/utils/artifact.d.ts.map +0 -1
  292. package/dist/tasks/utils/dependency.d.ts +0 -24
  293. package/dist/tasks/utils/dependency.d.ts.map +0 -1
  294. package/dist/tasks/utils/index.d.ts.map +0 -1
  295. package/dist/tasks/utils/json-schema.d.ts +0 -8
  296. package/dist/tasks/utils/json-schema.d.ts.map +0 -1
  297. package/dist/tasks/utils/module-definition.d.ts.map +0 -1
  298. package/dist/tasks/utils/operation-definition.d.ts.map +0 -1
  299. package/dist/tasks/utils/proxy-task-wrapper.d.ts +0 -3
  300. package/dist/tasks/utils/proxy-task-wrapper.d.ts.map +0 -1
  301. package/dist/tasks/utils/schema-definition.d.ts.map +0 -1
  302. package/dist/tasks/utils/to-comment.d.ts.map +0 -1
  303. package/dist/tasks/validate/index.d.ts +0 -6
  304. package/dist/tasks/validate/index.d.ts.map +0 -1
  305. package/dist/types/operation-id-factory.d.ts +0 -10
  306. package/dist/types/operation-id-factory.d.ts.map +0 -1
  307. package/dist/types/qs.d.ts +0 -9
  308. package/dist/types/qs.d.ts.map +0 -1
  309. package/dist/utils/openapi-utils/update-operation-id.d.ts +0 -5
  310. package/dist/utils/openapi-utils/update-operation-id.d.ts.map +0 -1
  311. /package/dist/{tasks → compiler/tasks}/setup/utils/find-nearest-package-json.d.ts +0 -0
  312. /package/dist/{tasks → compiler/tasks}/setup/utils/get-project-module-system.d.ts +0 -0
  313. /package/dist/{tasks → compiler/tasks}/setup/utils/index.d.ts +0 -0
  314. /package/dist/{tasks → compiler/tasks}/setup/utils/validate-modules.d.ts +0 -0
  315. /package/dist/{tasks/utils → models}/anchor.d.ts +0 -0
  316. /package/dist/{tasks → models}/utils/to-comment.d.ts +0 -0
  317. /package/dist/{tasks → plugins/terminal-select}/types/ignore-mode.d.ts +0 -0
  318. /package/dist/{renderer → transformers/json-schema}/types/any-other-attribute.d.ts +0 -0
  319. /package/dist/{renderer → transformers/json-schema}/types/mixed-schema-object.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/eslint/index.ts","../src/plugins/prettier/index.ts","../src/plugins/body-fallback/index.ts","../src/utils/json-schema-utils/is-array.ts","../src/utils/json-schema-utils/is-mixed.ts","../src/utils/json-schema-utils/is-non-array.ts","../src/utils/json-schema-utils/is-ref.ts","../src/utils/json-schema-utils/index.ts"],"sourcesContent":["import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { ESLint } from 'eslint'\n\n\ninterface EslintPluginOptions {\n /**\n * List of ESLint rules to disable\n */\n disable?: string[]\n}\n\nexport class EslintPlugin implements Plugin {\n constructor(private options: EslintPluginOptions = {}) {}\n\n\n apply(compiler: Compiler): void {\n if (!compiler.options.build) return\n\n if (this.options.disable && this.options.disable.length > 0) {\n const $rules = [\n ...this.options.disable.map((rule) => `/* eslint-disable ${rule} */`),\n ].join('\\n')\n\n compiler.hooks.afterCompile.tap(EslintPlugin.name, () => {\n const artifacts = compiler.context.compiled?.artifacts || []\n\n for (const artifact of artifacts) {\n artifact.anchor.append('file:start', $rules)\n }\n })\n }\n\n compiler.hooks.afterPersist.tapPromise(EslintPlugin.name, async (task) => {\n const files = compiler.context.persisted?.files || []\n if (files.length === 0) return\n\n const eslint = new ESLint({ fix: true })\n const results = await eslint.lintFiles(files.map((file) => file.path))\n await ESLint.outputFixes(results)\n })\n }\n}\n","import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { exec } from 'child_process'\nimport { promisify } from 'util'\n\nconst execAsync = promisify(exec)\n\n\nexport class PrettierPlugin implements Plugin {\n apply(compiler: Compiler): void {\n if (!compiler.options.build) return\n\n compiler.hooks.afterPersist.tapPromise(PrettierPlugin.name, async () => {\n const files = compiler.context.persisted?.files || []\n if (files.length === 0) return\n\n const filePaths = files.map((file) => file.path).join(' ')\n await execAsync(`prettier --write ${filePaths}`)\n })\n }\n}\n","import * as R from 'ramda'\nimport { Compiler } from '~/compiler/compiler.js'\nimport { Artifact } from '~/tasks/utils/artifact.js'\nimport { OperationDefinition } from '~/tasks/utils/operation-definition.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport class BodyFallbackPlugin implements Plugin {\n apply(compiler: Compiler): void {\n compiler.hooks.afterCompileOperationRequest.tap(BodyFallbackPlugin.name, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n const operation = operationDefinition.operation\n\n const parameters = operation.parameters?.filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p)) || []\n const keys = parameters.map((p) => p.name).filter(R.isNotNil)\n\n const $acc = !keys.length\n ? ' acc[key] = args[key]'\n : [\n ` if (![${keys.map((k) => JSON.stringify(k)).join(', ')}].includes(key)) {`,\n ' acc[key] = args[key]',\n ' }',\n ].join('\\n')\n\n artifact.anchor.block.replace('body', [\n // $mediaType ? `${$mediaType}\\n` : undefined,\n ' if (typeof args === \"object\" && args !== null && !Array.isArray(args)) {',\n ' const requestBody = Object.keys(args)',\n ' .reduce((acc, key) => {',\n $acc,\n ' return acc',\n ' }, {} as Record<string, unknown>)',\n '',\n ' if (Object.keys(requestBody).length > 0) {',\n ' req.send(requestBody)',\n ' }',\n ' }',\n ].filter(R.isNotNil).join('\\n'))\n\n return artifact\n })\n }\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.ArraySchemaObject {\n return schema.type === 'array'\n}\n","\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\n\nexport function isMixed(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is MixedSchemaObject {\n return Array.isArray(schema.type)\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isNonArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.NonArraySchemaObject {\n return typeof schema.type === 'string' && schema.type !== 'array'\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function isRef(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject): schema is OpenAPIV3_1.ReferenceObject {\n return '$ref' in schema\n}\n","import { isArray } from './is-array.js'\nimport { isMixed } from './is-mixed.js'\nimport { isNonArray } from './is-non-array.js'\nimport { isRef } from './is-ref.js'\n\n\nexport class JsonSchemaUtils {\n static isRef = isRef\n static isArray = isArray\n static isNonArray = isNonArray\n static isMixed = isMixed\n}\n"],"mappings":";AAEA,SAAS,cAAc;AAUhB,IAAM,eAAN,MAAM,cAA+B;AAAA,EAC1C,YAAoB,UAA+B,CAAC,GAAG;AAAnC;AAAA,EAAoC;AAAA,EAGxD,MAAM,UAA0B;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/prettier/prettier.plugin.ts","../src/plugins/body-fallback/index.ts","../src/utils/json-schema-utils/is-array.ts","../src/utils/json-schema-utils/is-mixed.ts","../src/utils/json-schema-utils/is-non-array.ts","../src/utils/json-schema-utils/is-ref.ts","../src/utils/json-schema-utils/index.ts","../src/plugins/generate-micro-function/generate-micro-function.plugin.ts","../src/plugins/generate-micro-function/constants/metadata-storage.ts","../src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts","../src/models/artifact.ts","../src/models/anchor.ts","../src/models/api-document_v3_1.ts","../src/models/module-definition.ts","../src/constants/supported-methods.ts","../src/models/operation-definition.ts","../src/utils/is-keywords.ts","../src/utils/is-reserved-word.ts","../src/models/schema-definition.ts","../src/utils/logger.ts","../src/plugins/generate-declaration/generate-declaration.plugin.ts","../src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts","../src/transformers/json-schema/comment.renderer.ts","../src/transformers/json-schema/declaration.renderer.ts","../src/utils/indent.ts","../src/transformers/json-schema/reference.transformer.ts","../src/transformers/json-schema/json-schema.transformer.ts","../src/transformers/schema-definition/schema-definition.transformer.ts","../src/transformers/operation-definition/comment.renderer.ts","../src/transformers/operation-definition/declaration.renderer.ts","../src/transformers/operation-definition/utils/type-name-factory.ts","../src/utils/openapi-utils/dereference.ts","../src/utils/openapi-utils/dereference-operation.ts","../src/utils/openapi-utils/remove-undefined-ref.ts","../src/utils/openapi-utils/is-ref-defined.ts","../src/utils/openapi-utils/dereference-deep.ts","../src/utils/openapi-utils/to-3_1.ts","../src/utils/openapi-utils/map-operation.ts","../src/utils/openapi-utils/map-parameter.ts","../src/utils/openapi-utils/index.ts","../src/transformers/operation-definition/micro-function.renderer.ts","../src/exception.ts","../src/transformers/operation-definition/typescript-snippet.ts","../src/constants/qs-array-format.ts","../src/transformers/operation-definition/nestjs-method.renderer.ts","../src/transformers/operation-definition/operation-definition.transformer.ts","../src/transformers/entrypoint/entrypoint.transformer.ts","../src/transformers/api-document/nestjs-client.renderer.ts","../src/transformers/api-document/nestjs-module.renderer.ts","../src/transformers/api-document/api-document.transformer.ts","../src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts","../src/plugins/generate-declaration/constants/metadata-storage.ts","../src/plugins/generate-micro-function/generators/request/request.generator.ts","../src/plugins/generate-nestjs-module/generate-nestjs-module.ts","../src/plugins/generate-nestjs-module/constants/metadata-storage.ts","../src/plugins/generate-nestjs-module/generators/nestjs-module.generator.ts","../src/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.ts","../src/plugins/download-http-file/download-http-file.plugin.ts","../src/plugins/download-local-file/download-local-file.plugin.ts","../src/plugins/shaking/shaking.plugin.ts","../src/plugins/terminal-select/utils/select-operation-definitions.ts","../src/plugins/terminal-select/terminal-select.plugin.ts","../src/plugins/initialize/initialize.plugin.ts","../src/plugins/overwrite-operation-id/overwrite-operation-id.plugin.ts","../src/plugins/overwrite-query-options/overwrite-query-options.plugin.ts"],"sourcesContent":["import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { ESLint } from 'eslint'\n\n\ninterface EslintPluginOptions {\n /**\n * List of ESLint rules to disable\n */\n disable?: string[]\n}\n\nexport class EslintPlugin implements Plugin {\n constructor(private options: EslintPluginOptions = {}) {}\n\n\n apply(compiler: Compiler): void {\n if (!compiler.options.build) return\n\n if (this.options.disable && this.options.disable.length > 0) {\n const $rules = [\n ...this.options.disable.map((rule) => `/* eslint-disable ${rule} */`),\n ].join('\\n')\n\n compiler.hooks.afterCompile.tap(EslintPlugin.name, () => {\n const artifacts = compiler.context.artifacts || []\n\n for (const artifact of artifacts) {\n artifact.anchor.append('file:start', $rules)\n }\n })\n }\n\n compiler.hooks.afterPersist.tapPromise(EslintPlugin.name, async (task) => {\n const files = compiler.context.assets || []\n if (files.length === 0) return\n\n const eslint = new ESLint({ fix: true })\n const results = await eslint.lintFiles(files.map((file) => file.path))\n await ESLint.outputFixes(results)\n })\n }\n}\n","import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { exec } from 'child_process'\nimport { promisify } from 'util'\n\nconst execAsync = promisify(exec)\n\n\nexport class PrettierPlugin implements Plugin {\n apply(compiler: Compiler): void {\n if (!compiler.options.build) return\n\n compiler.hooks.afterPersist.tapPromise(PrettierPlugin.name, async () => {\n const files = compiler.context.assets || []\n if (files.length === 0) return\n\n const filePaths = files.map((file) => file.path).join(' ')\n await execAsync(`prettier --write ${filePaths}`)\n })\n }\n}\n","import * as R from 'ramda'\nimport { Compiler } from '~/compiler/compiler.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nimport { GenerateMicroFunctionPlugin } from '../generate-micro-function/index.js'\n\n\nexport class BodyFallbackPlugin implements Plugin {\n apply(compiler: Compiler): void {\n compiler.hooks.setup.tap(BodyFallbackPlugin.name, () => {\n const generateMicroFunctionPluginMetadata = GenerateMicroFunctionPlugin.of(compiler)\n\n if (!generateMicroFunctionPluginMetadata) {\n throw new Error('BodyFallbackPlugin requires GenerateMicroFunctionPlugin to be applied first.')\n }\n\n generateMicroFunctionPluginMetadata.hooks.afterMicroFunctionArtifactGenerated\n .tap(BodyFallbackPlugin.name, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n const operation = operationDefinition.operation\n\n const parameters = operation.parameters?.filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p)) || []\n const keys = parameters.map((p) => p.name).filter(R.isNotNil)\n\n const $acc = !keys.length\n ? ' acc[key] = args[key]'\n : [\n ` if (![${keys.map((k) => JSON.stringify(k)).join(', ')}].includes(key)) {`,\n ' acc[key] = args[key]',\n ' }',\n ].join('\\n')\n\n artifact.anchor.block.replace('body', [\n // $mediaType ? `${$mediaType}\\n` : undefined,\n ' if (typeof args === \"object\" && args !== null && !Array.isArray(args)) {',\n ' const requestBody = Object.keys(args)',\n ' .reduce((acc, key) => {',\n $acc,\n ' return acc',\n ' }, {} as Record<string, unknown>)',\n '',\n ' if (Object.keys(requestBody).length > 0) {',\n ' req.send(requestBody)',\n ' }',\n ' }',\n ].filter(R.isNotNil).join('\\n'))\n\n return artifact\n })\n })\n }\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.ArraySchemaObject {\n return schema.type === 'array'\n}\n","\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\n\nexport function isMixed(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is MixedSchemaObject {\n return Array.isArray(schema.type)\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isNonArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.NonArraySchemaObject {\n return typeof schema.type === 'string' && schema.type !== 'array'\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function isRef(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject): schema is OpenAPIV3_1.ReferenceObject {\n return '$ref' in schema\n}\n","import { isArray } from './is-array.js'\nimport { isMixed } from './is-mixed.js'\nimport { isNonArray } from './is-non-array.js'\nimport { isRef } from './is-ref.js'\n\n\nexport class JsonSchemaUtils {\n static isRef = isRef\n static isArray = isArray\n static isNonArray = isNonArray\n static isMixed = isMixed\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { GenerateMicroFunctionPluginMetadata, MetadataStorage } from './constants/index.js'\nimport { MicroFunctionGenerator, RequestGenerator } from './generators/index.js'\n\n\nexport class GenerateMicroFunctionPlugin implements Plugin {\n private readonly microFunctionGenerator = new MicroFunctionGenerator()\n private readonly requestGenerator = new RequestGenerator()\n\n apply(compiler: Compiler): void {\n GenerateMicroFunctionPlugin.register(compiler)\n\n compiler.hooks.compile.tapPromise(GenerateMicroFunctionPlugin.name, async (task: TaskWrapper) => {\n const artifacts = [\n ...(await this.requestGenerator.compile(compiler, task)),\n ...(await this.microFunctionGenerator.compile(compiler, task)),\n ]\n\n compiler.context.artifacts!.push(...artifacts)\n })\n }\n\n static register(compiler: Compiler): GenerateMicroFunctionPluginMetadata {\n if (!MetadataStorage.has(compiler)) {\n MetadataStorage.set(compiler, {\n hooks: {\n afterEntrypointArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>(['artifact', 'task']),\n afterMicroFunctionArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>(['artifact', 'operationDefinition', 'task']),\n },\n })\n }\n\n return MetadataStorage.get(compiler)!\n }\n\n\n static of(compiler: Compiler): GenerateMicroFunctionPluginMetadata | undefined {\n return this.register(compiler)\n }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\n\nexport interface GenerateMicroFunctionPluginMetadata {\n hooks: {\n afterEntrypointArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>\n afterMicroFunctionArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>\n }\n}\n\nexport const MetadataStorage = new WeakMap<Compiler, GenerateMicroFunctionPluginMetadata>()\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport * as changeCase from 'change-case'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Generator, RuntimeConfig } from '~/types/index.js'\nimport { Artifact, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { OperationDeclarationGenerator } from '~/plugins/generate-declaration/index.js'\nimport { OperationDefinitionTransformer } from '~/transformers/index.js'\nimport { EntrypointTransformer } from '~/transformers/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\nimport { RequestGenerator } from '../request/index.js'\n\n\nexport const MICRO_FUNCTION_GENERATOR = 'microFunctionGenerator'\n\nexport class MicroFunctionGenerator implements Generator {\n async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n const metadata = MetadataStorage.get(compiler)!\n const context = compiler.context\n const rc = context.rc!\n const documents = context.documents!\n\n const operationDefinitions = documents.flatMap((document) => document.operations)\n\n const artifactMap = new Map<OperationDefinition, Artifact>(\n await Promise.all(\n operationDefinitions.map(async (operationDefinition) => (<const>[\n operationDefinition,\n await metadata.hooks.afterMicroFunctionArtifactGenerated.promise(\n this.generateOperationDefinitionArtifact(operationDefinition, rc),\n operationDefinition,\n task,\n ),\n ])),\n ),\n )\n\n\n const entrypoints = await Promise.all(\n R.collectBy(\n (operationDefinition: OperationDefinition) => operationDefinition.module.name,\n operationDefinitions,\n )\n .map((operationDefinitions) => (<const>[\n operationDefinitions[0].module,\n operationDefinitions\n .map((operationDefinition) => artifactMap.get(operationDefinition))\n .filter((artifact): artifact is Artifact => Boolean(artifact)),\n ]))\n .map(async ([moduleDefinition, artifacts]) => await metadata.hooks.afterEntrypointArtifactGenerated.promise(\n this.generateEntrypointArtifact(\n moduleDefinition,\n artifacts,\n rc,\n ),\n task,\n )),\n )\n\n return [...entrypoints, ...artifactMap.values()]\n }\n\n\n private generateOperationDefinitionArtifact(operationDefinition: OperationDefinition, rc: RuntimeConfig): Artifact {\n const filepath = MicroFunctionGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: MicroFunctionGenerator.getOperationDefinitionArtifactId(operationDefinition),\n filepath,\n content: OperationDefinitionTransformer.toMicroFunction(operationDefinition, {\n esm: rc.esm,\n getOperationDefinitionDeclarationFilepath(operationDefinition: OperationDefinition): string {\n const relativePath = path.relative(\n dirpath,\n OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle),\n )\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n getRequestFilepath(): string {\n const relativePath = path.relative(\n dirpath,\n RequestGenerator.getRequestArtifactFilepath(),\n )\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n }),\n extensionName: '.type.ts',\n })\n\n return artifact\n }\n\n private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n const filepath = MicroFunctionGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle)\n const dirpath = filepath.substring(0, filepath.lastIndexOf('/'))\n\n const artifact = new Artifact({\n id: MicroFunctionGenerator.getEntrypointArtifactId(moduleDefinition),\n filepath,\n content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n })\n\n return artifact\n }\n\n\n static getOperationDefinitionArtifactFilepath(operationDefinition: OperationDefinition, fileNamingStyle: FileNamingStyle): string {\n const filename = `${changeCase[fileNamingStyle](operationDefinition.operationId)}.fn.ts`\n const filepath = [\n '.',\n changeCase[fileNamingStyle](operationDefinition.module.name),\n 'operations',\n filename,\n ].join('/')\n\n return filepath\n }\n\n static getOperationDefinitionArtifactId(operationDefinition: OperationDefinition): string {\n return `${operationDefinition.id}?generator=${MICRO_FUNCTION_GENERATOR}`\n }\n\n static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n return [\n '.',\n changeCase[fileNamingStyle](moduleDefinition.name),\n 'operations',\n 'index.ts',\n ].join('/')\n }\n\n static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n return `${moduleDefinition.address}/paths/entrypoint?generator=${MICRO_FUNCTION_GENERATOR}`\n }\n}\n","import * as path from 'path'\nimport { Anchor } from './anchor.js'\n\n\nconst HeaderComment = [\n '// Code generated by keq-cli. DO NOT EDIT.',\n '// Code generated by keq-cli. DO NOT EDIT.',\n '// Code generated by keq-cli. DO NOT EDIT.',\n '',\n '',\n].join('\\n')\n\nexport class Artifact {\n id: string\n filepath: string\n content: string\n extensionName\n anchor = new Anchor(this)\n\n constructor(options: {\n id: string\n filepath: string\n content: string\n extensionName?: string\n }) {\n this.id = options.id\n this.filepath = options.filepath\n this.extensionName = options.extensionName || path.extname(options.filepath)\n this.content = options.content\n }\n\n get dirname(): string {\n return path.dirname(this.filepath)\n }\n\n renderer(): string {\n return `${HeaderComment}${this.content}`\n }\n}\n","import type { Artifact } from './artifact.js'\n\nclass AnchorBlock {\n constructor(\n private artifact: Artifact,\n ) {}\n\n /**\n * Append content to the end of the anchor block.\n */\n append(anchorName: string, content: string): void {\n const lines = this.artifact.content.split('\\n')\n\n const anchor = `@anchor:${anchorName}:end`\n const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n if (anchorIndex === -1) {\n throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n }\n\n lines.splice(anchorIndex, 0, content)\n this.artifact.content = lines.join('\\n')\n }\n\n prepend(anchorName: string, content: string): void {\n const lines = this.artifact.content.split('\\n')\n\n const anchor = `@anchor:${anchorName}:start`\n const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n if (anchorIndex === -1) {\n throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n }\n\n lines.splice(anchorIndex + 1, 0, content)\n this.artifact.content = lines.join('\\n')\n }\n\n replace(anchorName: string, content: string): void {\n const lines = this.artifact.content.split('\\n')\n const startIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:start */`))\n const endIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:end */`))\n\n if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {\n throw new Error(`\"@anchor:${anchorName}:start\" or \"@anchor:${anchorName}:end\" not found in artifact \"${this.artifact.filepath}\".`)\n }\n\n lines.splice(startIndex + 1, endIndex - startIndex - 1, content)\n this.artifact.content = lines.join('\\n')\n }\n}\n\n\nexport class Anchor {\n block: AnchorBlock\n\n constructor(\n private artifact: Artifact,\n ) {\n this.block = new AnchorBlock(artifact)\n }\n\n append(anchorName: string, content: string): void {\n const lines = this.artifact.content.split('\\n')\n\n const anchor = `@anchor:${anchorName}`\n const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n if (anchorIndex === -1) {\n throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n }\n\n lines.splice(anchorIndex + 1, 0, content)\n this.artifact.content = lines.join('\\n')\n }\n\n prepend(anchorName: string, content: string): void {\n const lines = this.artifact.content.split('\\n')\n\n const anchor = `@anchor:${anchorName}`\n const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n if (anchorIndex === -1) {\n throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n }\n\n lines.splice(anchorIndex, 0, content)\n this.artifact.content = lines.join('\\n')\n }\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\nimport { OperationDefinition } from './operation-definition.js'\nimport { SchemaDefinition } from './schema-definition.js'\nimport { logger } from '~/utils/logger.js'\n\n\nexport class ApiDocumentV3_1 {\n readonly module: ModuleDefinition\n readonly specification: OpenAPIV3_1.Document\n\n constructor(specification: OpenAPIV3_1.Document, module: ModuleDefinition) {\n this.module = module\n this.specification = specification\n }\n\n get schemas(): SchemaDefinition[] {\n const module = this.module\n\n return Object.entries(this.specification.components?.schemas || {})\n .map(([name, schema]) => new SchemaDefinition({\n name,\n schema,\n module,\n document: this,\n }))\n }\n\n get operations(): OperationDefinition[] {\n const module = this.module\n\n return Object.entries(this.specification.paths || {})\n .flatMap(([pathname, pathItem]) => Object.entries(pathItem || {})\n .filter(([method]) => SupportedMethods.includes(method.toLowerCase()))\n .map(([method, operation]) => new OperationDefinition({\n method,\n pathname,\n operation,\n module,\n document: this,\n })))\n }\n\n isEmpty(): boolean {\n return R.isEmpty(this.specification.paths)\n }\n\n dereference($ref: string): SchemaDefinition | undefined {\n if ($ref.startsWith('#/')) {\n return this.schemas.find((schema) => schema.id.endsWith($ref))\n }\n\n logger.warn(`The $ref(${$ref}) is not defined in ${this.module.name} openapi/swagger.`)\n }\n\n isRefDefined($ref: string): boolean {\n if ($ref.startsWith('#/')) {\n const path = $ref.replace('#/', '').split('/')\n return R.path(path, this.specification) !== undefined\n }\n\n return false\n }\n\n static unknown(): ApiDocumentV3_1 {\n return new ApiDocumentV3_1({}, ModuleDefinition.unknown())\n }\n}\n","export class ModuleDefinition {\n name: string\n address: string\n\n constructor(name: string, address: string) {\n this.name = name\n this.address = address\n }\n\n static unknown(): ModuleDefinition {\n return new ModuleDefinition('', '')\n }\n}\n","export const SupportedMethods = [\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n]\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { isKeywords } from '~/utils/is-keywords.js'\nimport { isReservedWord } from '~/utils/is-reserved-word.js'\nimport { ApiDocumentV3_1 } from './api-document_v3_1.js'\nimport { JSONPath } from 'jsonpath-plus'\nimport { SchemaDefinition } from './schema-definition.js'\n\n\nexport class OperationDefinition {\n readonly module: ModuleDefinition\n\n readonly operationId: string\n readonly method: string\n readonly pathname: string\n readonly operation: OpenAPIV3_1.OperationObject\n readonly document: ApiDocumentV3_1\n\n get id(): string {\n return `${this.module.address}#/paths/${this.pathname}/${this.method}`\n }\n\n constructor(args: {\n method: string\n pathname: string\n operation: OpenAPIV3_1.OperationObject\n module: ModuleDefinition\n document: ApiDocumentV3_1\n }) {\n this.module = args.module\n this.method = args.method.toLowerCase()\n this.pathname = args.pathname\n this.document = args.document\n this.operationId = this.formatOperationId(args.method, args.pathname, args.operation)\n\n this.operation = {\n ...args.operation,\n operationId: this.operationId,\n }\n }\n\n private formatOperationId(method: string, pathname: string, operation: OpenAPIV3_1.OperationObject): string {\n const operationId = operation.operationId\n\n if (\n operationId\n && operationId !== 'index'\n && !isKeywords(operationId)\n && !isReservedWord(operationId)\n ) {\n return operationId as string\n }\n\n return `${method}_${pathname}`\n .replace(/\\//g, '_')\n .replace(/-/g, '_')\n .replace(/:/g, '$$')\n .replace(/{(.+)}/, '$$$1')\n }\n\n getDependencies(): SchemaDefinition[] {\n const refs = R.uniq([\n ...JSONPath<string>({\n path: '$.requestBody.content..schema..$ref',\n json: this.operation,\n }),\n ...JSONPath<string>({\n path: '$.responses..content..schema..$ref',\n json: this.operation,\n }),\n ...JSONPath<string>({\n path: '$.parameters..schema..$ref',\n json: this.operation,\n }),\n ])\n\n const dependencies = refs\n .filter((ref) => typeof ref === 'string' && ref)\n .map((ref) => {\n const schemaDefinition = this.document.dereference(ref)\n if (schemaDefinition) return schemaDefinition\n\n return SchemaDefinition.unknown()\n })\n\n return dependencies\n }\n}\n","const keywords = [\n 'break',\n 'case',\n 'catch',\n 'continue',\n 'default',\n 'delete',\n 'do',\n 'else',\n 'finally',\n 'for',\n 'function',\n 'if',\n 'in',\n 'instanceof',\n 'new',\n 'return',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'while',\n 'with',\n]\n\nexport function isKeywords(str: string): boolean {\n return keywords.includes(str)\n}\n","\nconst reservedWords = [\n 'abstract',\n 'boolean',\n 'byte',\n 'char',\n 'class',\n 'const',\n 'debugger',\n 'double',\n 'enum',\n 'export',\n 'extends',\n 'final',\n 'float',\n 'goto',\n 'implements',\n 'import',\n 'int',\n 'interface',\n 'long',\n 'native',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'short',\n 'static',\n 'super',\n 'synchronized',\n 'throws',\n 'transient',\n 'volatile',\n]\n\nexport function isReservedWord(str: string): boolean {\n return reservedWords.includes(str)\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { JSONPath } from 'jsonpath-plus'\nimport { ApiDocumentV3_1 } from './api-document_v3_1.js'\n\n\nexport class SchemaDefinition {\n readonly name: string\n readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject\n readonly module: ModuleDefinition\n readonly document: ApiDocumentV3_1\n\n get id(): string {\n return `${this.module.address}#/components/schemas/${this.name}`\n }\n\n constructor(args: {\n name: string\n schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject\n module: ModuleDefinition\n document: ApiDocumentV3_1\n }) {\n this.module = args.module\n this.name = args.name\n this.schema = args.schema\n this.document = args.document\n }\n\n getDependencies(): SchemaDefinition[] {\n const refs: string[] = R.uniq(JSONPath({\n path: \"$..*['$ref']\",\n json: this.schema,\n }))\n\n return refs\n .filter((ref) => typeof ref === 'string' && !!ref.trim())\n .map((ref) => {\n const definition = this.document.dereference(ref)\n if (definition) return definition\n\n return SchemaDefinition.unknown()\n })\n }\n\n static unknown(): SchemaDefinition {\n return new SchemaDefinition({\n name: '',\n schema: {},\n module: ModuleDefinition.unknown(),\n document: ApiDocumentV3_1.unknown(),\n })\n }\n\n static isUnknown(definition: SchemaDefinition): boolean {\n return definition.name === ''\n }\n}\n","import chalk from 'chalk'\n\n\nexport const logger = {\n log: (str: string) => console.log(chalk.green(str)),\n warn: (str: string) => console.warn(chalk.yellow(str)),\n error: (str: string) => console.error(chalk.red(str)),\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/plugin.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition, SchemaDefinition } from '~/models/index.js'\nimport { OperationDeclarationGenerator, SchemaDeclarationGenerator } from './generators/index.js'\nimport { GenerateDeclarationPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\nexport const DECLARATION_GENERATOR = 'declarationGenerator'\n\nexport class GenerateDeclarationPlugin implements Plugin {\n name = DECLARATION_GENERATOR\n\n operationGenerator = new OperationDeclarationGenerator()\n schemaGenerator = new SchemaDeclarationGenerator()\n\n constructor() {}\n\n apply(compiler: Compiler): void {\n GenerateDeclarationPlugin.register(compiler)\n\n compiler.hooks.compile.tapPromise(GenerateDeclarationPlugin.name, async (task: TaskWrapper) => {\n compiler.context.artifacts?.push(\n ...await this.schemaGenerator.compile(compiler, task),\n ...await this.operationGenerator.compile(compiler, task),\n )\n })\n }\n\n static register(compiler: Compiler): GenerateDeclarationPluginMetadata {\n if (!MetadataStorage.has(compiler)) {\n MetadataStorage.set(compiler, {\n hooks: {\n afterEntrypointArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, TaskWrapper], Artifact>(['artifact', 'task']),\n afterSchemaDeclarationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, SchemaDefinition, TaskWrapper], Artifact>(['artifact', 'schemaDefinition', 'task']),\n afterOperationDeclarationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper], Artifact>(['artifact', 'operationDefinition', 'task']),\n },\n })\n }\n return MetadataStorage.get(compiler)!\n }\n\n static of(compiler: Compiler): GenerateDeclarationPluginMetadata | undefined {\n return this.register(compiler)\n }\n}\n","import * as path from 'path'\nimport * as changeCase from 'change-case'\nimport { Artifact, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { OperationDefinitionTransformer, EntrypointTransformer } from '~/transformers/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport type { Generator, RuntimeConfig } from '~/types/index.js'\nimport { SchemaDeclarationGenerator } from '../schema-declaration/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\n\n\nexport const OPERATION_GENERATOR = 'operationDeclarationGenerator'\n\nexport class OperationDeclarationGenerator implements Generator {\n async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n const context = compiler.context\n const metadata = MetadataStorage.get(compiler)!\n\n const rc = context.rc!\n // const matcher = context.matcher!\n const documents = context.documents!\n // .filter((document) => !matcher.isModuleIgnored(document.module))\n\n const operationDefinitions = documents.flatMap((document) => document.operations)\n\n const artifactMap = new Map<OperationDefinition, Artifact>(\n await Promise.all(\n operationDefinitions.map(async (operationDefinition) => (<const>[\n operationDefinition,\n await metadata.hooks.afterOperationDeclarationArtifactGenerated.promise(\n this.generateOperationDefinitionArtifact(operationDefinition, rc),\n operationDefinition,\n task,\n ),\n ])),\n ),\n )\n\n return Array.from(artifactMap.values())\n }\n\n\n private generateOperationDefinitionArtifact(operationDefinition: OperationDefinition, rc: RuntimeConfig): Artifact {\n const filepath = OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: OperationDeclarationGenerator.getOperationDefinitionArtifactId(operationDefinition),\n filepath,\n content: OperationDefinitionTransformer.toDeclaration(\n operationDefinition,\n {\n esm: rc.esm,\n getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {\n const relativePath = path.relative(\n dirpath,\n SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle),\n )\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n },\n ),\n extensionName: '.type.ts',\n })\n\n return artifact\n }\n\n private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n const filepath = OperationDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: OperationDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),\n filepath,\n content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n })\n\n return artifact\n }\n\n\n static getOperationDefinitionArtifactFilepath(operationDefinition: OperationDefinition, fileNamingStyle: FileNamingStyle): string {\n const filename = `${changeCase[fileNamingStyle](operationDefinition.operationId)}.type.ts`\n const filepath = [\n '.',\n changeCase[fileNamingStyle](operationDefinition.module.name),\n 'types',\n 'operations',\n filename,\n ].join('/')\n\n return filepath\n }\n\n static getOperationDefinitionArtifactId(operationDefinition: OperationDefinition): string {\n return `${operationDefinition.id}?generator=${OPERATION_GENERATOR}`\n }\n\n static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n return [\n '.',\n changeCase[fileNamingStyle](moduleDefinition.name),\n 'types',\n 'operations',\n 'index.ts',\n ].join('/')\n }\n\n static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n return `${moduleDefinition.address}/paths/entrypoint?generator=${OPERATION_GENERATOR}`\n }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport class CommentRenderer implements Renderer {\n constructor(\n private readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n ) {}\n\n render(): string {\n const schema = this.schema\n\n const lines = ['/**']\n\n if (schema.description) {\n const description = schema.description.replace('*/', '*\\\\/')\n lines.push(...description.split('\\n').map((line) => ` * ${line}`))\n }\n\n if (schema.deprecated) {\n lines.push(' * @deprecated')\n }\n\n if (schema.readOnly) {\n lines.push(' * @readonly')\n }\n\n if (schema.format) {\n lines.push(` * @format ${schema.format}`)\n }\n\n lines.push(' */')\n\n if (lines.length === 2) return ''\n return lines.join('\\n')\n }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { ReferenceTransformer } from './reference.transformer.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport interface JsonSchemaDeclarationRendererOptions {\n referenceTransformer?: (schema: OpenAPIV3_1.ReferenceObject) => string\n}\n\nexport class DeclarationRenderer implements Renderer {\n constructor(\n private readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n private readonly options: JsonSchemaDeclarationRendererOptions = {},\n ) {\n }\n\n render(): string {\n return this.renderSchema(this.schema)\n }\n\n private renderSchema(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): string {\n if (typeof schema === 'boolean') return 'unknown'\n\n if (JsonSchemaUtils.isRef(schema)) return this.renderReference(schema)\n if (JsonSchemaUtils.isMixed(schema)) return this.renderMixed(schema)\n if (JsonSchemaUtils.isArray(schema)) return this.renderArray(schema)\n\n if (schema.type === 'object') return this.renderObject(schema)\n if (schema.enum) return this.renderEnum(schema)\n if (schema.oneOf) return this.renderOneOf(schema)\n if (schema.anyOf) return this.renderAnyOf(schema)\n if (schema.allOf) return this.renderAllOf(schema)\n if (schema.type === 'string') return this.renderString(schema)\n if (schema.type === 'number') return this.renderNumber(schema)\n if (schema.type === 'boolean') return this.renderBoolean(schema)\n if (schema.type === 'null') return this.renderNull(schema)\n if (schema.type === 'integer') return this.renderInteger(schema)\n\n return 'unknown'\n }\n\n\n private renderMixed(schema: MixedSchemaObject): string {\n if (Array.isArray(schema.type)) {\n schema.type\n .map((type): (OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject) => ({ ...schema, type }))\n .map((schema) => this.renderSchema(schema))\n .join(' | ')\n }\n\n return 'unknown'\n }\n\n private renderReference(schema: OpenAPIV3_1.ReferenceObject): string {\n if (!this.options.referenceTransformer) {\n return ReferenceTransformer.toDeclaration(schema)\n }\n\n return this.options.referenceTransformer(schema)\n }\n\n private renderArray(schema: OpenAPIV3_1.ArraySchemaObject): string {\n if (schema.items && Array.isArray(schema.items)) {\n const items = schema.items.map((s) => this.renderSchema(s)).join(', ')\n return `[${items}]`\n }\n\n if (schema.items && typeof schema.items === 'object') {\n return `${this.renderSchema(schema.items)}[]`\n }\n\n return 'any[]'\n }\n\n\n private renderObject(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (\n (!schema.properties || R.isEmpty(schema.properties))\n && (!schema.additionalProperties || R.isEmpty(schema.additionalProperties))\n ) {\n return 'object'\n }\n\n\n const $properties = Object.entries(schema.properties || {})\n .map(([propertyName, propertySchema]) => {\n let $comment = new CommentRenderer(propertySchema).render()\n if ($comment) $comment += '\\n'\n\n const $key = `\"${propertyName}\"${schema.required?.includes(propertyName) ? '' : '?'}`\n const $value = this.renderSchema(propertySchema)\n\n return indent(2, `${$comment}${$key}: ${$value}`)\n })\n\n if (schema.additionalProperties) {\n const $value = schema.additionalProperties === true\n ? 'any'\n : this.renderSchema(schema.additionalProperties)\n $properties.push(indent(2, `[key: string]: ${$value}`))\n }\n\n return [\n '{',\n ...$properties,\n '}',\n ].join('\\n')\n }\n\n private renderOneOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (!schema.oneOf) return 'unknown'\n\n return schema.oneOf.map((s) => this.renderSchema(s)).join(' | ')\n }\n\n private renderAnyOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (!schema.anyOf) return 'unknown'\n\n return schema.anyOf.map((s) => this.renderSchema(s)).join(' | ')\n }\n\n private renderAllOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (!schema.allOf) return 'unknown'\n\n return schema.allOf.map((s) => this.renderSchema(s)).join(' & ')\n }\n\n private renderEnum(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (!schema.enum) return 'unknown'\n return schema.enum.map((v) => JSON.stringify(v)).join(' | ')\n }\n\n private renderString(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n if (schema.contentMediaType === 'application/octet-stream') return 'Blob | Buffer'\n if (schema.format === 'binary') return 'Blob | Buffer'\n return 'string'\n }\n\n private renderNumber(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n return 'number'\n }\n\n private renderBoolean(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n return 'boolean'\n }\n\n private renderNull(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n return 'null'\n }\n\n private renderInteger(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n return 'number'\n }\n}\n","export function indent(space: number, text: string): string {\n if (text === '') return ''\n\n const indentation = ' '.repeat(space)\n return text.split('\\n')\n .map((line) => (line ? `${indentation}${line}` : line))\n .join('\\n')\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport class ReferenceTransformer {\n static toDeclaration(schema: OpenAPIV3_1.ReferenceObject, alias: (name: string) => string = R.identity): string {\n if (!schema.$ref || !schema.$ref.startsWith('#')) return `unknown /* ${schema.$ref.replace('*/', '*\\\\/')} */`\n\n const parts: string[] = schema.$ref.split('/')\n // return parts[parts.length - 1] || 'unknown'\n\n return alias(parts[parts.length - 1]) || 'unknown'\n }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { DeclarationRenderer, JsonSchemaDeclarationRendererOptions } from './declaration.renderer.js'\n\n\nexport class JsonSchemaTransformer {\n static toComment(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): string {\n return new CommentRenderer(schema).render()\n }\n\n static toDeclaration(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject, options?: JsonSchemaDeclarationRendererOptions): string {\n return new DeclarationRenderer(schema, options).render()\n }\n}\n","import * as R from 'ramda'\nimport { SchemaDefinition } from '~/models/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { JsonSchemaTransformer } from '../json-schema/index.js'\n\n\ninterface SchemaDefinitionDeclarationRendererOptions {\n esm?: boolean\n\n getDependentSchemaDefinitionFilepath: (schemaDefinition: SchemaDefinition) => string\n}\n\nexport class SchemaDefinitionTransformer {\n static toDeclaration(schemaDefinition: SchemaDefinition, options: SchemaDefinitionDeclarationRendererOptions): string {\n const dependencies = schemaDefinition.getDependencies()\n let $dependencies = dependencies\n .filter((dep) => !SchemaDefinition.isUnknown(dep))\n .map((dep) => {\n const filepath = options.getDependentSchemaDefinitionFilepath(dep)\n return `import type { ${dep.name} } from \"${filepath}\"`\n })\n .map((str) => str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, options.esm ? ' from \"$1.js\"' : ' from \"$1\"'))\n .join('\\n')\n\n if ($dependencies) $dependencies += '\\n'\n\n let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema)\n if ($comment) $comment += '\\n'\n\n if (typeof schemaDefinition.schema === 'boolean') {\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n $comment || undefined,\n `type ${schemaDefinition.name} = unknown`,\n '',\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n\n if (JsonSchemaUtils.isNonArray(schemaDefinition.schema) && schemaDefinition.schema.type === 'object') {\n const $schema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema)\n\n const $declaration = $schema.startsWith('{')\n ? `export interface ${schemaDefinition.name} ${$schema}`\n : `export type ${schemaDefinition.name} = ${$schema}`\n\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n $comment || undefined,\n $declaration,\n '',\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n $comment || undefined,\n `export type ${schemaDefinition.name} = ${JsonSchemaTransformer.toDeclaration(schemaDefinition.schema)}`,\n '',\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport class CommentRenderer implements Renderer {\n constructor(\n private readonly operationDefinition: OperationDefinition,\n ) {}\n\n render(): string {\n const operation = this.operationDefinition.operation\n if (!operation.summary && !operation.description) return ''\n\n const lines = ['/**']\n\n if (operation.summary && typeof operation.summary === 'string') {\n lines.push(` * ${R.trim(operation.summary)}`)\n lines.push(' *')\n }\n\n if (operation.description && typeof operation.description === 'string') {\n lines.push(` * @description ${R.trim(operation.description)}`)\n }\n\n lines.push(' */')\n\n return lines.join('\\n')\n }\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition, SchemaDefinition } from '~/models/index.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { JsonSchemaTransformer, JsonSchemaDeclarationRendererOptions, ReferenceTransformer } from '../json-schema/index.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport interface OperationDefinitionDeclarationRendererOptions {\n esm?: boolean\n\n getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string\n}\n\nconst alias = (name: string): string => `${name}Schema`\n\nexport class DeclarationRenderer implements Renderer {\n private typeName: TypeNameFn\n\n constructor(\n private readonly operationDefinition: OperationDefinition,\n private readonly options: OperationDefinitionDeclarationRendererOptions,\n ) {\n this.typeName = typeNameFactory(operationDefinition)\n }\n\n private renderResponseBodies(operation: OpenAPIV3_1.OperationObject, options: JsonSchemaDeclarationRendererOptions): string {\n if (!operation.responses || R.isEmpty(operation.responses)) {\n return `export interface ${this.typeName('ResponseBodies')} {}`\n }\n\n const $responses = Object.entries(operation.responses)\n .map(([statusCode, response]) => {\n if (!JsonSchemaUtils.isRef(response)) {\n const $value = Object.entries(response.content || {})\n .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n .map(([mediaType, schema]) => {\n if (mediaType.includes('text/event-stream')) return 'ReadableStream<ServerSentEvent>'\n if (mediaType.includes('multipart/form-data')) return 'FormData'\n if (!schema) return 'unknown'\n\n return JsonSchemaTransformer.toDeclaration(schema, options)\n })\n .join(' | ')\n\n return indent(2, `${statusCode}: ${$value || 'void'}`)\n }\n })\n .join('\\n')\n\n return [\n `export interface ${this.typeName('ResponseBodies')} {`,\n $responses,\n '}',\n ].join('\\n')\n }\n\n private renderRequestBodies(operation: OpenAPIV3_1.OperationObject, options: JsonSchemaDeclarationRendererOptions): string {\n let $requestBodies = `export interface ${this.typeName('RequestBodies')} {}`\n\n if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {\n const $mediaTypes = Object.entries(operation.requestBody.content || {})\n .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n .map(([mediaType, schema]) => {\n if (!schema) return `${JSON.stringify(mediaType)}: unknown`\n\n // if (mediaType === 'multipart/form-data') {\n // return `${JSON.stringify(mediaType)}: FormData | ${generateSchema(schema, alias)}`\n // } else if (mediaType === 'application/x-www-form-urlencoded') {\n // return `${JSON.stringify(mediaType)}: URLSearchParams | ${generateSchema(schema, alias)}`\n // }\n\n return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schema, options)}`\n })\n .map((pair) => indent(2, pair))\n\n $requestBodies = [\n `export interface ${this.typeName('RequestBodies')} {`,\n ...$mediaTypes,\n '}',\n ].join('\\n')\n }\n\n return $requestBodies\n }\n\n private renderParameterBodies(operationDefinition: OperationDefinition, options: JsonSchemaDeclarationRendererOptions): string {\n const { operation } = operationDefinition\n let parameterBodies = ''\n // let parameterBodies = `interface ${typeName('ParameterBodies')} {}`\n\n if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {\n const $mediaTypes = Object.entries(operation.requestBody.content || {})\n .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n // .filter((pair): pair is [string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject] => !!pair[1])\n .map(([mediaType, schemaOrRef]) => {\n if (!schemaOrRef) return `${JSON.stringify(mediaType)}: unknown`\n\n const schema = JsonSchemaUtils.isRef(schemaOrRef)\n ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(schemaOrRef.$ref, operationDefinition.document.specification)\n : schemaOrRef\n\n if (schema.type === 'object' || schema.properties) {\n return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schemaOrRef, options)} & { [key: string]: any }`\n }\n\n return `${JSON.stringify(mediaType)}: { [key: string]: any }`\n })\n .map((pair) => indent(2, pair))\n\n // $requestBodies = `export type ${typeName('RequestBody')} = ${$value || 'unknown'}`\n parameterBodies = [\n `interface ${this.typeName('ParameterBodies')} {`,\n ...$mediaTypes,\n '}',\n '',\n ].join('\\n')\n }\n\n return parameterBodies\n }\n\n private renderRequestParameters(operation: OpenAPIV3_1.OperationObject, options: JsonSchemaDeclarationRendererOptions): string {\n const mediaTypes = operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)\n ? Object.keys(operation.requestBody.content || {})\n : []\n\n const base = `${this.typeName('RequestQuery')} & ${this.typeName('RouteParameters')} & ${this.typeName('RequestHeaders')}`\n\n if (mediaTypes.length === 1) {\n return `export type ${this.typeName('RequestParameters')} = ${base} & ${this.typeName('RequestBodies')}[${JSON.stringify(mediaTypes[0])}]`\n }\n\n if (mediaTypes.length > 1) {\n const unions = mediaTypes\n .map((mediaType) => `(${base} & ${this.typeName('RequestBodies')}[${JSON.stringify(mediaType)}] & { \"content-type\": ${JSON.stringify(mediaType)} })`)\n .join('\\n| ')\n\n return `export type ${this.typeName('RequestParameters')} = ${unions}`\n }\n\n return `export type ${this.typeName('RequestParameters')} = ${base}`\n }\n\n private rendererParameters(name: string, parameters: OpenAPIV3_1.ParameterObject[], options: JsonSchemaDeclarationRendererOptions): string {\n if (parameters.length === 0) {\n return `export type ${name} = {}`\n }\n\n const $parameters = parameters.map((parameter) => {\n const parameterName = `\"${parameter.name}\"`\n const $key = parameter.required ? parameterName : `${parameterName}?`\n const $value = JsonSchemaTransformer.toDeclaration(parameter.schema || { type: 'any' }, options)\n\n return indent(2, `${$key}: ${$value}`)\n })\n .join('\\n')\n\n\n return [\n `export type ${name} = {`,\n $parameters,\n '}',\n ].filter(Boolean).join('\\n')\n }\n\n private renderDependencies(): string {\n const schemaDefinitions = this.operationDefinition.getDependencies()\n .filter((schemaDefinition) => !SchemaDefinition.isUnknown(schemaDefinition))\n\n const $schemaDefinitions = schemaDefinitions\n .map((schemaDefinition) => {\n const filepath = this.options.getDependentSchemaDefinitionFilepath(schemaDefinition)\n const schemaName = schemaDefinition.name\n\n return `import type { ${schemaName} as ${alias(schemaName)} } from \"${filepath}\"`\n })\n .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n\n return [\n 'import type { KeqOperation, KeqPathParameterInit, KeqQueryInit, ServerSentEvent } from \"keq\"',\n ...$schemaDefinitions,\n ].join('\\n')\n }\n\n render(): string {\n const { operation } = this.operationDefinition\n\n if (!operation.responses) return ''\n\n const jsonSchemaDeclarationRendererOptions: JsonSchemaDeclarationRendererOptions = {\n referenceTransformer: (schema: OpenAPIV3_1.ReferenceObject) => {\n return ReferenceTransformer.toDeclaration(schema, alias)\n },\n }\n\n const $dependencies = this.renderDependencies()\n\n const $responseBodies = this.renderResponseBodies(operation, jsonSchemaDeclarationRendererOptions)\n const $requestBodies = this.renderRequestBodies(operation, jsonSchemaDeclarationRendererOptions)\n const $parameterBodies = this.renderParameterBodies(this.operationDefinition, jsonSchemaDeclarationRendererOptions)\n const $requestParameters = this.renderRequestParameters(operation, jsonSchemaDeclarationRendererOptions)\n const $requestQuery = this.rendererParameters(\n `${this.typeName('RequestQuery')}`,\n operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === 'query') || [],\n jsonSchemaDeclarationRendererOptions,\n )\n const $routeParameters = this.rendererParameters(\n `${this.typeName('RouteParameters')}`,\n operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === 'path') || [],\n jsonSchemaDeclarationRendererOptions,\n )\n const $requestHeaders = this.rendererParameters(\n `${this.typeName('RequestHeaders')}`,\n operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === 'header') || [],\n jsonSchemaDeclarationRendererOptions,\n )\n\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n '',\n $responseBodies,\n '',\n $requestBodies,\n '',\n $requestQuery,\n '',\n $routeParameters,\n '',\n $requestHeaders,\n '',\n $parameterBodies || undefined,\n $requestParameters,\n '',\n `export interface ${this.typeName('Operation')}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${$parameterBodies ? `keyof ${this.typeName('ParameterBodies')}` : 'string'} > extends KeqOperation {`,\n ` requestParams: ${this.typeName('RouteParameters')} & { [key: string]: KeqPathParameterInit }`,\n ` requestQuery: ${this.typeName('RequestQuery')} & { [key: string]: KeqQueryInit }`,\n ` requestHeaders: ${this.typeName('RequestHeaders')} & { [key: string]: string | number }`,\n ` requestBody: ${$parameterBodies ? `${this.typeName('ParameterBodies')}[CONTENT_TYPE] | ` : 'object | '}BodyInit`,\n ` responseBody: ${this.typeName('ResponseBodies')}[STATUS]`,\n '}',\n '',\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n}\n","import * as changeCase from 'change-case'\nimport { OperationDefinition } from '~/models/index.js'\n\nexport type TypeNameFn = (name: string) => string\n\nexport function typeNameFactory(operationDefinition: OperationDefinition): TypeNameFn {\n const pascalCaseOperationId = changeCase.pascalCase(operationDefinition.operationId)\n return (name: string) => `${pascalCaseOperationId}${name}`\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function dereference<T extends OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject | OpenAPIV3_1.RequestBodyObject | OpenAPIV3_1.ReferenceObject>($ref: string, swagger: OpenAPIV3_1.Document): T {\n let value\n\n for (const key of $ref.split('/')) {\n if (key === '#') {\n value = swagger\n } else {\n value = value[key]\n }\n\n if (!value) break\n }\n\n return value as T\n}\n","import * as R from 'ramda'\nimport jsonpointer from 'jsonpointer'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { JSONPath } from 'jsonpath-plus'\nimport { removeUndefinedRef } from './remove-undefined-ref.js'\nimport { dereference } from './dereference.js'\n\n\nfunction dereferencePathObject(swagger: OpenAPIV3_1.Document): void {\n const matches = JSONPath({\n path: '$.paths.*.$ref^',\n json: swagger,\n resultType: 'all',\n })\n\n for (const match of matches) {\n const value = dereference(match.value.$ref, swagger)\n jsonpointer.set(swagger, match.pointer, value)\n }\n}\n\nfunction dereferenceRequestBody(swagger: OpenAPIV3_1.Document): void {\n const matches = JSONPath({\n path: '$.paths.*.*.requestBody.$ref^',\n json: swagger,\n resultType: 'all',\n })\n\n for (const match of matches) {\n const value = dereference(match.value.$ref, swagger)\n jsonpointer.set(swagger, match.pointer, value)\n }\n}\n\nexport function dereferenceResponses(swagger: OpenAPIV3_1.Document): void {\n const matches = [\n ...JSONPath({\n path: '$.paths.*.*.responses.*.$ref^',\n json: swagger,\n resultType: 'all',\n }),\n ...JSONPath({\n path: '$.paths.*.*.responses.*.headers.*.$ref^',\n json: swagger,\n resultType: 'all',\n }),\n ]\n\n for (const match of matches) {\n const value = dereference(match.value.$ref, swagger)\n jsonpointer.set(swagger, match.pointer, value)\n }\n}\n\nfunction dereferenceParameters(swagger: OpenAPIV3_1.Document): void {\n const matches = JSONPath({\n path: '$.paths.*.*.parameters.*.$ref^',\n json: swagger,\n resultType: 'all',\n })\n\n for (const match of matches) {\n const value = dereference(match.value.$ref, swagger)\n jsonpointer.set(swagger, match.pointer, value)\n }\n}\n\nexport function dereferenceOperation(swagger: OpenAPIV3_1.Document): OpenAPIV3_1.Document {\n const shadow = R.clone(swagger)\n\n dereferencePathObject(shadow)\n dereferenceRequestBody(shadow)\n dereferenceResponses(shadow)\n dereferenceParameters(shadow)\n\n return removeUndefinedRef(shadow)\n}\n","import * as R from 'ramda'\nimport jsonpointer from 'jsonpointer'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { JSONPath } from 'jsonpath-plus'\nimport { isRefDefined } from './is-ref-defined.js'\n\n\n// remove schema $ref if the reference is not founded\nexport function removeUndefinedRef(swagger: OpenAPIV3_1.Document): OpenAPIV3_1.Document {\n const shadow = R.clone(swagger)\n\n const matches = JSONPath({\n path: \"$..*['$ref']^\",\n json: swagger,\n resultType: 'all',\n })\n\n for (const match of matches) {\n if (match.value.$ref && !isRefDefined(match.value.$ref, swagger)) {\n jsonpointer.set(shadow, match.pointer, R.omit(['$ref'], match.value))\n }\n }\n\n return shadow\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function isRefDefined($ref: string, swagger: OpenAPIV3_1.Document): boolean {\n if ($ref.startsWith('#/')) {\n const path = $ref.replace('#/', '').split('/')\n return R.path(path, swagger) !== undefined\n }\n\n return false\n}\n\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { dereference } from './dereference.js'\nimport { JsonSchemaUtils } from '../json-schema-utils/index.js'\n\n\nexport function dereferenceDeep<T extends OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject | OpenAPIV3_1.RequestBodyObject>($ref: string, swagger: OpenAPIV3_1.Document): T {\n const stack = [$ref]\n let value\n\n while (true) {\n const last = stack[stack.length - 1]\n value = dereference(last, swagger)\n\n if (JsonSchemaUtils.isRef(value)) {\n if (!stack.includes(value.$ref)) {\n stack.push(value.$ref)\n continue\n } else {\n // Circular reference detected\n throw new Error(`Circular reference detected: ${stack.join(' -> ')} -> ${value.$ref}`)\n }\n }\n\n break\n }\n\n return value as T\n}\n","import { upgrade } from '@scalar/openapi-parser'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function To3_1(openapi: object): OpenAPIV3_1.Document {\n const { specification } = upgrade(openapi)\n return specification\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\n\n\nexport type OpenapiOperationMapper = (method: string, pathname: string, operation: OpenAPIV3_1.OperationObject) => OpenAPIV3_1.OperationObject\n\n\nexport function mapOperation(specification: OpenAPIV3_1.Document, mapper: OpenapiOperationMapper): OpenAPIV3_1.Document {\n const shadow = R.clone(specification)\n\n for (const [pathname, pathItem] of Object.entries(shadow.paths || {})) {\n for (const m in pathItem) {\n const method = m.toLowerCase()\n if (!SupportedMethods.includes(method)) continue\n if (typeof pathItem[m] !== 'object' || Array.isArray(pathItem[m]) || pathItem[m] === null) continue\n\n const operation: OpenAPIV3_1.OperationObject = pathItem[m]\n pathItem[m] = mapper(method, pathname, operation)\n }\n }\n\n return shadow\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { mapOperation } from './map-operation.js'\n\n\nexport type OpenapiParameterMapper = (method: string, pathname: string, operation: OpenAPIV3_1.OperationObject, parameter: OpenAPIV3_1.ParameterObject) => OpenAPIV3_1.ParameterObject\n\nexport function mapParameter(\n specification: OpenAPIV3_1.Document,\n mapper: OpenapiParameterMapper,\n): OpenAPIV3_1.Document {\n return mapOperation(specification, (method, pathname, operation) => {\n if (!operation.parameters) return operation\n\n operation.parameters = operation.parameters\n .map((parameter) => mapper(method, pathname, operation, parameter as OpenAPIV3_1.ParameterObject))\n\n return operation\n })\n}\n","import { dereference } from './dereference.js'\nimport { dereferenceOperation } from './dereference-operation.js'\nimport { isRefDefined } from './is-ref-defined.js'\nimport { removeUndefinedRef } from './remove-undefined-ref.js'\nimport { dereferenceDeep } from './dereference-deep.js'\nimport { To3_1 } from './to-3_1.js'\nimport { mapOperation } from './map-operation.js'\nimport { mapParameter } from './map-parameter.js'\n\n\nexport class OpenapiUtils {\n static isRefDefined = isRefDefined\n static dereference = dereference\n static dereferenceDeep = dereferenceDeep\n static removeUndefinedRef = removeUndefinedRef\n static dereferenceOperation = dereferenceOperation\n static mapOperation = mapOperation\n static mapParameter = mapParameter\n // static updateOperationId = updateOperationId\n static to3_1 = To3_1\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { Exception } from '~/exception.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { OperationDefinitionSnippet, OperationDefinitionSnippetOptions } from './typescript-snippet.js'\n\n\nexport interface OperationDefinitionMicroFunctionRendererOptions extends OperationDefinitionSnippetOptions {\n getOperationDefinitionDeclarationFilepath(operationDefinition: OperationDefinition): string\n getRequestFilepath(): string\n}\n\nexport class OperationDefinitionMicroFunctionRenderer implements Renderer {\n helper: OperationDefinitionSnippet\n typeName: TypeNameFn\n\n constructor(\n private readonly operationDefinition: OperationDefinition,\n private readonly options: OperationDefinitionMicroFunctionRendererOptions,\n ) {\n this.typeName = typeNameFactory(operationDefinition)\n this.helper = new OperationDefinitionSnippet(operationDefinition, options)\n }\n\n render(): string {\n const { operation, operationId, method, pathname } = this.operationDefinition\n if (!operation.responses) return ''\n\n const $dependencies = this.renderDependencies()\n const $comment = new CommentRenderer(this.operationDefinition).render()\n\n const moduleName = this.operationDefinition.module.name\n\n const $method = method.toLowerCase()\n const $queryParameters = this.helper.renderRequestQuery()\n const $headerParameters = this.helper.renderRequestHeaders()\n const $pathParameters = this.helper.renderRequestPathParameters()\n\n const $mediaType = this.helper.renderMediaType()\n\n const $requestBody = this.helper.renderRequestBody()\n\n const $operationDeclaration = this.renderOperationDeclaration()\n\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n '',\n `const moduleName = \"${moduleName}\"`,\n `const method = \"${method}\"`,\n `const pathname = \"${pathname}\"`,\n '',\n $comment || undefined,\n `export ${$operationDeclaration} {`,\n ` const req = request.${$method}<${this.typeName('ResponseBodies')}[STATUS]>(\"${pathname}\")`,\n ' .option(\\'module\\', { name: moduleName, pathname, method })',\n '',\n $mediaType || undefined,\n ' /* @anchor:query:start */',\n $queryParameters ? indent(2, $queryParameters) : undefined,\n ' /* @anchor:query:end */',\n '',\n ' /* @anchor:headers:start */',\n $headerParameters ? indent(2, $headerParameters) : undefined,\n ' /* @anchor:headers:end */',\n '',\n ' /* @anchor:path-parameters:start */',\n $pathParameters ? indent(2, $pathParameters) : undefined,\n ' /* @anchor:path-parameters:end */',\n '',\n ' /* @anchor:body:start */',\n $requestBody ? indent(2, $requestBody) : undefined,\n ' /* @anchor:body:end */',\n '',\n ' /* @anchor:operation-return */',\n ` return req as ReturnType<typeof ${operationId}<STATUS${$operationDeclaration.includes('CONTENT_TYPE') ? ', CONTENT_TYPE' : ''}>>`,\n '}',\n '',\n `${operationId}.pathname = pathname`,\n `${operationId}.method = method`,\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n\n private renderDependencies(): string {\n const declarationFilepath = this.options.getOperationDefinitionDeclarationFilepath(this.operationDefinition)\n const requestFilepath = this.options.getRequestFilepath()\n\n return [\n 'import { Keq } from \"keq\"',\n `import { request } from \"${requestFilepath}\"`,\n `import type { ${this.typeName('Operation')}, ${this.typeName('ResponseBodies')}, ${this.typeName('RequestParameters')} } from \"${declarationFilepath}\"`,\n `export type { ${this.typeName('RequestQuery')}, ${this.typeName('RequestHeaders')}, ${this.typeName('RequestBodies')} } from \"${declarationFilepath}\"`,\n ]\n .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n .join('\\n')\n }\n\n private renderOperationDeclaration(): string {\n const { operationId } = this.operationDefinition\n\n const mediaTypes = this.helper.getRequestMediaTypes()\n\n if (mediaTypes.length === 0) {\n 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>>`\n } else if (mediaTypes.length === 1) {\n 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>>`\n } else if (mediaTypes.length > 1) {\n 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>>`\n }\n\n throw new Exception(this.operationDefinition.module, '[operationDeclarationRenderer] Unreachable')\n }\n}\n","import { CustomError } from 'ts-custom-error'\nimport wrap from 'word-wrap'\nimport { ModuleDefinition } from '~/models/index.js'\n\n\nexport class Exception extends CustomError {\n constructor(module: ModuleDefinition | string, message: string) {\n const moduleName = typeof module === 'string' ? module : module.name\n\n const msg = wrap(message, { width: 60, indent: ' ' })\n super(`${moduleName} module failed to compile:\\n${msg}`)\n\n Object.defineProperty(this, 'name', { value: 'KeqCLI_Exception' })\n }\n}\n","import * as R from 'ramda'\nimport { KeqQueryOptions } from 'keq'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition } from '~/models/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { QsArrayFormat } from '~/constants/index.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\n\n\nexport interface OperationDefinitionSnippetOptions {\n esm?: boolean\n}\n\nexport class OperationDefinitionSnippet {\n typeName: TypeNameFn\n\n constructor(\n private readonly operationDefinition: OperationDefinition,\n private readonly options: OperationDefinitionSnippetOptions,\n ) {\n this.typeName = typeNameFactory(operationDefinition)\n }\n\n\n private getQsParameters(parameter: OpenAPIV3_1.ParameterObject): KeqQueryOptions | undefined {\n let arrayFormat: QsArrayFormat | undefined\n let allowDots: boolean | undefined\n let indices: boolean | undefined\n\n const style = parameter.style || 'form'\n const explode = parameter.explode ?? true\n\n if ('x-qs-array-format' in parameter) {\n arrayFormat = parameter['x-qs-array-format'] as QsArrayFormat\n } else {\n if (style === 'deepObject') {\n arrayFormat = QsArrayFormat.brackets\n } else if (explode) {\n arrayFormat = QsArrayFormat.repeat\n } else {\n if (style === 'form') {\n arrayFormat = QsArrayFormat.comma\n } else if (style === 'spaceDelimited') {\n arrayFormat = QsArrayFormat.space\n } else if (style === 'pipeDelimited') {\n arrayFormat = QsArrayFormat.pipe\n }\n }\n }\n\n if ('x-qs-allow-dots' in parameter) {\n allowDots = Boolean(parameter['x-qs-allow-dots'])\n }\n\n if ('x-qs-indices' in parameter) {\n indices = Boolean(parameter['x-qs-indices'])\n }\n\n\n if (arrayFormat || allowDots !== undefined || indices !== undefined) {\n return {\n ...(arrayFormat ? { arrayFormat } : {}),\n ...(allowDots !== undefined ? { allowDots } : {}),\n ...(indices !== undefined ? { indices } : {}),\n }\n }\n\n return undefined\n }\n\n\n // render: \"if (args && 'Authorization' in args) req.header('Authorization', args['Authorization'])\"\n renderRequestHeaders(): string {\n const { operation } = this.operationDefinition\n\n const $headers = (operation.parameters || [])\n .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n .filter((p) => p.in === 'header')\n .map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.header(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`)\n .join('\\n')\n\n return $headers\n }\n\n // render: \"if (args && 'id' in args) req.query('id', args['id'], options)\"\n renderRequestQuery(): string {\n const { operation } = this.operationDefinition\n\n const $query = (operation.parameters || [])\n .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n .filter((p) => p.in === 'query')\n .map((p) => {\n const option = this.getQsParameters(p)\n const $option = (!option || R.isEmpty(option)) ? '' : `, ${JSON.stringify(option)}`\n\n return `if (args && ${JSON.stringify(p.name)} in args) req.query(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}]${$option})`\n })\n .join('\\n')\n\n return $query\n }\n\n // render: \"if (args && 'id' in args) req.params('id', args['id'])\"\n renderRequestPathParameters(): string {\n const { operation } = this.operationDefinition\n\n const $pathParameters = (operation.parameters || [])\n .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n .filter((p) => p.in === 'path')\n .map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.params(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`)\n .join('\\n')\n\n return $pathParameters\n }\n\n getRequestMediaTypes(): string[] {\n const { operation } = this.operationDefinition\n const requestBodyContent = (operation.requestBody?.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n return Object.keys(requestBodyContent)\n }\n\n // render \"req.type(\"application/json\")\"\n renderMediaType(): string {\n const mediaTypes = this.getRequestMediaTypes()\n\n if (mediaTypes.length === 1 && !mediaTypes[0].endsWith('/*')) {\n return `req.type(\"${mediaTypes[0]}\")\\n`\n } else if (mediaTypes.some((mediaType) => mediaType === '*/*')) {\n // no-op\n } else if (mediaTypes.some((mediaType) => mediaType.endsWith('/*'))) {\n return 'if(args?.[\"content-type\"]) req.type(args[\"content-type\"])\\n'\n } else if (mediaTypes.length > 1) {\n return 'if(args?.[\"content-type\"]) req.type(args[\"content-type\"])\\n'\n }\n\n return ''\n }\n\n\n // render body\n\n private requestBodyFormDataPropertyRenderer(\n propertyName: string,\n propertySchema: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject,\n mediaType: string,\n ): string {\n try {\n const $propertyName = JSON.stringify(propertyName)\n\n const schema = JsonSchemaUtils.isRef(propertySchema)\n ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(propertySchema.$ref, this.operationDefinition.document.specification)\n : propertySchema\n\n if (\n (schema.type === 'string' && schema.format === 'binary')\n || schema.contentMediaType === 'application/octet-stream') {\n return `if (args && ${$propertyName} in args && args[${$propertyName}]) req.attach(${$propertyName}, args[${$propertyName}])`\n } else if (\n schema.type === 'string'\n || (schema.type === 'array' && schema.items && schema.items.type === 'string')\n ) {\n return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, args[${$propertyName}])`\n } else if (schema.type === 'number' || schema.type === 'integer') {\n return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, String(args[${$propertyName}]))`\n }\n\n 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 */)`\n } catch (err) {\n return this.renderErrorComment(err, mediaType)\n }\n }\n\n private requestBodyPropertyRenderer(\n propertyName: string,\n propertySchema: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject,\n mediaType: string,\n ): string {\n if (mediaType === 'application/json') {\n const $propertyName = JSON.stringify(propertyName)\n return `if (args && ${$propertyName} in args) req.send({ ${$propertyName}: args[${$propertyName}] })`\n } else if (mediaType === 'multipart/form-data') {\n return this.requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType)\n } else {\n throw new Error(`Unsupported media type: ${mediaType}`)\n }\n }\n\n renderRequestBody(): string {\n const { operation } = this.operationDefinition\n const requestBodyContent = (operation.requestBody?.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n\n const $requestBody = Object.entries(requestBodyContent)\n .map(([mediaType, mediaTypeObject]): string | undefined => {\n if (!mediaTypeObject.schema) return\n\n try {\n const schema = JsonSchemaUtils.isRef(mediaTypeObject.schema)\n ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(mediaTypeObject.schema.$ref, this.operationDefinition.document.specification)\n : mediaTypeObject.schema\n\n if (schema.type !== 'object') return\n\n const properties = (schema.properties || {}) as OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject\n\n return Object.entries(properties)\n .map(([propertyName, propertySchema]) => this.requestBodyPropertyRenderer(propertyName, propertySchema, mediaType))\n .join('\\n')\n } catch (err) {\n return this.renderErrorComment(err, mediaType)\n }\n })\n .filter(R.isNotNil)\n .join('\\n')\n\n return $requestBody\n }\n\n private renderErrorComment(err: unknown, mediaType: string): string {\n const $err = String(err)\n .split('\\n')\n .map(((line) => ` * ${line}`))\n .join('\\n')\n\n return [\n '/**',\n ` * Unable to dereference schema for media type ${mediaType}`,\n $err,\n ' */',\n ].join('\\n')\n }\n}\n","export enum QsArrayFormat {\n brackets = 'brackets',\n indices = 'indices',\n repeat = 'repeat',\n comma = 'comma',\n space = 'space',\n pipe = 'pipe',\n}\n","import * as R from 'ramda'\nimport { TypeNameFn, typeNameFactory } from './utils/index.js'\nimport { OperationDefinition } from '~/models/index.js'\nimport { OperationDefinitionSnippet, OperationDefinitionSnippetOptions } from './typescript-snippet.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { indent } from '~/utils/indent.js'\nimport { Renderer } from '../types/renderer.js'\nimport { Exception } from '~/exception.js'\n\n\nexport type OperationDefinitionNestjsMethodRendererOptions = OperationDefinitionSnippetOptions\n\nexport class OperationDefinitionNestjsMethodRenderer implements Renderer {\n helper: OperationDefinitionSnippet\n typeName: TypeNameFn\n\n constructor(\n private readonly operationDefinition: OperationDefinition,\n private readonly options: OperationDefinitionNestjsMethodRendererOptions,\n ) {\n this.typeName = typeNameFactory(operationDefinition)\n this.helper = new OperationDefinitionSnippet(operationDefinition, options)\n }\n\n\n render(): string {\n // const operationId = changeCase.camelCase(this.operationDefinition.operationId)\n const pathname = this.operationDefinition.pathname\n\n const $comment = new CommentRenderer(this.operationDefinition).render()\n const $method = this.operationDefinition.method.toLowerCase()\n const $mediaType = this.helper.renderMediaType()\n const $operationDeclaration = this.renderOperationDeclaration(this.operationDefinition)\n const $queryParameters = this.helper.renderRequestQuery()\n const $headerParameters = this.helper.renderRequestHeaders()\n const $pathParameters = this.helper.renderRequestPathParameters()\n const $requestBody = this.helper.renderRequestBody()\n\n return [\n $comment,\n `${$operationDeclaration} {`,\n ` const req = this.request.${$method}<${this.typeName('ResponseBodies')}[STATUS]>(${JSON.stringify(pathname)})`,\n ' .option(',\n ' \"module\",',\n ' {',\n ` name: ${JSON.stringify(this.operationDefinition.module.name)},`,\n ` pathname: ${JSON.stringify(pathname)},`,\n ` method: ${JSON.stringify($method)},`,\n ' },',\n ' )',\n '',\n $mediaType ? indent(2, $mediaType) : undefined,\n '',\n ' /* @anchor:query:start */',\n $queryParameters ? indent(2, $queryParameters) : undefined,\n ' /* @anchor:query:end */',\n '',\n ' /* @anchor:headers:start */',\n $headerParameters ? indent(2, $headerParameters) : undefined,\n ' /* @anchor:headers:end */',\n '',\n ' /* @anchor:path-parameters:start */',\n $pathParameters ? indent(2, $pathParameters) : undefined,\n ' /* @anchor:path-parameters:end */',\n '',\n ' /* @anchor:body:start */',\n $requestBody ? indent(2, $requestBody) : undefined,\n ' /* @anchor:body:end */',\n '',\n ' return req',\n '}',\n ].filter(R.isNotNil).join('\\n')\n }\n\n private renderOperationDeclaration(operationDefinition: OperationDefinition): string {\n const { operationId } = operationDefinition\n const typeName = typeNameFactory(operationDefinition)\n\n const mediaTypes = this.helper.getRequestMediaTypes()\n\n if (mediaTypes.length === 0) {\n return `${operationId}<STATUS extends keyof ${typeName('ResponseBodies')}, CONTENT_TYPE extends never = never>(args?: ${typeName('RequestParameters')}): Keq<${typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n } else if (mediaTypes.length === 1) {\n 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>>`\n } else if (mediaTypes.length > 1) {\n 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>>`\n }\n\n throw new Exception(operationDefinition.module, '[operationDeclarationRenderer] Unreachable')\n }\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { DeclarationRenderer, OperationDefinitionDeclarationRendererOptions } from './declaration.renderer.js'\nimport { OperationDefinitionMicroFunctionRendererOptions, OperationDefinitionMicroFunctionRenderer } from './micro-function.renderer.js'\nimport { OperationDefinitionNestjsMethodRenderer, OperationDefinitionNestjsMethodRendererOptions } from './nestjs-method.renderer.js'\n\n\nexport class OperationDefinitionTransformer {\n static toDeclaration(operationDefinition: OperationDefinition, options: OperationDefinitionDeclarationRendererOptions): string {\n return new DeclarationRenderer(operationDefinition, options).render()\n }\n\n static toMicroFunction(operationDefinition: OperationDefinition, options: OperationDefinitionMicroFunctionRendererOptions): string {\n return new OperationDefinitionMicroFunctionRenderer(operationDefinition, options).render()\n }\n\n static toNestjsMethod(operationDefinition: OperationDefinition, options: OperationDefinitionNestjsMethodRendererOptions): string {\n return new OperationDefinitionNestjsMethodRenderer(operationDefinition, options).render()\n }\n\n static toComment(operationDefinition: OperationDefinition): string {\n return new CommentRenderer(operationDefinition).render()\n }\n}\n","import * as path from 'path'\nimport { Artifact } from '~/models/index.js'\n\n\ninterface EntrypointTypescriptRendererOptions {\n esm?: boolean\n\n // The directory path of the entrypoint file being generated\n dirpath: string\n}\n\nexport class EntrypointTransformer {\n static toTypescript(exports: Artifact[], options: EntrypointTypescriptRendererOptions): string {\n const $exports = exports.map((exportArtifact) => {\n const relativePath = path.relative(\n options.dirpath,\n exportArtifact.filepath,\n )\n .replace(/(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?$/, options.esm ? '.js' : '')\n\n return relativePath.startsWith('.')\n ? `export * from '${relativePath}'`\n : `export * from './${relativePath}'`\n })\n\n return [\n '/* @anchor:file:start */',\n '',\n ...$exports,\n '',\n '/* @anchor:file:end */',\n ].join('\\n')\n }\n}\n","import * as R from 'ramda'\nimport * as changeCase from 'change-case'\nimport { ApiDocumentV3_1, OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { OperationDefinitionTransformer, typeNameFactory } from '../operation-definition/index.js'\nimport { indent } from '~/utils/indent.js'\n\n\nexport interface ApiDocumentNestjsClientRendererOptions {\n esm?: boolean\n\n getOperationDefinitionDeclarationFilepath(this: void, operationDefinition: OperationDefinition): string\n}\n\n\nexport class NestjsClientRenderer implements Renderer {\n constructor(\n private readonly document: ApiDocumentV3_1,\n private readonly options: ApiDocumentNestjsClientRendererOptions,\n ) {\n\n }\n\n private renderDependencies(): string {\n const $operations = this.document.operations\n .map((operationDefinition) => {\n const filepath = this.options.getOperationDefinitionDeclarationFilepath(operationDefinition)\n const typeName = typeNameFactory(operationDefinition)\n\n return `import type { ${typeName('Operation')}, ${typeName('ResponseBodies')}, ${typeName('RequestParameters')} } from \"${filepath}\"`\n })\n .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n\n return [\n 'import { Injectable, Logger } from \"@nestjs/common\"',\n 'import { Keq, KeqRequest } from \"keq\"',\n ...$operations,\n ]\n .join('\\n')\n }\n\n render(): string {\n const moduleName = changeCase.pascalCase(this.document.module.name)\n\n const $dependencies = this.renderDependencies()\n const $operations = this.document.operations\n .map((operation) => OperationDefinitionTransformer.toNestjsMethod(operation, {\n esm: this.options.esm,\n }))\n .join('\\n\\n')\n\n return [\n '/* @anchor:file:start */',\n '',\n $dependencies,\n '',\n '@Injectable()',\n `export class ${moduleName}Client {`,\n ` private readonly logger = new Logger(${moduleName}Client.name)`,\n '',\n ' constructor(',\n ' // @anchor:client-constructor-parameters:start',\n ' private readonly request: KeqRequest,',\n ' // @anchor:client-constructor-parameters:end',\n ' ) {}',\n '',\n indent(2, $operations),\n '}',\n '',\n '/* @anchor:file:end */',\n ].filter(R.isNotNil).join('\\n')\n }\n}\n","import * as changeCase from 'change-case'\nimport { ApiDocumentV3_1 } from '~/models/api-document_v3_1.js'\n\nexport interface ApiDocumentNestjsModuleRendererOptions {\n esm?: boolean\n\n getNestjsClientFilepath(document: ApiDocumentV3_1): string\n}\n\nexport class NestjsModuleRenderer {\n constructor(\n private readonly document: ApiDocumentV3_1,\n private readonly options: ApiDocumentNestjsModuleRendererOptions,\n ) {\n }\n\n render(): string {\n const moduleName = changeCase.pascalCase(this.document.module.name)\n const clientFilepath = this.options.getNestjsClientFilepath(this.document)\n .replace(/(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?$/, this.options.esm ? '.js' : '')\n\n return [\n '/* @anchor:file:start */',\n 'import { Module, Inject, ConfigurableModuleBuilder, Global } from \"@nestjs/common\"',\n 'import { KeqRequest } from \"keq\"',\n 'import { KeqModuleOptions } from \"@keq-request/nestjs\"',\n `import { ${moduleName}Client } from \"${clientFilepath}\"`,\n '',\n '',\n 'const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } = new ConfigurableModuleBuilder<KeqModuleOptions>().build()',\n '',\n '@Global()',\n '@Module({',\n ' imports: [],',\n ' controllers: [],',\n ` providers: [${moduleName}Client],`,\n ` exports: [${moduleName}Client],`,\n '})',\n `export class ${moduleName}Module extends ConfigurableModuleClass {`,\n '',\n ' constructor(',\n ' @Inject(MODULE_OPTIONS_TOKEN) private readonly options: KeqModuleOptions,',\n ' private readonly request: KeqRequest,',\n ' ) {',\n ' super()',\n ' }',\n '',\n ' onModuleInit() {',\n ' if (this.options.middlewares) {',\n ' for (const middleware of this.options.middlewares) {',\n ' this.request.use(middleware)',\n ' }',\n ' }',\n ' }',\n '}',\n '',\n '/* @anchor:file:end */',\n ].join('\\n')\n }\n}\n","import { ApiDocumentV3_1 } from '~/models/index.js'\nimport { ApiDocumentNestjsClientRendererOptions, NestjsClientRenderer } from './nestjs-client.renderer.js'\nimport { ApiDocumentNestjsModuleRendererOptions, NestjsModuleRenderer } from './nestjs-module.renderer.js'\n\n\nexport class ApiDocumentTransformer {\n static toNestjsModule(document: ApiDocumentV3_1, options: ApiDocumentNestjsModuleRendererOptions): string {\n return new NestjsModuleRenderer(document, options).render()\n }\n\n static toNestjsClient(document: ApiDocumentV3_1, options: ApiDocumentNestjsClientRendererOptions): string {\n return new NestjsClientRenderer(document, options).render()\n }\n}\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport { Artifact, ModuleDefinition, SchemaDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { SchemaDefinitionTransformer } from '~/transformers/index.js'\nimport { EntrypointTransformer } from '~/transformers/entrypoint/entrypoint.transformer.js'\nimport { FileNamingStyle } from '~/constants/file-naming-style.js'\nimport * as changeCase from 'change-case'\nimport type { Generator, RuntimeConfig } from '~/types/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\n\n\nexport const SCHEMA_GENERATOR = 'schemaGenerator'\n\nexport class SchemaDeclarationGenerator implements Generator {\n async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n const context = compiler.context\n const metadata = MetadataStorage.get(compiler)!\n\n const rc = context.rc!\n // const matcher = context.matcher!\n const documents = context.documents!\n // .filter((document) => !matcher.isModuleIgnored(document.module))\n\n const schemaDefinitions = documents.flatMap((document) => document.schemas)\n\n const artifactMap = new Map<SchemaDefinition, Artifact>(\n await Promise.all(\n schemaDefinitions.map(async (schemaDefinition) => (<const>[\n schemaDefinition,\n await metadata.hooks.afterSchemaDeclarationArtifactGenerated.promise(\n this.generateSchemaDefinitionsArtifact(schemaDefinition, rc),\n schemaDefinition,\n task,\n ),\n ])),\n ),\n )\n\n\n const entrypoints = R.collectBy(\n (schemaDefinition) => schemaDefinition.module.name,\n schemaDefinitions,\n )\n .map((schemaDefinitions) => <const>[\n schemaDefinitions[0].module,\n schemaDefinitions\n .map((schemaDefinition) => artifactMap.get(schemaDefinition))\n .filter((artifact): artifact is Artifact => Boolean(artifact)),\n ])\n\n .map(([moduleDefinition, artifacts]) => this.generateEntrypointArtifact(\n moduleDefinition,\n artifacts,\n rc,\n ))\n\n return [...artifactMap.values(), ...entrypoints]\n }\n\n private generateSchemaDefinitionsArtifact(schemaDefinition: SchemaDefinition, rc: RuntimeConfig): Artifact {\n const filepath = SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(schemaDefinition, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: SchemaDeclarationGenerator.getSchemaDefinitionArtifactId(schemaDefinition),\n filepath,\n content: SchemaDefinitionTransformer.toDeclaration(\n schemaDefinition,\n {\n esm: rc.esm,\n getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string {\n const relativePath = path.relative(\n dirpath,\n SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle),\n )\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n },\n ),\n extensionName: '.schema.ts',\n })\n\n return artifact\n }\n\n private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n const filepath = SchemaDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: SchemaDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),\n filepath,\n content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n })\n\n return artifact\n }\n\n static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n return [\n '.',\n changeCase[fileNamingStyle](moduleDefinition.name),\n 'types',\n 'components',\n 'schemas',\n 'index.ts',\n ].join('/')\n }\n\n static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n return `${moduleDefinition.address}/components/schemas/entrypoint?generator=${SCHEMA_GENERATOR}`\n }\n\n static getSchemaDefinitionArtifactFilepath(schemaDefinition: SchemaDefinition, fileNamingStyle: FileNamingStyle): string {\n const filename = `${changeCase[fileNamingStyle](schemaDefinition.name)}.schema.ts`\n return [\n '.',\n changeCase[fileNamingStyle](schemaDefinition.module.name),\n 'types',\n 'components',\n 'schemas',\n filename,\n ].join('/')\n }\n\n static getSchemaDefinitionArtifactId(schemaDefinition: SchemaDefinition): string {\n return `${schemaDefinition.id}?generator=${SCHEMA_GENERATOR}`\n }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition, SchemaDefinition } from '~/models/index.js'\n\n\nexport interface GenerateDeclarationPluginMetadata {\n hooks: {\n afterEntrypointArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>\n afterSchemaDeclarationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, SchemaDefinition, TaskWrapper]>\n afterOperationDeclarationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>\n }\n}\n\nexport const MetadataStorage = new WeakMap<Compiler, GenerateDeclarationPluginMetadata>()\n","import { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact } from '~/models/index.js'\nimport { Generator } from '~/types/index.js'\n\n\nexport const MICRO_FUNCTION_REQUEST_GENERATOR = 'microFunctionRequestGenerator'\n\nexport class RequestGenerator implements Generator {\n private generateRequestArtifact(): Artifact {\n const content = [\n '/* @anchor:file:start */',\n '',\n 'import { KeqRequest } from \"keq\"',\n '',\n '/* @anchor:request-declaration */',\n 'export const request = new KeqRequest()',\n '',\n '/* @anchor:file:end */',\n ].join('\\n')\n\n return new Artifact({\n id: RequestGenerator.getRequestArtifactId(),\n filepath: RequestGenerator.getRequestArtifactFilepath(),\n content,\n })\n }\n\n\n // eslint-disable-next-line @typescript-eslint/require-await\n async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n return [\n this.generateRequestArtifact(),\n ]\n }\n\n static getRequestArtifactFilepath(): string {\n return './request.ts'\n }\n\n static getRequestArtifactId(): string {\n return `request?generator=${MICRO_FUNCTION_REQUEST_GENERATOR}`\n }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\nimport { GenerateNestjsModulePluginMetadata, MetadataStorage } from './constants/index.js'\nimport { NestjsModuleGenerator } from './generators/nestjs-module.generator.js'\n\n\nexport class GenerateNestjsModulePlugin implements Plugin {\n private readonly nestjsModuleGenerator = new NestjsModuleGenerator()\n\n apply(compiler: Compiler): void {\n GenerateNestjsModulePlugin.register(compiler)\n\n compiler.hooks.compile.tapPromise(GenerateNestjsModulePlugin.name, async (task) => {\n const artifacts = await this.nestjsModuleGenerator.compile(compiler, task)\n compiler.context.artifacts!.push(...artifacts)\n })\n }\n\n static register(compiler: Compiler): GenerateNestjsModulePluginMetadata {\n if (!MetadataStorage.has(compiler)) {\n MetadataStorage.set(compiler, {\n hooks: {\n afterNestjsModuleArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, ApiDocumentV3_1, TaskWrapper]>(['artifact', 'document', 'task']),\n },\n })\n }\n\n return MetadataStorage.get(compiler)!\n }\n\n static of(compiler: Compiler): GenerateNestjsModulePluginMetadata | undefined {\n return MetadataStorage.get(compiler)\n }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\n\nexport interface GenerateNestjsModulePluginMetadata {\n hooks: {\n afterNestjsModuleArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, ApiDocumentV3_1, TaskWrapper]>\n }\n}\n\nexport const MetadataStorage = new WeakMap<Compiler, GenerateNestjsModulePluginMetadata>()\n","import * as path from 'path'\nimport * as changeCase from 'change-case'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\nimport { MetadataStorage } from '../constants/metadata-storage.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { Generator, RuntimeConfig } from '~/types/index.js'\nimport { ApiDocumentTransformer } from '~/transformers/index.js'\nimport { OperationDeclarationGenerator } from '~/plugins/generate-declaration/index.js'\n\n\nconst NESTJS_MODULE_GENERATOR = 'nestjs-module-generator'\n\nexport class NestjsModuleGenerator implements Generator {\n private generateNestjsModuleArtifact(document: ApiDocumentV3_1, rc: RuntimeConfig): Artifact {\n const filepath = NestjsModuleGenerator.getNestjsModuleArtifactFilepath(document, rc.fileNamingStyle)\n const dirname = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: NestjsModuleGenerator.getNestjsModuleArtifactId(document),\n filepath,\n content: ApiDocumentTransformer.toNestjsModule(document, {\n esm: rc.esm,\n getNestjsClientFilepath(document) {\n const relativePath = path.relative(\n dirname,\n NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.fileNamingStyle),\n )\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n }),\n })\n\n return artifact\n }\n\n private generateNestjsClientArtifact(document: ApiDocumentV3_1, rc: RuntimeConfig): Artifact {\n const filepath = NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.fileNamingStyle)\n const dirpath = path.dirname(filepath)\n\n const artifact = new Artifact({\n id: NestjsModuleGenerator.getNestjsClientArtifactId(document),\n filepath,\n content: ApiDocumentTransformer.toNestjsClient(document, {\n esm: rc.esm,\n getOperationDefinitionDeclarationFilepath(operationDefinition) {\n const relativePath = path.relative(\n dirpath,\n OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle),\n )\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n },\n }),\n })\n\n return artifact\n }\n\n async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n const metadata = MetadataStorage.get(compiler)!\n const rc = compiler.context.rc!\n const documents = compiler.context.documents!\n\n const nestjsModuleArtifacts = await Promise.all(\n documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(\n this.generateNestjsModuleArtifact(document, rc),\n document,\n task,\n )),\n )\n\n const nestjsClientArtifacts = await Promise.all(\n documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(\n this.generateNestjsClientArtifact(document, rc),\n document,\n task,\n )),\n )\n\n return [...nestjsModuleArtifacts, ...nestjsClientArtifacts]\n }\n\n static getNestjsModuleArtifactFilepath(document: ApiDocumentV3_1, fileNamingStyle: FileNamingStyle): string {\n const filename = `${changeCase[fileNamingStyle](document.module.name)}.module.ts`\n\n const filepath = [\n '.',\n changeCase[fileNamingStyle](document.module.name),\n filename,\n ]\n\n return filepath.join('/')\n }\n\n static getNestjsModuleArtifactId(document: ApiDocumentV3_1): string {\n return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}`\n }\n\n static getNestjsClientArtifactFilepath(document: ApiDocumentV3_1, fileNamingStyle: FileNamingStyle): string {\n const filename = `${changeCase[fileNamingStyle](document.module.name)}.client.ts`\n\n const filepath = [\n '.',\n changeCase[fileNamingStyle](document.module.name),\n filename,\n ]\n\n return filepath.join('/')\n }\n\n static getNestjsClientArtifactId(document: ApiDocumentV3_1): string {\n return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}-client`\n }\n}\n","\nimport { fixSwagger } from 'swagger-fix'\nimport { Compiler } from '~/compiler/index.js'\nimport { ApiDocumentV3_1 } from '~/models/index.js'\n\n\nexport class ChineseToPinyinPlugin {\n apply(compiler: Compiler): void {\n compiler.hooks.afterDownload.tap(ChineseToPinyinPlugin.name, (task) => {\n const documents = compiler.context.documents!\n\n compiler.context.documents = documents.map((doc) => {\n return new ApiDocumentV3_1(\n fixSwagger(doc.specification as any),\n doc.module,\n )\n })\n })\n }\n}\n","import * as validUrl from 'valid-url'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\nexport class DownloadHttpFilePlugin implements Plugin {\n apply(compiler: Compiler): void {\n compiler.hooks.download.tapPromise(DownloadHttpFilePlugin.name, async (address, task) => {\n if (!validUrl.isUri(address)) return undefined\n const content = await this.download(address)\n const spec = this.deserialize(content)\n return JSON.stringify(spec)\n })\n }\n\n async download(address): Promise<string> {\n try {\n const res = await fetch(address)\n if (res.status >= 400) throw new Error(`failed with status code ${res.status}`)\n\n return await res.text()\n } catch (e) {\n if (e instanceof Error) {\n e.message = `Unable get the openapi/swagger file from ${address}: ${e.message}`\n }\n\n throw e\n }\n }\n\n deserialize(content: string): object {\n const json = JSON.parse(content)\n const spec = OpenapiUtils.to3_1(json)\n return spec\n }\n}\n","import * as path from 'path'\nimport * as fs from 'fs/promises'\nimport * as yaml from 'js-yaml'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\nexport class DownloadLocalFilePlugin implements Plugin {\n apply(compiler: Compiler): void {\n compiler.hooks.download.tapPromise(DownloadLocalFilePlugin.name, async (address, task) => {\n if (!address.startsWith('./') && !address.startsWith('/') && !address.startsWith('../')) return undefined\n\n const fileExt = path.extname(address)\n const content = await fs.readFile(address, 'utf8')\n\n if (['.yml', '.yaml'].includes(fileExt)) {\n const value = yaml.load(content)\n return JSON.stringify(OpenapiUtils.to3_1(value))\n } else if (fileExt === '.json') {\n return JSON.stringify(OpenapiUtils.to3_1(JSON.parse(content)))\n }\n })\n }\n}\n","import { Plugin } from '~/types/index.js'\nimport { Compiler } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SupportedMethods } from '~/constants/index.js'\nimport { openapiShakingSync } from '@opendoc/openapi-shaking'\n\nexport class ShakingPlugin implements Plugin {\n apply(compiler: Compiler): void {\n compiler.hooks.beforeCompile.tap(ShakingPlugin.name, (task) => {\n const matcher = compiler.context.matcher!\n const documents = compiler.context.documents!\n\n compiler.context.documents = documents\n .map((document) => this.shaking(compiler, document))\n .filter((document) => !document.isEmpty())\n .filter((document) => !matcher.isModuleIgnored(document.module))\n })\n }\n\n shaking(compiler: Compiler, document: ApiDocumentV3_1): ApiDocumentV3_1 {\n const rc = compiler.context.rc!\n const matcher = compiler.context.matcher!\n\n const isAccepted = (pathname: string, method: string, operation: OpenAPIV3_1.Document): boolean => {\n if (!SupportedMethods.includes(method)) return false\n\n return !matcher.isOperationIgnored(new OperationDefinition({\n method,\n pathname,\n operation,\n module: document.module,\n document: document,\n }))\n }\n\n\n const sharkedSwagger = openapiShakingSync(\n document.specification as any,\n isAccepted as any,\n { tolerant: rc.tolerant },\n ) as OpenAPIV3_1.Document\n\n return new ApiDocumentV3_1(\n sharkedSwagger,\n new ModuleDefinition(\n document.module.name,\n `file://${document.module.name}.v3_1.sharked.json`,\n ),\n )\n }\n}\n","import { ListrTaskWrapper } from 'listr2'\nimport { OperationDefinition } from '~/models/index.js'\nimport { select } from 'inquirer-select-pro'\nimport { ListrInquirerPromptAdapter } from '@listr2/prompt-adapter-inquirer'\nimport { CompilerContext } from '~/compiler/index.js'\n\nexport async function selectOperationDefinitions(\n task: ListrTaskWrapper<CompilerContext, any, any>,\n operationDefinitions: OperationDefinition[],\n): Promise<OperationDefinition[]> {\n const selectedOperationDefinitions = await task.prompt(ListrInquirerPromptAdapter).run(\n select<OperationDefinition>,\n {\n message: 'Select Pathname',\n defaultValue: [],\n options: (input) => {\n const items = operationDefinitions.map((op) => ({ name: `${op.module.name} ${op.method.toUpperCase()} ${op.pathname}`, value: op }))\n\n if (!input) return items\n const keys = input\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n\n return items.filter((i) => {\n const name = i.name.toLowerCase()\n return keys.every((q) => name.includes(q))\n })\n },\n },\n )\n\n return selectedOperationDefinitions\n}\n","import { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { selectOperationDefinitions } from './utils/select-operation-definitions.js'\nimport { IgnoreMode } from './types/index.js'\n\nexport interface TerminalSelectPluginOptions {\n mode: IgnoreMode\n\n persist?: boolean\n\n /**\n * Remove all previously matcher rules.\n * This means that all rules form `.keqignore` file will be removed.\n */\n clear?: boolean\n}\n\n\nexport class TerminalSelectPlugin implements Plugin {\n constructor(private options: TerminalSelectPluginOptions) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.afterDownload.tapPromise(TerminalSelectPlugin.name, async (task) => {\n const context = compiler.context\n\n const matcher = context.matcher!\n const documents = context.documents!\n const operationDefinitions = documents.flatMap((document) => document.operations)\n const selectedOperationDefinitions = await selectOperationDefinitions(task, operationDefinitions)\n\n if (this.options.clear) {\n matcher.append({\n persist: false,\n ignore: true,\n moduleName: '*',\n operationMethod: '*',\n operationPathname: '*',\n })\n }\n\n for (const op of selectedOperationDefinitions) {\n matcher.append({\n persist: !!this.options.persist,\n ignore: this.options.mode === 'add',\n moduleName: op.module.name,\n operationMethod: op.method,\n operationPathname: op.pathname,\n })\n }\n })\n }\n}\n","import * as R from 'ramda'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { DownloadHttpFilePlugin } from '../download-http-file/index.js'\nimport { DownloadLocalFilePlugin } from '../download-local-file/index.js'\nimport { GenerateDeclarationPlugin } from '../generate-declaration/index.js'\nimport { ShakingPlugin } from '../shaking/index.js'\nimport { TerminalSelectPlugin, TerminalSelectPluginOptions } from '../terminal-select/index.js'\nimport { GenerateMicroFunctionPlugin } from '../generate-micro-function/index.js'\nimport { GenerateNestjsModulePlugin } from '../generate-nestjs-module/index.js'\n\n\ninterface InitializePluginOptions {\n build?: boolean\n interactive?: boolean | TerminalSelectPluginOptions\n\n includes?: string[]\n}\n\nexport class InitializePlugin implements Plugin {\n constructor(private options: InitializePluginOptions) {\n }\n\n apply(compiler: Compiler): void {\n compiler.hooks.setup.tap(InitializePlugin.name, (task) => {\n new DownloadHttpFilePlugin().apply(compiler)\n new DownloadLocalFilePlugin().apply(compiler)\n\n new GenerateDeclarationPlugin().apply(compiler)\n\n if (this.options.build) {\n new ShakingPlugin().apply(compiler)\n }\n\n if (this.options.interactive) {\n new TerminalSelectPlugin(\n typeof this.options.interactive === 'object'\n ? this.options.interactive\n : { mode: 'except' },\n ).apply(compiler)\n }\n\n const rc = compiler.context.rc!\n\n if (rc.mode === 'micro-function') {\n new GenerateMicroFunctionPlugin().apply(compiler)\n } else if (rc.mode === 'nestjs-module') {\n new GenerateNestjsModulePlugin().apply(compiler)\n }\n\n // Apply Custom Plugins\n if (rc.plugins && rc.plugins.length) {\n for (const plugin of rc.plugins) {\n plugin.apply(compiler)\n }\n }\n })\n\n if (this.options.includes && this.options.includes.length) {\n const modulesIncludes = this.options.includes\n\n compiler.hooks.afterSetup.tap(InitializePlugin.name, (task) => {\n const rc = compiler.context.rc!\n const matcher = compiler.context.matcher!\n\n const notExistModules = modulesIncludes.filter((moduleName) => !(moduleName in rc.modules))\n if (notExistModules.length) {\n throw new Error(`Cannot find module(s) ${notExistModules.join(', ')} in config file.`)\n }\n\n const ignoredModules = R.difference(R.keys(rc.modules), modulesIncludes)\n for (const moduleName of ignoredModules) {\n matcher.append({\n persist: false,\n ignore: true,\n moduleName,\n operationMethod: '*',\n operationPathname: '*',\n })\n }\n })\n }\n }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { Compiler } from '~/compiler/index.js'\nimport { Exception } from '~/exception.js'\nimport { ApiDocumentV3_1 } from '~/models/api-document_v3_1.js'\nimport { ModuleDefinition } from '~/models/module-definition.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\n/**\n * A factory function that generates an operationId for a given operation.\n * If undefined is returned, the operationId will not be modified.\n */\nexport type OperationIdFactory = (context: {\n module: ModuleDefinition\n method: string\n pathname: string\n operation: OpenAPIV3_1.OperationObject\n}) => string | undefined\n\n\nexport class OverwriteOperationIdPlugin implements Plugin {\n constructor(private readonly factory: OperationIdFactory) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.afterDownload.tap(OverwriteOperationIdPlugin.name, () => {\n const documents = compiler.context.documents!\n const factory = this.factory\n\n compiler.context.documents = documents.map((document) => {\n const spec = OpenapiUtils.mapOperation(\n document.specification,\n (method, pathname, operation) => {\n const operationId = factory({ method, pathname, operation, module: document.module })\n if (typeof operationId === 'string') {\n if (operationId.length === 0) {\n throw new Exception(document.module, `The generated operationId for [${method.toUpperCase()} ${pathname}] is an empty string.`)\n }\n operation.operationId = operationId\n return operation\n }\n\n return operation\n },\n )\n\n return new ApiDocumentV3_1(spec, document.module)\n })\n })\n }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { KeqQueryOptions } from 'keq'\nimport { Compiler } from '~/compiler/index.js'\nimport { QsArrayFormat } from '~/constants/qs-array-format.js'\nimport { Exception } from '~/exception.js'\nimport { ApiDocumentV3_1, ModuleDefinition } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\nexport type OverwriteQueryOptionsFactory = (\n (options: {\n module: ModuleDefinition\n method: string\n pathname: string\n operation: OpenAPIV3_1.OperationObject\n parameter: OpenAPIV3_1.ParameterObject\n }) => KeqQueryOptions | undefined\n) | KeqQueryOptions\n\nconst QsArrayFormatUnion: string[] = Object.values(QsArrayFormat)\n\nexport class OverwriteQueryOptionsPlugin implements Plugin {\n constructor(private readonly factory: OverwriteQueryOptionsFactory) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.afterDownload.tap(OverwriteQueryOptionsPlugin.name, (task) => {\n const documents = compiler.context.documents!\n const factory = this.factory\n\n compiler.context.documents = documents.map((document) => {\n const specification = OpenapiUtils.mapParameter(\n document.specification,\n (method, pathname, operation, parameter) => {\n const qsOptions = typeof factory === 'function' ? factory({ parameter, operation, pathname, method, module: document.module }) : factory\n if (!qsOptions) return parameter\n\n if (qsOptions.arrayFormat) {\n if (!QsArrayFormatUnion.includes(qsOptions.arrayFormat)) {\n throw new Exception(document.module, `The 'arrayFormat' value '${qsOptions.arrayFormat}' for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] is invalid.`)\n }\n\n parameter['x-qs-array-format'] = qsOptions.arrayFormat\n }\n\n if (qsOptions.allowDots !== undefined) {\n if (typeof qsOptions.allowDots !== 'boolean') {\n throw new Exception(document.module, `The 'allowDots' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`)\n }\n\n parameter['x-qs-allow-dots'] = Boolean(qsOptions.allowDots)\n }\n\n if (qsOptions.indices !== undefined) {\n if (typeof qsOptions.indices !== 'boolean') {\n throw new Exception(document.module, `The 'indices' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`)\n }\n\n parameter['x-qs-indices'] = Boolean(qsOptions.indices)\n }\n\n return parameter\n },\n )\n\n return new ApiDocumentV3_1(\n specification,\n document.module,\n )\n })\n })\n }\n}\n"],"mappings":";AAEA,SAAS,cAAc;AAUhB,IAAM,eAAN,MAAM,cAA+B;AAAA,EAC1C,YAAoB,UAA+B,CAAC,GAAG;AAAnC;AAAA,EAAoC;AAAA,EAGxD,MAAM,UAA0B;AAC9B,QAAI,CAAC,SAAS,QAAQ,MAAO;AAE7B,QAAI,KAAK,QAAQ,WAAW,KAAK,QAAQ,QAAQ,SAAS,GAAG;AAC3D,YAAM,SAAS;AAAA,QACb,GAAG,KAAK,QAAQ,QAAQ,IAAI,CAAC,SAAS,qBAA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UAAU,aAAa;AACzB,kBAAI,CAAC,mBAAmB,SAAS,UAAU,WAAW,GAAG;AACvD,sBAAM,IAAI,UAAU,SAAS,QAAQ,4BAA4B,UAAU,WAAW,8BAA8B,UAAU,IAAI,SAAS,OAAO,YAAY,CAAC,IAAI,QAAQ,eAAe;AAAA,cAC5L;AAEA,wBAAU,mBAAmB,IAAI,UAAU;AAAA,YAC7C;AAEA,gBAAI,UAAU,cAAc,QAAW;AACrC,kBAAI,OAAO,UAAU,cAAc,WAAW;AAC5C,sBAAM,IAAI,UAAU,SAAS,QAAQ,kDAAkD,UAAU,IAAI,SAAS,OAAO,YAAY,CAAC,IAAI,QAAQ,sBAAsB;AAAA,cACtK;AAEA,wBAAU,iBAAiB,IAAI,QAAQ,UAAU,SAAS;AAAA,YAC5D;AAEA,gBAAI,UAAU,YAAY,QAAW;AACnC,kBAAI,OAAO,UAAU,YAAY,WAAW;AAC1C,sBAAM,IAAI,UAAU,SAAS,QAAQ,gDAAgD,UAAU,IAAI,SAAS,OAAO,YAAY,CAAC,IAAI,QAAQ,sBAAsB;AAAA,cACpK;AAEA,wBAAU,cAAc,IAAI,QAAQ,UAAU,OAAO;AAAA,YACvD;AAEA,mBAAO;AAAA,UACT;AAAA,QACF;AAEA,eAAO,IAAI;AAAA,UACT;AAAA,UACA,SAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":["R","AsyncSeriesWaterfallHook","R","path","changeCase","R","R","JSONPath","JSONPath","path","path","changeCase","R","R","alias","schema","R","R","CommentRenderer","R","R","jsonpointer","JSONPath","R","JSONPath","R","path","JSONPath","JSONPath","jsonpointer","R","DeclarationRenderer","R","R","QsArrayFormat","CommentRenderer","R","CommentRenderer","DeclarationRenderer","CommentRenderer","path","R","changeCase","changeCase","R","path","changeCase","MetadataStorage","MetadataStorage","schemaDefinitions","changeCase","MetadataStorage","changeCase","MetadataStorage","operationDefinitions","operationDefinition","changeCase","AsyncSeriesWaterfallHook","keys","AsyncSeriesWaterfallHook","MetadataStorage","path","changeCase","dirname","document","MetadataStorage","changeCase","MetadataStorage","AsyncSeriesWaterfallHook","path","keys","R"]}
@@ -0,0 +1,8 @@
1
+ import { ApiDocumentV3_1 } from '../../models/index.js';
2
+ import { ApiDocumentNestjsClientRendererOptions } from './nestjs-client.renderer.js';
3
+ import { ApiDocumentNestjsModuleRendererOptions } from './nestjs-module.renderer.js';
4
+ export declare class ApiDocumentTransformer {
5
+ static toNestjsModule(document: ApiDocumentV3_1, options: ApiDocumentNestjsModuleRendererOptions): string;
6
+ static toNestjsClient(document: ApiDocumentV3_1, options: ApiDocumentNestjsClientRendererOptions): string;
7
+ }
8
+ //# sourceMappingURL=api-document.transformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-document.transformer.d.ts","sourceRoot":"","sources":["../../../src/transformers/api-document/api-document.transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,sCAAsC,EAAwB,MAAM,6BAA6B,CAAA;AAC1G,OAAO,EAAE,sCAAsC,EAAwB,MAAM,6BAA6B,CAAA;AAG1G,qBAAa,sBAAsB;IACjC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,sCAAsC,GAAG,MAAM;IAIzG,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,sCAAsC,GAAG,MAAM;CAG1G"}
@@ -0,0 +1,2 @@
1
+ export * from './api-document.transformer.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transformers/api-document/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { ApiDocumentV3_1, OperationDefinition } from '../../models/index.js';
2
+ import { Renderer } from '../types/renderer.js';
3
+ export interface ApiDocumentNestjsClientRendererOptions {
4
+ esm?: boolean;
5
+ getOperationDefinitionDeclarationFilepath(this: void, operationDefinition: OperationDefinition): string;
6
+ }
7
+ export declare class NestjsClientRenderer implements Renderer {
8
+ private readonly document;
9
+ private readonly options;
10
+ constructor(document: ApiDocumentV3_1, options: ApiDocumentNestjsClientRendererOptions);
11
+ private renderDependencies;
12
+ render(): string;
13
+ }
14
+ //# sourceMappingURL=nestjs-client.renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs-client.renderer.d.ts","sourceRoot":"","sources":["../../../src/transformers/api-document/nestjs-client.renderer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAK/C,MAAM,WAAW,sCAAsC;IACrD,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb,yCAAyC,CAAC,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,mBAAmB,GAAG,MAAM,CAAA;CACxG;AAGD,qBAAa,oBAAqB,YAAW,QAAQ;IAEjD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,sCAAsC;IAKlE,OAAO,CAAC,kBAAkB;IAkB1B,MAAM,IAAI,MAAM;CA+BjB"}
@@ -0,0 +1,12 @@
1
+ import { ApiDocumentV3_1 } from '../../models/api-document_v3_1.js';
2
+ export interface ApiDocumentNestjsModuleRendererOptions {
3
+ esm?: boolean;
4
+ getNestjsClientFilepath(document: ApiDocumentV3_1): string;
5
+ }
6
+ export declare class NestjsModuleRenderer {
7
+ private readonly document;
8
+ private readonly options;
9
+ constructor(document: ApiDocumentV3_1, options: ApiDocumentNestjsModuleRendererOptions);
10
+ render(): string;
11
+ }
12
+ //# sourceMappingURL=nestjs-module.renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs-module.renderer.d.ts","sourceRoot":"","sources":["../../../src/transformers/api-document/nestjs-module.renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,MAAM,WAAW,sCAAsC;IACrD,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAAA;CAC3D;AAED,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,sCAAsC;IAIlE,MAAM,IAAI,MAAM;CA2CjB"}
@@ -0,0 +1,10 @@
1
+ import { Artifact } from '../../models/index.js';
2
+ interface EntrypointTypescriptRendererOptions {
3
+ esm?: boolean;
4
+ dirpath: string;
5
+ }
6
+ export declare class EntrypointTransformer {
7
+ static toTypescript(exports: Artifact[], options: EntrypointTypescriptRendererOptions): string;
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=entrypoint.transformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoint.transformer.d.ts","sourceRoot":"","sources":["../../../src/transformers/entrypoint/entrypoint.transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,UAAU,mCAAmC;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAA;IAGb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,qBAAqB;IAChC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,mCAAmC,GAAG,MAAM;CAqB/F"}
@@ -0,0 +1,2 @@
1
+ export * from './entrypoint.transformer.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transformers/entrypoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from './json-schema/index.js';
2
+ export * from './schema-definition/index.js';
3
+ export * from './operation-definition/index.js';
4
+ export * from './entrypoint/index.js';
5
+ export * from './api-document/index.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import { Renderer } from '../types/renderer.js';
3
+ export declare class CommentRenderer implements Renderer {
4
+ private readonly schema;
5
+ constructor(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject);
6
+ render(): string;
7
+ }
8
+ //# sourceMappingURL=comment.renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.renderer.d.ts","sourceRoot":"","sources":["../../../src/transformers/json-schema/comment.renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,qBAAa,eAAgB,YAAW,QAAQ;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,eAAe;IAGjF,MAAM,IAAI,MAAM;CA2BjB"}
@@ -0,0 +1,26 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import { Renderer } from '../types/renderer.js';
3
+ export interface JsonSchemaDeclarationRendererOptions {
4
+ referenceTransformer?: (schema: OpenAPIV3_1.ReferenceObject) => string;
5
+ }
6
+ export declare class DeclarationRenderer implements Renderer {
7
+ private readonly schema;
8
+ private readonly options;
9
+ constructor(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject, options?: JsonSchemaDeclarationRendererOptions);
10
+ render(): string;
11
+ private renderSchema;
12
+ private renderMixed;
13
+ private renderReference;
14
+ private renderArray;
15
+ private renderObject;
16
+ private renderOneOf;
17
+ private renderAnyOf;
18
+ private renderAllOf;
19
+ private renderEnum;
20
+ private renderString;
21
+ private renderNumber;
22
+ private renderBoolean;
23
+ private renderNull;
24
+ private renderInteger;
25
+ }
26
+ //# sourceMappingURL=declaration.renderer.d.ts.map