moonflower 1.2.0 → 1.3.1

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 (435) hide show
  1. package/cli/entry.cjs +1 -1
  2. package/dist/cli/cli.cjs +2 -0
  3. package/dist/cli/cli.cjs.map +1 -0
  4. package/dist/cli/cli.d.ts +2 -0
  5. package/dist/cli/cli.d.ts.map +1 -0
  6. package/dist/cli/cli.mjs +62 -0
  7. package/dist/cli/cli.mjs.map +1 -0
  8. package/dist/cli/prettyprint.cjs +2 -0
  9. package/dist/cli/prettyprint.cjs.map +1 -0
  10. package/dist/cli/prettyprint.d.ts +5 -0
  11. package/dist/cli/prettyprint.d.ts.map +1 -0
  12. package/dist/cli/prettyprint.mjs +15 -0
  13. package/dist/cli/prettyprint.mjs.map +1 -0
  14. package/dist/errors/UserFacingErrors.cjs +1 -1
  15. package/dist/errors/UserFacingErrors.cjs.map +1 -1
  16. package/dist/errors/UserFacingErrors.d.ts +27 -0
  17. package/dist/errors/UserFacingErrors.d.ts.map +1 -1
  18. package/dist/errors/UserFacingErrors.mjs +67 -13
  19. package/dist/errors/UserFacingErrors.mjs.map +1 -1
  20. package/dist/hooks/usePathParams.cjs +1 -1
  21. package/dist/hooks/usePathParams.cjs.map +1 -1
  22. package/dist/hooks/usePathParams.d.ts.map +1 -1
  23. package/dist/hooks/usePathParams.mjs +20 -27
  24. package/dist/hooks/usePathParams.mjs.map +1 -1
  25. package/dist/hooks/useQueryParams.cjs +1 -1
  26. package/dist/hooks/useQueryParams.cjs.map +1 -1
  27. package/dist/hooks/useQueryParams.d.ts +4 -3
  28. package/dist/hooks/useQueryParams.d.ts.map +1 -1
  29. package/dist/hooks/useQueryParams.mjs +24 -33
  30. package/dist/hooks/useQueryParams.mjs.map +1 -1
  31. package/dist/hooks/useRequestBody.cjs +1 -1
  32. package/dist/hooks/useRequestBody.cjs.map +1 -1
  33. package/dist/hooks/useRequestBody.d.ts +4 -3
  34. package/dist/hooks/useRequestBody.d.ts.map +1 -1
  35. package/dist/hooks/useRequestBody.mjs +23 -34
  36. package/dist/hooks/useRequestBody.mjs.map +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.mjs +64 -55
  39. package/dist/node_modules/zod/index.cjs +2 -0
  40. package/dist/node_modules/zod/index.cjs.map +1 -0
  41. package/dist/node_modules/zod/index.mjs +6 -0
  42. package/dist/node_modules/zod/index.mjs.map +1 -0
  43. package/dist/node_modules/zod/v4/classic/checks.cjs +2 -0
  44. package/dist/node_modules/zod/v4/classic/checks.cjs.map +1 -0
  45. package/dist/node_modules/zod/v4/classic/checks.mjs +34 -0
  46. package/dist/node_modules/zod/v4/classic/checks.mjs.map +1 -0
  47. package/dist/node_modules/zod/v4/classic/coerce.cjs +2 -0
  48. package/dist/node_modules/zod/v4/classic/coerce.cjs.map +1 -0
  49. package/dist/node_modules/zod/v4/classic/coerce.mjs +26 -0
  50. package/dist/node_modules/zod/v4/classic/coerce.mjs.map +1 -0
  51. package/dist/node_modules/zod/v4/classic/compat.cjs +2 -0
  52. package/dist/node_modules/zod/v4/classic/compat.cjs.map +1 -0
  53. package/dist/node_modules/zod/v4/classic/compat.mjs +35 -0
  54. package/dist/node_modules/zod/v4/classic/compat.mjs.map +1 -0
  55. package/dist/node_modules/zod/v4/classic/errors.cjs +2 -0
  56. package/dist/node_modules/zod/v4/classic/errors.cjs.map +1 -0
  57. package/dist/node_modules/zod/v4/classic/errors.mjs +41 -0
  58. package/dist/node_modules/zod/v4/classic/errors.mjs.map +1 -0
  59. package/dist/node_modules/zod/v4/classic/external.cjs +2 -0
  60. package/dist/node_modules/zod/v4/classic/external.cjs.map +1 -0
  61. package/dist/node_modules/zod/v4/classic/external.mjs +260 -0
  62. package/dist/node_modules/zod/v4/classic/external.mjs.map +1 -0
  63. package/dist/node_modules/zod/v4/classic/from-json-schema.cjs +2 -0
  64. package/dist/node_modules/zod/v4/classic/from-json-schema.cjs.map +1 -0
  65. package/dist/node_modules/zod/v4/classic/from-json-schema.mjs +287 -0
  66. package/dist/node_modules/zod/v4/classic/from-json-schema.mjs.map +1 -0
  67. package/dist/node_modules/zod/v4/classic/iso.cjs +2 -0
  68. package/dist/node_modules/zod/v4/classic/iso.cjs.map +1 -0
  69. package/dist/node_modules/zod/v4/classic/iso.mjs +40 -0
  70. package/dist/node_modules/zod/v4/classic/iso.mjs.map +1 -0
  71. package/dist/node_modules/zod/v4/classic/parse.cjs +2 -0
  72. package/dist/node_modules/zod/v4/classic/parse.cjs.map +1 -0
  73. package/dist/node_modules/zod/v4/classic/parse.mjs +19 -0
  74. package/dist/node_modules/zod/v4/classic/parse.mjs.map +1 -0
  75. package/dist/node_modules/zod/v4/classic/schemas.cjs +2 -0
  76. package/dist/node_modules/zod/v4/classic/schemas.cjs.map +1 -0
  77. package/dist/node_modules/zod/v4/classic/schemas.mjs +912 -0
  78. package/dist/node_modules/zod/v4/classic/schemas.mjs.map +1 -0
  79. package/dist/node_modules/zod/v4/core/api.cjs +2 -0
  80. package/dist/node_modules/zod/v4/core/api.cjs.map +1 -0
  81. package/dist/node_modules/zod/v4/core/api.mjs +1110 -0
  82. package/dist/node_modules/zod/v4/core/api.mjs.map +1 -0
  83. package/dist/node_modules/zod/v4/core/checks.cjs +2 -0
  84. package/dist/node_modules/zod/v4/core/checks.cjs.map +1 -0
  85. package/dist/node_modules/zod/v4/core/checks.mjs +421 -0
  86. package/dist/node_modules/zod/v4/core/checks.mjs.map +1 -0
  87. package/dist/node_modules/zod/v4/core/core.cjs +2 -0
  88. package/dist/node_modules/zod/v4/core/core.cjs.map +1 -0
  89. package/dist/node_modules/zod/v4/core/core.mjs +62 -0
  90. package/dist/node_modules/zod/v4/core/core.mjs.map +1 -0
  91. package/dist/node_modules/zod/v4/core/doc.cjs +4 -0
  92. package/dist/node_modules/zod/v4/core/doc.cjs.map +1 -0
  93. package/dist/node_modules/zod/v4/core/doc.mjs +27 -0
  94. package/dist/node_modules/zod/v4/core/doc.mjs.map +1 -0
  95. package/dist/node_modules/zod/v4/core/errors.cjs +3 -0
  96. package/dist/node_modules/zod/v4/core/errors.cjs.map +1 -0
  97. package/dist/node_modules/zod/v4/core/errors.mjs +89 -0
  98. package/dist/node_modules/zod/v4/core/errors.mjs.map +1 -0
  99. package/dist/node_modules/zod/v4/core/index.cjs +2 -0
  100. package/dist/node_modules/zod/v4/core/index.cjs.map +1 -0
  101. package/dist/node_modules/zod/v4/core/index.mjs +293 -0
  102. package/dist/node_modules/zod/v4/core/index.mjs.map +1 -0
  103. package/dist/node_modules/zod/v4/core/json-schema-generator.cjs +2 -0
  104. package/dist/node_modules/zod/v4/core/json-schema-generator.cjs.map +1 -0
  105. package/dist/node_modules/zod/v4/core/json-schema-generator.mjs +66 -0
  106. package/dist/node_modules/zod/v4/core/json-schema-generator.mjs.map +1 -0
  107. package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +2 -0
  108. package/dist/node_modules/zod/v4/core/json-schema-processors.cjs.map +1 -0
  109. package/dist/node_modules/zod/v4/core/json-schema-processors.mjs +346 -0
  110. package/dist/node_modules/zod/v4/core/json-schema-processors.mjs.map +1 -0
  111. package/dist/node_modules/zod/v4/core/json-schema.cjs +2 -0
  112. package/dist/node_modules/zod/v4/core/json-schema.cjs.map +1 -0
  113. package/dist/node_modules/zod/v4/core/json-schema.mjs +2 -0
  114. package/dist/node_modules/zod/v4/core/json-schema.mjs.map +1 -0
  115. package/dist/node_modules/zod/v4/core/parse.cjs +2 -0
  116. package/dist/node_modules/zod/v4/core/parse.cjs.map +1 -0
  117. package/dist/node_modules/zod/v4/core/parse.mjs +75 -0
  118. package/dist/node_modules/zod/v4/core/parse.mjs.map +1 -0
  119. package/dist/node_modules/zod/v4/core/regexes.cjs +2 -0
  120. package/dist/node_modules/zod/v4/core/regexes.cjs.map +1 -0
  121. package/dist/node_modules/zod/v4/core/regexes.mjs +94 -0
  122. package/dist/node_modules/zod/v4/core/regexes.mjs.map +1 -0
  123. package/dist/node_modules/zod/v4/core/registries.cjs +2 -0
  124. package/dist/node_modules/zod/v4/core/registries.cjs.map +1 -0
  125. package/dist/node_modules/zod/v4/core/registries.mjs +44 -0
  126. package/dist/node_modules/zod/v4/core/registries.mjs.map +1 -0
  127. package/dist/node_modules/zod/v4/core/schemas.cjs +36 -0
  128. package/dist/node_modules/zod/v4/core/schemas.cjs.map +1 -0
  129. package/dist/node_modules/zod/v4/core/schemas.mjs +1319 -0
  130. package/dist/node_modules/zod/v4/core/schemas.mjs.map +1 -0
  131. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +4 -0
  132. package/dist/node_modules/zod/v4/core/to-json-schema.cjs.map +1 -0
  133. package/dist/node_modules/zod/v4/core/to-json-schema.mjs +244 -0
  134. package/dist/node_modules/zod/v4/core/to-json-schema.mjs.map +1 -0
  135. package/dist/node_modules/zod/v4/core/util.cjs +2 -0
  136. package/dist/node_modules/zod/v4/core/util.cjs.map +1 -0
  137. package/dist/node_modules/zod/v4/core/util.mjs +523 -0
  138. package/dist/node_modules/zod/v4/core/util.mjs.map +1 -0
  139. package/dist/node_modules/zod/v4/core/versions.cjs +2 -0
  140. package/dist/node_modules/zod/v4/core/versions.cjs.map +1 -0
  141. package/dist/node_modules/zod/v4/core/versions.mjs +9 -0
  142. package/dist/node_modules/zod/v4/core/versions.mjs.map +1 -0
  143. package/dist/node_modules/zod/v4/locales/ar.cjs +2 -0
  144. package/dist/node_modules/zod/v4/locales/ar.cjs.map +1 -0
  145. package/dist/node_modules/zod/v4/locales/ar.mjs +87 -0
  146. package/dist/node_modules/zod/v4/locales/ar.mjs.map +1 -0
  147. package/dist/node_modules/zod/v4/locales/az.cjs +2 -0
  148. package/dist/node_modules/zod/v4/locales/az.cjs.map +1 -0
  149. package/dist/node_modules/zod/v4/locales/az.mjs +87 -0
  150. package/dist/node_modules/zod/v4/locales/az.mjs.map +1 -0
  151. package/dist/node_modules/zod/v4/locales/be.cjs +2 -0
  152. package/dist/node_modules/zod/v4/locales/be.cjs.map +1 -0
  153. package/dist/node_modules/zod/v4/locales/be.mjs +129 -0
  154. package/dist/node_modules/zod/v4/locales/be.mjs.map +1 -0
  155. package/dist/node_modules/zod/v4/locales/bg.cjs +2 -0
  156. package/dist/node_modules/zod/v4/locales/bg.cjs.map +1 -0
  157. package/dist/node_modules/zod/v4/locales/bg.mjs +98 -0
  158. package/dist/node_modules/zod/v4/locales/bg.mjs.map +1 -0
  159. package/dist/node_modules/zod/v4/locales/ca.cjs +2 -0
  160. package/dist/node_modules/zod/v4/locales/ca.cjs.map +1 -0
  161. package/dist/node_modules/zod/v4/locales/ca.mjs +88 -0
  162. package/dist/node_modules/zod/v4/locales/ca.mjs.map +1 -0
  163. package/dist/node_modules/zod/v4/locales/cs.cjs +2 -0
  164. package/dist/node_modules/zod/v4/locales/cs.cjs.map +1 -0
  165. package/dist/node_modules/zod/v4/locales/cs.mjs +91 -0
  166. package/dist/node_modules/zod/v4/locales/cs.mjs.map +1 -0
  167. package/dist/node_modules/zod/v4/locales/da.cjs +2 -0
  168. package/dist/node_modules/zod/v4/locales/da.cjs.map +1 -0
  169. package/dist/node_modules/zod/v4/locales/da.mjs +94 -0
  170. package/dist/node_modules/zod/v4/locales/da.mjs.map +1 -0
  171. package/dist/node_modules/zod/v4/locales/de.cjs +2 -0
  172. package/dist/node_modules/zod/v4/locales/de.cjs.map +1 -0
  173. package/dist/node_modules/zod/v4/locales/de.mjs +89 -0
  174. package/dist/node_modules/zod/v4/locales/de.mjs.map +1 -0
  175. package/dist/node_modules/zod/v4/locales/en.cjs +2 -0
  176. package/dist/node_modules/zod/v4/locales/en.cjs.map +1 -0
  177. package/dist/node_modules/zod/v4/locales/en.mjs +91 -0
  178. package/dist/node_modules/zod/v4/locales/en.mjs.map +1 -0
  179. package/dist/node_modules/zod/v4/locales/eo.cjs +2 -0
  180. package/dist/node_modules/zod/v4/locales/eo.cjs.map +1 -0
  181. package/dist/node_modules/zod/v4/locales/eo.mjs +90 -0
  182. package/dist/node_modules/zod/v4/locales/eo.mjs.map +1 -0
  183. package/dist/node_modules/zod/v4/locales/es.cjs +2 -0
  184. package/dist/node_modules/zod/v4/locales/es.cjs.map +1 -0
  185. package/dist/node_modules/zod/v4/locales/es.mjs +111 -0
  186. package/dist/node_modules/zod/v4/locales/es.mjs.map +1 -0
  187. package/dist/node_modules/zod/v4/locales/fa.cjs +2 -0
  188. package/dist/node_modules/zod/v4/locales/fa.cjs.map +1 -0
  189. package/dist/node_modules/zod/v4/locales/fa.mjs +89 -0
  190. package/dist/node_modules/zod/v4/locales/fa.mjs.map +1 -0
  191. package/dist/node_modules/zod/v4/locales/fi.cjs +2 -0
  192. package/dist/node_modules/zod/v4/locales/fi.cjs.map +1 -0
  193. package/dist/node_modules/zod/v4/locales/fi.mjs +91 -0
  194. package/dist/node_modules/zod/v4/locales/fi.mjs.map +1 -0
  195. package/dist/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  196. package/dist/node_modules/zod/v4/locales/fr-CA.cjs.map +1 -0
  197. package/dist/node_modules/zod/v4/locales/fr-CA.mjs +87 -0
  198. package/dist/node_modules/zod/v4/locales/fr-CA.mjs.map +1 -0
  199. package/dist/node_modules/zod/v4/locales/fr.cjs +2 -0
  200. package/dist/node_modules/zod/v4/locales/fr.cjs.map +1 -0
  201. package/dist/node_modules/zod/v4/locales/fr.mjs +89 -0
  202. package/dist/node_modules/zod/v4/locales/fr.mjs.map +1 -0
  203. package/dist/node_modules/zod/v4/locales/he.cjs +2 -0
  204. package/dist/node_modules/zod/v4/locales/he.cjs.map +1 -0
  205. package/dist/node_modules/zod/v4/locales/he.mjs +152 -0
  206. package/dist/node_modules/zod/v4/locales/he.mjs.map +1 -0
  207. package/dist/node_modules/zod/v4/locales/hu.cjs +2 -0
  208. package/dist/node_modules/zod/v4/locales/hu.cjs.map +1 -0
  209. package/dist/node_modules/zod/v4/locales/hu.mjs +89 -0
  210. package/dist/node_modules/zod/v4/locales/hu.mjs.map +1 -0
  211. package/dist/node_modules/zod/v4/locales/hy.cjs +2 -0
  212. package/dist/node_modules/zod/v4/locales/hy.cjs.map +1 -0
  213. package/dist/node_modules/zod/v4/locales/hy.mjs +130 -0
  214. package/dist/node_modules/zod/v4/locales/hy.mjs.map +1 -0
  215. package/dist/node_modules/zod/v4/locales/id.cjs +2 -0
  216. package/dist/node_modules/zod/v4/locales/id.cjs.map +1 -0
  217. package/dist/node_modules/zod/v4/locales/id.mjs +87 -0
  218. package/dist/node_modules/zod/v4/locales/id.mjs.map +1 -0
  219. package/dist/node_modules/zod/v4/locales/index.cjs +2 -0
  220. package/dist/node_modules/zod/v4/locales/index.cjs.map +1 -0
  221. package/dist/node_modules/zod/v4/locales/index.mjs +101 -0
  222. package/dist/node_modules/zod/v4/locales/index.mjs.map +1 -0
  223. package/dist/node_modules/zod/v4/locales/is.cjs +2 -0
  224. package/dist/node_modules/zod/v4/locales/is.cjs.map +1 -0
  225. package/dist/node_modules/zod/v4/locales/is.mjs +89 -0
  226. package/dist/node_modules/zod/v4/locales/is.mjs.map +1 -0
  227. package/dist/node_modules/zod/v4/locales/it.cjs +2 -0
  228. package/dist/node_modules/zod/v4/locales/it.cjs.map +1 -0
  229. package/dist/node_modules/zod/v4/locales/it.mjs +89 -0
  230. package/dist/node_modules/zod/v4/locales/it.mjs.map +1 -0
  231. package/dist/node_modules/zod/v4/locales/ja.cjs +2 -0
  232. package/dist/node_modules/zod/v4/locales/ja.cjs.map +1 -0
  233. package/dist/node_modules/zod/v4/locales/ja.mjs +89 -0
  234. package/dist/node_modules/zod/v4/locales/ja.mjs.map +1 -0
  235. package/dist/node_modules/zod/v4/locales/ka.cjs +2 -0
  236. package/dist/node_modules/zod/v4/locales/ka.cjs.map +1 -0
  237. package/dist/node_modules/zod/v4/locales/ka.mjs +92 -0
  238. package/dist/node_modules/zod/v4/locales/ka.mjs.map +1 -0
  239. package/dist/node_modules/zod/v4/locales/kh.cjs +2 -0
  240. package/dist/node_modules/zod/v4/locales/kh.cjs.map +1 -0
  241. package/dist/node_modules/zod/v4/locales/kh.mjs +8 -0
  242. package/dist/node_modules/zod/v4/locales/kh.mjs.map +1 -0
  243. package/dist/node_modules/zod/v4/locales/km.cjs +2 -0
  244. package/dist/node_modules/zod/v4/locales/km.cjs.map +1 -0
  245. package/dist/node_modules/zod/v4/locales/km.mjs +90 -0
  246. package/dist/node_modules/zod/v4/locales/km.mjs.map +1 -0
  247. package/dist/node_modules/zod/v4/locales/ko.cjs +2 -0
  248. package/dist/node_modules/zod/v4/locales/ko.cjs.map +1 -0
  249. package/dist/node_modules/zod/v4/locales/ko.mjs +87 -0
  250. package/dist/node_modules/zod/v4/locales/ko.mjs.map +1 -0
  251. package/dist/node_modules/zod/v4/locales/lt.cjs +2 -0
  252. package/dist/node_modules/zod/v4/locales/lt.cjs.map +1 -0
  253. package/dist/node_modules/zod/v4/locales/lt.mjs +178 -0
  254. package/dist/node_modules/zod/v4/locales/lt.mjs.map +1 -0
  255. package/dist/node_modules/zod/v4/locales/mk.cjs +2 -0
  256. package/dist/node_modules/zod/v4/locales/mk.cjs.map +1 -0
  257. package/dist/node_modules/zod/v4/locales/mk.mjs +89 -0
  258. package/dist/node_modules/zod/v4/locales/mk.mjs.map +1 -0
  259. package/dist/node_modules/zod/v4/locales/ms.cjs +2 -0
  260. package/dist/node_modules/zod/v4/locales/ms.cjs.map +1 -0
  261. package/dist/node_modules/zod/v4/locales/ms.mjs +88 -0
  262. package/dist/node_modules/zod/v4/locales/ms.mjs.map +1 -0
  263. package/dist/node_modules/zod/v4/locales/nl.cjs +2 -0
  264. package/dist/node_modules/zod/v4/locales/nl.cjs.map +1 -0
  265. package/dist/node_modules/zod/v4/locales/nl.mjs +88 -0
  266. package/dist/node_modules/zod/v4/locales/nl.mjs.map +1 -0
  267. package/dist/node_modules/zod/v4/locales/no.cjs +2 -0
  268. package/dist/node_modules/zod/v4/locales/no.cjs.map +1 -0
  269. package/dist/node_modules/zod/v4/locales/no.mjs +89 -0
  270. package/dist/node_modules/zod/v4/locales/no.mjs.map +1 -0
  271. package/dist/node_modules/zod/v4/locales/ota.cjs +2 -0
  272. package/dist/node_modules/zod/v4/locales/ota.cjs.map +1 -0
  273. package/dist/node_modules/zod/v4/locales/ota.mjs +90 -0
  274. package/dist/node_modules/zod/v4/locales/ota.mjs.map +1 -0
  275. package/dist/node_modules/zod/v4/locales/pl.cjs +2 -0
  276. package/dist/node_modules/zod/v4/locales/pl.cjs.map +1 -0
  277. package/dist/node_modules/zod/v4/locales/pl.mjs +89 -0
  278. package/dist/node_modules/zod/v4/locales/pl.mjs.map +1 -0
  279. package/dist/node_modules/zod/v4/locales/ps.cjs +2 -0
  280. package/dist/node_modules/zod/v4/locales/ps.cjs.map +1 -0
  281. package/dist/node_modules/zod/v4/locales/ps.mjs +89 -0
  282. package/dist/node_modules/zod/v4/locales/ps.mjs.map +1 -0
  283. package/dist/node_modules/zod/v4/locales/pt.cjs +2 -0
  284. package/dist/node_modules/zod/v4/locales/pt.cjs.map +1 -0
  285. package/dist/node_modules/zod/v4/locales/pt.mjs +89 -0
  286. package/dist/node_modules/zod/v4/locales/pt.mjs.map +1 -0
  287. package/dist/node_modules/zod/v4/locales/ru.cjs +2 -0
  288. package/dist/node_modules/zod/v4/locales/ru.cjs.map +1 -0
  289. package/dist/node_modules/zod/v4/locales/ru.mjs +129 -0
  290. package/dist/node_modules/zod/v4/locales/ru.mjs.map +1 -0
  291. package/dist/node_modules/zod/v4/locales/sl.cjs +2 -0
  292. package/dist/node_modules/zod/v4/locales/sl.cjs.map +1 -0
  293. package/dist/node_modules/zod/v4/locales/sl.mjs +89 -0
  294. package/dist/node_modules/zod/v4/locales/sl.mjs.map +1 -0
  295. package/dist/node_modules/zod/v4/locales/sv.cjs +2 -0
  296. package/dist/node_modules/zod/v4/locales/sv.cjs.map +1 -0
  297. package/dist/node_modules/zod/v4/locales/sv.mjs +89 -0
  298. package/dist/node_modules/zod/v4/locales/sv.mjs.map +1 -0
  299. package/dist/node_modules/zod/v4/locales/ta.cjs +2 -0
  300. package/dist/node_modules/zod/v4/locales/ta.cjs.map +1 -0
  301. package/dist/node_modules/zod/v4/locales/ta.mjs +90 -0
  302. package/dist/node_modules/zod/v4/locales/ta.mjs.map +1 -0
  303. package/dist/node_modules/zod/v4/locales/th.cjs +2 -0
  304. package/dist/node_modules/zod/v4/locales/th.cjs.map +1 -0
  305. package/dist/node_modules/zod/v4/locales/th.mjs +90 -0
  306. package/dist/node_modules/zod/v4/locales/th.mjs.map +1 -0
  307. package/dist/node_modules/zod/v4/locales/tr.cjs +2 -0
  308. package/dist/node_modules/zod/v4/locales/tr.cjs.map +1 -0
  309. package/dist/node_modules/zod/v4/locales/tr.mjs +87 -0
  310. package/dist/node_modules/zod/v4/locales/tr.mjs.map +1 -0
  311. package/dist/node_modules/zod/v4/locales/ua.cjs +2 -0
  312. package/dist/node_modules/zod/v4/locales/ua.cjs.map +1 -0
  313. package/dist/node_modules/zod/v4/locales/ua.mjs +8 -0
  314. package/dist/node_modules/zod/v4/locales/ua.mjs.map +1 -0
  315. package/dist/node_modules/zod/v4/locales/uk.cjs +2 -0
  316. package/dist/node_modules/zod/v4/locales/uk.cjs.map +1 -0
  317. package/dist/node_modules/zod/v4/locales/uk.mjs +89 -0
  318. package/dist/node_modules/zod/v4/locales/uk.mjs.map +1 -0
  319. package/dist/node_modules/zod/v4/locales/ur.cjs +2 -0
  320. package/dist/node_modules/zod/v4/locales/ur.cjs.map +1 -0
  321. package/dist/node_modules/zod/v4/locales/ur.mjs +90 -0
  322. package/dist/node_modules/zod/v4/locales/ur.mjs.map +1 -0
  323. package/dist/node_modules/zod/v4/locales/uz.cjs +2 -0
  324. package/dist/node_modules/zod/v4/locales/uz.cjs.map +1 -0
  325. package/dist/node_modules/zod/v4/locales/uz.mjs +90 -0
  326. package/dist/node_modules/zod/v4/locales/uz.mjs.map +1 -0
  327. package/dist/node_modules/zod/v4/locales/vi.cjs +2 -0
  328. package/dist/node_modules/zod/v4/locales/vi.cjs.map +1 -0
  329. package/dist/node_modules/zod/v4/locales/vi.mjs +89 -0
  330. package/dist/node_modules/zod/v4/locales/vi.mjs.map +1 -0
  331. package/dist/node_modules/zod/v4/locales/yo.cjs +2 -0
  332. package/dist/node_modules/zod/v4/locales/yo.cjs.map +1 -0
  333. package/dist/node_modules/zod/v4/locales/yo.mjs +89 -0
  334. package/dist/node_modules/zod/v4/locales/yo.mjs.map +1 -0
  335. package/dist/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  336. package/dist/node_modules/zod/v4/locales/zh-CN.cjs.map +1 -0
  337. package/dist/node_modules/zod/v4/locales/zh-CN.mjs +90 -0
  338. package/dist/node_modules/zod/v4/locales/zh-CN.mjs.map +1 -0
  339. package/dist/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  340. package/dist/node_modules/zod/v4/locales/zh-TW.cjs.map +1 -0
  341. package/dist/node_modules/zod/v4/locales/zh-TW.mjs +87 -0
  342. package/dist/node_modules/zod/v4/locales/zh-TW.mjs.map +1 -0
  343. package/dist/openapi/analyzerModule/analyzerModule.cjs +1 -1
  344. package/dist/openapi/analyzerModule/analyzerModule.cjs.map +1 -1
  345. package/dist/openapi/analyzerModule/analyzerModule.d.ts.map +1 -1
  346. package/dist/openapi/analyzerModule/analyzerModule.mjs +42 -42
  347. package/dist/openapi/analyzerModule/analyzerModule.mjs.map +1 -1
  348. package/dist/openapi/analyzerModule/nodeParsers.cjs +1 -1
  349. package/dist/openapi/analyzerModule/nodeParsers.cjs.map +1 -1
  350. package/dist/openapi/analyzerModule/nodeParsers.d.ts +1 -0
  351. package/dist/openapi/analyzerModule/nodeParsers.d.ts.map +1 -1
  352. package/dist/openapi/analyzerModule/nodeParsers.mjs +261 -206
  353. package/dist/openapi/analyzerModule/nodeParsers.mjs.map +1 -1
  354. package/dist/openapi/analyzerModule/parseEndpoint.cjs +1 -1
  355. package/dist/openapi/analyzerModule/parseEndpoint.cjs.map +1 -1
  356. package/dist/openapi/analyzerModule/parseEndpoint.d.ts.map +1 -1
  357. package/dist/openapi/analyzerModule/parseEndpoint.mjs +62 -62
  358. package/dist/openapi/analyzerModule/parseEndpoint.mjs.map +1 -1
  359. package/dist/openapi/analyzerModule/test/TestCase.d.ts +9 -0
  360. package/dist/openapi/analyzerModule/test/TestCase.d.ts.map +1 -0
  361. package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.d.ts +2 -0
  362. package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.d.ts.map +1 -0
  363. package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.d.ts +2 -0
  364. package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.d.ts.map +1 -0
  365. package/dist/openapi/initOpenApiEngine.cjs +1 -1
  366. package/dist/openapi/initOpenApiEngine.cjs.map +1 -1
  367. package/dist/openapi/initOpenApiEngine.d.ts +7 -2
  368. package/dist/openapi/initOpenApiEngine.d.ts.map +1 -1
  369. package/dist/openapi/initOpenApiEngine.mjs +13 -7
  370. package/dist/openapi/initOpenApiEngine.mjs.map +1 -1
  371. package/dist/openapi/manager/OpenApiManager.cjs +1 -1
  372. package/dist/openapi/manager/OpenApiManager.cjs.map +1 -1
  373. package/dist/openapi/manager/OpenApiManager.d.ts +4 -0
  374. package/dist/openapi/manager/OpenApiManager.d.ts.map +1 -1
  375. package/dist/openapi/manager/OpenApiManager.mjs +11 -2
  376. package/dist/openapi/manager/OpenApiManager.mjs.map +1 -1
  377. package/dist/openapi/router/OpenApiRouter.cjs +1 -1
  378. package/dist/openapi/router/OpenApiRouter.cjs.map +1 -1
  379. package/dist/openapi/router/OpenApiRouter.d.ts.map +1 -1
  380. package/dist/openapi/router/OpenApiRouter.mjs +9 -6
  381. package/dist/openapi/router/OpenApiRouter.mjs.map +1 -1
  382. package/dist/utils/getValueAsNullableString.cjs +2 -0
  383. package/dist/utils/getValueAsNullableString.cjs.map +1 -0
  384. package/dist/utils/getValueAsNullableString.d.ts +2 -0
  385. package/dist/utils/getValueAsNullableString.d.ts.map +1 -0
  386. package/dist/utils/getValueAsNullableString.mjs +7 -0
  387. package/dist/utils/getValueAsNullableString.mjs.map +1 -0
  388. package/dist/utils/validationMessages.cjs +1 -1
  389. package/dist/utils/validationMessages.cjs.map +1 -1
  390. package/dist/utils/validationMessages.d.ts +1 -1
  391. package/dist/utils/validationMessages.d.ts.map +1 -1
  392. package/dist/utils/validationMessages.mjs +8 -8
  393. package/dist/utils/validationMessages.mjs.map +1 -1
  394. package/dist/validators/types.d.ts +4 -0
  395. package/dist/validators/types.d.ts.map +1 -1
  396. package/dist/validators/validateMissingParams.cjs +2 -0
  397. package/dist/validators/validateMissingParams.cjs.map +1 -0
  398. package/dist/validators/validateMissingParams.d.ts +7 -0
  399. package/dist/validators/validateMissingParams.d.ts.map +1 -0
  400. package/dist/validators/validateMissingParams.mjs +17 -0
  401. package/dist/validators/validateMissingParams.mjs.map +1 -0
  402. package/dist/validators/validateParam.cjs +2 -0
  403. package/dist/validators/validateParam.cjs.map +1 -0
  404. package/dist/validators/validateParam.d.ts +8 -0
  405. package/dist/validators/validateParam.d.ts.map +1 -0
  406. package/dist/validators/validateParam.mjs +41 -0
  407. package/dist/validators/validateParam.mjs.map +1 -0
  408. package/package.json +12 -5
  409. package/{cli → src/cli}/cli.ts +26 -6
  410. package/{cli → src/cli}/prettyprint.ts +2 -2
  411. package/src/errors/UserFacingErrors.ts +54 -0
  412. package/src/hooks/usePathParams.spec.ts +27 -0
  413. package/src/hooks/usePathParams.ts +5 -13
  414. package/src/hooks/useQueryParams.spec.ts +99 -0
  415. package/src/hooks/useQueryParams.ts +16 -25
  416. package/src/hooks/useRequestBody.spec.ts +99 -0
  417. package/src/hooks/useRequestBody.ts +16 -35
  418. package/src/openapi/analyzerModule/analyzerModule.ts +2 -3
  419. package/src/openapi/analyzerModule/nodeParsers.ts +113 -8
  420. package/src/openapi/analyzerModule/parseEndpoint.ts +2 -2
  421. package/src/openapi/analyzerModule/test/TestCase.ts +8 -0
  422. package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.ts +9 -0
  423. package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.ts +21 -0
  424. package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.ts +87 -0
  425. package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.ts +178 -0
  426. package/src/openapi/initOpenApiEngine.ts +48 -6
  427. package/src/openapi/manager/OpenApiManager.ts +16 -0
  428. package/src/openapi/router/OpenApiRouter.ts +6 -1
  429. package/src/test/app.spec.ts +27 -0
  430. package/src/utils/getValueAsNullableString.ts +8 -0
  431. package/src/utils/validationMessages.ts +4 -0
  432. package/src/validators/types.ts +5 -0
  433. package/src/validators/validateMissingParams.ts +27 -0
  434. package/src/validators/validateParam.ts +69 -0
  435. package/vite.config.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"analyzerModule.mjs","sources":["../../../src/openapi/analyzerModule/analyzerModule.ts"],"sourcesContent":["import * as path from 'path'\nimport { SourceFile, SyntaxKind } from 'ts-morph'\nimport { Project } from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { discoverImportedName } from '../discoveryModule/discoverImports/discoverImports'\nimport {\n\tDiscoveredSourceFile,\n\tdiscoverRouterFiles,\n} from '../discoveryModule/discoverRouterFiles/discoverRouterFiles'\nimport { discoverRouters } from '../discoveryModule/discoverRouters/discoverRouters'\nimport { ApiDocsHeader, OpenApiManager } from '../manager/OpenApiManager'\nimport { EndpointData, ExposedModelData } from '../types'\nimport { getSourceFileTimestamp, TimestampCache } from './getSourceFileTimestamp'\nimport { getValuesOfObjectLiteral } from './nodeParsers'\nimport { parseEndpoint } from './parseEndpoint'\nimport { parseExposedModel, parseNamedExposedModels } from './parseExposedModels'\nimport { SourceFileCache } from './sourceFileCache'\n\ntype Props = {\n\tlogLevel?: Parameters<(typeof Logger)['setLevel']>[0]\n\ttsconfigPath: string\n\tsourceFilePaths?: string[]\n\tsourceFileDiscovery?: boolean | FileDiscoveryConfig\n\tincremental?:\n\t\t| boolean\n\t\t| {\n\t\t\t\tcachePath: string\n\t\t }\n}\n\ntype FileDiscoveryConfig = {\n\trootPath: string\n}\n\n/**\n * @param tsconfigPath Path to tsconfig file relative to project root\n * @param sourceFilePaths Array of router source files relative to project root\n */\nexport const prepareOpenApiSpec = ({\n\tlogLevel,\n\ttsconfigPath,\n\tsourceFilePaths,\n\tsourceFileDiscovery,\n\tincremental,\n}: Props) => {\n\tconst openApiManager = OpenApiManager.getInstance()\n\n\tif (openApiManager.isReady()) {\n\t\treturn\n\t}\n\n\tif (logLevel) {\n\t\tLogger.setLevel(logLevel)\n\t}\n\n\tLogger.info('Preparing OpenAPI spec')\n\n\tconst project = new Project({\n\t\ttsConfigFilePath: path.resolve(tsconfigPath),\n\t\tskipFileDependencyResolution: true,\n\t})\n\n\tconst { explicitRouters, discoveredRouterFiles, allSourceFiles } = (() => {\n\t\tconst sourceFilesToAdd = sourceFilePaths ?? []\n\t\tconst resolvedSourceFilePaths = sourceFilesToAdd.map((filepath) => path.resolve(filepath))\n\t\tconst sourceFiles = resolvedSourceFilePaths.map((filePath) => project.getSourceFileOrThrow(filePath))\n\t\tconst explicitRouters = sourceFiles.flatMap((file) => ({\n\t\t\tfileName: file.getFilePath(),\n\t\t\tsourceFile: file,\n\t\t\trouters: discoverRouters(file),\n\t\t}))\n\n\t\tconst { discoveredRouterFiles, discoveredSourceFiles } = (() => {\n\t\t\tif (sourceFileDiscovery === false) {\n\t\t\t\treturn { discoveredRouterFiles: [], discoveredSourceFiles: [] }\n\t\t\t}\n\n\t\t\tconst startTime = performance.now()\n\t\t\tconst files = discoverRouterFiles({\n\t\t\t\ttargetPath: typeof sourceFileDiscovery === 'object' ? sourceFileDiscovery.rootPath : '.',\n\t\t\t\ttsConfigPath: tsconfigPath,\n\t\t\t})\n\t\t\tLogger.info(`File discovery took ${Math.round(performance.now() - startTime)}ms`)\n\t\t\treturn files\n\t\t})()\n\n\t\tconst allSourceFiles = sourceFiles.reduce(\n\t\t\t(acc, current) =>\n\t\t\t\tacc.some((r) => r.getFilePath() === current.getFilePath()) ? acc : acc.concat(current),\n\t\t\tdiscoveredSourceFiles,\n\t\t)\n\n\t\treturn { explicitRouters, discoveredRouterFiles, allSourceFiles }\n\t})()\n\n\tconst filesToAnalyze = explicitRouters.reduce(\n\t\t(acc, current) => (acc.some((r) => r.fileName === current.fileName) ? acc : acc.concat(current)),\n\t\tdiscoveredRouterFiles,\n\t)\n\n\tconst apiHeaders = allSourceFiles\n\t\t.flatMap((file) => analyzeSourceFileApiHeader(file))\n\t\t.filter((headers) => !!headers)\n\tif (apiHeaders.length > 0 && apiHeaders[0]) {\n\t\topenApiManager.setHeader(apiHeaders[0])\n\t}\n\n\tconst exposedModels = allSourceFiles.flatMap((file) => analyzeSourceFileExposedModels(file))\n\n\topenApiManager.setExposedModels(exposedModels)\n\n\tconst cachePath = (() => {\n\t\tif (typeof incremental === 'object' && incremental.cachePath) {\n\t\t\treturn incremental.cachePath\n\t\t}\n\t\treturn path.resolve(process.cwd(), 'node_modules', '.cache', 'moonflower')\n\t})()\n\tconst endpoints = analyzeMultipleSourceFiles(filesToAnalyze, {\n\t\tincremental: incremental !== false,\n\t\tcachePath,\n\t\ttimestampCache: {},\n\t})\n\n\topenApiManager.setStats({\n\t\tdiscoveredRouterFiles: discoveredRouterFiles.map((file) => ({\n\t\t\tpath: file.fileName,\n\t\t\trouters: file.routers.named.map((r) => ({\n\t\t\t\tname: r,\n\t\t\t\tendpoints: endpoints\n\t\t\t\t\t.filter((e) => e.sourceFilePath === file.fileName)\n\t\t\t\t\t.map((e) => `${e.method.toUpperCase()} ${e.path}`),\n\t\t\t})),\n\t\t})),\n\t\texplicitRouterFiles: explicitRouters.map((file) => ({\n\t\t\tpath: file.fileName,\n\t\t\trouters: file.routers.named.map((r) => ({\n\t\t\t\tname: r,\n\t\t\t\tendpoints: endpoints\n\t\t\t\t\t.filter((e) => e.sourceFilePath === file.fileName)\n\t\t\t\t\t.map((e) => `${e.method.toUpperCase()} ${e.path}`),\n\t\t\t})),\n\t\t})),\n\t})\n\n\topenApiManager.setEndpoints(endpoints)\n\topenApiManager.markAsReady()\n}\n\nexport const analyzeMultipleSourceFiles = (\n\tfiles: DiscoveredSourceFile[],\n\tconfig: {\n\t\tincremental: boolean\n\t\tcachePath: string\n\t\ttimestampCache: TimestampCache\n\t},\n\tfilterEndpointPaths?: string[],\n): EndpointData[] => {\n\tconst startTime = performance.now()\n\tconst analyzedFiles = files.map((file) => analyzeSourceFileWithCache(file, config, filterEndpointPaths))\n\tLogger.info(`Router analysis took ${Math.round(performance.now() - startTime)}ms`)\n\n\tanalyzedFiles\n\t\t.map((f, index) => ({\n\t\t\tfileName: files[index].fileName,\n\t\t\ttimeTaken: f.timing,\n\t\t}))\n\t\t.sort((a, b) => b.timeTaken - a.timeTaken)\n\t\t.filter((t) => t.timeTaken > 500)\n\t\t.forEach((t) => {\n\t\t\tLogger.info(`- [${t.fileName}] Took ${Math.round(t.timeTaken)}ms to analyze`)\n\t\t})\n\n\treturn analyzedFiles.flatMap((f) => f.endpoints)\n}\n\nexport const analyzeSourceFileWithCache = (\n\tfile: DiscoveredSourceFile,\n\tconfig: {\n\t\tincremental: boolean\n\t\tcachePath: string\n\t\ttimestampCache: TimestampCache\n\t},\n\tfilterEndpointPaths?: string[],\n): { endpoints: EndpointData[]; timing: number } => {\n\tconst timestamp = getSourceFileTimestamp(file.sourceFile, config.timestampCache)\n\tconst cachedResults = SourceFileCache.getCachedResults(file.sourceFile, timestamp, config.cachePath)\n\n\tif (cachedResults) {\n\t\tLogger.debug(`[${file.fileName}] Found cached results`)\n\t\treturn { endpoints: cachedResults.endpoints, timing: 0 }\n\t}\n\tLogger.debug(`[${file.fileName}] Analyzing...`)\n\n\tconst t1 = performance.now()\n\tconst endpoints = analyzeSourceFileEndpoints(file, filterEndpointPaths)\n\tconst t2 = performance.now()\n\tLogger.debug(`[${file.fileName}] Analyzed in ${t2 - t1}ms`)\n\tSourceFileCache.cacheResults(file.sourceFile, timestamp, config.cachePath, endpoints)\n\treturn { endpoints, timing: t2 - t1 }\n}\n\nexport const analyzeSourceFileEndpoints = (\n\tfile: DiscoveredSourceFile,\n\tfilterEndpointPaths?: string[],\n): EndpointData[] => {\n\tconst endpoints: EndpointData[] = []\n\tconst operations = ['get', 'post', 'put', 'delete', 'del', 'patch']\n\tconst joinedOperations = operations.join('|')\n\n\tfile.routers.named.forEach((routerName) => {\n\t\tfile.sourceFile.forEachChild((node) => {\n\t\t\tconst nodeText = node.getText()\n\t\t\tconst routerPattern = new RegExp(`${routerName}\\\\.(?:${joinedOperations})`)\n\n\t\t\tif (routerPattern.test(nodeText)) {\n\t\t\t\tconst endpointText = node.getFirstDescendantByKind(SyntaxKind.StringLiteral)?.getText() ?? ''\n\t\t\t\tconst endpointPath = endpointText.slice(1, -1)\n\n\t\t\t\tif (filterEndpointPaths && !filterEndpointPaths.some((path) => endpointPath.includes(path))) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tendpoints.push(parseEndpoint(node, file.fileName))\n\t\t\t}\n\t\t})\n\t})\n\n\treturn endpoints\n}\n\nexport const analyzeSourceFileApiHeader = (sourceFile: SourceFile): ApiDocsHeader | null => {\n\tconst nameOfUseApiHeader = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useApiHeader',\n\t})\n\n\tif (!nameOfUseApiHeader) {\n\t\treturn null\n\t}\n\n\tconst node = sourceFile\n\t\t.forEachChildAsArray()\n\t\t.filter((node) => node.isKind(SyntaxKind.ExpressionStatement))\n\t\t.find((node) => nameOfUseApiHeader && node.getText().startsWith(nameOfUseApiHeader))\n\n\tif (!node) {\n\t\treturn null\n\t}\n\n\tconst targetNode = node.getFirstDescendantByKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n\tconst values = getValuesOfObjectLiteral(targetNode)\n\n\tconst collapseObject = (v: string | string[] | typeof values): any => {\n\t\tif (typeof v === 'string') {\n\t\t\treturn v\n\t\t}\n\t\tif (Array.isArray(v) && v.every((value) => typeof value === 'string')) {\n\t\t\treturn v\n\t\t}\n\n\t\treturn v.reduce((acc, current) => {\n\t\t\tif (typeof current === 'string') {\n\t\t\t\treturn acc\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t[current.identifier]: collapseObject(current.value as string[]),\n\t\t\t}\n\t\t}, {})\n\t}\n\treturn collapseObject(values)\n}\n\nexport const analyzeSourceFileExposedModels = (sourceFile: SourceFile): ExposedModelData[] => {\n\tconst models: ExposedModelData[] = []\n\n\tconst nameOfUseExposeApiModel = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useExposeApiModel',\n\t})\n\n\tconst nameOfUseExposeNamedApiModels = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useExposeNamedApiModels',\n\t})\n\n\tsourceFile\n\t\t.forEachChildAsArray()\n\t\t.filter((node) => node.isKind(SyntaxKind.ExpressionStatement))\n\t\t.map((node) => {\n\t\t\tif (nameOfUseExposeApiModel && node.getText().startsWith(nameOfUseExposeApiModel)) {\n\t\t\t\tconst callExpressionNode = node.getFirstChild()\n\t\t\t\tconst syntaxListChildren = callExpressionNode?.getChildrenOfKind(SyntaxKind.SyntaxList) || []\n\n\t\t\t\tconst firstChild = syntaxListChildren[0].getFirstChild()\n\t\t\t\tif (!firstChild) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tmodels.push(parseExposedModel(firstChild))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (nameOfUseExposeNamedApiModels && node.getText().startsWith(nameOfUseExposeNamedApiModels)) {\n\t\t\t\tconst callExpressionNode = node.getFirstChild()\n\t\t\t\tconst syntaxListChildren = callExpressionNode?.getChildrenOfKind(SyntaxKind.SyntaxList) || []\n\n\t\t\t\tconst firstChild = syntaxListChildren[0].getFirstChild()\n\t\t\t\tif (!firstChild) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst parsedModels = parseNamedExposedModels(firstChild)\n\t\t\t\tparsedModels.forEach((model) => models.push(model))\n\t\t\t}\n\t\t})\n\treturn models\n}\n"],"names":["prepareOpenApiSpec","logLevel","tsconfigPath","sourceFilePaths","sourceFileDiscovery","incremental","openApiManager","OpenApiManager","Logger","project","Project","path","explicitRouters","discoveredRouterFiles","allSourceFiles","sourceFiles","filepath","filePath","file","discoverRouters","discoveredSourceFiles","startTime","files","discoverRouterFiles","acc","current","r","filesToAnalyze","apiHeaders","analyzeSourceFileApiHeader","headers","exposedModels","analyzeSourceFileExposedModels","cachePath","endpoints","analyzeMultipleSourceFiles","e","config","filterEndpointPaths","analyzedFiles","analyzeSourceFileWithCache","f","index","a","b","t","timestamp","getSourceFileTimestamp","cachedResults","SourceFileCache","t1","analyzeSourceFileEndpoints","t2","joinedOperations","routerName","node","nodeText","SyntaxKind","parseEndpoint","sourceFile","nameOfUseApiHeader","discoverImportedName","targetNode","values","getValuesOfObjectLiteral","collapseObject","v","value","models","nameOfUseExposeApiModel","nameOfUseExposeNamedApiModels","firstChild","parseExposedModel","parseNamedExposedModels","model"],"mappings":";;;;;;;;;;;;AAuCO,MAAMA,KAAqB,CAAC;AAAA,EAClC,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,aAAAC;AACD,MAAa;AACN,QAAAC,IAAiBC,EAAe,YAAY;AAE9C,MAAAD,EAAe;AAClB;AAGD,EAAIL,KACHO,EAAO,SAASP,CAAQ,GAGzBO,EAAO,KAAK,wBAAwB;AAE9B,QAAAC,IAAU,IAAIC,EAAQ;AAAA,IAC3B,kBAAkBC,EAAK,QAAQT,CAAY;AAAA,IAC3C,8BAA8B;AAAA,EAAA,CAC9B,GAEK,EAAE,iBAAAU,GAAiB,uBAAAC,GAAuB,gBAAAC,EAAA,KAAoB,MAAM;AAGnE,UAAAC,KAFmBZ,KAAmB,CAAC,GACI,IAAI,CAACa,MAAaL,EAAK,QAAQK,CAAQ,CAAC,EAC7C,IAAI,CAACC,MAAaR,EAAQ,qBAAqBQ,CAAQ,CAAC,G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;AAAA,IAC1D,YAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACd;AAED,SAAAA,EACE,oBAAoB,EACpB,OAAO,CAACJ,MAASA,EAAK,OAAOE,EAAW,mBAAmB,CAAC,EAC5D,IAAI,CAACF,MAAS;AACd,QAAIc,KAA2Bd,EAAK,QAAU,EAAA,WAAWc,CAAuB,GAAG;AAIlF,YAAME,KAHqBhB,EAAK,cAAc,GACC,kBAAkBE,EAAW,UAAU,KAAK,CAAC,GAEtD,CAAC,EAAE,cAAc;AACvD,UAAI,CAACc;AACJ;AAGM,MAAAH,EAAA,KAAKI,EAAkBD,CAAU,CAAC;AACzC;AAAA,IAAA;AAGD,QAAID,KAAiCf,EAAK,QAAU,EAAA,WAAWe,CAA6B,GAAG;AAI9F,YAAMC,KAHqBhB,EAAK,cAAc,GACC,kBAAkBE,EAAW,UAAU,KAAK,CAAC,GAEtD,CAAC,EAAE,cAAc;AACvD,UAAI,CAACc;AACJ;AAID,MADqBE,EAAwBF,CAAU,EAC1C,QAAQ,CAACG,MAAUN,EAAO,KAAKM,CAAK,CAAC;AAAA,IAAA;AAAA,EACnD,CACA,GACKN;AACR;"}
