vona-module-a-swagger 5.0.2

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 (458) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +2 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/common/index.d.ts +2 -0
  7. package/dist/lib/common/index.d.ts.map +1 -0
  8. package/dist/lib/common/index.js +2 -0
  9. package/dist/lib/common/index.js.map +1 -0
  10. package/dist/lib/common/type.interface.d.ts +4 -0
  11. package/dist/lib/common/type.interface.d.ts.map +1 -0
  12. package/dist/lib/common/type.interface.js +2 -0
  13. package/dist/lib/common/type.interface.js.map +1 -0
  14. package/dist/lib/constants.d.ts +22 -0
  15. package/dist/lib/constants.d.ts.map +1 -0
  16. package/dist/lib/constants.js +22 -0
  17. package/dist/lib/constants.js.map +1 -0
  18. package/dist/lib/decorators/api-basic.decorator.d.ts +2 -0
  19. package/dist/lib/decorators/api-basic.decorator.d.ts.map +1 -0
  20. package/dist/lib/decorators/api-basic.decorator.js +5 -0
  21. package/dist/lib/decorators/api-basic.decorator.js.map +1 -0
  22. package/dist/lib/decorators/api-bearer.decorator.d.ts +2 -0
  23. package/dist/lib/decorators/api-bearer.decorator.d.ts.map +1 -0
  24. package/dist/lib/decorators/api-bearer.decorator.js +5 -0
  25. package/dist/lib/decorators/api-bearer.decorator.js.map +1 -0
  26. package/dist/lib/decorators/api-body.decorator.d.ts +17 -0
  27. package/dist/lib/decorators/api-body.decorator.d.ts.map +1 -0
  28. package/dist/lib/decorators/api-body.decorator.js +24 -0
  29. package/dist/lib/decorators/api-body.decorator.js.map +1 -0
  30. package/dist/lib/decorators/api-callbacks.decorator.d.ts +3 -0
  31. package/dist/lib/decorators/api-callbacks.decorator.d.ts.map +1 -0
  32. package/dist/lib/decorators/api-callbacks.decorator.js +6 -0
  33. package/dist/lib/decorators/api-callbacks.decorator.js.map +1 -0
  34. package/dist/lib/decorators/api-consumes.decorator.d.ts +2 -0
  35. package/dist/lib/decorators/api-consumes.decorator.d.ts.map +1 -0
  36. package/dist/lib/decorators/api-consumes.decorator.js +6 -0
  37. package/dist/lib/decorators/api-consumes.decorator.js.map +1 -0
  38. package/dist/lib/decorators/api-cookie.decorator.d.ts +2 -0
  39. package/dist/lib/decorators/api-cookie.decorator.d.ts.map +1 -0
  40. package/dist/lib/decorators/api-cookie.decorator.js +5 -0
  41. package/dist/lib/decorators/api-cookie.decorator.js.map +1 -0
  42. package/dist/lib/decorators/api-default-getter.decorator.d.ts +25 -0
  43. package/dist/lib/decorators/api-default-getter.decorator.d.ts.map +1 -0
  44. package/dist/lib/decorators/api-default-getter.decorator.js +32 -0
  45. package/dist/lib/decorators/api-default-getter.decorator.js.map +1 -0
  46. package/dist/lib/decorators/api-exclude-controller.decorator.d.ts +2 -0
  47. package/dist/lib/decorators/api-exclude-controller.decorator.d.ts.map +1 -0
  48. package/dist/lib/decorators/api-exclude-controller.decorator.js +6 -0
  49. package/dist/lib/decorators/api-exclude-controller.decorator.js.map +1 -0
  50. package/dist/lib/decorators/api-exclude-endpoint.decorator.d.ts +2 -0
  51. package/dist/lib/decorators/api-exclude-endpoint.decorator.d.ts.map +1 -0
  52. package/dist/lib/decorators/api-exclude-endpoint.decorator.js +8 -0
  53. package/dist/lib/decorators/api-exclude-endpoint.decorator.js.map +1 -0
  54. package/dist/lib/decorators/api-extension.decorator.d.ts +2 -0
  55. package/dist/lib/decorators/api-extension.decorator.d.ts.map +1 -0
  56. package/dist/lib/decorators/api-extension.decorator.js +13 -0
  57. package/dist/lib/decorators/api-extension.decorator.js.map +1 -0
  58. package/dist/lib/decorators/api-extra-models.decorator.d.ts +2 -0
  59. package/dist/lib/decorators/api-extra-models.decorator.d.ts.map +1 -0
  60. package/dist/lib/decorators/api-extra-models.decorator.js +14 -0
  61. package/dist/lib/decorators/api-extra-models.decorator.js.map +1 -0
  62. package/dist/lib/decorators/api-header.decorator.d.ts +8 -0
  63. package/dist/lib/decorators/api-header.decorator.d.ts.map +1 -0
  64. package/dist/lib/decorators/api-header.decorator.js +40 -0
  65. package/dist/lib/decorators/api-header.decorator.js.map +1 -0
  66. package/dist/lib/decorators/api-hide-property.decorator.d.ts +2 -0
  67. package/dist/lib/decorators/api-hide-property.decorator.d.ts.map +1 -0
  68. package/dist/lib/decorators/api-hide-property.decorator.js +5 -0
  69. package/dist/lib/decorators/api-hide-property.decorator.js.map +1 -0
  70. package/dist/lib/decorators/api-link.decorator.d.ts +48 -0
  71. package/dist/lib/decorators/api-link.decorator.d.ts.map +1 -0
  72. package/dist/lib/decorators/api-link.decorator.js +50 -0
  73. package/dist/lib/decorators/api-link.decorator.js.map +1 -0
  74. package/dist/lib/decorators/api-oauth2.decorator.d.ts +2 -0
  75. package/dist/lib/decorators/api-oauth2.decorator.d.ts.map +1 -0
  76. package/dist/lib/decorators/api-oauth2.decorator.js +5 -0
  77. package/dist/lib/decorators/api-oauth2.decorator.js.map +1 -0
  78. package/dist/lib/decorators/api-operation.decorator.d.ts +6 -0
  79. package/dist/lib/decorators/api-operation.decorator.d.ts.map +1 -0
  80. package/dist/lib/decorators/api-operation.decorator.js +13 -0
  81. package/dist/lib/decorators/api-operation.decorator.js.map +1 -0
  82. package/dist/lib/decorators/api-param.decorator.d.ts +23 -0
  83. package/dist/lib/decorators/api-param.decorator.d.ts.map +1 -0
  84. package/dist/lib/decorators/api-param.decorator.js +19 -0
  85. package/dist/lib/decorators/api-param.decorator.js.map +1 -0
  86. package/dist/lib/decorators/api-produces.decorator.d.ts +2 -0
  87. package/dist/lib/decorators/api-produces.decorator.d.ts.map +1 -0
  88. package/dist/lib/decorators/api-produces.decorator.js +6 -0
  89. package/dist/lib/decorators/api-produces.decorator.js.map +1 -0
  90. package/dist/lib/decorators/api-property.decorator.d.ts +25 -0
  91. package/dist/lib/decorators/api-property.decorator.d.ts.map +1 -0
  92. package/dist/lib/decorators/api-property.decorator.js +53 -0
  93. package/dist/lib/decorators/api-property.decorator.js.map +1 -0
  94. package/dist/lib/decorators/api-query.decorator.d.ts +25 -0
  95. package/dist/lib/decorators/api-query.decorator.d.ts.map +1 -0
  96. package/dist/lib/decorators/api-query.decorator.js +28 -0
  97. package/dist/lib/decorators/api-query.decorator.js.map +1 -0
  98. package/dist/lib/decorators/api-response.decorator.d.ts +40 -0
  99. package/dist/lib/decorators/api-response.decorator.d.ts.map +1 -0
  100. package/dist/lib/decorators/api-response.decorator.js +63 -0
  101. package/dist/lib/decorators/api-response.decorator.js.map +1 -0
  102. package/dist/lib/decorators/api-schema.decorator.d.ts +9 -0
  103. package/dist/lib/decorators/api-schema.decorator.d.ts.map +1 -0
  104. package/dist/lib/decorators/api-schema.decorator.js +6 -0
  105. package/dist/lib/decorators/api-schema.decorator.js.map +1 -0
  106. package/dist/lib/decorators/api-security.decorator.d.ts +3 -0
  107. package/dist/lib/decorators/api-security.decorator.d.ts.map +1 -0
  108. package/dist/lib/decorators/api-security.decorator.js +23 -0
  109. package/dist/lib/decorators/api-security.decorator.js.map +1 -0
  110. package/dist/lib/decorators/api-use-tags.decorator.d.ts +2 -0
  111. package/dist/lib/decorators/api-use-tags.decorator.d.ts.map +1 -0
  112. package/dist/lib/decorators/api-use-tags.decorator.js +6 -0
  113. package/dist/lib/decorators/api-use-tags.decorator.js.map +1 -0
  114. package/dist/lib/decorators/helpers.d.ts +9 -0
  115. package/dist/lib/decorators/helpers.d.ts.map +1 -0
  116. package/dist/lib/decorators/helpers.js +120 -0
  117. package/dist/lib/decorators/helpers.js.map +1 -0
  118. package/dist/lib/decorators/index.d.ts +25 -0
  119. package/dist/lib/decorators/index.d.ts.map +1 -0
  120. package/dist/lib/decorators/index.js +25 -0
  121. package/dist/lib/decorators/index.js.map +1 -0
  122. package/dist/lib/document-builder.d.ts +28 -0
  123. package/dist/lib/document-builder.d.ts.map +1 -0
  124. package/dist/lib/document-builder.js +167 -0
  125. package/dist/lib/document-builder.js.map +1 -0
  126. package/dist/lib/explorers/api-callbacks.explorer.d.ts +3 -0
  127. package/dist/lib/explorers/api-callbacks.explorer.d.ts.map +1 -0
  128. package/dist/lib/explorers/api-callbacks.explorer.js +35 -0
  129. package/dist/lib/explorers/api-callbacks.explorer.js.map +1 -0
  130. package/dist/lib/explorers/api-consumes.explorer.d.ts +6 -0
  131. package/dist/lib/explorers/api-consumes.explorer.d.ts.map +1 -0
  132. package/dist/lib/explorers/api-consumes.explorer.js +7 -0
  133. package/dist/lib/explorers/api-consumes.explorer.js.map +1 -0
  134. package/dist/lib/explorers/api-exclude-controller.explorer.d.ts +3 -0
  135. package/dist/lib/explorers/api-exclude-controller.explorer.d.ts.map +1 -0
  136. package/dist/lib/explorers/api-exclude-controller.explorer.js +3 -0
  137. package/dist/lib/explorers/api-exclude-controller.explorer.js.map +1 -0
  138. package/dist/lib/explorers/api-exclude-endpoint.explorer.d.ts +3 -0
  139. package/dist/lib/explorers/api-exclude-endpoint.explorer.d.ts.map +1 -0
  140. package/dist/lib/explorers/api-exclude-endpoint.explorer.js +3 -0
  141. package/dist/lib/explorers/api-exclude-endpoint.explorer.js.map +1 -0
  142. package/dist/lib/explorers/api-extra-models.explorer.d.ts +4 -0
  143. package/dist/lib/explorers/api-extra-models.explorer.d.ts.map +1 -0
  144. package/dist/lib/explorers/api-extra-models.explorer.js +7 -0
  145. package/dist/lib/explorers/api-extra-models.explorer.js.map +1 -0
  146. package/dist/lib/explorers/api-headers.explorer.d.ts +8 -0
  147. package/dist/lib/explorers/api-headers.explorer.d.ts.map +1 -0
  148. package/dist/lib/explorers/api-headers.explorer.js +6 -0
  149. package/dist/lib/explorers/api-headers.explorer.js.map +1 -0
  150. package/dist/lib/explorers/api-operation.explorer.d.ts +3 -0
  151. package/dist/lib/explorers/api-operation.explorer.d.ts.map +1 -0
  152. package/dist/lib/explorers/api-operation.explorer.js +38 -0
  153. package/dist/lib/explorers/api-operation.explorer.js.map +1 -0
  154. package/dist/lib/explorers/api-parameters.explorer.d.ts +6 -0
  155. package/dist/lib/explorers/api-parameters.explorer.d.ts.map +1 -0
  156. package/dist/lib/explorers/api-parameters.explorer.js +44 -0
  157. package/dist/lib/explorers/api-parameters.explorer.js.map +1 -0
  158. package/dist/lib/explorers/api-produces.explorer.d.ts +6 -0
  159. package/dist/lib/explorers/api-produces.explorer.d.ts.map +1 -0
  160. package/dist/lib/explorers/api-produces.explorer.js +7 -0
  161. package/dist/lib/explorers/api-produces.explorer.js.map +1 -0
  162. package/dist/lib/explorers/api-response.explorer.d.ts +8 -0
  163. package/dist/lib/explorers/api-response.explorer.d.ts.map +1 -0
  164. package/dist/lib/explorers/api-response.explorer.js +77 -0
  165. package/dist/lib/explorers/api-response.explorer.js.map +1 -0
  166. package/dist/lib/explorers/api-security.explorer.d.ts +6 -0
  167. package/dist/lib/explorers/api-security.explorer.d.ts.map +1 -0
  168. package/dist/lib/explorers/api-security.explorer.js +9 -0
  169. package/dist/lib/explorers/api-security.explorer.js.map +1 -0
  170. package/dist/lib/explorers/api-use-tags.explorer.d.ts +6 -0
  171. package/dist/lib/explorers/api-use-tags.explorer.d.ts.map +1 -0
  172. package/dist/lib/explorers/api-use-tags.explorer.js +17 -0
  173. package/dist/lib/explorers/api-use-tags.explorer.js.map +1 -0
  174. package/dist/lib/extra/swagger-shim.d.ts +97 -0
  175. package/dist/lib/extra/swagger-shim.d.ts.map +1 -0
  176. package/dist/lib/extra/swagger-shim.js +265 -0
  177. package/dist/lib/extra/swagger-shim.js.map +1 -0
  178. package/dist/lib/fixtures/document.base.d.ts +3 -0
  179. package/dist/lib/fixtures/document.base.d.ts.map +1 -0
  180. package/dist/lib/fixtures/document.base.js +13 -0
  181. package/dist/lib/fixtures/document.base.js.map +1 -0
  182. package/dist/lib/index.d.ts +8 -0
  183. package/dist/lib/index.d.ts.map +1 -0
  184. package/dist/lib/index.js +8 -0
  185. package/dist/lib/index.js.map +1 -0
  186. package/dist/lib/interfaces/callback-object.interface.d.ts +13 -0
  187. package/dist/lib/interfaces/callback-object.interface.d.ts.map +1 -0
  188. package/dist/lib/interfaces/callback-object.interface.js +2 -0
  189. package/dist/lib/interfaces/callback-object.interface.js.map +1 -0
  190. package/dist/lib/interfaces/denormalized-doc-resolvers.interface.d.ts +8 -0
  191. package/dist/lib/interfaces/denormalized-doc-resolvers.interface.d.ts.map +1 -0
  192. package/dist/lib/interfaces/denormalized-doc-resolvers.interface.js +2 -0
  193. package/dist/lib/interfaces/denormalized-doc-resolvers.interface.js.map +1 -0
  194. package/dist/lib/interfaces/denormalized-doc.interface.d.ts +9 -0
  195. package/dist/lib/interfaces/denormalized-doc.interface.d.ts.map +1 -0
  196. package/dist/lib/interfaces/denormalized-doc.interface.js +2 -0
  197. package/dist/lib/interfaces/denormalized-doc.interface.js.map +1 -0
  198. package/dist/lib/interfaces/enum-schema-attributes.interface.d.ts +3 -0
  199. package/dist/lib/interfaces/enum-schema-attributes.interface.d.ts.map +1 -0
  200. package/dist/lib/interfaces/enum-schema-attributes.interface.js +2 -0
  201. package/dist/lib/interfaces/enum-schema-attributes.interface.js.map +1 -0
  202. package/dist/lib/interfaces/index.d.ts +4 -0
  203. package/dist/lib/interfaces/index.d.ts.map +1 -0
  204. package/dist/lib/interfaces/index.js +3 -0
  205. package/dist/lib/interfaces/index.js.map +1 -0
  206. package/dist/lib/interfaces/module-route.interface.d.ts +3 -0
  207. package/dist/lib/interfaces/module-route.interface.d.ts.map +1 -0
  208. package/dist/lib/interfaces/module-route.interface.js +2 -0
  209. package/dist/lib/interfaces/module-route.interface.js.map +1 -0
  210. package/dist/lib/interfaces/open-api-spec.interface.d.ts +241 -0
  211. package/dist/lib/interfaces/open-api-spec.interface.d.ts.map +1 -0
  212. package/dist/lib/interfaces/open-api-spec.interface.js +6 -0
  213. package/dist/lib/interfaces/open-api-spec.interface.js.map +1 -0
  214. package/dist/lib/interfaces/schema-object-metadata.interface.d.ts +24 -0
  215. package/dist/lib/interfaces/schema-object-metadata.interface.d.ts.map +1 -0
  216. package/dist/lib/interfaces/schema-object-metadata.interface.js +2 -0
  217. package/dist/lib/interfaces/schema-object-metadata.interface.js.map +1 -0
  218. package/dist/lib/interfaces/swagger-custom-options.interface.d.ts +85 -0
  219. package/dist/lib/interfaces/swagger-custom-options.interface.d.ts.map +1 -0
  220. package/dist/lib/interfaces/swagger-custom-options.interface.js +2 -0
  221. package/dist/lib/interfaces/swagger-custom-options.interface.js.map +1 -0
  222. package/dist/lib/interfaces/swagger-document-options.interface.d.ts +36 -0
  223. package/dist/lib/interfaces/swagger-document-options.interface.d.ts.map +1 -0
  224. package/dist/lib/interfaces/swagger-document-options.interface.js +2 -0
  225. package/dist/lib/interfaces/swagger-document-options.interface.js.map +1 -0
  226. package/dist/lib/interfaces/swagger-ui-init-options.interface.d.ts +8 -0
  227. package/dist/lib/interfaces/swagger-ui-init-options.interface.d.ts.map +1 -0
  228. package/dist/lib/interfaces/swagger-ui-init-options.interface.js +2 -0
  229. package/dist/lib/interfaces/swagger-ui-init-options.interface.js.map +1 -0
  230. package/dist/lib/interfaces/swagger-ui-options.interface.d.ts +21 -0
  231. package/dist/lib/interfaces/swagger-ui-options.interface.d.ts.map +1 -0
  232. package/dist/lib/interfaces/swagger-ui-options.interface.js +2 -0
  233. package/dist/lib/interfaces/swagger-ui-options.interface.js.map +1 -0
  234. package/dist/lib/plugin/compiler-plugin.d.ts +3 -0
  235. package/dist/lib/plugin/compiler-plugin.d.ts.map +1 -0
  236. package/dist/lib/plugin/compiler-plugin.js +27 -0
  237. package/dist/lib/plugin/compiler-plugin.js.map +1 -0
  238. package/dist/lib/plugin/index.d.ts +3 -0
  239. package/dist/lib/plugin/index.d.ts.map +1 -0
  240. package/dist/lib/plugin/index.js +3 -0
  241. package/dist/lib/plugin/index.js.map +1 -0
  242. package/dist/lib/plugin/merge-options.d.ts +15 -0
  243. package/dist/lib/plugin/merge-options.d.ts.map +1 -0
  244. package/dist/lib/plugin/merge-options.js +35 -0
  245. package/dist/lib/plugin/merge-options.js.map +1 -0
  246. package/dist/lib/plugin/metadata-loader.d.ts +8 -0
  247. package/dist/lib/plugin/metadata-loader.d.ts.map +1 -0
  248. package/dist/lib/plugin/metadata-loader.js +41 -0
  249. package/dist/lib/plugin/metadata-loader.js.map +1 -0
  250. package/dist/lib/plugin/plugin-constants.d.ts +4 -0
  251. package/dist/lib/plugin/plugin-constants.d.ts.map +1 -0
  252. package/dist/lib/plugin/plugin-constants.js +4 -0
  253. package/dist/lib/plugin/plugin-constants.js.map +1 -0
  254. package/dist/lib/plugin/plugin-debug-logger.d.ts +6 -0
  255. package/dist/lib/plugin/plugin-debug-logger.d.ts.map +1 -0
  256. package/dist/lib/plugin/plugin-debug-logger.js +5 -0
  257. package/dist/lib/plugin/plugin-debug-logger.js.map +1 -0
  258. package/dist/lib/plugin/utils/ast-utils.d.ts +31 -0
  259. package/dist/lib/plugin/utils/ast-utils.d.ts.map +1 -0
  260. package/dist/lib/plugin/utils/ast-utils.js +242 -0
  261. package/dist/lib/plugin/utils/ast-utils.js.map +1 -0
  262. package/dist/lib/plugin/utils/external-imports.util.d.ts +4 -0
  263. package/dist/lib/plugin/utils/external-imports.util.d.ts.map +1 -0
  264. package/dist/lib/plugin/utils/external-imports.util.js +31 -0
  265. package/dist/lib/plugin/utils/external-imports.util.js.map +1 -0
  266. package/dist/lib/plugin/utils/is-filename-matched.util.d.ts +2 -0
  267. package/dist/lib/plugin/utils/is-filename-matched.util.d.ts.map +1 -0
  268. package/dist/lib/plugin/utils/is-filename-matched.util.js +2 -0
  269. package/dist/lib/plugin/utils/is-filename-matched.util.js.map +1 -0
  270. package/dist/lib/plugin/utils/plugin-utils.d.ts +58 -0
  271. package/dist/lib/plugin/utils/plugin-utils.d.ts.map +1 -0
  272. package/dist/lib/plugin/utils/plugin-utils.js +282 -0
  273. package/dist/lib/plugin/utils/plugin-utils.js.map +1 -0
  274. package/dist/lib/plugin/utils/type-reference-to-identifier.util.d.ts +8 -0
  275. package/dist/lib/plugin/utils/type-reference-to-identifier.util.d.ts.map +1 -0
  276. package/dist/lib/plugin/utils/type-reference-to-identifier.util.js +50 -0
  277. package/dist/lib/plugin/utils/type-reference-to-identifier.util.js.map +1 -0
  278. package/dist/lib/plugin/visitors/abstract.visitor.d.ts +5 -0
  279. package/dist/lib/plugin/visitors/abstract.visitor.d.ts.map +1 -0
  280. package/dist/lib/plugin/visitors/abstract.visitor.js +20 -0
  281. package/dist/lib/plugin/visitors/abstract.visitor.js.map +1 -0
  282. package/dist/lib/plugin/visitors/controller-class.visitor.d.ts +21 -0
  283. package/dist/lib/plugin/visitors/controller-class.visitor.d.ts.map +1 -0
  284. package/dist/lib/plugin/visitors/controller-class.visitor.js +266 -0
  285. package/dist/lib/plugin/visitors/controller-class.visitor.js.map +1 -0
  286. package/dist/lib/plugin/visitors/model-class.visitor.d.ts +40 -0
  287. package/dist/lib/plugin/visitors/model-class.visitor.d.ts.map +1 -0
  288. package/dist/lib/plugin/visitors/model-class.visitor.js +445 -0
  289. package/dist/lib/plugin/visitors/model-class.visitor.js.map +1 -0
  290. package/dist/lib/plugin/visitors/readonly.visitor.d.ts +22 -0
  291. package/dist/lib/plugin/visitors/readonly.visitor.d.ts.map +1 -0
  292. package/dist/lib/plugin/visitors/readonly.visitor.js +60 -0
  293. package/dist/lib/plugin/visitors/readonly.visitor.js.map +1 -0
  294. package/dist/lib/services/constants.d.ts +2 -0
  295. package/dist/lib/services/constants.d.ts.map +1 -0
  296. package/dist/lib/services/constants.js +2 -0
  297. package/dist/lib/services/constants.js.map +1 -0
  298. package/dist/lib/services/decorators-properties.d.ts +27 -0
  299. package/dist/lib/services/decorators-properties.d.ts.map +1 -0
  300. package/dist/lib/services/decorators-properties.js +147 -0
  301. package/dist/lib/services/decorators-properties.js.map +1 -0
  302. package/dist/lib/services/mimetype-content-wrapper.d.ts +5 -0
  303. package/dist/lib/services/mimetype-content-wrapper.d.ts.map +1 -0
  304. package/dist/lib/services/mimetype-content-wrapper.js +8 -0
  305. package/dist/lib/services/mimetype-content-wrapper.js.map +1 -0
  306. package/dist/lib/services/model-properties-accessor.d.ts +7 -0
  307. package/dist/lib/services/model-properties-accessor.d.ts.map +1 -0
  308. package/dist/lib/services/model-properties-accessor.js +33 -0
  309. package/dist/lib/services/model-properties-accessor.js.map +1 -0
  310. package/dist/lib/services/parameter-metadata-accessor.d.ts +22 -0
  311. package/dist/lib/services/parameter-metadata-accessor.d.ts.map +1 -0
  312. package/dist/lib/services/parameter-metadata-accessor.js +38 -0
  313. package/dist/lib/services/parameter-metadata-accessor.js.map +1 -0
  314. package/dist/lib/services/parameters-metadata-mapper.d.ts +10 -0
  315. package/dist/lib/services/parameters-metadata-mapper.d.ts.map +1 -0
  316. package/dist/lib/services/parameters-metadata-mapper.js +45 -0
  317. package/dist/lib/services/parameters-metadata-mapper.js.map +1 -0
  318. package/dist/lib/services/response-object-factory.d.ts +15 -0
  319. package/dist/lib/services/response-object-factory.d.ts.map +1 -0
  320. package/dist/lib/services/response-object-factory.js +123 -0
  321. package/dist/lib/services/response-object-factory.js.map +1 -0
  322. package/dist/lib/services/response-object-mapper.d.ts +8 -0
  323. package/dist/lib/services/response-object-mapper.d.ts.map +1 -0
  324. package/dist/lib/services/response-object-mapper.js +55 -0
  325. package/dist/lib/services/response-object-mapper.js.map +1 -0
  326. package/dist/lib/services/schema-object-factory.d.ts +160 -0
  327. package/dist/lib/services/schema-object-factory.d.ts.map +1 -0
  328. package/dist/lib/services/schema-object-factory.js +484 -0
  329. package/dist/lib/services/schema-object-factory.js.map +1 -0
  330. package/dist/lib/services/swagger-types-mapper.d.ts +19 -0
  331. package/dist/lib/services/swagger-types-mapper.d.ts.map +1 -0
  332. package/dist/lib/services/swagger-types-mapper.js +132 -0
  333. package/dist/lib/services/swagger-types-mapper.js.map +1 -0
  334. package/dist/lib/storages/global-parameters.storage.d.ts +9 -0
  335. package/dist/lib/storages/global-parameters.storage.d.ts.map +1 -0
  336. package/dist/lib/storages/global-parameters.storage.js +23 -0
  337. package/dist/lib/storages/global-parameters.storage.js.map +1 -0
  338. package/dist/lib/swagger-transformer.d.ts +8 -0
  339. package/dist/lib/swagger-transformer.d.ts.map +1 -0
  340. package/dist/lib/swagger-transformer.js +36 -0
  341. package/dist/lib/swagger-transformer.js.map +1 -0
  342. package/dist/lib/swagger-ui/constants.d.ts +4 -0
  343. package/dist/lib/swagger-ui/constants.d.ts.map +1 -0
  344. package/dist/lib/swagger-ui/constants.js +130 -0
  345. package/dist/lib/swagger-ui/constants.js.map +1 -0
  346. package/dist/lib/swagger-ui/helpers.d.ts +6 -0
  347. package/dist/lib/swagger-ui/helpers.d.ts.map +1 -0
  348. package/dist/lib/swagger-ui/helpers.js +17 -0
  349. package/dist/lib/swagger-ui/helpers.js.map +1 -0
  350. package/dist/lib/swagger-ui/index.d.ts +2 -0
  351. package/dist/lib/swagger-ui/index.d.ts.map +1 -0
  352. package/dist/lib/swagger-ui/index.js +2 -0
  353. package/dist/lib/swagger-ui/index.js.map +1 -0
  354. package/dist/lib/swagger-ui/swagger-ui.d.ts +14 -0
  355. package/dist/lib/swagger-ui/swagger-ui.d.ts.map +1 -0
  356. package/dist/lib/swagger-ui/swagger-ui.js +64 -0
  357. package/dist/lib/swagger-ui/swagger-ui.js.map +1 -0
  358. package/dist/lib/type-helpers/index.d.ts +5 -0
  359. package/dist/lib/type-helpers/index.d.ts.map +1 -0
  360. package/dist/lib/type-helpers/index.js +5 -0
  361. package/dist/lib/type-helpers/index.js.map +1 -0
  362. package/dist/lib/type-helpers/intersection-type.helper.d.ts +9 -0
  363. package/dist/lib/type-helpers/intersection-type.helper.d.ts.map +1 -0
  364. package/dist/lib/type-helpers/intersection-type.helper.js +40 -0
  365. package/dist/lib/type-helpers/intersection-type.helper.js.map +1 -0
  366. package/dist/lib/type-helpers/mapped-types.utils.d.ts +3 -0
  367. package/dist/lib/type-helpers/mapped-types.utils.d.ts.map +1 -0
  368. package/dist/lib/type-helpers/mapped-types.utils.js +33 -0
  369. package/dist/lib/type-helpers/mapped-types.utils.js.map +1 -0
  370. package/dist/lib/type-helpers/omit-type.helper.d.ts +3 -0
  371. package/dist/lib/type-helpers/omit-type.helper.d.ts.map +1 -0
  372. package/dist/lib/type-helpers/omit-type.helper.js +38 -0
  373. package/dist/lib/type-helpers/omit-type.helper.js.map +1 -0
  374. package/dist/lib/type-helpers/partial-type.helper.d.ts +14 -0
  375. package/dist/lib/type-helpers/partial-type.helper.d.ts.map +1 -0
  376. package/dist/lib/type-helpers/partial-type.helper.js +52 -0
  377. package/dist/lib/type-helpers/partial-type.helper.js.map +1 -0
  378. package/dist/lib/type-helpers/pick-type.helper.d.ts +3 -0
  379. package/dist/lib/type-helpers/pick-type.helper.d.ts.map +1 -0
  380. package/dist/lib/type-helpers/pick-type.helper.js +38 -0
  381. package/dist/lib/type-helpers/pick-type.helper.js.map +1 -0
  382. package/dist/lib/types/swagger-enum.type.d.ts +2 -0
  383. package/dist/lib/types/swagger-enum.type.d.ts.map +1 -0
  384. package/dist/lib/types/swagger-enum.type.js +2 -0
  385. package/dist/lib/types/swagger-enum.type.js.map +1 -0
  386. package/dist/lib/utils/assign-two-levels-deep.d.ts +16 -0
  387. package/dist/lib/utils/assign-two-levels-deep.d.ts.map +1 -0
  388. package/dist/lib/utils/assign-two-levels-deep.js +24 -0
  389. package/dist/lib/utils/assign-two-levels-deep.js.map +1 -0
  390. package/dist/lib/utils/enum.utils.d.ts +10 -0
  391. package/dist/lib/utils/enum.utils.d.ts.map +1 -0
  392. package/dist/lib/utils/enum.utils.js +68 -0
  393. package/dist/lib/utils/enum.utils.js.map +1 -0
  394. package/dist/lib/utils/extend-metadata.util.d.ts +3 -0
  395. package/dist/lib/utils/extend-metadata.util.d.ts.map +1 -0
  396. package/dist/lib/utils/extend-metadata.util.js +9 -0
  397. package/dist/lib/utils/extend-metadata.util.js.map +1 -0
  398. package/dist/lib/utils/get-global-prefix.d.ts +3 -0
  399. package/dist/lib/utils/get-global-prefix.d.ts.map +1 -0
  400. package/dist/lib/utils/get-global-prefix.js +5 -0
  401. package/dist/lib/utils/get-global-prefix.js.map +1 -0
  402. package/dist/lib/utils/get-schema-path.util.d.ts +5 -0
  403. package/dist/lib/utils/get-schema-path.util.d.ts.map +1 -0
  404. package/dist/lib/utils/get-schema-path.util.js +22 -0
  405. package/dist/lib/utils/get-schema-path.util.js.map +1 -0
  406. package/dist/lib/utils/index.d.ts +2 -0
  407. package/dist/lib/utils/index.d.ts.map +1 -0
  408. package/dist/lib/utils/index.js +2 -0
  409. package/dist/lib/utils/index.js.map +1 -0
  410. package/dist/lib/utils/is-body-parameter.util.d.ts +3 -0
  411. package/dist/lib/utils/is-body-parameter.util.d.ts.map +1 -0
  412. package/dist/lib/utils/is-body-parameter.util.js +4 -0
  413. package/dist/lib/utils/is-body-parameter.util.js.map +1 -0
  414. package/dist/lib/utils/is-built-in-type.util.d.ts +3 -0
  415. package/dist/lib/utils/is-built-in-type.util.d.ts.map +1 -0
  416. package/dist/lib/utils/is-built-in-type.util.js +6 -0
  417. package/dist/lib/utils/is-built-in-type.util.js.map +1 -0
  418. package/dist/lib/utils/is-date-ctor.util.d.ts +3 -0
  419. package/dist/lib/utils/is-date-ctor.util.d.ts.map +1 -0
  420. package/dist/lib/utils/is-date-ctor.util.js +4 -0
  421. package/dist/lib/utils/is-date-ctor.util.js.map +1 -0
  422. package/dist/lib/utils/merge-and-uniq.util.d.ts +2 -0
  423. package/dist/lib/utils/merge-and-uniq.util.d.ts.map +1 -0
  424. package/dist/lib/utils/merge-and-uniq.util.js +5 -0
  425. package/dist/lib/utils/merge-and-uniq.util.js.map +1 -0
  426. package/dist/lib/utils/normalize-rel-path.d.ts +2 -0
  427. package/dist/lib/utils/normalize-rel-path.d.ts.map +1 -0
  428. package/dist/lib/utils/normalize-rel-path.js +6 -0
  429. package/dist/lib/utils/normalize-rel-path.js.map +1 -0
  430. package/dist/lib/utils/remove-undefined-keys.d.ts +6 -0
  431. package/dist/lib/utils/remove-undefined-keys.d.ts.map +1 -0
  432. package/dist/lib/utils/remove-undefined-keys.js +9 -0
  433. package/dist/lib/utils/remove-undefined-keys.js.map +1 -0
  434. package/dist/lib/utils/resolve-path.util.d.ts +2 -0
  435. package/dist/lib/utils/resolve-path.util.d.ts.map +1 -0
  436. package/dist/lib/utils/resolve-path.util.js +5 -0
  437. package/dist/lib/utils/resolve-path.util.js.map +1 -0
  438. package/dist/lib/utils/reverse-object-keys.util.d.ts +2 -0
  439. package/dist/lib/utils/reverse-object-keys.util.d.ts.map +1 -0
  440. package/dist/lib/utils/reverse-object-keys.util.js +9 -0
  441. package/dist/lib/utils/reverse-object-keys.util.js.map +1 -0
  442. package/dist/lib/utils/sort-object-lexicographically.d.ts +6 -0
  443. package/dist/lib/utils/sort-object-lexicographically.d.ts.map +1 -0
  444. package/dist/lib/utils/sort-object-lexicographically.js +9 -0
  445. package/dist/lib/utils/sort-object-lexicographically.js.map +1 -0
  446. package/dist/lib/utils/strip-last-slash.util.d.ts +2 -0
  447. package/dist/lib/utils/strip-last-slash.util.d.ts.map +1 -0
  448. package/dist/lib/utils/strip-last-slash.util.js +4 -0
  449. package/dist/lib/utils/strip-last-slash.util.js.map +1 -0
  450. package/dist/lib/utils/validate-global-prefix.util.d.ts +2 -0
  451. package/dist/lib/utils/validate-global-prefix.util.d.ts.map +1 -0
  452. package/dist/lib/utils/validate-global-prefix.util.js +4 -0
  453. package/dist/lib/utils/validate-global-prefix.util.js.map +1 -0
  454. package/dist/lib/utils/validate-path.util.d.ts +2 -0
  455. package/dist/lib/utils/validate-path.util.d.ts.map +1 -0
  456. package/dist/lib/utils/validate-path.util.js +4 -0
  457. package/dist/lib/utils/validate-path.util.js.map +1 -0
  458. package/package.json +40 -0
@@ -0,0 +1,445 @@
1
+ import { compact, flatten, head } from 'lodash';
2
+ import { posix } from 'path';
3
+ import * as ts from 'typescript';
4
+ import { factory } from 'typescript';
5
+ import { ApiHideProperty, ApiProperty } from '../../decorators/index.js';
6
+ import { METADATA_FACTORY_NAME } from '../plugin-constants.js';
7
+ import { pluginDebugLogger } from '../plugin-debug-logger.js';
8
+ import { createBooleanLiteral, createLiteralFromAnyValue, createPrimitiveLiteral, getDecoratorArguments, getMainCommentOfNode, getText, getTsDocTagsOfNode, isEnum, } from '../utils/ast-utils.js';
9
+ import { canReferenceNode, convertPath, extractTypeArgumentIfArray, getDecoratorOrUndefinedByNames, getTypeReferenceAsString, hasPropertyKey, isAutoGeneratedEnumUnion, isAutoGeneratedTypeUnion, } from '../utils/plugin-utils.js';
10
+ import { typeReferenceToIdentifier } from '../utils/type-reference-to-identifier.util.js';
11
+ import { AbstractFileVisitor } from './abstract.visitor.js';
12
+ import { getExternalImports, replaceExternalImportsInTypeReference } from '../utils/external-imports.util.js';
13
+ import { decoratorsProperties, decoratorsPropertiesMappingType } from '../../services/decorators-properties.js';
14
+ import { Cast } from 'vona';
15
+ export class ModelClassVisitor extends AbstractFileVisitor {
16
+ constructor() {
17
+ super(...arguments);
18
+ Object.defineProperty(this, "_typeImports", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: {}
23
+ });
24
+ Object.defineProperty(this, "_collectedMetadata", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: {}
29
+ });
30
+ }
31
+ get typeImports() {
32
+ return this._typeImports;
33
+ }
34
+ get collectedMetadata() {
35
+ const metadataWithImports = [];
36
+ Object.keys(this._collectedMetadata).forEach(filePath => {
37
+ const metadata = this._collectedMetadata[filePath];
38
+ const path = filePath.replace(/\.[jt]s$/, '');
39
+ const importExpr = ts.factory.createCallExpression(ts.factory.createToken(ts.SyntaxKind.ImportKeyword), undefined, [ts.factory.createStringLiteral(path)]);
40
+ metadataWithImports.push([importExpr, metadata]);
41
+ });
42
+ return metadataWithImports;
43
+ }
44
+ visit(sourceFile, ctx, program, options) {
45
+ const externalImports = getExternalImports(sourceFile);
46
+ const typeChecker = program.getTypeChecker();
47
+ sourceFile = Cast(this).updateImports(sourceFile, ctx.factory, program);
48
+ const propertyNodeVisitorFactory = (metadata) => (node) => {
49
+ const visit = () => {
50
+ if (ts.isPropertyDeclaration(node)) {
51
+ this.visitPropertyNodeDeclaration(node, ctx, typeChecker, options, sourceFile, metadata, externalImports);
52
+ }
53
+ else if (options.parameterProperties && ts.isConstructorDeclaration(node)) {
54
+ this.visitConstructorDeclarationNode(node, typeChecker, options, sourceFile, metadata, externalImports);
55
+ }
56
+ return node;
57
+ };
58
+ const visitedNode = visit();
59
+ if (!options.readonly) {
60
+ return visitedNode;
61
+ }
62
+ };
63
+ const visitClassNode = (node) => {
64
+ if (ts.isClassDeclaration(node)) {
65
+ const metadata = {};
66
+ const isExported = node.modifiers?.some(modifier => modifier.kind === ts.SyntaxKind.ExportKeyword);
67
+ if (options.readonly) {
68
+ if (isExported) {
69
+ ts.forEachChild(node, propertyNodeVisitorFactory(metadata));
70
+ }
71
+ else {
72
+ if (options.debug) {
73
+ pluginDebugLogger.debug(`Skipping class "${node.name.getText()}" because it's not exported.`);
74
+ }
75
+ }
76
+ }
77
+ else {
78
+ node = ts.visitEachChild(node, propertyNodeVisitorFactory(metadata), ctx);
79
+ }
80
+ if ((isExported && options.readonly) || !options.readonly) {
81
+ const declaration = this.addMetadataFactory(ctx.factory, node, metadata, sourceFile, options);
82
+ if (!options.readonly) {
83
+ return declaration;
84
+ }
85
+ }
86
+ }
87
+ if (options.readonly) {
88
+ ts.forEachChild(node, visitClassNode);
89
+ }
90
+ else {
91
+ return ts.visitEachChild(node, visitClassNode, ctx);
92
+ }
93
+ };
94
+ return ts.visitNode(sourceFile, visitClassNode);
95
+ }
96
+ visitPropertyNodeDeclaration(node, ctx, typeChecker, options, sourceFile, metadata, externalImports) {
97
+ const isPropertyStatic = (node.modifiers || []).some((modifier) => modifier.kind === ts.SyntaxKind.StaticKeyword);
98
+ if (isPropertyStatic) {
99
+ return node;
100
+ }
101
+ const decorators = ts.canHaveDecorators(node) && ts.getDecorators(node);
102
+ const classTransformerShim = options.classTransformerShim;
103
+ const hidePropertyDecoratorExists = getDecoratorOrUndefinedByNames(classTransformerShim ? [ApiHideProperty.name, 'Exclude'] : [ApiHideProperty.name], decorators, factory);
104
+ const annotatePropertyDecoratorExists = getDecoratorOrUndefinedByNames(classTransformerShim ? [ApiProperty.name, 'Expose'] : [ApiProperty.name], decorators, factory);
105
+ if (!annotatePropertyDecoratorExists && (hidePropertyDecoratorExists || classTransformerShim === 'exclusive')) {
106
+ return node;
107
+ }
108
+ else if (annotatePropertyDecoratorExists && hidePropertyDecoratorExists) {
109
+ pluginDebugLogger.debug(`"${node.parent.name?.getText()}->${node.name.getText()}" has conflicting decorators, excluding as @ApiHideProperty() takes priority.`);
110
+ return node;
111
+ }
112
+ try {
113
+ this.inspectPropertyDeclaration(ctx.factory, node, typeChecker, options, sourceFile.fileName, sourceFile, metadata, externalImports);
114
+ }
115
+ catch (_err) {
116
+ return node;
117
+ }
118
+ }
119
+ visitConstructorDeclarationNode(constructorNode, typeChecker, options, sourceFile, metadata, externalImports) {
120
+ constructorNode.forEachChild(node => {
121
+ if (ts.isParameter(node) &&
122
+ node.modifiers != null &&
123
+ node.modifiers.some((modifier) => modifier.kind === ts.SyntaxKind.ReadonlyKeyword ||
124
+ modifier.kind === ts.SyntaxKind.PrivateKeyword ||
125
+ modifier.kind === ts.SyntaxKind.PublicKeyword ||
126
+ modifier.kind === ts.SyntaxKind.ProtectedKeyword)) {
127
+ const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(factory, node, typeChecker, factory.createNodeArray(), options, sourceFile.fileName, sourceFile, externalImports);
128
+ const propertyName = node.name.getText();
129
+ metadata[propertyName] = objectLiteralExpr;
130
+ }
131
+ });
132
+ }
133
+ addMetadataFactory(factory, node, classMetadata, sourceFile, options) {
134
+ const returnValue = factory.createObjectLiteralExpression(Object.keys(classMetadata).map(key => factory.createPropertyAssignment(factory.createIdentifier(key), classMetadata[key])));
135
+ if (options.readonly) {
136
+ const filePath = this.normalizeImportPath(options.pathToSource, sourceFile.fileName);
137
+ if (!this._collectedMetadata[filePath]) {
138
+ this._collectedMetadata[filePath] = {};
139
+ }
140
+ const attributeKey = node.name.getText();
141
+ this._collectedMetadata[filePath][attributeKey] = returnValue;
142
+ return;
143
+ }
144
+ const method = factory.createMethodDeclaration([factory.createModifier(ts.SyntaxKind.StaticKeyword)], undefined, factory.createIdentifier(METADATA_FACTORY_NAME), undefined, undefined, [], undefined, factory.createBlock([factory.createReturnStatement(returnValue)], true));
145
+ return factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, node.heritageClauses, [
146
+ ...node.members,
147
+ method,
148
+ ]);
149
+ }
150
+ inspectPropertyDeclaration(factory, compilerNode, typeChecker, options, hostFilename, sourceFile, metadata, externalImports) {
151
+ const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(factory, compilerNode, typeChecker, factory.createNodeArray(), options, hostFilename, sourceFile, externalImports);
152
+ this.addClassMetadata(compilerNode, objectLiteralExpr, sourceFile, metadata);
153
+ }
154
+ createDecoratorObjectLiteralExpr(factory, node, typeChecker, existingProperties = factory.createNodeArray(), options = {}, hostFilename = '', sourceFile, externalImports = {}) {
155
+ const isRequired = !node.questionToken;
156
+ const properties = [
157
+ ...existingProperties,
158
+ !hasPropertyKey('required', existingProperties) &&
159
+ factory.createPropertyAssignment('required', createBooleanLiteral(factory, isRequired)),
160
+ ...this.createTypePropertyAssignments(factory, node.type, typeChecker, existingProperties, hostFilename, options),
161
+ ...this.createDescriptionAndTsDocTagPropertyAssignments(factory, node, typeChecker, existingProperties, options, sourceFile),
162
+ this.createDefaultPropertyAssignment(factory, node, existingProperties, options),
163
+ this.createEnumPropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options, externalImports),
164
+ ];
165
+ if ((ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) && options.classValidatorShim) {
166
+ properties.push(this.createValidationPropertyAssignments(factory, node, options));
167
+ }
168
+ return factory.createObjectLiteralExpression(compact(flatten(properties)));
169
+ }
170
+ /**
171
+ * Returns an array with 0..2 "ts.PropertyAssignment"s.
172
+ * The first one is the "type" property assignment, the second one is the "nullable" property assignment.
173
+ * When type cannot be determined, an empty array is returned.
174
+ */
175
+ createTypePropertyAssignments(factory, node, typeChecker, existingProperties, hostFilename, options) {
176
+ const key = 'type';
177
+ if (hasPropertyKey(key, existingProperties)) {
178
+ return [];
179
+ }
180
+ if (node) {
181
+ if (ts.isTypeLiteralNode(node)) {
182
+ const initializer = this.createInitializerForTypeLiteralNode(node, factory, typeChecker, existingProperties, hostFilename, options);
183
+ return [factory.createPropertyAssignment(key, initializer)];
184
+ }
185
+ else if (ts.isUnionTypeNode(node)) {
186
+ const { nullableType, isNullable } = this.isNullableUnion(node);
187
+ const remainingTypes = node.types.filter(item => item !== nullableType);
188
+ // TODO: When we have more than 1 type left, we could use "oneOf"
189
+ if (remainingTypes.length === 1) {
190
+ const propertyAssignments = this.createTypePropertyAssignments(factory, remainingTypes[0], typeChecker, existingProperties, hostFilename, options);
191
+ if (!isNullable) {
192
+ return propertyAssignments;
193
+ }
194
+ return [
195
+ ...propertyAssignments,
196
+ factory.createPropertyAssignment('nullable', createBooleanLiteral(factory, true)),
197
+ ];
198
+ }
199
+ }
200
+ }
201
+ const type = typeChecker.getTypeAtLocation(node);
202
+ if (!type) {
203
+ return [];
204
+ }
205
+ const typeReferenceDescriptor = getTypeReferenceAsString(type, typeChecker);
206
+ if (!typeReferenceDescriptor.typeName) {
207
+ return [];
208
+ }
209
+ const identifier = typeReferenceToIdentifier(typeReferenceDescriptor, hostFilename, options, factory, type, this._typeImports);
210
+ const initializer = factory.createArrowFunction(undefined, undefined, [], undefined, undefined, identifier);
211
+ return [factory.createPropertyAssignment(key, initializer)];
212
+ }
213
+ createInitializerForTypeLiteralNode(node, factory, typeChecker, existingProperties, hostFilename, options) {
214
+ const propertyAssignments = Array.from(node.members || []).map(member => {
215
+ const literalExpr = this.createDecoratorObjectLiteralExpr(factory, member, typeChecker, existingProperties, options, hostFilename);
216
+ return factory.createPropertyAssignment(factory.createIdentifier(member.name.getText()), literalExpr);
217
+ });
218
+ const initializer = factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory.createParenthesizedExpression(factory.createObjectLiteralExpression(propertyAssignments)));
219
+ return initializer;
220
+ }
221
+ isNullableUnion(node) {
222
+ const nullableType = node.types.find(type => type.kind === ts.SyntaxKind.NullKeyword || (!!ts.SyntaxKind.LiteralType && type.getText() === 'null'));
223
+ const isNullable = !!nullableType;
224
+ return { nullableType, isNullable };
225
+ }
226
+ createEnumPropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options, externalImports) {
227
+ const key = 'enum';
228
+ if (hasPropertyKey(key, existingProperties)) {
229
+ return undefined;
230
+ }
231
+ let type = typeChecker.getTypeAtLocation(node);
232
+ if (!type) {
233
+ return undefined;
234
+ }
235
+ if (isAutoGeneratedTypeUnion(type)) {
236
+ const types = type.types;
237
+ type = types[types.length - 1];
238
+ }
239
+ const typeIsArrayTuple = extractTypeArgumentIfArray(type);
240
+ if (!typeIsArrayTuple) {
241
+ return undefined;
242
+ }
243
+ const isArrayType = typeIsArrayTuple.isArray;
244
+ type = typeIsArrayTuple.type;
245
+ const isEnumMember = type.symbol && type.symbol.flags === ts.SymbolFlags.EnumMember;
246
+ if (!isEnum(type) || isEnumMember) {
247
+ if (!isEnumMember) {
248
+ type = isAutoGeneratedEnumUnion(type, typeChecker);
249
+ }
250
+ if (!type) {
251
+ return undefined;
252
+ }
253
+ const typeIsArrayTuple = extractTypeArgumentIfArray(type);
254
+ if (!typeIsArrayTuple) {
255
+ return undefined;
256
+ }
257
+ type = typeIsArrayTuple.type;
258
+ }
259
+ const typeReferenceDescriptor = {
260
+ typeName: replaceExternalImportsInTypeReference(getText(type, typeChecker), externalImports),
261
+ };
262
+ const enumIdentifier = typeReferenceToIdentifier(typeReferenceDescriptor, hostFilename, options, factory, type, this._typeImports);
263
+ const enumProperty = factory.createPropertyAssignment(key, enumIdentifier);
264
+ if (isArrayType) {
265
+ const isArrayKey = 'isArray';
266
+ const isArrayProperty = factory.createPropertyAssignment(isArrayKey, factory.createIdentifier('true'));
267
+ return [enumProperty, isArrayProperty];
268
+ }
269
+ return enumProperty;
270
+ }
271
+ createDefaultPropertyAssignment(factory, node, existingProperties, options) {
272
+ const key = 'default';
273
+ if (hasPropertyKey(key, existingProperties)) {
274
+ return undefined;
275
+ }
276
+ if (ts.isPropertySignature(node)) {
277
+ return undefined;
278
+ }
279
+ if (node.initializer == null) {
280
+ return undefined;
281
+ }
282
+ let initializer = node.initializer;
283
+ if (ts.isAsExpression(initializer)) {
284
+ initializer = initializer.expression;
285
+ }
286
+ initializer = this.clonePrimitiveLiteral(factory, initializer) ?? initializer;
287
+ if (!canReferenceNode(initializer, options)) {
288
+ const parentFilePath = node.getSourceFile().fileName;
289
+ const propertyName = node.name.getText();
290
+ pluginDebugLogger.debug(`Skipping registering default value for "${propertyName}" property in "${parentFilePath}" file because it is not a referenceable value ("${initializer.getText()}").`);
291
+ return undefined;
292
+ }
293
+ return factory.createPropertyAssignment(key, initializer);
294
+ }
295
+ createValidationPropertyAssignments(factory, node, options) {
296
+ const assignments = [];
297
+ const decorators = ts.canHaveDecorators(node) && ts.getDecorators(node);
298
+ if (!options.readonly) {
299
+ // @IsIn() annotation is not supported in readonly mode
300
+ this.addPropertyByValidationDecorator(factory, 'IsIn', 'enum', decorators, assignments, options);
301
+ }
302
+ decoratorsProperties.forEach(decoratorProperty => {
303
+ if (decoratorProperty.mappingType === decoratorsPropertiesMappingType.DIRECT) {
304
+ this.addPropertyByValidationDecorator(factory, decoratorProperty.decorator, decoratorProperty.property, decorators, assignments, options);
305
+ }
306
+ else if (decoratorProperty.mappingType === decoratorsPropertiesMappingType.INDIRECT_VALUE) {
307
+ this.addPropertiesByValidationDecorator(factory, decoratorProperty.decorator, decorators, assignments, () => {
308
+ return [
309
+ factory.createPropertyAssignment(decoratorProperty.property, createPrimitiveLiteral(factory, decoratorProperty.value)),
310
+ ];
311
+ });
312
+ }
313
+ else if (decoratorProperty.mappingType === decoratorsPropertiesMappingType.INDIRECT_ARGUMENT) {
314
+ this.addPropertiesByValidationDecorator(factory, decoratorProperty.decorator, decorators, assignments, (decoratorRef) => {
315
+ const decoratorArguments = getDecoratorArguments(decoratorRef);
316
+ const result = [];
317
+ const argumentValue = head(decoratorArguments);
318
+ if (!canReferenceNode(argumentValue, options)) {
319
+ return result;
320
+ }
321
+ const clonedArgumentValue = this.clonePrimitiveLiteral(factory, argumentValue);
322
+ if (clonedArgumentValue) {
323
+ result.push(factory.createPropertyAssignment(decoratorProperty.property, clonedArgumentValue));
324
+ }
325
+ return result;
326
+ });
327
+ }
328
+ });
329
+ this.addPropertiesByValidationDecorator(factory, 'Length', decorators, assignments, (decoratorRef) => {
330
+ const decoratorArguments = getDecoratorArguments(decoratorRef);
331
+ const result = [];
332
+ const minLength = head(decoratorArguments);
333
+ if (!canReferenceNode(minLength, options)) {
334
+ return result;
335
+ }
336
+ const clonedMinLength = this.clonePrimitiveLiteral(factory, minLength) ?? minLength;
337
+ if (clonedMinLength) {
338
+ result.push(factory.createPropertyAssignment('minLength', clonedMinLength));
339
+ }
340
+ if (decoratorArguments.length > 1) {
341
+ const maxLength = decoratorArguments[1];
342
+ if (!canReferenceNode(maxLength, options)) {
343
+ return result;
344
+ }
345
+ const clonedMaxLength = this.clonePrimitiveLiteral(factory, maxLength) ?? maxLength;
346
+ if (clonedMaxLength) {
347
+ result.push(factory.createPropertyAssignment('maxLength', clonedMaxLength));
348
+ }
349
+ }
350
+ return result;
351
+ });
352
+ this.addPropertiesByValidationDecorator(factory, 'Matches', decorators, assignments, (decoratorRef) => {
353
+ const decoratorArguments = getDecoratorArguments(decoratorRef);
354
+ return [
355
+ factory.createPropertyAssignment('pattern', createPrimitiveLiteral(factory, head(decoratorArguments).text)),
356
+ ];
357
+ });
358
+ return assignments;
359
+ }
360
+ addPropertyByValidationDecorator(factory, decoratorName, propertyKey, decorators, assignments, options) {
361
+ this.addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, (decoratorRef) => {
362
+ const argument = head(getDecoratorArguments(decoratorRef));
363
+ const assignment = this.clonePrimitiveLiteral(factory, argument) ?? argument;
364
+ if (!canReferenceNode(assignment, options)) {
365
+ return [];
366
+ }
367
+ return [factory.createPropertyAssignment(propertyKey, assignment)];
368
+ });
369
+ }
370
+ addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, addPropertyAssignments) {
371
+ const decoratorRef = getDecoratorOrUndefinedByNames([decoratorName], decorators, factory);
372
+ if (!decoratorRef) {
373
+ return;
374
+ }
375
+ assignments.push(...addPropertyAssignments(decoratorRef));
376
+ }
377
+ addClassMetadata(node, objectLiteral, sourceFile, metadata) {
378
+ const hostClass = node.parent;
379
+ const className = hostClass.name && hostClass.name.getText();
380
+ if (!className) {
381
+ return;
382
+ }
383
+ const propertyName = node.name && node.name.getText(sourceFile);
384
+ if (!propertyName || (node.name && node.name.kind === ts.SyntaxKind.ComputedPropertyName)) {
385
+ return;
386
+ }
387
+ metadata[propertyName] = objectLiteral;
388
+ }
389
+ createDescriptionAndTsDocTagPropertyAssignments(factory, node, typeChecker, existingProperties = factory.createNodeArray(), options = {}, sourceFile) {
390
+ if (!options.introspectComments || !sourceFile) {
391
+ return [];
392
+ }
393
+ const propertyAssignments = [];
394
+ const comments = getMainCommentOfNode(node, sourceFile);
395
+ const tags = getTsDocTagsOfNode(node, typeChecker);
396
+ const keyOfComment = options.dtoKeyOfComment;
397
+ if (!hasPropertyKey(keyOfComment, existingProperties) && comments) {
398
+ const descriptionPropertyAssignment = factory.createPropertyAssignment(keyOfComment, factory.createStringLiteral(comments));
399
+ propertyAssignments.push(descriptionPropertyAssignment);
400
+ }
401
+ const hasExampleOrExamplesKey = hasPropertyKey('example', existingProperties) || hasPropertyKey('examples', existingProperties);
402
+ if (!hasExampleOrExamplesKey && tags.example?.length) {
403
+ if (tags.example.length === 1) {
404
+ const examplePropertyAssignment = factory.createPropertyAssignment('example', createLiteralFromAnyValue(factory, tags.example[0]));
405
+ propertyAssignments.push(examplePropertyAssignment);
406
+ }
407
+ else {
408
+ const examplesPropertyAssignment = factory.createPropertyAssignment('examples', createLiteralFromAnyValue(factory, tags.example));
409
+ propertyAssignments.push(examplesPropertyAssignment);
410
+ }
411
+ }
412
+ const hasDeprecatedKey = hasPropertyKey('deprecated', existingProperties);
413
+ if (!hasDeprecatedKey && tags.deprecated) {
414
+ const deprecatedPropertyAssignment = factory.createPropertyAssignment('deprecated', createLiteralFromAnyValue(factory, tags.deprecated));
415
+ propertyAssignments.push(deprecatedPropertyAssignment);
416
+ }
417
+ return propertyAssignments;
418
+ }
419
+ normalizeImportPath(pathToSource, path) {
420
+ let relativePath = posix.relative(convertPath(pathToSource), convertPath(path));
421
+ relativePath = relativePath[0] !== '.' ? './' + relativePath : relativePath;
422
+ return relativePath;
423
+ }
424
+ clonePrimitiveLiteral(factory, node) {
425
+ const primitiveTypeName = this.getInitializerPrimitiveTypeName(node);
426
+ if (!primitiveTypeName) {
427
+ return undefined;
428
+ }
429
+ const text = node.text ?? node.getText();
430
+ return createPrimitiveLiteral(factory, text, primitiveTypeName);
431
+ }
432
+ getInitializerPrimitiveTypeName(node) {
433
+ if (ts.isIdentifier(node) && (node.text === 'true' || node.text === 'false')) {
434
+ return 'boolean';
435
+ }
436
+ if (ts.isNumericLiteral(node) || ts.isPrefixUnaryExpression(node)) {
437
+ return 'number';
438
+ }
439
+ if (ts.isStringLiteral(node)) {
440
+ return 'string';
441
+ }
442
+ return undefined;
443
+ }
444
+ }
445
+ //# sourceMappingURL=model-class.visitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-class.visitor.js","sourceRoot":"","sources":["../../../../src/lib/plugin/visitors/model-class.visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAs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0 +1,22 @@
1
+ import * as ts from 'typescript';
2
+ import { PluginOptions } from '../merge-options.js';
3
+ export declare class ReadonlyVisitor {
4
+ private readonly options;
5
+ readonly key = "@nestjs/swagger";
6
+ private readonly modelClassVisitor;
7
+ private readonly controllerClassVisitor;
8
+ get typeImports(): {
9
+ [x: string]: string;
10
+ };
11
+ constructor(options: PluginOptions);
12
+ visit(program: ts.Program, sf: ts.SourceFile): ts.Node | undefined;
13
+ collect(): {
14
+ models: [ts.CallExpression, Record<string, {
15
+ [x: string]: ts.ObjectLiteralExpression;
16
+ }>][];
17
+ controllers: [ts.CallExpression, Record<string, {
18
+ [x: string]: ts.ObjectLiteralExpression;
19
+ }>][];
20
+ };
21
+ }
22
+ //# sourceMappingURL=readonly.visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readonly.visitor.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugin/visitors/readonly.visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAKxE,qBAAa,eAAe;IAYd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAXpC,SAAgB,GAAG,qBAAqB;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2B;IAC7D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAgC;IAEvE,IAAI,WAAW;;MAKd;gBAE4B,OAAO,EAAE,aAAa;IAQnD,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,UAAU;IAY5C,OAAO;;;;;;;;CAMR"}
@@ -0,0 +1,60 @@
1
+ import * as ts from 'typescript';
2
+ import { mergePluginOptions } from '../merge-options.js';
3
+ import { isFilenameMatched } from '../utils/is-filename-matched.util.js';
4
+ import { ControllerClassVisitor } from './controller-class.visitor.js';
5
+ import { ModelClassVisitor } from './model-class.visitor.js';
6
+ export class ReadonlyVisitor {
7
+ get typeImports() {
8
+ return {
9
+ ...this.modelClassVisitor.typeImports,
10
+ ...this.controllerClassVisitor.typeImports,
11
+ };
12
+ }
13
+ constructor(options) {
14
+ Object.defineProperty(this, "options", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: options
19
+ });
20
+ Object.defineProperty(this, "key", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: '@nestjs/swagger'
25
+ });
26
+ Object.defineProperty(this, "modelClassVisitor", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: new ModelClassVisitor()
31
+ });
32
+ Object.defineProperty(this, "controllerClassVisitor", {
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true,
36
+ value: new ControllerClassVisitor()
37
+ });
38
+ options.readonly = true;
39
+ if (!options.pathToSource) {
40
+ throw new Error('"pathToSource" must be defined in plugin options');
41
+ }
42
+ }
43
+ visit(program, sf) {
44
+ const factoryHost = { factory: ts.factory };
45
+ const parsedOptions = mergePluginOptions(this.options);
46
+ if (isFilenameMatched(parsedOptions.dtoFileNameSuffix, sf.fileName)) {
47
+ return this.modelClassVisitor.visit(sf, factoryHost, program, parsedOptions);
48
+ }
49
+ if (isFilenameMatched(parsedOptions.controllerFileNameSuffix, sf.fileName)) {
50
+ return this.controllerClassVisitor.visit(sf, factoryHost, program, parsedOptions);
51
+ }
52
+ }
53
+ collect() {
54
+ return {
55
+ models: this.modelClassVisitor.collectedMetadata,
56
+ controllers: this.controllerClassVisitor.collectedMetadata,
57
+ };
58
+ }
59
+ }
60
+ //# sourceMappingURL=readonly.visitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readonly.visitor.js","sourceRoot":"","sources":["../../../../src/lib/plugin/visitors/readonly.visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,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C,CAAC;QACpF,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC,iBAAiB;YAChD,WAAW,EAAE,IAAI,CAAC,sBAAsB,CAAC,iBAAiB;SAC3D,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare const BUILT_IN_TYPES: (ObjectConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/services/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uGAA2C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const BUILT_IN_TYPES = [String, Boolean, Number, Object, Array];
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/services/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ export declare enum decoratorsPropertiesMappingType {
2
+ DIRECT = 0,
3
+ INDIRECT_VALUE = 1,
4
+ INDIRECT_ARGUMENT = 2
5
+ }
6
+ export declare const decoratorsProperties: ({
7
+ mappingType: decoratorsPropertiesMappingType;
8
+ decorator: string;
9
+ property: string;
10
+ value: undefined;
11
+ } | {
12
+ mappingType: decoratorsPropertiesMappingType;
13
+ decorator: string;
14
+ property: string;
15
+ value: number;
16
+ } | {
17
+ mappingType: decoratorsPropertiesMappingType;
18
+ decorator: string;
19
+ property: string;
20
+ value: boolean;
21
+ } | {
22
+ mappingType: decoratorsPropertiesMappingType;
23
+ decorator: string;
24
+ property: string;
25
+ value: string;
26
+ })[];
27
+ //# sourceMappingURL=decorators-properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators-properties.d.ts","sourceRoot":"","sources":["../../../src/lib/services/decorators-properties.ts"],"names":[],"mappings":"AAAA,oBAAY,+BAA+B;IACzC,MAAM,IAAA;IACN,cAAc,IAAA;IACd,iBAAiB,IAAA;CAClB;AACD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;IA2IhC,CAAC"}