1
+ {"version":3,"file":"analyzerModule.mjs","sources":["../../../src/openapi/analyzerModule/analyzerModule.ts"],"sourcesContent":["import * as path from 'path'\nimport { SourceFile, SyntaxKind } from 'ts-morph'\nimport { Project } from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { discoverImportedName } from '../discoveryModule/discoverImports/discoverImports'\nimport {\n\tDiscoveredSourceFile,\n\tdiscoverRouterFiles,\n} from '../discoveryModule/discoverRouterFiles/discoverRouterFiles'\nimport { discoverRouters } from '../discoveryModule/discoverRouters/discoverRouters'\nimport { ApiDocsHeader, OpenApiManager } from '../manager/OpenApiManager'\nimport { EndpointData, ExposedModelData } from '../types'\nimport { getSourceFileTimestamp, TimestampCache } from './getSourceFileTimestamp'\nimport { getValuesOfObjectLiteral, resolveEndpointPath } from './nodeParsers'\nimport { parseEndpoint } from './parseEndpoint'\nimport { parseExposedModel, parseNamedExposedModels } from './parseExposedModels'\nimport { SourceFileCache } from './sourceFileCache'\n\ntype Props = {\n\tlogLevel?: Parameters<(typeof Logger)['setLevel']>[0]\n\ttsconfigPath: string\n\tsourceFilePaths?: string[]\n\tsourceFileDiscovery?: boolean | FileDiscoveryConfig\n\tincremental?:\n\t\t| boolean\n\t\t| {\n\t\t\t\tcachePath: string\n\t\t }\n}\n\ntype FileDiscoveryConfig = {\n\trootPath: string\n}\n\n/**\n * @param tsconfigPath Path to tsconfig file relative to project root\n * @param sourceFilePaths Array of router source files relative to project root\n */\nexport const prepareOpenApiSpec = ({\n\tlogLevel,\n\ttsconfigPath,\n\tsourceFilePaths,\n\tsourceFileDiscovery,\n\tincremental,\n}: Props) => {\n\tconst openApiManager = OpenApiManager.getInstance()\n\n\tif (openApiManager.isReady()) {\n\t\treturn\n\t}\n\n\tif (logLevel) {\n\t\tLogger.setLevel(logLevel)\n\t}\n\n\tLogger.info('Preparing OpenAPI spec')\n\n\tconst project = new Project({\n\t\ttsConfigFilePath: path.resolve(tsconfigPath),\n\t\tskipFileDependencyResolution: true,\n\t})\n\n\tconst { explicitRouters, discoveredRouterFiles, allSourceFiles } = (() => {\n\t\tconst sourceFilesToAdd = sourceFilePaths ?? []\n\t\tconst resolvedSourceFilePaths = sourceFilesToAdd.map((filepath) => path.resolve(filepath))\n\t\tconst sourceFiles = resolvedSourceFilePaths.map((filePath) => project.getSourceFileOrThrow(filePath))\n\t\tconst explicitRouters = sourceFiles.flatMap((file) => ({\n\t\t\tfileName: file.getFilePath(),\n\t\t\tsourceFile: file,\n\t\t\trouters: discoverRouters(file),\n\t\t}))\n\n\t\tconst { discoveredRouterFiles, discoveredSourceFiles } = (() => {\n\t\t\tif (sourceFileDiscovery === false) {\n\t\t\t\treturn { discoveredRouterFiles: [], discoveredSourceFiles: [] }\n\t\t\t}\n\n\t\t\tconst startTime = performance.now()\n\t\t\tconst files = discoverRouterFiles({\n\t\t\t\ttargetPath: typeof sourceFileDiscovery === 'object' ? sourceFileDiscovery.rootPath : '.',\n\t\t\t\ttsConfigPath: tsconfigPath,\n\t\t\t})\n\t\t\tLogger.info(`File discovery took ${Math.round(performance.now() - startTime)}ms`)\n\t\t\treturn files\n\t\t})()\n\n\t\tconst allSourceFiles = sourceFiles.reduce(\n\t\t\t(acc, current) =>\n\t\t\t\tacc.some((r) => r.getFilePath() === current.getFilePath()) ? acc : acc.concat(current),\n\t\t\tdiscoveredSourceFiles,\n\t\t)\n\n\t\treturn { explicitRouters, discoveredRouterFiles, allSourceFiles }\n\t})()\n\n\tconst filesToAnalyze = explicitRouters.reduce(\n\t\t(acc, current) => (acc.some((r) => r.fileName === current.fileName) ? acc : acc.concat(current)),\n\t\tdiscoveredRouterFiles,\n\t)\n\n\tconst apiHeaders = allSourceFiles\n\t\t.flatMap((file) => analyzeSourceFileApiHeader(file))\n\t\t.filter((headers) => !!headers)\n\tif (apiHeaders.length > 0 && apiHeaders[0]) {\n\t\topenApiManager.setHeader(apiHeaders[0])\n\t}\n\n\tconst exposedModels = allSourceFiles.flatMap((file) => analyzeSourceFileExposedModels(file))\n\n\topenApiManager.setExposedModels(exposedModels)\n\n\tconst cachePath = (() => {\n\t\tif (typeof incremental === 'object' && incremental.cachePath) {\n\t\t\treturn incremental.cachePath\n\t\t}\n\t\treturn path.resolve(process.cwd(), 'node_modules', '.cache', 'moonflower')\n\t})()\n\tconst endpoints = analyzeMultipleSourceFiles(filesToAnalyze, {\n\t\tincremental: incremental !== false,\n\t\tcachePath,\n\t\ttimestampCache: {},\n\t})\n\n\topenApiManager.setStats({\n\t\tdiscoveredRouterFiles: discoveredRouterFiles.map((file) => ({\n\t\t\tpath: file.fileName,\n\t\t\trouters: file.routers.named.map((r) => ({\n\t\t\t\tname: r,\n\t\t\t\tendpoints: endpoints\n\t\t\t\t\t.filter((e) => e.sourceFilePath === file.fileName)\n\t\t\t\t\t.map((e) => `${e.method.toUpperCase()} ${e.path}`),\n\t\t\t})),\n\t\t})),\n\t\texplicitRouterFiles: explicitRouters.map((file) => ({\n\t\t\tpath: file.fileName,\n\t\t\trouters: file.routers.named.map((r) => ({\n\t\t\t\tname: r,\n\t\t\t\tendpoints: endpoints\n\t\t\t\t\t.filter((e) => e.sourceFilePath === file.fileName)\n\t\t\t\t\t.map((e) => `${e.method.toUpperCase()} ${e.path}`),\n\t\t\t})),\n\t\t})),\n\t})\n\n\topenApiManager.setEndpoints(endpoints)\n\topenApiManager.markAsReady()\n}\n\nexport const analyzeMultipleSourceFiles = (\n\tfiles: DiscoveredSourceFile[],\n\tconfig: {\n\t\tincremental: boolean\n\t\tcachePath: string\n\t\ttimestampCache: TimestampCache\n\t},\n\tfilterEndpointPaths?: string[],\n): EndpointData[] => {\n\tconst startTime = performance.now()\n\tconst analyzedFiles = files.map((file) => analyzeSourceFileWithCache(file, config, filterEndpointPaths))\n\tLogger.info(`Router analysis took ${Math.round(performance.now() - startTime)}ms`)\n\n\tanalyzedFiles\n\t\t.map((f, index) => ({\n\t\t\tfileName: files[index].fileName,\n\t\t\ttimeTaken: f.timing,\n\t\t}))\n\t\t.sort((a, b) => b.timeTaken - a.timeTaken)\n\t\t.filter((t) => t.timeTaken > 500)\n\t\t.forEach((t) => {\n\t\t\tLogger.info(`- [${t.fileName}] Took ${Math.round(t.timeTaken)}ms to analyze`)\n\t\t})\n\n\treturn analyzedFiles.flatMap((f) => f.endpoints)\n}\n\nexport const analyzeSourceFileWithCache = (\n\tfile: DiscoveredSourceFile,\n\tconfig: {\n\t\tincremental: boolean\n\t\tcachePath: string\n\t\ttimestampCache: TimestampCache\n\t},\n\tfilterEndpointPaths?: string[],\n): { endpoints: EndpointData[]; timing: number } => {\n\tconst timestamp = getSourceFileTimestamp(file.sourceFile, config.timestampCache)\n\tconst cachedResults = SourceFileCache.getCachedResults(file.sourceFile, timestamp, config.cachePath)\n\n\tif (cachedResults) {\n\t\tLogger.debug(`[${file.fileName}] Found cached results`)\n\t\treturn { endpoints: cachedResults.endpoints, timing: 0 }\n\t}\n\tLogger.debug(`[${file.fileName}] Analyzing...`)\n\n\tconst t1 = performance.now()\n\tconst endpoints = analyzeSourceFileEndpoints(file, filterEndpointPaths)\n\tconst t2 = performance.now()\n\tLogger.debug(`[${file.fileName}] Analyzed in ${t2 - t1}ms`)\n\tSourceFileCache.cacheResults(file.sourceFile, timestamp, config.cachePath, endpoints)\n\treturn { endpoints, timing: t2 - t1 }\n}\n\nexport const analyzeSourceFileEndpoints = (\n\tfile: DiscoveredSourceFile,\n\tfilterEndpointPaths?: string[],\n): EndpointData[] => {\n\tconst endpoints: EndpointData[] = []\n\tconst operations = ['get', 'post', 'put', 'delete', 'del', 'patch']\n\tconst joinedOperations = operations.join('|')\n\n\tfile.routers.named.forEach((routerName) => {\n\t\tfile.sourceFile.forEachChild((node) => {\n\t\t\tconst nodeText = node.getText()\n\t\t\tconst routerPattern = new RegExp(`${routerName}\\\\.(?:${joinedOperations})`)\n\n\t\t\tif (routerPattern.test(nodeText)) {\n\t\t\t\tconst endpointPath = resolveEndpointPath(node) ?? ''\n\n\t\t\t\tif (filterEndpointPaths && !filterEndpointPaths.some((path) => endpointPath.includes(path))) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tendpoints.push(parseEndpoint(node, file.fileName))\n\t\t\t}\n\t\t})\n\t})\n\n\treturn endpoints\n}\n\nexport const analyzeSourceFileApiHeader = (sourceFile: SourceFile): ApiDocsHeader | null => {\n\tconst nameOfUseApiHeader = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useApiHeader',\n\t})\n\n\tif (!nameOfUseApiHeader) {\n\t\treturn null\n\t}\n\n\tconst node = sourceFile\n\t\t.forEachChildAsArray()\n\t\t.filter((node) => node.isKind(SyntaxKind.ExpressionStatement))\n\t\t.find((node) => nameOfUseApiHeader && node.getText().startsWith(nameOfUseApiHeader))\n\n\tif (!node) {\n\t\treturn null\n\t}\n\n\tconst targetNode = node.getFirstDescendantByKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n\tconst values = getValuesOfObjectLiteral(targetNode)\n\n\tconst collapseObject = (v: string | string[] | typeof values): any => {\n\t\tif (typeof v === 'string') {\n\t\t\treturn v\n\t\t}\n\t\tif (Array.isArray(v) && v.every((value) => typeof value === 'string')) {\n\t\t\treturn v\n\t\t}\n\n\t\treturn v.reduce((acc, current) => {\n\t\t\tif (typeof current === 'string') {\n\t\t\t\treturn acc\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t[current.identifier]: collapseObject(current.value as string[]),\n\t\t\t}\n\t\t}, {})\n\t}\n\treturn collapseObject(values)\n}\n\nexport const analyzeSourceFileExposedModels = (sourceFile: SourceFile): ExposedModelData[] => {\n\tconst models: ExposedModelData[] = []\n\n\tconst nameOfUseExposeApiModel = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useExposeApiModel',\n\t})\n\n\tconst nameOfUseExposeNamedApiModels = discoverImportedName({\n\t\tsourceFile,\n\t\toriginalName: 'useExposeNamedApiModels',\n\t})\n\n\tsourceFile\n\t\t.forEachChildAsArray()\n\t\t.filter((node) => node.isKind(SyntaxKind.ExpressionStatement))\n\t\t.map((node) => {\n\t\t\tif (nameOfUseExposeApiModel && node.getText().startsWith(nameOfUseExposeApiModel)) {\n\t\t\t\tconst callExpressionNode = node.getFirstChild()\n\t\t\t\tconst syntaxListChildren = callExpressionNode?.getChildrenOfKind(SyntaxKind.SyntaxList) || []\n\n\t\t\t\tconst firstChild = syntaxListChildren[0].getFirstChild()\n\t\t\t\tif (!firstChild) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tmodels.push(parseExposedModel(firstChild))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (nameOfUseExposeNamedApiModels && node.getText().startsWith(nameOfUseExposeNamedApiModels)) {\n\t\t\t\tconst callExpressionNode = node.getFirstChild()\n\t\t\t\tconst syntaxListChildren = callExpressionNode?.getChildrenOfKind(SyntaxKind.SyntaxList) || []\n\n\t\t\t\tconst firstChild = syntaxListChildren[0].getFirstChild()\n\t\t\t\tif (!firstChild) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst parsedModels = parseNamedExposedModels(firstChild)\n\t\t\t\tparsedModels.forEach((model) => models.push(model))\n\t\t\t}\n\t\t})\n\treturn models\n}\n"],"names":["prepareOpenApiSpec","logLevel","tsconfigPath","sourceFilePaths","sourceFileDiscovery","incremental","openApiManager","OpenApiManager","Logger","project","Project","path","explicitRouters","discoveredRouterFiles","allSourceFiles","sourceFiles","filepath","filePath","file","discoverRouters","discoveredSourceFiles","startTime","files","discoverRouterFiles","acc","current","r","filesToAnalyze","apiHeaders","analyzeSourceFileApiHeader","headers","exposedModels","analyzeSourceFileExposedModels","cachePath","endpoints","analyzeMultipleSourceFiles","e","config","filterEndpointPaths","analyzedFiles","analyzeSourceFileWithCache","f","index","a","b","t","timestamp","getSourceFileTimestamp","cachedResults","SourceFileCache","t1","analyzeSourceFileEndpoints","t2","joinedOperations","routerName","node","nodeText","resolveEndpointPath","parseEndpoint","sourceFile","nameOfUseApiHeader","discoverImportedName","SyntaxKind","targetNode","values","getValuesOfObjectLiteral","collapseObject","v","value","models","nameOfUseExposeApiModel","nameOfUseExposeNamedApiModels","firstChild","parseExposedModel","parseNamedExposedModels","model"],"mappings":";;;;;;;;;;;;AAuCO,MAAMA,KAAqB,CAAC;AAAA,EAClC,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,aAAAC;AACD,MAAa;AACN,QAAAC,IAAiBC,EAAe,YAAY;AAE9C,MAAAD,EAAe;AAClB;AAGD,EAAIL,KACHO,EAAO,SAASP,CAAQ,GAGzBO,EAAO,KAAK,wBAAwB;AAE9B,QAAAC,IAAU,IAAIC,EAAQ;AAAA,IAC3B,kBAAkBC,EAAK,QAAQT,CAAY;AAAA,IAC3C,8BAA8B;AAAA,EAAA,CAC9B,GAEK,EAA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B,GAEahC,IAAiC,CAAC2B,MAA+C;AAC7F,QAAMU,IAA6B,CAAC,GAE9BC,IAA0BT,EAAqB;AAAA,IACpD,YAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACd,GAEKY,IAAgCV,EAAqB;AAAA,IAC1D,YAAAF;AAAA,IACA,cAAc;AAAA,EAAA,CACd;AAED,SAAAA,EACE,oBAAoB,EACpB,OAAO,CAACJ,MAASA,EAAK,OAAOO,EAAW,mBAAmB,CAAC,EAC5D,IAAI,CAACP,MAAS;AACd,QAAIe,KAA2Bf,EAAK,QAAU,EAAA,WAAWe,CAAuB,GAAG;AAIlF,YAAME,KAHqBjB,EAAK,cAAc,GACC,kBAAkBO,EAAW,UAAU,KAAK,CAAC,GAEtD,CAAC,EAAE,cAAc;AACvD,UAAI,CAACU;AACJ;AAGM,MAAAH,EAAA,KAAKI,EAAkBD,CAAU,CAAC;AACzC;AAAA,IAAA;AAGD,QAAID,KAAiChB,EAAK,QAAU,EAAA,WAAWgB,CAA6B,GAAG;AAI9F,YAAMC,KAHqBjB,EAAK,cAAc,GACC,kBAAkBO,EAAW,UAAU,KAAK,CAAC,GAEtD,CAAC,EAAE,cAAc;AACvD,UAAI,CAACU;AACJ;AAID,MADqBE,EAAwBF,CAAU,EAC1C,QAAQ,CAACG,MAAUN,EAAO,KAAKM,CAAK,CAAC;AAAA,IAAA;AAAA,EACnD,CACA,GACKN;AACR;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ts-morph"),S=require("../../utils/logger.cjs"),V=require("../manager/OpenApiManager.cjs"),L=new WeakMap,f=t=>{const r=L.get(t);if(r)return r;if(t.getKind()===e.SyntaxKind.Identifier){const i=t.asKind(e.SyntaxKind.Identifier).getImplementations()[0]?.getNode();if(i){const a=i.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const g=f(a);return L.set(t,g),g}const p=t.asKind(e.SyntaxKind.Identifier).getDefinitions()[0]?.getNode();if(p){const a=p.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const g=f(a);return L.set(t,g),g}throw new Error("No implementation nor definition available")}return L.set(t,t),t},h=t=>{const r=t.getChildrenOfKind(e.SyntaxKind.Identifier);return r.length===2?f(r[1]):t.getChildren().reverse().find(p=>p.getKind()!==e.SyntaxKind.GreaterThanToken&&p.getKind()!==e.SyntaxKind.CommaToken&&p.getKind()!==e.SyntaxKind.SemicolonToken)},F=t=>{const r=t.getFirstChildByKind(e.SyntaxKind.SyntaxList);return r.isKind(e.SyntaxKind.SyntaxList)?c(r.getFirstChild()):c(r)},c=t=>{const r=t.getSymbol()?.getName();if(r&&V.OpenApiManager.getInstance().hasExposedModel(r))return[{role:"ref",shape:r,optional:!1}];const i=f(t);if(i.asKind(e.SyntaxKind.UndefinedKeyword))return"undefined";const n=i.asKind(e.SyntaxKind.LiteralType);if(n){if(n.getFirstChildByKind(e.SyntaxKind.TrueKeyword))return"true";if(n.getFirstChildByKind(e.SyntaxKind.FalseKeyword))return"false"}if(i.asKind(e.SyntaxKind.BooleanKeyword)||i.asKind(e.SyntaxKind.TrueKeyword)||i.asKind(e.SyntaxKind.FalseKeyword))return"boolean";if(i.asKind(e.SyntaxKind.StringKeyword)||i.asKind(e.SyntaxKind.StringLiteral))return"string";if(i.asKind(e.SyntaxKind.NumberKeyword)||i.asKind(e.SyntaxKind.NumericLiteral))return"number";if(i.asKind(e.SyntaxKind.BigIntKeyword)||i.asKind(e.SyntaxKind.BigIntLiteral))return"bigint";const s=i.asKind(e.SyntaxKind.TypeLiteral);if(s)return s.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertySignature).map(E=>{const O=E.getFirstChildByKind(e.SyntaxKind.Identifier),k=h(E),R=O.getNextSiblingIfKind(e.SyntaxKind.QuestionToken);return{role:"property",identifier:O.getText(),shape:c(k),optional:k.getType().isNullable()||!!R}});const d=i.asKind(e.SyntaxKind.TypeReference);if(d)return c(d.getFirstChild());if(i.asKind(e.SyntaxKind.PropertyAccessExpression)){const A=f(i.getLastChild());return u(A.asKind(e.SyntaxKind.CallExpression).getReturnType(),A)}const K=i.asKind(e.SyntaxKind.UnionType);if(K)return u(K.getType(),i);const T=i.asKind(e.SyntaxKind.TypeQuery);if(T)return c(T.getLastChild());const C=i.asKind(e.SyntaxKind.QualifiedName);if(C)return c(C.getLastChild());const N=i.asKind(e.SyntaxKind.CallExpression);if(N)return u(N.getReturnType(),N);const B=i.asKind(e.SyntaxKind.AwaitExpression);if(B)return c(B.getChildAtIndex(1));const I=i.asKind(e.SyntaxKind.AsExpression);if(I)return c(I.getChildAtIndex(2));const v=i.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${v}] Unknown node type: ${i.getKindName()}`),"unknown_1"},D=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const a=n.getFirstChild(),g=(()=>{if(a.isKind(e.SyntaxKind.Identifier))return a.getText();if(a.isKind(e.SyntaxKind.StringLiteral))return a.getLiteralText();const s=n.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${s}] Unknown identifier name: ${a.getText()}`),"unknown_30"})(),o=n.getLastChild(),y=f(o);return{role:"property",identifier:g,shape:m(y),optional:w(y),description:x(y,"description"),errorMessage:x(y,"errorMessage")}})||[],m=t=>{const r=t.getParent().getFirstChildByKind(e.SyntaxKind.AsExpression);if(r){const s=r.getLastChildByKind(e.SyntaxKind.TypeReference);return F(s)}const i=t.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(i)return F(i);if(t.getParent().getChildrenOfKind(e.SyntaxKind.SyntaxList).length>=2){const s=t.getParent().getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild();return c(s)}const p=t.getParent().getFirstChildByKind(e.SyntaxKind.CallExpression);if(p){const s=f(p.getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild()),d=s.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(d)return u(d.getType(),d,[]);const l=s.getParent().getFirstChildByKind(e.SyntaxKind.ObjectLiteralExpression);if(l)return m(l);if(s.getKind()===e.SyntaxKind.CallExpression||s.getKind()===e.SyntaxKind.IntersectionType)return m(s);const K=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${K}] Unknown call expression argument: ${s.getKindName()}`),"unknown_3"}const a=t.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).find(s=>s.getFirstChildByKind(e.SyntaxKind.Identifier)?.getText()==="parse");if(a){const s=h(a).asKind(e.SyntaxKind.ArrowFunction).getReturnType();return u(s,a)}const g=t.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChildByKind(e.SyntaxKind.ImportType);if(g){const s=g.getLastChildByKind(e.SyntaxKind.GreaterThanToken).getChildIndex(),d=g.getChildAtIndex(s-1);return c(d.getFirstChild())}const o=t.isKind(e.SyntaxKind.IntersectionType)?t:t.getParent()?.isKind(e.SyntaxKind.VariableDeclaration)?t.getParent()?.getFirstChildByKind(e.SyntaxKind.IntersectionType):null;if(o){const s=o.getFirstChildByKind(e.SyntaxKind.TypeReference);if(s)return F(s)}const y=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${y}] Unknown import type node`),"unknown_2"},w=t=>{const r=t.asKind(e.SyntaxKind.CallExpression);if(r){const n=r.getFirstChildByKind(e.SyntaxKind.Identifier);if(n?.getText()==="OptionalParam")return!0;if(n?.getText()==="RequiredParam")return!1;const a=r.getFirstChildByKind(e.SyntaxKind.SyntaxList),g=f(a.getFirstChild());return w(g)}return t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).some(n=>n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()==="optional"?h(n).getKind()===e.SyntaxKind.TrueKeyword:!1)},x=(t,r)=>{const i=f(t),p=i.asKind(e.SyntaxKind.CallExpression);if(p){const d=p.getLastChildByKind(e.SyntaxKind.SyntaxList);return x(d,r)}const n=i.asKind(e.SyntaxKind.SyntaxList);if(n)return n.getChildren().map(l=>x(l,r)).find(l=>!!l&&l!=="unknown_25")||"";const a=i.asKind(e.SyntaxKind.ObjectLiteralExpression);if(a){const l=b(a).find(K=>K.identifier===r);return l?Array.isArray(l.value)?"array":l.value||"":""}const g=i.asKind(e.SyntaxKind.IntersectionType);if(g)return g.getTypeNodes().flatMap(d=>x(d,r)).filter(d=>!!d&&d!=="unknown_25")[0]||"unknown_27";const o=i.asKind(e.SyntaxKind.TypeLiteral);if(o)return x(o.getFirstChildByKind(e.SyntaxKind.SyntaxList),r);const y=i.asKind(e.SyntaxKind.PropertySignature);if(y&&i.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()===r)return h(y).getFirstDescendantByKind(e.SyntaxKind.StringLiteral).getLiteralText();const s=i.getSourceFile().getFilePath().split("/").pop();return S.Logger.dev(`[${s}] Unknown property string value node ${i.getKindName()}`),"unknown_25"},M=t=>{const r=t.getSymbol();if(!t.isObject()||!r)return!1;const i=t.getTypeArguments();return r.getName()==="Promise"&&i.length===1},u=(t,r,i=[])=>{const p=t.getAliasSymbol()?.getName();if(p&&V.OpenApiManager.getInstance().hasExposedModel(p))return[{role:"ref",shape:p,optional:!1}];const n=M(t)?t.getTypeArguments()[0]:t;if(i.some(o=>o===n))return"circular";const a=i.concat(n);if(n.getText()==="void")return"void";if(n.isAny())return"any";if(n.isNull())return"null";if(n.isUndefined())return"undefined";if(n.isBoolean()||n.isBooleanLiteral())return"boolean";if(n.isStringLiteral())return[{role:"literal_string",shape:String(n.getLiteralValue()),optional:!1}];if(n.isNumberLiteral())return[{role:"literal_number",shape:String(n.getLiteralValue()),optional:!1}];if(n.isString()||n.isTemplateLiteral())return"string";if(n.isNumber())return"number";if(n.getText()==="bigint")return"bigint";if(n.isTuple())return[{role:"tuple",shape:n.getTupleElements().map(o=>({role:"tuple_entry",shape:u(o,r,a),optional:!1})),optional:!1}];if(n.isArray())return[{role:"array",shape:u(n.getArrayElementType(),r,a),optional:!1}];if(n.isObject()&&n.getText()==="Buffer")return[{role:"buffer",shape:"buffer",optional:!1}];if(n.isObject()&&n.getProperties().length===0){const o=n.getAliasTypeArguments()[1];return[{role:"record",shape:u(o,r,a),optional:!1}]}if(n.isObject())return n.getText()==="Date"?"Date":n.getProperties().map(o=>{const y=o.getValueDeclaration()||o.getDeclarations()[0];if(!y)return{role:"property",identifier:o.getName(),shape:u(o.getTypeAtLocation(r),r,a),optional:!1};if(!(y.asKind(e.SyntaxKind.PropertySignature)||y.asKind(e.SyntaxKind.PropertyAssignment)||y.asKind(e.SyntaxKind.ShorthandPropertyAssignment)))return{role:"property",identifier:o.getName(),shape:u(o.getTypeAtLocation(r),r,a),optional:!1};const d=o.getTypeAtLocation(r).isNullable(),l=u(o.getTypeAtLocation(r),r,a);return{role:"property",identifier:o.getName(),shape:l,optional:d}}).filter(o=>o.shape!=="undefined");if(n.isUnion()){const y=n.getUnionTypes().map(l=>({role:"union_entry",shape:u(l,r,a),optional:!1})).filter((l,K,T)=>!T.find((C,N)=>C.shape===l.shape&&N>K)),s=y.some(l=>l.shape==="undefined"),d=y.filter(l=>l.shape!=="undefined");return d.length===1?d[0].shape:[{role:"union",shape:d,optional:s}]}if(n.isIntersection())return n.getIntersectionTypes().map(s=>u(s,r,a)).filter(s=>typeof s!="string").reduce((s,d)=>[...s,...d],[]);const g=r.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${g}] Unknown type shape node ${t.getText()}`),"unknown_5"},P=t=>{if(t.isKind(e.SyntaxKind.Identifier))return P(f(t));if(t.isKind(e.SyntaxKind.StringLiteral))return t.getLiteralValue();if(t.isKind(e.SyntaxKind.ArrayLiteralExpression))return t.forEachChildAsArray().map(i=>P(i));if(t.isKind(e.SyntaxKind.PropertyAccessExpression))return P(h(t));if(t.isKind(e.SyntaxKind.ObjectLiteralExpression))return b(t);const r=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.dev(`[${r}] Unknown literal value node ${t.getKindName()}`),"unknown_6"},b=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const g=n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText(),o=n.getLastChild(),y=f(o),s=P(y);return{identifier:g,value:s}})||[];exports.findNodeImplementation=f;exports.findPropertyAssignmentValueNode=h;exports.getProperTypeShape=u;exports.getRecursiveNodeShape=c;exports.getShapeOfValidatorLiteral=D;exports.getTypeReferenceShape=F;exports.getValidatorPropertyOptionality=w;exports.getValidatorPropertyShape=m;exports.getValidatorPropertyStringValue=x;exports.getValuesOfObjectLiteral=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ts-morph"),x=require("../../utils/logger.cjs"),R=require("../manager/OpenApiManager.cjs"),F=new WeakMap,c=t=>{const n=F.get(t);if(n)return n;if(t.getKind()===e.SyntaxKind.Identifier){const r=t.asKind(e.SyntaxKind.Identifier).getImplementations()[0]?.getNode();if(r){const a=r.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const y=c(a);return F.set(t,y),y}const d=t.asKind(e.SyntaxKind.Identifier).getDefinitions()[0]?.getNode();if(d){const a=d.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const y=c(a);return F.set(t,y),y}throw new Error("No implementation nor definition available")}return F.set(t,t),t},m=t=>{const n=t.getChildrenOfKind(e.SyntaxKind.Identifier);return n.length===2?c(n[1]):t.getChildren().reverse().find(d=>d.getKind()!==e.SyntaxKind.GreaterThanToken&&d.getKind()!==e.SyntaxKind.CommaToken&&d.getKind()!==e.SyntaxKind.SemicolonToken)},P=t=>{const n=t.getFirstChildByKind(e.SyntaxKind.SyntaxList);return n.isKind(e.SyntaxKind.SyntaxList)?f(n.getFirstChild()):f(n)},f=t=>{const n=t.getSymbol()?.getName();if(n&&R.OpenApiManager.getInstance().hasExposedModel(n))return[{role:"ref",shape:n,optional:!1}];const r=c(t);if(r.asKind(e.SyntaxKind.UndefinedKeyword))return"undefined";const i=r.asKind(e.SyntaxKind.LiteralType);if(i){if(i.getFirstChildByKind(e.SyntaxKind.TrueKeyword))return"true";if(i.getFirstChildByKind(e.SyntaxKind.FalseKeyword))return"false"}if(r.asKind(e.SyntaxKind.BooleanKeyword)||r.asKind(e.SyntaxKind.TrueKeyword)||r.asKind(e.SyntaxKind.FalseKeyword))return"boolean";if(r.asKind(e.SyntaxKind.StringKeyword)||r.asKind(e.SyntaxKind.StringLiteral))return"string";if(r.asKind(e.SyntaxKind.NumberKeyword)||r.asKind(e.SyntaxKind.NumericLiteral))return"number";if(r.asKind(e.SyntaxKind.BigIntKeyword)||r.asKind(e.SyntaxKind.BigIntLiteral))return"bigint";const s=r.asKind(e.SyntaxKind.TypeLiteral);if(s)return s.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertySignature).map(O=>{const V=O.getFirstChildByKind(e.SyntaxKind.Identifier),v=m(O),D=V.getNextSiblingIfKind(e.SyntaxKind.QuestionToken);return{role:"property",identifier:V.getText(),shape:f(v),optional:v.getType().isNullable()||!!D}});const l=r.asKind(e.SyntaxKind.TypeReference);if(l)return f(l.getFirstChild());if(r.asKind(e.SyntaxKind.PropertyAccessExpression)){const A=c(r.getLastChild());return u(A.asKind(e.SyntaxKind.CallExpression).getReturnType(),A)}const K=r.asKind(e.SyntaxKind.UnionType);if(K)return u(K.getType(),r);const C=r.asKind(e.SyntaxKind.TypeQuery);if(C)return f(C.getLastChild());const L=r.asKind(e.SyntaxKind.QualifiedName);if(L)return f(L.getLastChild());const N=r.asKind(e.SyntaxKind.CallExpression);if(N)return u(N.getReturnType(),N);const I=r.asKind(e.SyntaxKind.AwaitExpression);if(I)return f(I.getChildAtIndex(1));const k=r.asKind(e.SyntaxKind.AsExpression);if(k)return f(k.getChildAtIndex(2));const _=r.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${_}] Unknown node type: ${r.getKindName()}`),"unknown_1"},j=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(i=>{const a=i.getFirstChild(),y=(()=>{if(a.isKind(e.SyntaxKind.Identifier))return a.getText();if(a.isKind(e.SyntaxKind.StringLiteral))return a.getLiteralText();const s=i.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${s}] Unknown identifier name: ${a.getText()}`),"unknown_30"})(),o=i.getLastChild(),p=c(o);return{role:"property",identifier:y,shape:h(p),optional:B(p),description:S(p,"description"),errorMessage:S(p,"errorMessage")}})||[],T=t=>{const n=t.asKind(e.SyntaxKind.CallExpression);return n?(n.getReturnType().getSymbol()?.getName()??"").startsWith("Zod"):!1},w=t=>{const n=t.asKind(e.SyntaxKind.CallExpression),d=n.getReturnType().getSymbol()?.getName()??"";if(d==="ZodNumber")return"number";if(d==="ZodString")return"string";if(d==="ZodBoolean")return"boolean";if(d==="ZodBigInt")return"bigint";if(d==="ZodObject"){const y=n.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild()?.asKind(e.SyntaxKind.ObjectLiteralExpression);if(!y)return"unknown_zod_object";const o=y.getFirstChildByKind(e.SyntaxKind.SyntaxList);return o?o.getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(s=>{const l=s.getFirstChildByKind(e.SyntaxKind.Identifier).getText(),g=s.getLastChild();return{role:"property",identifier:l,shape:T(g)?w(g):h(g),optional:!1}}):[]}if(d==="ZodArray"){const a=n.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild();return a?[{role:"array",shape:T(a)?w(a):h(a),optional:!1}]:"unknown_zod_array"}const i=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${i}] Unknown zod type: ${d}`),"unknown_zod"},h=t=>{if(T(t))return w(t);const n=t.getParent().getFirstChildByKind(e.SyntaxKind.AsExpression);if(n){const s=n.getLastChildByKind(e.SyntaxKind.TypeReference);return P(s)}const r=t.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(r)return P(r);if(t.getParent().getChildrenOfKind(e.SyntaxKind.SyntaxList).length>=2){const s=t.getParent().getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild();return f(s)}const d=t.getParent().getFirstChildByKind(e.SyntaxKind.CallExpression);if(d){const s=c(d.getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild()),l=s.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(l)return u(l.getType(),l,[]);const g=s.getParent().getFirstChildByKind(e.SyntaxKind.ObjectLiteralExpression);if(g)return h(g);if(s.getKind()===e.SyntaxKind.CallExpression||s.getKind()===e.SyntaxKind.IntersectionType)return h(s);const K=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${K}] Unknown call expression argument: ${s.getKindName()}`),"unknown_3"}const a=t.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).find(s=>s.getFirstChildByKind(e.SyntaxKind.Identifier)?.getText()==="parse");if(a){const s=m(a).asKind(e.SyntaxKind.ArrowFunction).getReturnType();return u(s,a)}const y=t.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChildByKind(e.SyntaxKind.ImportType);if(y){const s=y.getLastChildByKind(e.SyntaxKind.GreaterThanToken).getChildIndex(),l=y.getChildAtIndex(s-1);return f(l.getFirstChild())}const o=t.isKind(e.SyntaxKind.IntersectionType)?t:t.getParent()?.isKind(e.SyntaxKind.VariableDeclaration)?t.getParent()?.getFirstChildByKind(e.SyntaxKind.IntersectionType):null;if(o){const s=o.getFirstChildByKind(e.SyntaxKind.TypeReference);if(s)return P(s)}const p=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${p}] Unknown import type node`),"unknown_2"},B=t=>{if(T(t))return!1;const n=t.asKind(e.SyntaxKind.CallExpression);if(n){const i=n.getFirstChildByKind(e.SyntaxKind.Identifier);if(i?.getText()==="OptionalParam")return!0;if(i?.getText()==="RequiredParam")return!1;const a=n.getFirstChildByKind(e.SyntaxKind.SyntaxList),y=c(a.getFirstChild());return B(y)}return t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).some(i=>i.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()==="optional"?m(i).getKind()===e.SyntaxKind.TrueKeyword:!1)},S=(t,n)=>{if(T(t))return"";const r=c(t),d=r.asKind(e.SyntaxKind.CallExpression);if(d){const l=d.getLastChildByKind(e.SyntaxKind.SyntaxList);return S(l,n)}const i=r.asKind(e.SyntaxKind.SyntaxList);if(i)return i.getChildren().map(g=>S(g,n)).find(g=>!!g&&g!=="unknown_25")||"";const a=r.asKind(e.SyntaxKind.ObjectLiteralExpression);if(a){const g=E(a).find(K=>K.identifier===n);return g?Array.isArray(g.value)?"array":g.value||"":""}const y=r.asKind(e.SyntaxKind.IntersectionType);if(y)return y.getTypeNodes().flatMap(l=>S(l,n)).filter(l=>!!l&&l!=="unknown_25")[0]||"unknown_27";const o=r.asKind(e.SyntaxKind.TypeLiteral);if(o)return S(o.getFirstChildByKind(e.SyntaxKind.SyntaxList),n);const p=r.asKind(e.SyntaxKind.PropertySignature);if(p&&r.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()===n)return m(p).getFirstDescendantByKind(e.SyntaxKind.StringLiteral).getLiteralText();const s=r.getSourceFile().getFilePath().split("/").pop();return x.Logger.dev(`[${s}] Unknown property string value node ${r.getKindName()}`),"unknown_25"},$=t=>{const n=t.getSymbol();if(!t.isObject()||!n)return!1;const r=t.getTypeArguments();return n.getName()==="Promise"&&r.length===1},u=(t,n,r=[])=>{const d=t.getAliasSymbol()?.getName();if(d&&R.OpenApiManager.getInstance().hasExposedModel(d))return[{role:"ref",shape:d,optional:!1}];const i=$(t)?t.getTypeArguments()[0]:t;if(r.some(o=>o===i))return"circular";const a=r.concat(i);if(i.getText()==="void")return"void";if(i.isAny())return"any";if(i.isNull())return"null";if(i.isUndefined())return"undefined";if(i.isBoolean()||i.isBooleanLiteral())return"boolean";if(i.isStringLiteral())return[{role:"literal_string",shape:String(i.getLiteralValue()),optional:!1}];if(i.isNumberLiteral())return[{role:"literal_number",shape:String(i.getLiteralValue()),optional:!1}];if(i.isString()||i.isTemplateLiteral())return"string";if(i.isNumber())return"number";if(i.getText()==="bigint")return"bigint";if(i.isTuple())return[{role:"tuple",shape:i.getTupleElements().map(o=>({role:"tuple_entry",shape:u(o,n,a),optional:!1})),optional:!1}];if(i.isArray())return[{role:"array",shape:u(i.getArrayElementType(),n,a),optional:!1}];if(i.isObject()&&i.getText()==="Buffer")return[{role:"buffer",shape:"buffer",optional:!1}];if(i.isObject()&&i.getProperties().length===0){const o=i.getAliasTypeArguments()[1]??i.getStringIndexType();if(o)return[{role:"record",shape:u(o,n,a),optional:!1}]}if(i.isObject())return i.getText()==="Date"?"Date":i.getProperties().map(o=>{const p=o.getValueDeclaration()||o.getDeclarations()[0];if(!p)return{role:"property",identifier:o.getName(),shape:u(o.getTypeAtLocation(n),n,a),optional:!1};if(!(p.asKind(e.SyntaxKind.PropertySignature)||p.asKind(e.SyntaxKind.PropertyAssignment)||p.asKind(e.SyntaxKind.ShorthandPropertyAssignment)))return{role:"property",identifier:o.getName(),shape:u(o.getTypeAtLocation(n),n,a),optional:!1};const l=o.getTypeAtLocation(n).isNullable(),g=u(o.getTypeAtLocation(n),n,a);return{role:"property",identifier:o.getName(),shape:g,optional:l}}).filter(o=>o.shape!=="undefined");if(i.isUnion()){const p=i.getUnionTypes().map(g=>({role:"union_entry",shape:u(g,n,a),optional:!1})).filter((g,K,C)=>!C.find((L,N)=>L.shape===g.shape&&N>K)),s=p.some(g=>g.shape==="undefined"),l=p.filter(g=>g.shape!=="undefined");return l.length===1?l[0].shape:[{role:"union",shape:l,optional:s}]}if(i.isIntersection())return i.getIntersectionTypes().map(s=>u(s,n,a)).filter(s=>typeof s!="string").reduce((s,l)=>[...s,...l],[]);const y=n.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${y}] Unknown type shape node ${t.getText()}`),"unknown_5"},b=t=>{if(t.isKind(e.SyntaxKind.Identifier))return b(c(t));if(t.isKind(e.SyntaxKind.StringLiteral))return t.getLiteralValue();if(t.isKind(e.SyntaxKind.ArrayLiteralExpression))return t.forEachChildAsArray().map(r=>b(r));if(t.isKind(e.SyntaxKind.PropertyAccessExpression))return b(m(t));if(t.isKind(e.SyntaxKind.ObjectLiteralExpression))return E(t);const n=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.dev(`[${n}] Unknown literal value node ${t.getKindName()}`),"unknown_6"},M=t=>{const n=t.getFirstDescendantByKind(e.SyntaxKind.CallExpression);if(!n)return null;const r=n.getArguments()[0];if(!r)return null;const d=r.getType();return d.isStringLiteral()?d.getLiteralValue():null},E=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(i=>{const y=i.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText(),o=i.getLastChild(),p=c(o),s=b(p);return{identifier:y,value:s}})||[];exports.findNodeImplementation=c;exports.findPropertyAssignmentValueNode=m;exports.getProperTypeShape=u;exports.getRecursiveNodeShape=f;exports.getShapeOfValidatorLiteral=j;exports.getTypeReferenceShape=P;exports.getValidatorPropertyOptionality=B;exports.getValidatorPropertyShape=h;exports.getValidatorPropertyStringValue=S;exports.getValuesOfObjectLiteral=E;exports.resolveEndpointPath=M;
2
2
  //# sourceMappingURL=nodeParsers.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeParsers.cjs","sources":["../../../src/openapi/analyzerModule/nodeParsers.ts"],"sourcesContent":["import {\n\tNode,\n\tPropertyAccessExpression,\n\tPropertyAssignment,\n\tPropertySignature,\n\tShorthandPropertyAssignment,\n\tSyntaxKind,\n\tts,\n\tType,\n\tTypeReferenceNode,\n} from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { OpenApiManager } from '../manager/OpenApiManager'\nimport { ShapeOfProperty, ShapeOfType, ShapeOfUnionEntry } from './types'\n\nconst implementationCache = new WeakMap<Node, Node>()\n\nexport const findNodeImplementation = (node: Node): Node => {\n\tconst cached = implementationCache.get(node)\n\tif (cached) {\n\t\treturn cached\n\t}\n\n\tif (node.getKind() === SyntaxKind.Identifier) {\n\t\tconst implementationNode = node.asKind(SyntaxKind.Identifier)!.getImplementations()[0]?.getNode()\n\t\tif (implementationNode) {\n\t\t\tconst implementationParentNode = implementationNode.getParent()!\n\t\t\tconst assignmentValueNode = implementationParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\n\t\tconst definitionNode = node.asKind(SyntaxKind.Identifier)!.getDefinitions()[0]?.getNode()\n\t\tif (definitionNode) {\n\t\t\tconst definitionParentNode = definitionNode.getParent()!\n\t\t\tconst assignmentValueNode = definitionParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\t\tthrow new Error('No implementation nor definition available')\n\t}\n\n\timplementationCache.set(node, node)\n\treturn node\n}\n\nexport const findPropertyAssignmentValueNode = (\n\tnode:\n\t\t| PropertyAssignment\n\t\t| TypeReferenceNode\n\t\t| PropertySignature\n\t\t| PropertyAccessExpression\n\t\t| ShorthandPropertyAssignment,\n): Node => {\n\tconst identifierChildren = node.getChildrenOfKind(SyntaxKind.Identifier)\n\tif (identifierChildren.length === 2) {\n\t\treturn findNodeImplementation(identifierChildren[1])\n\t}\n\tconst lastMatchingChild = node.getChildren().reverse()\n\treturn lastMatchingChild.find(\n\t\t(child) =>\n\t\t\tchild.getKind() !== SyntaxKind.GreaterThanToken &&\n\t\t\tchild.getKind() !== SyntaxKind.CommaToken &&\n\t\t\tchild.getKind() !== SyntaxKind.SemicolonToken,\n\t)!\n}\n\nexport const getTypeReferenceShape = (node: TypeReferenceNode): ShapeOfType['shape'] => {\n\tconst firstChild = node.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tif (firstChild.isKind(SyntaxKind.SyntaxList)) {\n\t\treturn getRecursiveNodeShape(firstChild.getFirstChild()!)\n\t} else {\n\t\treturn getRecursiveNodeShape(firstChild)\n\t}\n}\n\nexport const getRecursiveNodeShape = (nodeOrReference: Node): ShapeOfType['shape'] => {\n\tconst typeName = nodeOrReference.getSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\t// Undefined\n\tconst undefinedNode = node.asKind(SyntaxKind.UndefinedKeyword)\n\tif (undefinedNode) {\n\t\treturn 'undefined'\n\t}\n\n\t// Literal type\n\tconst literalNode = node.asKind(SyntaxKind.LiteralType)\n\tif (literalNode) {\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.TrueKeyword)) {\n\t\t\treturn 'true'\n\t\t}\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.FalseKeyword)) {\n\t\t\treturn 'false'\n\t\t}\n\t}\n\n\t// Boolean literal\n\tconst booleanLiteralNode =\n\t\tnode.asKind(SyntaxKind.BooleanKeyword) ||\n\t\tnode.asKind(SyntaxKind.TrueKeyword) ||\n\t\tnode.asKind(SyntaxKind.FalseKeyword)\n\tif (booleanLiteralNode) {\n\t\treturn 'boolean'\n\t}\n\n\t// String literal\n\tconst stringLiteralNode = node.asKind(SyntaxKind.StringKeyword) || node.asKind(SyntaxKind.StringLiteral)\n\tif (stringLiteralNode) {\n\t\treturn 'string'\n\t}\n\n\t// Number literal\n\tconst numberLiteralNode = node.asKind(SyntaxKind.NumberKeyword) || node.asKind(SyntaxKind.NumericLiteral)\n\tif (numberLiteralNode) {\n\t\treturn 'number'\n\t}\n\n\t// BigInt literal\n\tconst bigIntNode = node.asKind(SyntaxKind.BigIntKeyword) || node.asKind(SyntaxKind.BigIntLiteral)\n\tif (bigIntNode) {\n\t\treturn 'bigint'\n\t}\n\n\t// Type literal\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\tconst properties = typeLiteralNode\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getChildrenOfKind(SyntaxKind.PropertySignature)\n\n\t\tconst propertyShapes = properties.map((propNode) => {\n\t\t\tconst identifier = propNode.getFirstChildByKind(SyntaxKind.Identifier)!\n\t\t\tconst valueNode = findPropertyAssignmentValueNode(propNode)\n\t\t\tconst questionMarkToken = identifier.getNextSiblingIfKind(SyntaxKind.QuestionToken)\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier: identifier.getText(),\n\t\t\t\tshape: getRecursiveNodeShape(valueNode),\n\t\t\t\toptional: valueNode.getType().isNullable() || !!questionMarkToken,\n\t\t\t}\n\t\t})\n\t\treturn propertyShapes\n\t}\n\n\t// Type reference\n\tconst typeReferenceNode = node.asKind(SyntaxKind.TypeReference)\n\tif (typeReferenceNode) {\n\t\treturn getRecursiveNodeShape(typeReferenceNode.getFirstChild()!)\n\t}\n\n\t// Property access expression\n\tconst propertyAccessNode = node.asKind(SyntaxKind.PropertyAccessExpression)\n\tif (propertyAccessNode) {\n\t\tconst lastChild = findNodeImplementation(node.getLastChild()!)\n\t\treturn getProperTypeShape(lastChild.asKind(SyntaxKind.CallExpression)!.getReturnType(), lastChild)\n\t}\n\n\t// Union type\n\tconst unionTypeNode = node.asKind(SyntaxKind.UnionType)\n\tif (unionTypeNode) {\n\t\treturn getProperTypeShape(unionTypeNode.getType(), node)\n\t}\n\n\t// Typeof query\n\tconst typeQueryNode = node.asKind(SyntaxKind.TypeQuery)\n\tif (typeQueryNode) {\n\t\treturn getRecursiveNodeShape(typeQueryNode.getLastChild()!)\n\t}\n\n\t// Qualified name\n\tconst qualifiedNameNode = node.asKind(SyntaxKind.QualifiedName)\n\tif (qualifiedNameNode) {\n\t\treturn getRecursiveNodeShape(qualifiedNameNode.getLastChild()!)\n\t}\n\n\t// Call expression\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\treturn getProperTypeShape(callExpressionNode.getReturnType(), callExpressionNode)\n\t}\n\n\t// Await expression\n\tconst awaitExpressionNode = node.asKind(SyntaxKind.AwaitExpression)\n\tif (awaitExpressionNode) {\n\t\treturn getRecursiveNodeShape(awaitExpressionNode.getChildAtIndex(1)!)\n\t}\n\n\t// 'As' Expression\n\tconst asExpressionNode = node.asKind(SyntaxKind.AsExpression)\n\tif (asExpressionNode) {\n\t\treturn getRecursiveNodeShape(asExpressionNode.getChildAtIndex(2)!)\n\t}\n\n\t// TODO\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown node type: ${node.getKindName()}`)\n\treturn 'unknown_1'\n}\n\nexport const getShapeOfValidatorLiteral = (\n\tobjectLiteralNode: Node<ts.ObjectLiteralExpression>,\n): (ShapeOfProperty & { description: string; errorMessage: string })[] => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstChild()!\n\t\tconst identifierName = (() => {\n\t\t\tif (identifierNode.isKind(SyntaxKind.Identifier)) {\n\t\t\t\treturn identifierNode.getText()\n\t\t\t}\n\t\t\tif (identifierNode.isKind(SyntaxKind.StringLiteral)) {\n\t\t\t\treturn identifierNode.getLiteralText()\n\t\t\t}\n\t\t\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\t\t\tLogger.warn(`[${fileName}] Unknown identifier name: ${identifierNode.getText()}`)\n\t\t\treturn 'unknown_30'\n\t\t})()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst innerLiteralNode = findNodeImplementation(assignmentValueNode)\n\n\t\treturn {\n\t\t\trole: 'property' as const,\n\t\t\tidentifier: identifierName,\n\t\t\tshape: getValidatorPropertyShape(innerLiteralNode),\n\t\t\toptional: getValidatorPropertyOptionality(innerLiteralNode),\n\t\t\tdescription: getValidatorPropertyStringValue(innerLiteralNode, 'description'),\n\t\t\terrorMessage: getValidatorPropertyStringValue(innerLiteralNode, 'errorMessage'),\n\t\t}\n\t})\n\n\treturn properties || []\n}\n\nexport const getValidatorPropertyShape = (innerLiteralNode: Node): ShapeOfType['shape'] => {\n\t// Inline definition with `as Validator<...>` clause\n\tconst inlineValidatorAsExpression = innerLiteralNode\n\t\t.getParent()!\n\t\t.getFirstChildByKind(SyntaxKind.AsExpression)\n\tif (inlineValidatorAsExpression) {\n\t\tconst typeReference = inlineValidatorAsExpression.getLastChildByKind(SyntaxKind.TypeReference)!\n\t\treturn getTypeReferenceShape(typeReference)\n\t}\n\n\t// Variable with `: Validator<...>` clause\n\tconst childTypeReferenceNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.TypeReference)\n\tif (childTypeReferenceNode) {\n\t\treturn getTypeReferenceShape(childTypeReferenceNode)\n\t}\n\n\t// `RequiredParam<...>` inline call expression\n\tif (innerLiteralNode.getParent()!.getChildrenOfKind(SyntaxKind.SyntaxList).length >= 2) {\n\t\tconst typeNode = innerLiteralNode\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getFirstChild()!\n\t\treturn getRecursiveNodeShape(typeNode)\n\t}\n\n\t// `RequestParam | RequiredParam | OptionalParam` call expression\n\tconst childCallExpressionNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.CallExpression)\n\tif (childCallExpressionNode) {\n\t\tconst callExpressionArgument = findNodeImplementation(\n\t\t\tchildCallExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!.getFirstChild()!,\n\t\t)\n\n\t\t// Param is a type reference\n\t\tconst typeReferenceNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.TypeReference)!\n\t\tif (typeReferenceNode) {\n\t\t\treturn getProperTypeShape(typeReferenceNode.getType(), typeReferenceNode, [])\n\t\t}\n\n\t\tconst thingyNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.ObjectLiteralExpression)!\n\t\tif (thingyNode) {\n\t\t\treturn getValidatorPropertyShape(thingyNode)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.CallExpression) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.IntersectionType) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\t\tLogger.warn(`[${fileName}] Unknown call expression argument: ${callExpressionArgument.getKindName()}`)\n\t\treturn 'unknown_3'\n\t}\n\n\t// Attempting to infer type from `parse` function\n\tconst innerNodePropertyAssignments = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\tconst parsePropertyAssignment = innerNodePropertyAssignments.find((prop) => {\n\t\treturn prop.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'parse'\n\t})\n\tif (parsePropertyAssignment) {\n\t\tconst returnType = findPropertyAssignmentValueNode(parsePropertyAssignment)\n\t\t\t.asKind(SyntaxKind.ArrowFunction)!\n\t\t\t.getReturnType()\n\t\treturn getProperTypeShape(returnType, parsePropertyAssignment)\n\t}\n\n\t// Import statement\n\tconst importTypeNode = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\t?.getFirstChildByKind(SyntaxKind.ImportType)\n\tif (importTypeNode) {\n\t\tconst indexOfGreaterThanToken = importTypeNode\n\t\t\t.getLastChildByKind(SyntaxKind.GreaterThanToken)!\n\t\t\t.getChildIndex()\n\t\tconst targetSyntaxList = importTypeNode.getChildAtIndex(indexOfGreaterThanToken - 1)\n\t\treturn getRecursiveNodeShape(targetSyntaxList.getFirstChild()!)\n\t}\n\n\t// Intersection type with Validator\n\tconst intersectionType = innerLiteralNode.isKind(SyntaxKind.IntersectionType)\n\t\t? innerLiteralNode\n\t\t: innerLiteralNode.getParent()?.isKind(SyntaxKind.VariableDeclaration)\n\t\t\t? innerLiteralNode.getParent()?.getFirstChildByKind(SyntaxKind.IntersectionType)\n\t\t\t: null\n\n\tif (intersectionType) {\n\t\tconst validatorType = intersectionType.getFirstChildByKind(SyntaxKind.TypeReference)\n\t\tif (validatorType) {\n\t\t\treturn getTypeReferenceShape(validatorType)\n\t\t}\n\t}\n\n\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown import type node`)\n\n\treturn 'unknown_2'\n}\n\nexport const getValidatorPropertyOptionality = (node: Node): boolean => {\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst identifierNode = callExpressionNode.getFirstChildByKind(SyntaxKind.Identifier)\n\t\tif (identifierNode?.getText() === 'OptionalParam') {\n\t\t\treturn true\n\t\t} else if (identifierNode?.getText() === 'RequiredParam') {\n\t\t\treturn false\n\t\t}\n\n\t\tconst syntaxListNode = callExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\tconst literalExpression = findNodeImplementation(syntaxListNode.getFirstChild()!)\n\t\treturn getValidatorPropertyOptionality(literalExpression)\n\t}\n\n\tconst syntaxListNode = node.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\treturn assignmentNodes.some((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tif (identifierName === 'optional') {\n\t\t\tconst value = findPropertyAssignmentValueNode(node)\n\t\t\treturn value.getKind() === SyntaxKind.TrueKeyword\n\t\t}\n\t\treturn false\n\t})\n}\n\nexport const getValidatorPropertyStringValue = (\n\tnodeOrReference: Node,\n\tname: 'description' | 'errorMessage',\n): string => {\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst targetChild = callExpressionNode.getLastChildByKind(SyntaxKind.SyntaxList)!\n\t\treturn getValidatorPropertyStringValue(targetChild, name)\n\t}\n\n\tconst syntaxListNode = node.asKind(SyntaxKind.SyntaxList)\n\tif (syntaxListNode) {\n\t\tconst children = syntaxListNode.getChildren().map((c) => getValidatorPropertyStringValue(c, name))\n\t\treturn children.find((value) => !!value && value !== 'unknown_25') || ''\n\t}\n\n\tconst objectLiteralNode = node.asKind(SyntaxKind.ObjectLiteralExpression)\n\tif (objectLiteralNode) {\n\t\tconst values = getValuesOfObjectLiteral(objectLiteralNode)\n\t\tconst targetValue = values.find((value) => value.identifier === name)\n\t\tif (!targetValue) {\n\t\t\treturn ''\n\t\t}\n\t\tif (Array.isArray(targetValue.value)) {\n\t\t\treturn 'array'\n\t\t}\n\t\treturn targetValue.value || ''\n\t}\n\n\tconst intersectionTypeNode = node.asKind(SyntaxKind.IntersectionType)\n\tif (intersectionTypeNode) {\n\t\treturn (\n\t\t\tintersectionTypeNode\n\t\t\t\t.getTypeNodes()\n\t\t\t\t.flatMap((t) => getValidatorPropertyStringValue(t, name))\n\t\t\t\t.filter((v) => !!v && v !== 'unknown_25')[0] || 'unknown_27'\n\t\t)\n\t}\n\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\treturn getValidatorPropertyStringValue(typeLiteralNode.getFirstChildByKind(SyntaxKind.SyntaxList)!, name)\n\t}\n\n\tconst propertySignatureNode = node.asKind(SyntaxKind.PropertySignature)\n\tif (propertySignatureNode) {\n\t\tconst identifier = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tif (identifier.getText() === name) {\n\t\t\tconst targetNode = findPropertyAssignmentValueNode(propertySignatureNode).getFirstDescendantByKind(\n\t\t\t\tSyntaxKind.StringLiteral,\n\t\t\t)!\n\t\t\treturn targetNode.getLiteralText()\n\t\t}\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown property string value node ${node.getKindName()}`)\n\treturn 'unknown_25'\n}\n\nconst isPromise = (type: Type) => {\n\tconst symbol = type.getSymbol()\n\tif (!type.isObject() || !symbol) {\n\t\treturn false\n\t}\n\tconst args = type.getTypeArguments()\n\treturn symbol.getName() === 'Promise' && args.length === 1\n}\n\nexport const getProperTypeShape = (\n\ttypeOrPromise: Type,\n\tatLocation: Node,\n\tstack: Type[] = [],\n): ShapeOfType['shape'] => {\n\tconst typeName = typeOrPromise.getAliasSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst type = isPromise(typeOrPromise) ? typeOrPromise.getTypeArguments()[0] : typeOrPromise\n\n\tif (stack.some((previousType) => previousType === type)) {\n\t\treturn 'circular'\n\t}\n\n\tconst nextStack = stack.concat(type)\n\n\tif (type.getText() === 'void') {\n\t\treturn 'void'\n\t}\n\n\tif (type.isAny()) {\n\t\treturn 'any'\n\t}\n\n\tif (type.isNull()) {\n\t\treturn 'null'\n\t}\n\n\tif (type.isUndefined()) {\n\t\treturn 'undefined'\n\t}\n\n\tif (type.isBoolean() || type.isBooleanLiteral()) {\n\t\treturn 'boolean'\n\t}\n\n\tif (type.isStringLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_string' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isNumberLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_number' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isString() || type.isTemplateLiteral()) {\n\t\treturn 'string'\n\t}\n\n\tif (type.isNumber()) {\n\t\treturn 'number'\n\t}\n\n\tif (type.getText() === 'bigint') {\n\t\treturn 'bigint'\n\t}\n\n\tif (type.isTuple()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'tuple' as const,\n\t\t\t\tshape: type.getTupleElements().map((t) => ({\n\t\t\t\t\trole: 'tuple_entry' as const,\n\t\t\t\t\tshape: getProperTypeShape(t, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t})),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isArray()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: getProperTypeShape(type.getArrayElementType()!, atLocation, nextStack),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getText() === 'Buffer') {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'buffer' as const,\n\t\t\t\tshape: 'buffer',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getProperties().length === 0) {\n\t\tconst targetType = type.getAliasTypeArguments()[1]\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'record' as const,\n\t\t\t\tshape: getProperTypeShape(targetType, atLocation, nextStack),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject()) {\n\t\tif (type.getText() === 'Date') {\n\t\t\treturn 'Date'\n\t\t}\n\t\treturn type\n\t\t\t.getProperties()\n\t\t\t.map((prop) => {\n\t\t\t\tconst valueDeclaration = prop.getValueDeclaration() || prop.getDeclarations()[0]!\n\t\t\t\tif (!valueDeclaration) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst valueDeclarationNode =\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertySignature) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertyAssignment) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.ShorthandPropertyAssignment)\n\n\t\t\t\tif (!valueDeclarationNode) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst isOptional = prop.getTypeAtLocation(atLocation).isNullable()\n\n\t\t\t\tconst shape = getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack)\n\t\t\t\treturn {\n\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\tshape: shape,\n\t\t\t\t\toptional: isOptional,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((val) => val.shape !== 'undefined')\n\t}\n\n\tif (type.isUnion()) {\n\t\tconst unfilteredShapes: ShapeOfUnionEntry[] = type.getUnionTypes().map((type) => ({\n\t\t\trole: 'union_entry',\n\t\t\tshape: getProperTypeShape(type, atLocation, nextStack),\n\t\t\toptional: false,\n\t\t}))\n\n\t\tconst dedupedShapes = unfilteredShapes.filter(\n\t\t\t(type, index, arr) => !arr.find((dup, dupIndex) => dup.shape === type.shape && dupIndex > index),\n\t\t)\n\t\tconst isNullable = dedupedShapes.some((shape) => shape.shape === 'undefined')\n\t\tconst shapes = dedupedShapes.filter((shape) => shape.shape !== 'undefined')\n\t\tif (shapes.length === 1) {\n\t\t\treturn shapes[0].shape\n\t\t}\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'union',\n\t\t\t\tshape: shapes,\n\t\t\t\toptional: isNullable,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isIntersection()) {\n\t\tconst children = type.getIntersectionTypes()\n\t\tconst shapesOfChildren = children\n\t\t\t.map((child) => getProperTypeShape(child, atLocation, nextStack))\n\t\t\t.filter((shape) => typeof shape !== 'string') as ShapeOfProperty[][]\n\t\treturn shapesOfChildren.reduce<ShapeOfType[]>((total, current) => [...total, ...current], [])\n\t}\n\n\tconst fileName = atLocation.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown type shape node ${typeOrPromise.getText()}`)\n\treturn 'unknown_5'\n}\n\nconst getLiteralValueOfNode = (node: Node): string | string[] | unknown[] => {\n\tif (node.isKind(SyntaxKind.Identifier)) {\n\t\treturn getLiteralValueOfNode(findNodeImplementation(node))\n\t} else if (node.isKind(SyntaxKind.StringLiteral)) {\n\t\treturn node.getLiteralValue()\n\t} else if (node.isKind(SyntaxKind.ArrayLiteralExpression)) {\n\t\treturn node.forEachChildAsArray().map((child) => getLiteralValueOfNode(child)) as string[]\n\t} else if (node.isKind(SyntaxKind.PropertyAccessExpression)) {\n\t\treturn getLiteralValueOfNode(findPropertyAssignmentValueNode(node))\n\t} else if (node.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\treturn getValuesOfObjectLiteral(node)\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown literal value node ${node.getKindName()}`)\n\n\treturn 'unknown_6'\n}\n\nexport const getValuesOfObjectLiteral = (objectLiteralNode: Node<ts.ObjectLiteralExpression>) => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst targetNode = findNodeImplementation(assignmentValueNode)\n\t\tconst value = getLiteralValueOfNode(targetNode)\n\n\t\treturn {\n\t\t\tidentifier: identifierName,\n\t\t\tvalue,\n\t\t}\n\t})\n\n\treturn properties || []\n}\n"],"names":["implementationCache","findNodeImplementation","node","cached","SyntaxKind","implementationNode","assignmentValueNode","result","definitionNode","findPropertyAssignmentValueNode","identifierChildren","child","getTypeReferenceShape","firstChild","getRecursiveNodeShape","nodeOrReference","typeName","OpenApiManager","literalNode","typeLiteralNode","propNode","identifier","valueNode","questionMarkToken","typeReferenceNode","lastChild","getProperTypeShape","unionTypeNode","typeQueryNode","qualifiedNameNode","callExpressionNode","awaitExpressionNode","asExpressionNode","fileName","Logger","getShapeOfValidatorLiteral","objectLiteralNode","identifierNode","identifierName","innerLiteralNode","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","inlineValidatorAsExpression","typeReference","childTypeReferenceNode","typeNode","childCallExpressionNode","callExpressionArgument","thingyNode","parsePropertyAssignment","prop","returnType","importTypeNode","indexOfGreaterThanToken","targetSyntaxList","intersectionType","validatorType","syntaxListNode","literalExpression","name","targetChild","c","value","targetValue","getValuesOfObjectLiteral","intersectionTypeNode","t","v","propertySignatureNode","isPromise","type","symbol","args","typeOrPromise","atLocation","stack","previousType","nextStack","targetType","valueDeclaration","isOptional","shape","val","dedupedShapes","index","arr","dup","dupIndex","isNullable","shapes","total","current","getLiteralValueOfNode","targetNode"],"mappings":"2LAgBMA,MAA0B,QAEnBC,EAA0BC,GAAqB,CACrD,MAAAC,EAASH,EAAoB,IAAIE,CAAI,EAC3C,GAAIC,EACI,OAAAA,EAGR,GAAID,EAAK,YAAcE,EAAAA,WAAW,WAAY,CACvC,MAAAC,EAAqBH,EAAK,OAAOE,EAAW,WAAA,UAAU,EAAG,mBAAmB,EAAE,CAAC,GAAG,QAAQ,EAChG,GAAIC,EAAoB,CAEjB,MAAAC,EAD2BD,EAAmB,UAAU,EACT,aAAa,EAClE,GAAIC,IAAwBJ,EACrB,MAAA,IAAI,MAAM,gCAAgC,EAE3C,MAAAK,EAASN,EAAuBK,CAAmB,EACrC,OAAAN,EAAA,IAAIE,EAAMK,CAAM,EAC7BA,CAAA,CAGF,MAAAC,EAAiBN,EAAK,OAAOE,EAAW,WAAA,UAAU,EAAG,eAAe,EAAE,CAAC,GAAG,QAAQ,EACxF,GAAII,EAAgB,CAEb,MAAAF,EADuBE,EAAe,UAAU,EACL,aAAa,EAC9D,GAAIF,IAAwBJ,EACrB,MAAA,IAAI,MAAM,gCAAgC,EAE3C,MAAAK,EAASN,EAAuBK,CAAmB,EACrC,OAAAN,EAAA,IAAIE,EAAMK,CAAM,EAC7BA,CAAA,CAEF,MAAA,IAAI,MAAM,4CAA4C,CAAA,CAGzC,OAAAP,EAAA,IAAIE,EAAMA,CAAI,EAC3BA,CACR,EAEaO,EACZP,GAMU,CACV,MAAMQ,EAAqBR,EAAK,kBAAkBE,EAAAA,WAAW,UAAU,EACnE,OAAAM,EAAmB,SAAW,EAC1BT,EAAuBS,EAAmB,CAAC,CAAC,EAE1BR,EAAK,YAAY,EAAE,QAAQ,EAC5B,KACvBS,GACAA,EAAM,QAAA,IAAcP,EAAAA,WAAW,kBAC/BO,EAAM,YAAcP,EAAW,WAAA,YAC/B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zerModule/nodeParsers.ts"],"sourcesContent":["import {\n\tNode,\n\tPropertyAccessExpression,\n\tPropertyAssignment,\n\tPropertySignature,\n\tShorthandPropertyAssignment,\n\tSyntaxKind,\n\tts,\n\tType,\n\tTypeReferenceNode,\n} from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { OpenApiManager } from '../manager/OpenApiManager'\nimport { ShapeOfProperty, ShapeOfType, ShapeOfUnionEntry } from './types'\n\nconst implementationCache = new WeakMap<Node, Node>()\n\nexport const findNodeImplementation = (node: Node): Node => {\n\tconst cached = implementationCache.get(node)\n\tif (cached) {\n\t\treturn cached\n\t}\n\n\tif (node.getKind() === SyntaxKind.Identifier) {\n\t\tconst implementationNode = node.asKind(SyntaxKind.Identifier)!.getImplementations()[0]?.getNode()\n\t\tif (implementationNode) {\n\t\t\tconst implementationParentNode = implementationNode.getParent()!\n\t\t\tconst assignmentValueNode = implementationParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\n\t\tconst definitionNode = node.asKind(SyntaxKind.Identifier)!.getDefinitions()[0]?.getNode()\n\t\tif (definitionNode) {\n\t\t\tconst definitionParentNode = definitionNode.getParent()!\n\t\t\tconst assignmentValueNode = definitionParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\t\tthrow new Error('No implementation nor definition available')\n\t}\n\n\timplementationCache.set(node, node)\n\treturn node\n}\n\nexport const findPropertyAssignmentValueNode = (\n\tnode:\n\t\t| PropertyAssignment\n\t\t| TypeReferenceNode\n\t\t| PropertySignature\n\t\t| PropertyAccessExpression\n\t\t| ShorthandPropertyAssignment,\n): Node => {\n\tconst identifierChildren = node.getChildrenOfKind(SyntaxKind.Identifier)\n\tif (identifierChildren.length === 2) {\n\t\treturn findNodeImplementation(identifierChildren[1])\n\t}\n\tconst lastMatchingChild = node.getChildren().reverse()\n\treturn lastMatchingChild.find(\n\t\t(child) =>\n\t\t\tchild.getKind() !== SyntaxKind.GreaterThanToken &&\n\t\t\tchild.getKind() !== SyntaxKind.CommaToken &&\n\t\t\tchild.getKind() !== SyntaxKind.SemicolonToken,\n\t)!\n}\n\nexport const getTypeReferenceShape = (node: TypeReferenceNode): ShapeOfType['shape'] => {\n\tconst firstChild = node.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tif (firstChild.isKind(SyntaxKind.SyntaxList)) {\n\t\treturn getRecursiveNodeShape(firstChild.getFirstChild()!)\n\t} else {\n\t\treturn getRecursiveNodeShape(firstChild)\n\t}\n}\n\nexport const getRecursiveNodeShape = (nodeOrReference: Node): ShapeOfType['shape'] => {\n\tconst typeName = nodeOrReference.getSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\t// Undefined\n\tconst undefinedNode = node.asKind(SyntaxKind.UndefinedKeyword)\n\tif (undefinedNode) {\n\t\treturn 'undefined'\n\t}\n\n\t// Literal type\n\tconst literalNode = node.asKind(SyntaxKind.LiteralType)\n\tif (literalNode) {\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.TrueKeyword)) {\n\t\t\treturn 'true'\n\t\t}\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.FalseKeyword)) {\n\t\t\treturn 'false'\n\t\t}\n\t}\n\n\t// Boolean literal\n\tconst booleanLiteralNode =\n\t\tnode.asKind(SyntaxKind.BooleanKeyword) ||\n\t\tnode.asKind(SyntaxKind.TrueKeyword) ||\n\t\tnode.asKind(SyntaxKind.FalseKeyword)\n\tif (booleanLiteralNode) {\n\t\treturn 'boolean'\n\t}\n\n\t// String literal\n\tconst stringLiteralNode = node.asKind(SyntaxKind.StringKeyword) || node.asKind(SyntaxKind.StringLiteral)\n\tif (stringLiteralNode) {\n\t\treturn 'string'\n\t}\n\n\t// Number literal\n\tconst numberLiteralNode = node.asKind(SyntaxKind.NumberKeyword) || node.asKind(SyntaxKind.NumericLiteral)\n\tif (numberLiteralNode) {\n\t\treturn 'number'\n\t}\n\n\t// BigInt literal\n\tconst bigIntNode = node.asKind(SyntaxKind.BigIntKeyword) || node.asKind(SyntaxKind.BigIntLiteral)\n\tif (bigIntNode) {\n\t\treturn 'bigint'\n\t}\n\n\t// Type literal\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\tconst properties = typeLiteralNode\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getChildrenOfKind(SyntaxKind.PropertySignature)\n\n\t\tconst propertyShapes = properties.map((propNode) => {\n\t\t\tconst identifier = propNode.getFirstChildByKind(SyntaxKind.Identifier)!\n\t\t\tconst valueNode = findPropertyAssignmentValueNode(propNode)\n\t\t\tconst questionMarkToken = identifier.getNextSiblingIfKind(SyntaxKind.QuestionToken)\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier: identifier.getText(),\n\t\t\t\tshape: getRecursiveNodeShape(valueNode),\n\t\t\t\toptional: valueNode.getType().isNullable() || !!questionMarkToken,\n\t\t\t}\n\t\t})\n\t\treturn propertyShapes\n\t}\n\n\t// Type reference\n\tconst typeReferenceNode = node.asKind(SyntaxKind.TypeReference)\n\tif (typeReferenceNode) {\n\t\treturn getRecursiveNodeShape(typeReferenceNode.getFirstChild()!)\n\t}\n\n\t// Property access expression\n\tconst propertyAccessNode = node.asKind(SyntaxKind.PropertyAccessExpression)\n\tif (propertyAccessNode) {\n\t\tconst lastChild = findNodeImplementation(node.getLastChild()!)\n\t\treturn getProperTypeShape(lastChild.asKind(SyntaxKind.CallExpression)!.getReturnType(), lastChild)\n\t}\n\n\t// Union type\n\tconst unionTypeNode = node.asKind(SyntaxKind.UnionType)\n\tif (unionTypeNode) {\n\t\treturn getProperTypeShape(unionTypeNode.getType(), node)\n\t}\n\n\t// Typeof query\n\tconst typeQueryNode = node.asKind(SyntaxKind.TypeQuery)\n\tif (typeQueryNode) {\n\t\treturn getRecursiveNodeShape(typeQueryNode.getLastChild()!)\n\t}\n\n\t// Qualified name\n\tconst qualifiedNameNode = node.asKind(SyntaxKind.QualifiedName)\n\tif (qualifiedNameNode) {\n\t\treturn getRecursiveNodeShape(qualifiedNameNode.getLastChild()!)\n\t}\n\n\t// Call expression\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\treturn getProperTypeShape(callExpressionNode.getReturnType(), callExpressionNode)\n\t}\n\n\t// Await expression\n\tconst awaitExpressionNode = node.asKind(SyntaxKind.AwaitExpression)\n\tif (awaitExpressionNode) {\n\t\treturn getRecursiveNodeShape(awaitExpressionNode.getChildAtIndex(1)!)\n\t}\n\n\t// 'As' Expression\n\tconst asExpressionNode = node.asKind(SyntaxKind.AsExpression)\n\tif (asExpressionNode) {\n\t\treturn getRecursiveNodeShape(asExpressionNode.getChildAtIndex(2)!)\n\t}\n\n\t// TODO\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown node type: ${node.getKindName()}`)\n\treturn 'unknown_1'\n}\n\nexport const getShapeOfValidatorLiteral = (\n\tobjectLiteralNode: Node<ts.ObjectLiteralExpression>,\n): (ShapeOfProperty & { description: string; errorMessage: string })[] => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstChild()!\n\t\tconst identifierName = (() => {\n\t\t\tif (identifierNode.isKind(SyntaxKind.Identifier)) {\n\t\t\t\treturn identifierNode.getText()\n\t\t\t}\n\t\t\tif (identifierNode.isKind(SyntaxKind.StringLiteral)) {\n\t\t\t\treturn identifierNode.getLiteralText()\n\t\t\t}\n\t\t\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\t\t\tLogger.warn(`[${fileName}] Unknown identifier name: ${identifierNode.getText()}`)\n\t\t\treturn 'unknown_30'\n\t\t})()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst innerLiteralNode = findNodeImplementation(assignmentValueNode)\n\n\t\treturn {\n\t\t\trole: 'property' as const,\n\t\t\tidentifier: identifierName,\n\t\t\tshape: getValidatorPropertyShape(innerLiteralNode),\n\t\t\toptional: getValidatorPropertyOptionality(innerLiteralNode),\n\t\t\tdescription: getValidatorPropertyStringValue(innerLiteralNode, 'description'),\n\t\t\terrorMessage: getValidatorPropertyStringValue(innerLiteralNode, 'errorMessage'),\n\t\t}\n\t})\n\n\treturn properties || []\n}\n\nconst isZodCallExpression = (node: Node): boolean => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)\n\tif (!callExpression) {\n\t\treturn false\n\t}\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\treturn typeName.startsWith('Zod')\n}\n\nconst getZodCallShape = (node: Node): ShapeOfType['shape'] => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)!\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\n\tif (typeName === 'ZodNumber') {\n\t\treturn 'number'\n\t}\n\tif (typeName === 'ZodString') {\n\t\treturn 'string'\n\t}\n\tif (typeName === 'ZodBoolean') {\n\t\treturn 'boolean'\n\t}\n\tif (typeName === 'ZodBigInt') {\n\t\treturn 'bigint'\n\t}\n\n\tif (typeName === 'ZodObject') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tconst objectLiteral = argNode?.asKind(SyntaxKind.ObjectLiteralExpression)\n\t\tif (!objectLiteral) {\n\t\t\treturn 'unknown_zod_object'\n\t\t}\n\t\tconst syntaxList = objectLiteral.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\tif (!syntaxList) {\n\t\t\treturn []\n\t\t}\n\t\tconst properties = syntaxList.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\t\treturn properties.map((prop) => {\n\t\t\tconst identifier = prop.getFirstChildByKind(SyntaxKind.Identifier)!.getText()\n\t\t\tconst valueNode = prop.getLastChild()!\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier,\n\t\t\t\tshape: isZodCallExpression(valueNode)\n\t\t\t\t\t? getZodCallShape(valueNode)\n\t\t\t\t\t: getValidatorPropertyShape(valueNode),\n\t\t\t\toptional: false,\n\t\t\t}\n\t\t})\n\t}\n\n\tif (typeName === 'ZodArray') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tif (!argNode) {\n\t\t\treturn 'unknown_zod_array'\n\t\t}\n\t\tconst elementShape = isZodCallExpression(argNode)\n\t\t\t? getZodCallShape(argNode)\n\t\t\t: getValidatorPropertyShape(argNode)\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: elementShape,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown zod type: ${typeName}`)\n\treturn 'unknown_zod'\n}\n\nexport const getValidatorPropertyShape = (innerLiteralNode: Node): ShapeOfType['shape'] => {\n\t// Zod validator (e.g. z.number(), z.string(), z.object({...}), z.array(...))\n\tif (isZodCallExpression(innerLiteralNode)) {\n\t\treturn getZodCallShape(innerLiteralNode)\n\t}\n\n\t// Inline definition with `as Validator<...>` clause\n\tconst inlineValidatorAsExpression = innerLiteralNode\n\t\t.getParent()!\n\t\t.getFirstChildByKind(SyntaxKind.AsExpression)\n\tif (inlineValidatorAsExpression) {\n\t\tconst typeReference = inlineValidatorAsExpression.getLastChildByKind(SyntaxKind.TypeReference)!\n\t\treturn getTypeReferenceShape(typeReference)\n\t}\n\n\t// Variable with `: Validator<...>` clause\n\tconst childTypeReferenceNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.TypeReference)\n\tif (childTypeReferenceNode) {\n\t\treturn getTypeReferenceShape(childTypeReferenceNode)\n\t}\n\n\t// `RequiredParam<...>` inline call expression\n\tif (innerLiteralNode.getParent()!.getChildrenOfKind(SyntaxKind.SyntaxList).length >= 2) {\n\t\tconst typeNode = innerLiteralNode\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getFirstChild()!\n\t\treturn getRecursiveNodeShape(typeNode)\n\t}\n\n\t// `RequestParam | RequiredParam | OptionalParam` call expression\n\tconst childCallExpressionNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.CallExpression)\n\tif (childCallExpressionNode) {\n\t\tconst callExpressionArgument = findNodeImplementation(\n\t\t\tchildCallExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!.getFirstChild()!,\n\t\t)\n\n\t\t// Param is a type reference\n\t\tconst typeReferenceNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.TypeReference)!\n\t\tif (typeReferenceNode) {\n\t\t\treturn getProperTypeShape(typeReferenceNode.getType(), typeReferenceNode, [])\n\t\t}\n\n\t\tconst thingyNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.ObjectLiteralExpression)!\n\t\tif (thingyNode) {\n\t\t\treturn getValidatorPropertyShape(thingyNode)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.CallExpression) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.IntersectionType) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\t\tLogger.warn(`[${fileName}] Unknown call expression argument: ${callExpressionArgument.getKindName()}`)\n\t\treturn 'unknown_3'\n\t}\n\n\t// Attempting to infer type from `parse` function\n\tconst innerNodePropertyAssignments = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\tconst parsePropertyAssignment = innerNodePropertyAssignments.find((prop) => {\n\t\treturn prop.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'parse'\n\t})\n\tif (parsePropertyAssignment) {\n\t\tconst returnType = findPropertyAssignmentValueNode(parsePropertyAssignment)\n\t\t\t.asKind(SyntaxKind.ArrowFunction)!\n\t\t\t.getReturnType()\n\t\treturn getProperTypeShape(returnType, parsePropertyAssignment)\n\t}\n\n\t// Import statement\n\tconst importTypeNode = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\t?.getFirstChildByKind(SyntaxKind.ImportType)\n\tif (importTypeNode) {\n\t\tconst indexOfGreaterThanToken = importTypeNode\n\t\t\t.getLastChildByKind(SyntaxKind.GreaterThanToken)!\n\t\t\t.getChildIndex()\n\t\tconst targetSyntaxList = importTypeNode.getChildAtIndex(indexOfGreaterThanToken - 1)\n\t\treturn getRecursiveNodeShape(targetSyntaxList.getFirstChild()!)\n\t}\n\n\t// Intersection type with Validator\n\tconst intersectionType = innerLiteralNode.isKind(SyntaxKind.IntersectionType)\n\t\t? innerLiteralNode\n\t\t: innerLiteralNode.getParent()?.isKind(SyntaxKind.VariableDeclaration)\n\t\t\t? innerLiteralNode.getParent()?.getFirstChildByKind(SyntaxKind.IntersectionType)\n\t\t\t: null\n\n\tif (intersectionType) {\n\t\tconst validatorType = intersectionType.getFirstChildByKind(SyntaxKind.TypeReference)\n\t\tif (validatorType) {\n\t\t\treturn getTypeReferenceShape(validatorType)\n\t\t}\n\t}\n\n\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown import type node`)\n\n\treturn 'unknown_2'\n}\n\nexport const getValidatorPropertyOptionality = (node: Node): boolean => {\n\tif (isZodCallExpression(node)) {\n\t\treturn false\n\t}\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst identifierNode = callExpressionNode.getFirstChildByKind(SyntaxKind.Identifier)\n\t\tif (identifierNode?.getText() === 'OptionalParam') {\n\t\t\treturn true\n\t\t} else if (identifierNode?.getText() === 'RequiredParam') {\n\t\t\treturn false\n\t\t}\n\n\t\tconst syntaxListNode = callExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\tconst literalExpression = findNodeImplementation(syntaxListNode.getFirstChild()!)\n\t\treturn getValidatorPropertyOptionality(literalExpression)\n\t}\n\n\tconst syntaxListNode = node.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\treturn assignmentNodes.some((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tif (identifierName === 'optional') {\n\t\t\tconst value = findPropertyAssignmentValueNode(node)\n\t\t\treturn value.getKind() === SyntaxKind.TrueKeyword\n\t\t}\n\t\treturn false\n\t})\n}\n\nexport const getValidatorPropertyStringValue = (\n\tnodeOrReference: Node,\n\tname: 'description' | 'errorMessage',\n): string => {\n\tif (isZodCallExpression(nodeOrReference)) {\n\t\treturn ''\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst targetChild = callExpressionNode.getLastChildByKind(SyntaxKind.SyntaxList)!\n\t\treturn getValidatorPropertyStringValue(targetChild, name)\n\t}\n\n\tconst syntaxListNode = node.asKind(SyntaxKind.SyntaxList)\n\tif (syntaxListNode) {\n\t\tconst children = syntaxListNode.getChildren().map((c) => getValidatorPropertyStringValue(c, name))\n\t\treturn children.find((value) => !!value && value !== 'unknown_25') || ''\n\t}\n\n\tconst objectLiteralNode = node.asKind(SyntaxKind.ObjectLiteralExpression)\n\tif (objectLiteralNode) {\n\t\tconst values = getValuesOfObjectLiteral(objectLiteralNode)\n\t\tconst targetValue = values.find((value) => value.identifier === name)\n\t\tif (!targetValue) {\n\t\t\treturn ''\n\t\t}\n\t\tif (Array.isArray(targetValue.value)) {\n\t\t\treturn 'array'\n\t\t}\n\t\treturn targetValue.value || ''\n\t}\n\n\tconst intersectionTypeNode = node.asKind(SyntaxKind.IntersectionType)\n\tif (intersectionTypeNode) {\n\t\treturn (\n\t\t\tintersectionTypeNode\n\t\t\t\t.getTypeNodes()\n\t\t\t\t.flatMap((t) => getValidatorPropertyStringValue(t, name))\n\t\t\t\t.filter((v) => !!v && v !== 'unknown_25')[0] || 'unknown_27'\n\t\t)\n\t}\n\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\treturn getValidatorPropertyStringValue(typeLiteralNode.getFirstChildByKind(SyntaxKind.SyntaxList)!, name)\n\t}\n\n\tconst propertySignatureNode = node.asKind(SyntaxKind.PropertySignature)\n\tif (propertySignatureNode) {\n\t\tconst identifier = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tif (identifier.getText() === name) {\n\t\t\tconst targetNode = findPropertyAssignmentValueNode(propertySignatureNode).getFirstDescendantByKind(\n\t\t\t\tSyntaxKind.StringLiteral,\n\t\t\t)!\n\t\t\treturn targetNode.getLiteralText()\n\t\t}\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown property string value node ${node.getKindName()}`)\n\treturn 'unknown_25'\n}\n\nconst isPromise = (type: Type) => {\n\tconst symbol = type.getSymbol()\n\tif (!type.isObject() || !symbol) {\n\t\treturn false\n\t}\n\tconst args = type.getTypeArguments()\n\treturn symbol.getName() === 'Promise' && args.length === 1\n}\n\nexport const getProperTypeShape = (\n\ttypeOrPromise: Type,\n\tatLocation: Node,\n\tstack: Type[] = [],\n): ShapeOfType['shape'] => {\n\tconst typeName = typeOrPromise.getAliasSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst type = isPromise(typeOrPromise) ? typeOrPromise.getTypeArguments()[0] : typeOrPromise\n\n\tif (stack.some((previousType) => previousType === type)) {\n\t\treturn 'circular'\n\t}\n\n\tconst nextStack = stack.concat(type)\n\n\tif (type.getText() === 'void') {\n\t\treturn 'void'\n\t}\n\n\tif (type.isAny()) {\n\t\treturn 'any'\n\t}\n\n\tif (type.isNull()) {\n\t\treturn 'null'\n\t}\n\n\tif (type.isUndefined()) {\n\t\treturn 'undefined'\n\t}\n\n\tif (type.isBoolean() || type.isBooleanLiteral()) {\n\t\treturn 'boolean'\n\t}\n\n\tif (type.isStringLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_string' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isNumberLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_number' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isString() || type.isTemplateLiteral()) {\n\t\treturn 'string'\n\t}\n\n\tif (type.isNumber()) {\n\t\treturn 'number'\n\t}\n\n\tif (type.getText() === 'bigint') {\n\t\treturn 'bigint'\n\t}\n\n\tif (type.isTuple()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'tuple' as const,\n\t\t\t\tshape: type.getTupleElements().map((t) => ({\n\t\t\t\t\trole: 'tuple_entry' as const,\n\t\t\t\t\tshape: getProperTypeShape(t, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t})),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isArray()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: getProperTypeShape(type.getArrayElementType()!, atLocation, nextStack),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getText() === 'Buffer') {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'buffer' as const,\n\t\t\t\tshape: 'buffer',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getProperties().length === 0) {\n\t\tconst targetType = type.getAliasTypeArguments()[1] ?? type.getStringIndexType()\n\t\tif (targetType) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\trole: 'record' as const,\n\t\t\t\t\tshape: getProperTypeShape(targetType, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t}\n\n\tif (type.isObject()) {\n\t\tif (type.getText() === 'Date') {\n\t\t\treturn 'Date'\n\t\t}\n\t\treturn type\n\t\t\t.getProperties()\n\t\t\t.map((prop) => {\n\t\t\t\tconst valueDeclaration = prop.getValueDeclaration() || prop.getDeclarations()[0]!\n\t\t\t\tif (!valueDeclaration) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst valueDeclarationNode =\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertySignature) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertyAssignment) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.ShorthandPropertyAssignment)\n\n\t\t\t\tif (!valueDeclarationNode) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst isOptional = prop.getTypeAtLocation(atLocation).isNullable()\n\n\t\t\t\tconst shape = getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack)\n\t\t\t\treturn {\n\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\tshape: shape,\n\t\t\t\t\toptional: isOptional,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((val) => val.shape !== 'undefined')\n\t}\n\n\tif (type.isUnion()) {\n\t\tconst unfilteredShapes: ShapeOfUnionEntry[] = type.getUnionTypes().map((type) => ({\n\t\t\trole: 'union_entry',\n\t\t\tshape: getProperTypeShape(type, atLocation, nextStack),\n\t\t\toptional: false,\n\t\t}))\n\n\t\tconst dedupedShapes = unfilteredShapes.filter(\n\t\t\t(type, index, arr) => !arr.find((dup, dupIndex) => dup.shape === type.shape && dupIndex > index),\n\t\t)\n\t\tconst isNullable = dedupedShapes.some((shape) => shape.shape === 'undefined')\n\t\tconst shapes = dedupedShapes.filter((shape) => shape.shape !== 'undefined')\n\t\tif (shapes.length === 1) {\n\t\t\treturn shapes[0].shape\n\t\t}\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'union',\n\t\t\t\tshape: shapes,\n\t\t\t\toptional: isNullable,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isIntersection()) {\n\t\tconst children = type.getIntersectionTypes()\n\t\tconst shapesOfChildren = children\n\t\t\t.map((child) => getProperTypeShape(child, atLocation, nextStack))\n\t\t\t.filter((shape) => typeof shape !== 'string') as ShapeOfProperty[][]\n\t\treturn shapesOfChildren.reduce<ShapeOfType[]>((total, current) => [...total, ...current], [])\n\t}\n\n\tconst fileName = atLocation.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown type shape node ${typeOrPromise.getText()}`)\n\treturn 'unknown_5'\n}\n\nconst getLiteralValueOfNode = (node: Node): string | string[] | unknown[] => {\n\tif (node.isKind(SyntaxKind.Identifier)) {\n\t\treturn getLiteralValueOfNode(findNodeImplementation(node))\n\t} else if (node.isKind(SyntaxKind.StringLiteral)) {\n\t\treturn node.getLiteralValue()\n\t} else if (node.isKind(SyntaxKind.ArrayLiteralExpression)) {\n\t\treturn node.forEachChildAsArray().map((child) => getLiteralValueOfNode(child)) as string[]\n\t} else if (node.isKind(SyntaxKind.PropertyAccessExpression)) {\n\t\treturn getLiteralValueOfNode(findPropertyAssignmentValueNode(node))\n\t} else if (node.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\treturn getValuesOfObjectLiteral(node)\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown literal value node ${node.getKindName()}`)\n\n\treturn 'unknown_6'\n}\n\nexport const resolveEndpointPath = (node: Node): string | null => {\n\tconst callExpression = node.getFirstDescendantByKind(SyntaxKind.CallExpression)\n\tif (!callExpression) return null\n\n\tconst firstArg = callExpression.getArguments()[0]\n\tif (!firstArg) return null\n\n\tconst argType = firstArg.getType()\n\tif (argType.isStringLiteral()) {\n\t\treturn argType.getLiteralValue() as string\n\t}\n\n\treturn null\n}\n\nexport const getValuesOfObjectLiteral = (objectLiteralNode: Node<ts.ObjectLiteralExpression>) => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst targetNode = findNodeImplementation(assignmentValueNode)\n\t\tconst value = getLiteralValueOfNode(targetNode)\n\n\t\treturn {\n\t\t\tidentifier: identifierName,\n\t\t\tvalue,\n\t\t}\n\t})\n\n\treturn properties || []\n}\n"],"names":["implementationCache","findNodeImplementation","node","cached","SyntaxKind","implementationNode","assignmentValueNode","result","definitionNode","findPropertyAssignmentValueNode","identifierChildren","child","getTypeReferenceShape","firstChild","getRecursiveNodeShape","nodeOrReference","typeName","OpenApiManager","literalNode","typeLiteralNode","propNode","identifier","valueNode","questionMarkToken","typeReferenceNode","lastChild","getProperTypeShape","unionTypeNode","typeQueryNode","qualifiedNameNode","callExpressionNode","awaitExpressionNode","asExpressionNode","fileName","Logger","getShapeOfValidatorLiteral","objectLiteralNode","identifierNode","identifierName","innerLiteralNode","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","isZodCallExpression","callExpression","getZodCallShape","objectLiteral","syntaxList","prop","argNode","inlineValidatorAsExpression","typeReference","childTypeReferenceNode","typeNode","childCallExpressionNode","callExpressionArgument","thingyNode","parsePropertyAssignment","returnType","importTypeNode","indexOfGreaterThanToken","targetSyntaxList","intersectionType","validatorType","syntaxListNode","literalExpression","name","targetChild","c","value","targetValue","getValuesOfObjectLiteral","intersectionTypeNode","t","v","propertySignatureNode","isPromise","type","symbol","args","typeOrPromise","atLocation","stack","previousType","nextStack","targetType","valueDeclaration","isOptional","shape","val","dedupedShapes","index","arr","dup","dupIndex","isNullable","shapes","total","current","getLiteralValueOfNode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EAAWzD,EAAe,aAAa,EAAE,CAAC,EAC5C,GAAA,CAACyD,EAAiB,OAAA,KAEhB,MAAAC,EAAUD,EAAS,QAAQ,EAC7B,OAAAC,EAAQ,kBACJA,EAAQ,gBAAgB,EAGzB,IACR,EAEa/B,EAA4BnC,GACjBA,EAAkB,yBAAyBhC,EAAAA,WAAW,UAAU,EAChD,kBAAkBA,EAAAA,WAAW,kBAAkB,EAEnD,IAAKF,GAAS,CAE1C,MAAAoC,EADiBpC,EAAK,yBAAyBE,EAAAA,WAAW,UAAU,EACpC,QAAQ,EAExCE,EAAsBJ,EAAK,aAAa,EACxCqG,EAAatG,EAAuBK,CAAmB,EACvD+D,EAAQ8B,EAAsBI,CAAU,EAEvC,MAAA,CACN,WAAYjE,EACZ,MAAA+B,CACD,CAAA,CACA,GAEoB,CAAC"}
@@ -13,6 +13,7 @@ export declare const getValidatorPropertyShape: (innerLiteralNode: Node) => Shap
13
13
  export declare const getValidatorPropertyOptionality: (node: Node) => boolean;
14
14
  export declare const getValidatorPropertyStringValue: (nodeOrReference: Node, name: "description" | "errorMessage") => string;
15
15
  export declare const getProperTypeShape: (typeOrPromise: Type, atLocation: Node, stack?: Type[]) => ShapeOfType["shape"];
16
+ export declare const resolveEndpointPath: (node: Node) => string | null;
16
17
  export declare const getValuesOfObjectLiteral: (objectLiteralNode: Node<ts.ObjectLiteralExpression>) => {
17
18
  identifier: string;
18
19
  value: string | string[] | unknown[];
@@ -1 +1 @@
1
- {"version":3,"file":"nodeParsers.d.ts","sourceRoot":"","sources":["../../../src/openapi/analyzerModule/nodeParsers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,IAAI,EACJ,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAE3B,EAAE,EACF,IAAI,EACJ,iBAAiB,EACjB,MAAM,UAAU,CAAA;AAIjB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAqB,MAAM,SAAS,CAAA;AAIzE,eAAO,MAAM,sBAAsB,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