@tsed/common 7.0.0-alpha.1 → 7.0.0-beta.3

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 (409) hide show
  1. package/lib/cjs/builder/PlatformBuilder.js +275 -0
  2. package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
  3. package/lib/cjs/builder/PlatformControllerBuilder.js +85 -0
  4. package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
  5. package/lib/cjs/config/index.js +7 -0
  6. package/lib/cjs/config/index.js.map +1 -0
  7. package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
  8. package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
  9. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +3 -0
  10. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  11. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
  12. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  13. package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
  14. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
  15. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
  16. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  17. package/lib/cjs/config/interfaces/index.js +8 -0
  18. package/lib/cjs/config/interfaces/index.js.map +1 -0
  19. package/lib/cjs/config/services/PlatformConfiguration.js +181 -0
  20. package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
  21. package/lib/cjs/constants/routerOptions.js +5 -0
  22. package/lib/cjs/constants/routerOptions.js.map +1 -0
  23. package/lib/cjs/decorators/httpServer.js +32 -0
  24. package/lib/cjs/decorators/httpServer.js.map +1 -0
  25. package/lib/cjs/decorators/httpsServer.js +32 -0
  26. package/lib/cjs/decorators/httpsServer.js.map +1 -0
  27. package/lib/cjs/decorators/index.js +26 -0
  28. package/lib/cjs/decorators/index.js.map +1 -0
  29. package/lib/cjs/decorators/method/acceptMime.js +28 -0
  30. package/lib/cjs/decorators/method/acceptMime.js.map +1 -0
  31. package/lib/cjs/decorators/multer/index.js +7 -0
  32. package/lib/cjs/decorators/multer/index.js.map +1 -0
  33. package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
  34. package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
  35. package/lib/cjs/decorators/multer/multerOptions.js +52 -0
  36. package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
  37. package/lib/cjs/decorators/multer/multipartFile.js +78 -0
  38. package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
  39. package/lib/cjs/decorators/params/error.js +20 -0
  40. package/lib/cjs/decorators/params/error.js.map +1 -0
  41. package/lib/cjs/decorators/params/next.js +21 -0
  42. package/lib/cjs/decorators/params/next.js.map +1 -0
  43. package/lib/cjs/decorators/params/request.js +39 -0
  44. package/lib/cjs/decorators/params/request.js.map +1 -0
  45. package/lib/cjs/decorators/params/response.js +33 -0
  46. package/lib/cjs/decorators/params/response.js.map +1 -0
  47. package/lib/cjs/domain/AnyToPromiseWithCtx.js +27 -0
  48. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
  49. package/lib/cjs/domain/ControllerProvider.js +51 -0
  50. package/lib/cjs/domain/ControllerProvider.js.map +1 -0
  51. package/lib/cjs/domain/EndpointMetadata.js +70 -0
  52. package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
  53. package/lib/cjs/domain/HandlerMetadata.js +57 -0
  54. package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
  55. package/lib/cjs/domain/PlatformContext.js +92 -0
  56. package/lib/cjs/domain/PlatformContext.js.map +1 -0
  57. package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
  58. package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
  59. package/lib/cjs/domain/index.js +10 -0
  60. package/lib/cjs/domain/index.js.map +1 -0
  61. package/lib/cjs/index.js +34 -0
  62. package/lib/cjs/index.js.map +1 -0
  63. package/lib/cjs/interfaces/AfterInit.js +3 -0
  64. package/lib/cjs/interfaces/AfterInit.js.map +1 -0
  65. package/lib/cjs/interfaces/AfterListen.js +3 -0
  66. package/lib/cjs/interfaces/AfterListen.js.map +1 -0
  67. package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
  68. package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
  69. package/lib/cjs/interfaces/BeforeInit.js +3 -0
  70. package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
  71. package/lib/cjs/interfaces/BeforeListen.js +3 -0
  72. package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
  73. package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
  74. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
  75. package/lib/cjs/interfaces/HandlerType.js +17 -0
  76. package/lib/cjs/interfaces/HandlerType.js.map +1 -0
  77. package/lib/cjs/interfaces/IncomingEvent.js +3 -0
  78. package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
  79. package/lib/cjs/interfaces/OnReady.js +3 -0
  80. package/lib/cjs/interfaces/OnReady.js.map +1 -0
  81. package/lib/cjs/interfaces/OnRequest.js +3 -0
  82. package/lib/cjs/interfaces/OnRequest.js.map +1 -0
  83. package/lib/cjs/interfaces/OnResponse.js +3 -0
  84. package/lib/cjs/interfaces/OnResponse.js.map +1 -0
  85. package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
  86. package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
  87. package/lib/cjs/interfaces/PathType.js +3 -0
  88. package/lib/cjs/interfaces/PathType.js.map +1 -0
  89. package/lib/cjs/interfaces/PlatformAdapter.js +3 -0
  90. package/lib/cjs/interfaces/PlatformAdapter.js.map +1 -0
  91. package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
  92. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
  93. package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
  94. package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
  95. package/lib/cjs/interfaces/Route.js +3 -0
  96. package/lib/cjs/interfaces/Route.js.map +1 -0
  97. package/lib/cjs/interfaces/index.js +21 -0
  98. package/lib/cjs/interfaces/index.js.map +1 -0
  99. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
  100. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  101. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +55 -0
  102. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
  103. package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
  104. package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
  105. package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
  106. package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
  107. package/lib/cjs/middlewares/index.js +7 -0
  108. package/lib/cjs/middlewares/index.js.map +1 -0
  109. package/lib/cjs/services/FakeRawDriver.js +26 -0
  110. package/lib/cjs/services/FakeRawDriver.js.map +1 -0
  111. package/lib/cjs/services/Platform.js +107 -0
  112. package/lib/cjs/services/Platform.js.map +1 -0
  113. package/lib/cjs/services/PlatformApplication.js +34 -0
  114. package/lib/cjs/services/PlatformApplication.js.map +1 -0
  115. package/lib/cjs/services/PlatformHandler.js +233 -0
  116. package/lib/cjs/services/PlatformHandler.js.map +1 -0
  117. package/lib/cjs/services/PlatformMiddlewaresChain.js +34 -0
  118. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
  119. package/lib/cjs/services/PlatformRequest.js +138 -0
  120. package/lib/cjs/services/PlatformRequest.js.map +1 -0
  121. package/lib/cjs/services/PlatformResponse.js +271 -0
  122. package/lib/cjs/services/PlatformResponse.js.map +1 -0
  123. package/lib/cjs/services/PlatformRouter.js +126 -0
  124. package/lib/cjs/services/PlatformRouter.js.map +1 -0
  125. package/lib/cjs/services/PlatformTest.js +166 -0
  126. package/lib/cjs/services/PlatformTest.js.map +1 -0
  127. package/lib/cjs/services/index.js +12 -0
  128. package/lib/cjs/services/index.js.map +1 -0
  129. package/lib/cjs/utils/createContext.js +38 -0
  130. package/lib/cjs/utils/createContext.js.map +1 -0
  131. package/lib/cjs/utils/createHandlerMetadata.js +49 -0
  132. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
  133. package/lib/cjs/utils/createHttpServer.js +34 -0
  134. package/lib/cjs/utils/createHttpServer.js.map +1 -0
  135. package/lib/cjs/utils/createHttpsServer.js +34 -0
  136. package/lib/cjs/utils/createHttpsServer.js.map +1 -0
  137. package/lib/cjs/utils/createInjector.js +38 -0
  138. package/lib/cjs/utils/createInjector.js.map +1 -0
  139. package/lib/cjs/utils/getConfiguration.js +42 -0
  140. package/lib/cjs/utils/getConfiguration.js.map +1 -0
  141. package/lib/cjs/utils/getStaticsOptions.js +21 -0
  142. package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
  143. package/lib/cjs/utils/index.js +11 -0
  144. package/lib/cjs/utils/index.js.map +1 -0
  145. package/lib/cjs/utils/listenServer.js +21 -0
  146. package/lib/cjs/utils/listenServer.js.map +1 -0
  147. package/lib/cjs/utils/mapReturnedResponse.js +15 -0
  148. package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
  149. package/lib/cjs/utils/printRoutes.js +36 -0
  150. package/lib/cjs/utils/printRoutes.js.map +1 -0
  151. package/lib/cjs/utils/setResponseHeaders.js +35 -0
  152. package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
  153. package/lib/cjs/utils/useCtxHandler.js +15 -0
  154. package/lib/cjs/utils/useCtxHandler.js.map +1 -0
  155. package/lib/esm/builder/PlatformBuilder.js +271 -0
  156. package/lib/esm/builder/PlatformBuilder.js.map +1 -0
  157. package/lib/esm/builder/PlatformControllerBuilder.js +79 -0
  158. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
  159. package/lib/esm/config/index.js +4 -0
  160. package/lib/esm/config/index.js.map +1 -0
  161. package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
  162. package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
  163. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +2 -0
  164. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  165. package/lib/esm/config/interfaces/PlatformLoggerSettings.js +2 -0
  166. package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  167. package/lib/esm/config/interfaces/PlatformMulterSettings.js +2 -0
  168. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -0
  169. package/lib/esm/config/interfaces/PlatformStaticsSettings.js +2 -0
  170. package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  171. package/lib/esm/config/interfaces/index.js +5 -0
  172. package/lib/esm/config/interfaces/index.js.map +1 -0
  173. package/lib/esm/config/services/PlatformConfiguration.js +178 -0
  174. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
  175. package/lib/esm/constants/routerOptions.js +2 -0
  176. package/lib/esm/constants/routerOptions.js.map +1 -0
  177. package/lib/esm/decorators/httpServer.js +28 -0
  178. package/lib/esm/decorators/httpServer.js.map +1 -0
  179. package/lib/esm/decorators/httpsServer.js +28 -0
  180. package/lib/esm/decorators/httpsServer.js.map +1 -0
  181. package/lib/esm/decorators/index.js +14 -0
  182. package/lib/esm/decorators/index.js.map +1 -0
  183. package/lib/esm/decorators/method/acceptMime.js +24 -0
  184. package/lib/esm/decorators/method/acceptMime.js.map +1 -0
  185. package/lib/esm/decorators/multer/index.js +4 -0
  186. package/lib/esm/decorators/multer/index.js.map +1 -0
  187. package/lib/esm/decorators/multer/multerFileSize.js +31 -0
  188. package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
  189. package/lib/esm/decorators/multer/multerOptions.js +48 -0
  190. package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
  191. package/lib/esm/decorators/multer/multipartFile.js +74 -0
  192. package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
  193. package/lib/esm/decorators/params/error.js +16 -0
  194. package/lib/esm/decorators/params/error.js.map +1 -0
  195. package/lib/esm/decorators/params/next.js +17 -0
  196. package/lib/esm/decorators/params/next.js.map +1 -0
  197. package/lib/esm/decorators/params/request.js +34 -0
  198. package/lib/esm/decorators/params/request.js.map +1 -0
  199. package/lib/esm/decorators/params/response.js +28 -0
  200. package/lib/esm/decorators/params/response.js.map +1 -0
  201. package/lib/esm/domain/AnyToPromiseWithCtx.js +23 -0
  202. package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
  203. package/lib/esm/domain/ControllerProvider.js +47 -0
  204. package/lib/esm/domain/ControllerProvider.js.map +1 -0
  205. package/lib/esm/domain/EndpointMetadata.js +67 -0
  206. package/lib/esm/domain/EndpointMetadata.js.map +1 -0
  207. package/lib/esm/domain/HandlerMetadata.js +53 -0
  208. package/lib/esm/domain/HandlerMetadata.js.map +1 -0
  209. package/lib/esm/domain/PlatformContext.js +88 -0
  210. package/lib/esm/domain/PlatformContext.js.map +1 -0
  211. package/lib/esm/domain/PlatformRouteDetails.js +20 -0
  212. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
  213. package/lib/esm/domain/index.js +7 -0
  214. package/lib/esm/domain/index.js.map +1 -0
  215. package/lib/esm/index.js +28 -0
  216. package/lib/esm/index.js.map +1 -0
  217. package/lib/esm/interfaces/AfterInit.js +2 -0
  218. package/lib/esm/interfaces/AfterInit.js.map +1 -0
  219. package/lib/esm/interfaces/AfterListen.js +2 -0
  220. package/lib/esm/interfaces/AfterListen.js.map +1 -0
  221. package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
  222. package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
  223. package/lib/esm/interfaces/BeforeInit.js +2 -0
  224. package/lib/esm/interfaces/BeforeInit.js.map +1 -0
  225. package/lib/esm/interfaces/BeforeListen.js +2 -0
  226. package/lib/esm/interfaces/BeforeListen.js.map +1 -0
  227. package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
  228. package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
  229. package/lib/esm/interfaces/HandlerType.js +14 -0
  230. package/lib/esm/interfaces/HandlerType.js.map +1 -0
  231. package/lib/esm/interfaces/IncomingEvent.js +2 -0
  232. package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
  233. package/lib/esm/interfaces/OnReady.js +2 -0
  234. package/lib/esm/interfaces/OnReady.js.map +1 -0
  235. package/lib/esm/interfaces/OnRequest.js +2 -0
  236. package/lib/esm/interfaces/OnRequest.js.map +1 -0
  237. package/lib/esm/interfaces/OnResponse.js +2 -0
  238. package/lib/esm/interfaces/OnResponse.js.map +1 -0
  239. package/lib/esm/interfaces/OnRoutesInit.js +2 -0
  240. package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
  241. package/lib/esm/interfaces/PathType.js +2 -0
  242. package/lib/esm/interfaces/PathType.js.map +1 -0
  243. package/lib/esm/interfaces/PlatformAdapter.js +2 -0
  244. package/lib/esm/interfaces/PlatformAdapter.js.map +1 -0
  245. package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
  246. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
  247. package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
  248. package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
  249. package/lib/esm/interfaces/Route.js +2 -0
  250. package/lib/esm/interfaces/Route.js.map +1 -0
  251. package/lib/esm/interfaces/index.js +18 -0
  252. package/lib/esm/interfaces/index.js.map +1 -0
  253. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
  254. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  255. package/lib/esm/middlewares/PlatformMulterMiddleware.js +52 -0
  256. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
  257. package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
  258. package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
  259. package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
  260. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
  261. package/lib/esm/middlewares/index.js +4 -0
  262. package/lib/esm/middlewares/index.js.map +1 -0
  263. package/lib/esm/services/FakeRawDriver.js +22 -0
  264. package/lib/esm/services/FakeRawDriver.js.map +1 -0
  265. package/lib/esm/services/Platform.js +104 -0
  266. package/lib/esm/services/Platform.js.map +1 -0
  267. package/lib/esm/services/PlatformApplication.js +31 -0
  268. package/lib/esm/services/PlatformApplication.js.map +1 -0
  269. package/lib/esm/services/PlatformHandler.js +230 -0
  270. package/lib/esm/services/PlatformHandler.js.map +1 -0
  271. package/lib/esm/services/PlatformMiddlewaresChain.js +31 -0
  272. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
  273. package/lib/esm/services/PlatformRequest.js +135 -0
  274. package/lib/esm/services/PlatformRequest.js.map +1 -0
  275. package/lib/esm/services/PlatformResponse.js +268 -0
  276. package/lib/esm/services/PlatformResponse.js.map +1 -0
  277. package/lib/esm/services/PlatformRouter.js +123 -0
  278. package/lib/esm/services/PlatformRouter.js.map +1 -0
  279. package/lib/esm/services/PlatformTest.js +162 -0
  280. package/lib/esm/services/PlatformTest.js.map +1 -0
  281. package/lib/esm/services/index.js +9 -0
  282. package/lib/esm/services/index.js.map +1 -0
  283. package/lib/esm/utils/createContext.js +34 -0
  284. package/lib/esm/utils/createContext.js.map +1 -0
  285. package/lib/esm/utils/createHandlerMetadata.js +45 -0
  286. package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
  287. package/lib/esm/utils/createHttpServer.js +29 -0
  288. package/lib/esm/utils/createHttpServer.js.map +1 -0
  289. package/lib/esm/utils/createHttpsServer.js +29 -0
  290. package/lib/esm/utils/createHttpsServer.js.map +1 -0
  291. package/lib/esm/utils/createInjector.js +34 -0
  292. package/lib/esm/utils/createInjector.js.map +1 -0
  293. package/lib/esm/utils/getConfiguration.js +38 -0
  294. package/lib/esm/utils/getConfiguration.js.map +1 -0
  295. package/lib/esm/utils/getStaticsOptions.js +17 -0
  296. package/lib/esm/utils/getStaticsOptions.js.map +1 -0
  297. package/lib/esm/utils/index.js +8 -0
  298. package/lib/esm/utils/index.js.map +1 -0
  299. package/lib/esm/utils/listenServer.js +17 -0
  300. package/lib/esm/utils/listenServer.js.map +1 -0
  301. package/lib/esm/utils/mapReturnedResponse.js +11 -0
  302. package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
  303. package/lib/esm/utils/printRoutes.js +32 -0
  304. package/lib/esm/utils/printRoutes.js.map +1 -0
  305. package/lib/esm/utils/setResponseHeaders.js +31 -0
  306. package/lib/esm/utils/setResponseHeaders.js.map +1 -0
  307. package/lib/esm/utils/useCtxHandler.js +11 -0
  308. package/lib/esm/utils/useCtxHandler.js.map +1 -0
  309. package/lib/{builder → types/builder}/PlatformBuilder.d.ts +25 -30
  310. package/lib/types/builder/PlatformControllerBuilder.d.ts +17 -0
  311. package/lib/{config → types/config}/index.d.ts +0 -0
  312. package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
  313. package/lib/{config → types/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
  314. package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -16
  315. package/lib/{config → types/config}/interfaces/PlatformMulterSettings.d.ts +0 -0
  316. package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
  317. package/lib/{config → types/config}/interfaces/index.d.ts +17 -2
  318. package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +13 -11
  319. package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
  320. package/lib/{decorators → types/decorators}/httpServer.d.ts +1 -0
  321. package/lib/{decorators → types/decorators}/httpsServer.d.ts +1 -0
  322. package/lib/{decorators → types/decorators}/index.d.ts +1 -5
  323. package/lib/{decorators → types/decorators}/method/acceptMime.d.ts +0 -0
  324. package/lib/{decorators → types/decorators}/multer/index.d.ts +0 -0
  325. package/lib/{decorators → types/decorators}/multer/multerFileSize.d.ts +0 -0
  326. package/lib/{decorators → types/decorators}/multer/multerOptions.d.ts +0 -0
  327. package/lib/{decorators → types/decorators}/multer/multipartFile.d.ts +0 -0
  328. package/lib/{decorators → types/decorators}/params/error.d.ts +0 -0
  329. package/lib/{decorators → types/decorators}/params/next.d.ts +0 -0
  330. package/lib/{decorators → types/decorators}/params/request.d.ts +0 -0
  331. package/lib/{decorators → types/decorators}/params/response.d.ts +0 -0
  332. package/lib/{domain → types/domain}/AnyToPromiseWithCtx.d.ts +0 -0
  333. package/lib/types/domain/ControllerProvider.d.ts +24 -0
  334. package/lib/{domain → types/domain}/EndpointMetadata.d.ts +3 -42
  335. package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
  336. package/lib/{domain → types/domain}/PlatformContext.d.ts +1 -1
  337. package/lib/{domain → types/domain}/PlatformRouteDetails.d.ts +4 -10
  338. package/lib/{domain → types/domain}/index.d.ts +0 -0
  339. package/lib/{index.d.ts → types/index.d.ts} +2 -3
  340. package/lib/{interfaces → types/interfaces}/AfterInit.d.ts +0 -0
  341. package/lib/{interfaces → types/interfaces}/AfterListen.d.ts +0 -0
  342. package/lib/{interfaces → types/interfaces}/AfterRoutesInit.d.ts +0 -0
  343. package/lib/{interfaces → types/interfaces}/BeforeInit.d.ts +0 -0
  344. package/lib/{interfaces → types/interfaces}/BeforeListen.d.ts +0 -0
  345. package/lib/{interfaces → types/interfaces}/BeforeRoutesInit.d.ts +0 -0
  346. package/lib/{interfaces → types/interfaces}/HandlerType.d.ts +0 -0
  347. package/lib/{interfaces → types/interfaces}/IncomingEvent.d.ts +0 -0
  348. package/lib/{interfaces → types/interfaces}/OnReady.d.ts +0 -0
  349. package/lib/{interfaces → types/interfaces}/OnRequest.d.ts +0 -0
  350. package/lib/{interfaces → types/interfaces}/OnResponse.d.ts +0 -0
  351. package/lib/{interfaces → types/interfaces}/OnRoutesInit.d.ts +0 -0
  352. package/lib/{interfaces → types/interfaces}/PathType.d.ts +0 -0
  353. package/lib/types/interfaces/PlatformAdapter.d.ts +19 -0
  354. package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +5 -3
  355. package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
  356. package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
  357. package/lib/{interfaces → types/interfaces}/index.d.ts +1 -2
  358. package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
  359. package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +0 -0
  360. package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
  361. package/lib/{middlewares → types/middlewares}/bindEndpointMiddleware.d.ts +0 -0
  362. package/lib/{middlewares → types/middlewares}/index.d.ts +0 -1
  363. package/lib/{services → types/services}/FakeRawDriver.d.ts +0 -0
  364. package/lib/{services → types/services}/Platform.d.ts +12 -6
  365. package/lib/{services → types/services}/PlatformApplication.d.ts +0 -0
  366. package/lib/{services → types/services}/PlatformHandler.d.ts +3 -8
  367. package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -0
  368. package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
  369. package/lib/{services → types/services}/PlatformResponse.d.ts +4 -4
  370. package/lib/{services → types/services}/PlatformRouter.d.ts +4 -3
  371. package/lib/{services → types/services}/PlatformTest.d.ts +7 -6
  372. package/lib/{services → types/services}/index.d.ts +1 -1
  373. package/lib/{utils → types/utils}/createContext.d.ts +0 -0
  374. package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +0 -0
  375. package/lib/types/utils/createHttpServer.d.ts +4 -0
  376. package/lib/types/utils/createHttpsServer.d.ts +4 -0
  377. package/lib/types/utils/createInjector.d.ts +7 -0
  378. package/lib/types/utils/getConfiguration.d.ts +2 -0
  379. package/lib/types/utils/getStaticsOptions.d.ts +5 -0
  380. package/lib/{utils → types/utils}/index.d.ts +0 -1
  381. package/lib/types/utils/listenServer.d.ts +7 -0
  382. package/lib/{utils → types/utils}/mapReturnedResponse.d.ts +0 -0
  383. package/lib/{utils → types/utils}/printRoutes.d.ts +0 -0
  384. package/lib/{utils → types/utils}/setResponseHeaders.d.ts +0 -0
  385. package/lib/{utils → types/utils}/useCtxHandler.d.ts +0 -0
  386. package/package.json +29 -24
  387. package/tsconfig.compile.esm.json +23 -0
  388. package/lib/PlatformModule.d.ts +0 -15
  389. package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
  390. package/lib/decorators/class/controller.d.ts +0 -43
  391. package/lib/decorators/method/endpointFn.d.ts +0 -8
  392. package/lib/decorators/method/location.d.ts +0 -1
  393. package/lib/decorators/method/redirect.d.ts +0 -1
  394. package/lib/decorators/method/route.d.ts +0 -128
  395. package/lib/domain/ControllerProvider.d.ts +0 -54
  396. package/lib/index.js +0 -3990
  397. package/lib/index.js.map +0 -1
  398. package/lib/index.modern.js +0 -3870
  399. package/lib/index.modern.js.map +0 -1
  400. package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
  401. package/lib/middlewares/PlatformLogMiddleware.d.ts +0 -44
  402. package/lib/registries/ControllerRegistry.d.ts +0 -1
  403. package/lib/services/ConverterService.d.ts +0 -27
  404. package/lib/utils/createHttpServer.d.ts +0 -3
  405. package/lib/utils/createHttpsServer.d.ts +0 -3
  406. package/lib/utils/createInjector.d.ts +0 -2
  407. package/lib/utils/createPlatformApplication.d.ts +0 -2
  408. package/lib/utils/getControllerPath.d.ts +0 -2
  409. package/lib/utils/listenServer.d.ts +0 -10
@@ -8,24 +8,30 @@ import { PlatformApplication } from "./PlatformApplication";
8
8
  * @platform
9
9
  */
10
10
  export declare class Platform {
11
- #private;
12
11
  readonly injector: InjectorService;
13
12
  readonly platformApplication: PlatformApplication;
13
+ private _routes;
14
+ private _controllers;
14
15
  constructor(injector: InjectorService, platformApplication: PlatformApplication);
15
16
  get app(): PlatformApplication<TsED.Application, TsED.Router>;
16
17
  get routes(): PlatformRouteDetails[];
17
18
  addRoutes(routes: Route[]): void;
18
- addRoute(endpoint: string, token: TokenProvider): this;
19
+ addRoute(basePath: string, token: TokenProvider): this | undefined;
19
20
  /**
20
21
  * Get all routes built by TsExpressDecorators and mounted on Express application.
21
22
  * @returns {PlatformRouteDetails[]}
22
23
  */
23
24
  getRoutes(): PlatformRouteDetails[];
24
25
  getMountedControllers(): RouteController[];
26
+ protected $onInit(): void;
25
27
  /**
26
- *
27
- * @param ctrl
28
- * @param endpointUrl
28
+ * Create routers from the collected controllers.
29
+ * @private
29
30
  */
30
- private buildRoutes;
31
+ private createRouters;
32
+ /**
33
+ * Create controllers from DI
34
+ * @private
35
+ */
36
+ private buildControllers;
31
37
  }
@@ -1,5 +1,6 @@
1
1
  import { InjectorService, Provider } from "@tsed/di";
2
2
  import { ArgScope, HandlerWithScope, PlatformParams } from "@tsed/platform-params";
3
+ import { PlatformResponseFilter } from "@tsed/platform-response-filter";
3
4
  import { EndpointMetadata } from "../domain/EndpointMetadata";
4
5
  import { HandlerMetadata } from "../domain/HandlerMetadata";
5
6
  import { PlatformContext } from "../domain/PlatformContext";
@@ -19,6 +20,7 @@ export interface OnRequestOptions {
19
20
  export declare class PlatformHandler {
20
21
  protected injector: InjectorService;
21
22
  protected params: PlatformParams;
23
+ protected responseFilter: PlatformResponseFilter;
22
24
  constructor(injector: InjectorService, params: PlatformParams);
23
25
  /**
24
26
  * Create a native middleware based on the given metadata and return an instance of AnyToPromiseWithCtx
@@ -46,7 +48,7 @@ export declare class PlatformHandler {
46
48
  * @param requestOptions
47
49
  */
48
50
  protected onRequest(requestOptions: OnRequestOptions): Promise<any>;
49
- protected onError(er: unknown, requestOptions: OnRequestOptions): Promise<any>;
51
+ protected onError(er: Error, requestOptions: OnRequestOptions): Promise<any>;
50
52
  /**
51
53
  * Manage success scenario
52
54
  * @param data
@@ -62,13 +64,6 @@ export declare class PlatformHandler {
62
64
  * @protected
63
65
  */
64
66
  protected callReturnedMiddleware(middleware: any, ctx: PlatformContext, next: any): any;
65
- /**
66
- * Render the view if the endpoint has a configured view.
67
- * @param data
68
- * @param ctx
69
- * @protected
70
- */
71
- protected render(data: any, ctx: PlatformContext): Promise<any>;
72
67
  /**
73
68
  * create Raw handler
74
69
  * @param metadata
@@ -0,0 +1,6 @@
1
+ import { JsonOperationRoute } from "@tsed/schema";
2
+ import { ControllerProvider } from "../domain/ControllerProvider";
3
+ import { EndpointMetadata } from "../domain/EndpointMetadata";
4
+ export declare class PlatformMiddlewaresChain {
5
+ get(provider: ControllerProvider, operationRoute: JsonOperationRoute<EndpointMetadata>): any[];
6
+ }
@@ -18,12 +18,13 @@ declare global {
18
18
  export declare class PlatformRequest<T extends {
19
19
  [key: string]: any;
20
20
  } = any> {
21
+ protected $ctx: PlatformContext;
21
22
  raw: T;
22
23
  /**
23
24
  * The current @@PlatformResponse@@.
24
25
  */
25
26
  response: PlatformResponse;
26
- constructor({ request }: IncomingEvent);
27
+ constructor({ request }: IncomingEvent, $ctx: PlatformContext);
27
28
  get secure(): boolean;
28
29
  get host(): string;
29
30
  get protocol(): string;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
- import { PlatformViews } from "@tsed/platform-views";
3
2
  import { ServerResponse } from "http";
4
3
  import { IncomingEvent } from "../interfaces/IncomingEvent";
5
4
  import type { PlatformRequest } from "./PlatformRequest";
5
+ import type { PlatformContext } from "../domain/PlatformContext";
6
6
  declare global {
7
7
  namespace TsED {
8
8
  interface Response {
@@ -15,14 +15,14 @@ export declare type HeaderValue = Array<boolean | number | string> | boolean | n
15
15
  * @platform
16
16
  */
17
17
  export declare class PlatformResponse<T extends Record<string, any> = any> {
18
- platformViews: PlatformViews;
18
+ protected $ctx: PlatformContext;
19
19
  /**
20
20
  * The current @@PlatformRequest@@.
21
21
  */
22
22
  request: PlatformRequest;
23
23
  data: any;
24
24
  raw: T;
25
- constructor({ response }: IncomingEvent);
25
+ constructor({ response }: IncomingEvent, $ctx: PlatformContext);
26
26
  /**
27
27
  * Get the current statusCode
28
28
  */
@@ -139,7 +139,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
139
139
  * @param path
140
140
  * @param options
141
141
  */
142
- render(path: string, options?: any): Promise<string>;
142
+ render(path: string, options?: any): Promise<any>;
143
143
  /**
144
144
  * Send any data to your consumer.
145
145
  *
@@ -1,6 +1,6 @@
1
- import { InjectorService } from "@tsed/di";
1
+ import { InjectorService, PathType } from "@tsed/di";
2
2
  import { PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions } from "../config";
3
- import { PathType, PlatformRouteWithoutHandlers, PlatformRouteOptions } from "../interfaces";
3
+ import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces";
4
4
  import { PlatformHandler } from "./PlatformHandler";
5
5
  /**
6
6
  * @ignore
@@ -20,6 +20,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
20
20
  protected platformHandler: PlatformHandler;
21
21
  rawRouter: Router;
22
22
  raw: any;
23
+ isBuilt: boolean;
23
24
  injector: InjectorService;
24
25
  constructor(platformHandler: PlatformHandler);
25
26
  /**
@@ -32,7 +33,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
32
33
  callback(): any;
33
34
  getRouter(): Router;
34
35
  use(...handlers: any[]): this;
35
- addRoute(options: PlatformRouteOptions): this;
36
+ addRoute(options: Partial<PlatformRouteOptions>): this;
36
37
  all(path: PathType, ...handlers: any[]): this;
37
38
  get(path: PathType, ...handlers: any[]): this;
38
39
  post(path: PathType, ...handlers: any[]): this;
@@ -1,13 +1,13 @@
1
- import { Type } from "@tsed/core";
2
- import { DITest, InjectorService } from "@tsed/di";
3
- import { PlatformBuilder } from "../builder/PlatformBuilder";
1
+ import { DITest, DITestOptions, InjectorService } from "@tsed/di";
4
2
  import { PlatformContext, PlatformContextOptions } from "../domain/PlatformContext";
3
+ import { PlatformAdapter, PlatformBuilderSettings } from "../interfaces/PlatformAdapter";
4
+ import { Type } from "@tsed/core";
5
5
  /**
6
6
  * @platform
7
7
  */
8
8
  export declare class PlatformTest extends DITest {
9
- static platformBuilder: Type<PlatformBuilder<any, any>>;
10
- static create(options?: Partial<TsED.Configuration>): Promise<void>;
9
+ static adapter: Type<PlatformAdapter>;
10
+ static create(settings?: DITestOptions): Promise<void>;
11
11
  /**
12
12
  * Create a new injector with the right default services
13
13
  */
@@ -16,10 +16,11 @@ export declare class PlatformTest extends DITest {
16
16
  * Load the server silently without listening port and configure it on test profile.
17
17
  * @decorator
18
18
  * @param mod
19
+ * @param listen
19
20
  * @param settings
20
21
  * @returns {Promise<void>}
21
22
  */
22
- static bootstrap(mod: any, settings?: Partial<TsED.Configuration & {
23
+ static bootstrap(mod: any, { listen, ...settings }?: Partial<PlatformBuilderSettings & {
23
24
  listen: boolean;
24
25
  }>): () => Promise<void>;
25
26
  /**
@@ -5,4 +5,4 @@ export * from "./PlatformRequest";
5
5
  export * from "./PlatformResponse";
6
6
  export * from "./PlatformRouter";
7
7
  export * from "./PlatformTest";
8
- export * from "./ConverterService";
8
+ export * from "./PlatformMiddlewaresChain";
File without changes
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import { InjectorService } from "@tsed/di";
3
+ import Http from "http";
4
+ export declare function createHttpServer(injector: InjectorService, requestListener: Http.RequestListener): (() => Promise<void>) | undefined;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import { InjectorService } from "@tsed/di";
3
+ import Http from "http";
4
+ export declare function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener): (() => Promise<void>) | undefined;
@@ -0,0 +1,7 @@
1
+ import { InjectorService, IProvider } from "@tsed/di";
2
+ interface CreateInjectorOptions {
3
+ providers?: IProvider[];
4
+ settings?: Partial<TsED.Configuration>;
5
+ }
6
+ export declare function createInjector({ providers, settings }: CreateInjectorOptions): InjectorService;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Type } from "@tsed/core";
2
+ export declare function getConfiguration(configuration?: any, module?: Type<any> | null): any;
@@ -0,0 +1,5 @@
1
+ import { PlatformStaticsOptions, PlatformStaticsSettings } from "../config/interfaces/PlatformStaticsSettings";
2
+ export declare function getStaticsOptions(statics?: PlatformStaticsSettings): {
3
+ path: string;
4
+ options: PlatformStaticsOptions;
5
+ }[];
@@ -1,5 +1,4 @@
1
1
  export * from "./createInjector";
2
- export * from "./createPlatformApplication";
3
2
  export * from "./createHttpServer";
4
3
  export * from "./createHttpsServer";
5
4
  export * from "./printRoutes";
@@ -0,0 +1,7 @@
1
+ /// <reference types="node" />
2
+ import type Http from "http";
3
+ import type Https from "https";
4
+ import type Http2 from "http2";
5
+ import { InjectorService } from "@tsed/di";
6
+ import { getHostInfoFromPort } from "@tsed/core";
7
+ export declare function listenServer(injector: InjectorService, server: Http.Server | Https.Server | Http2.Http2Server, hostInfo: ReturnType<typeof getHostInfoFromPort>): Promise<ReturnType<typeof getHostInfoFromPort>>;
File without changes
File without changes
package/package.json CHANGED
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "name": "@tsed/common",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-beta.3",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
- "main": "./lib/index.js",
8
- "typings": "./lib/index.d.ts",
7
+ "main": "./lib/cjs/index.js",
8
+ "typings": "./lib/types/index.d.ts",
9
9
  "exports": {
10
- "require": "./lib/index.js",
11
- "default": "./lib/index.modern.js"
10
+ "types": "./lib/types/index.d.ts",
11
+ "import": "./lib/esm/index.js",
12
+ "require": "./lib/cjs/index.js",
13
+ "default": "./lib/esm/index.js"
14
+ },
15
+ "scripts": {
16
+ "build": "yarn run build:esm && yarn run build:cjs",
17
+ "build:cjs": "tsc --build tsconfig.compile.json",
18
+ "build:esm": "tsc --build tsconfig.compile.esm.json"
12
19
  },
13
20
  "keywords": [
14
21
  "Express",
@@ -39,7 +46,7 @@
39
46
  "bugs": {
40
47
  "url": "https://github.com/tsedio/tsed/issues"
41
48
  },
42
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/platform/common",
49
+ "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/platform/common",
43
50
  "repository": "https://github.com/tsedio/tsed",
44
51
  "funding": [
45
52
  {
@@ -51,26 +58,24 @@
51
58
  "url": "https://opencollective.com/tsed"
52
59
  }
53
60
  ],
54
- "scripts": {
55
- "build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json"
56
- },
57
61
  "dependencies": {
58
- "@tsed/components-scan": "7.0.0-alpha.1",
59
- "@tsed/core": "7.0.0-alpha.1",
60
- "@tsed/di": "7.0.0-alpha.1",
61
- "@tsed/exceptions": "7.0.0-alpha.1",
62
- "@tsed/json-mapper": "7.0.0-alpha.1",
63
- "@tsed/logger": "^5.16.0",
64
- "@tsed/perf": "7.0.0-alpha.1",
65
- "@tsed/platform-cache": "7.0.0-alpha.1",
66
- "@tsed/platform-exceptions": "7.0.0-alpha.1",
67
- "@tsed/platform-middlewares": "7.0.0-alpha.1",
68
- "@tsed/platform-params": "7.0.0-alpha.1",
69
- "@tsed/platform-response-filter": "7.0.0-alpha.1",
70
- "@tsed/platform-views": "7.0.0-alpha.1",
71
- "@tsed/schema": "7.0.0-alpha.1",
62
+ "@tsed/components-scan": "7.0.0-beta.3",
63
+ "@tsed/core": "7.0.0-beta.3",
64
+ "@tsed/di": "7.0.0-beta.3",
65
+ "@tsed/exceptions": "7.0.0-beta.3",
66
+ "@tsed/json-mapper": "7.0.0-beta.3",
67
+ "@tsed/logger": "^6.0.0",
68
+ "@tsed/logger-file": "^6.0.0",
69
+ "@tsed/perf": "7.0.0-beta.3",
70
+ "@tsed/platform-cache": "7.0.0-beta.3",
71
+ "@tsed/platform-exceptions": "7.0.0-beta.3",
72
+ "@tsed/platform-log-middleware": "7.0.0-beta.3",
73
+ "@tsed/platform-middlewares": "7.0.0-beta.3",
74
+ "@tsed/platform-params": "7.0.0-beta.3",
75
+ "@tsed/platform-response-filter": "7.0.0-beta.3",
76
+ "@tsed/platform-views": "7.0.0-beta.3",
77
+ "@tsed/schema": "7.0.0-beta.3",
72
78
  "@types/json-schema": "7.0.7",
73
- "json-schema": "^0.2.3",
74
79
  "on-finished": "2.3.0",
75
80
  "tslib": "2.2.0",
76
81
  "uuid": "8.3.2"
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "./tsconfig.compile.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "module": "ES2020",
6
+ "rootDir": "src",
7
+ "outDir": "./lib/esm",
8
+ "declaration": true,
9
+ "declarationDir": "./lib/types"
10
+ },
11
+ "exclude": [
12
+ "node_modules",
13
+ "test",
14
+ "lib",
15
+ "benchmark",
16
+ "coverage",
17
+ "spec",
18
+ "**/*.benchmark.ts",
19
+ "**/*.spec.ts",
20
+ "keys",
21
+ "jest.config.js"
22
+ ]
23
+ }
@@ -1,15 +0,0 @@
1
- import { InjectorService } from "@tsed/di";
2
- import { Platform } from "./services/Platform";
3
- /**
4
- * @ignore
5
- */
6
- export declare class PlatformModule {
7
- protected injector: InjectorService;
8
- protected platform: Platform;
9
- constructor(injector: InjectorService, platform: Platform);
10
- /**
11
- * Create routers from the collected controllers
12
- */
13
- createRoutersFromControllers(): (import("./interfaces").PlatformRouterMethods<any> | undefined)[];
14
- $$loadRoutes(): void;
15
- }
@@ -1,19 +0,0 @@
1
- import { InjectorService } from "@tsed/di";
2
- import { ControllerProvider } from "../domain/ControllerProvider";
3
- import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
4
- /**
5
- * @ignore
6
- */
7
- export declare class PlatformControllerBuilder {
8
- private provider;
9
- constructor(provider: ControllerProvider);
10
- /**
11
- *
12
- * @returns {any}
13
- */
14
- build(injector: InjectorService): PlatformRouterMethods;
15
- private buildEndpoints;
16
- private buildEndpoint;
17
- private buildChildrenCtrls;
18
- private buildMiddlewares;
19
- }
@@ -1,43 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { IProvider } from "@tsed/di";
3
- import { PathType } from "../../interfaces";
4
- export interface ControllerMiddlewares {
5
- useBefore: any[];
6
- use: any[];
7
- useAfter: any[];
8
- }
9
- export interface ControllerOptions extends Partial<IProvider<any>> {
10
- path?: PathType;
11
- children?: Type<any>[];
12
- routerOptions?: any;
13
- middlewares?: Partial<ControllerMiddlewares>;
14
- }
15
- /**
16
- * Declare a new controller with his Rest path. His methods annotated will be collected to build the routing list.
17
- * This routing listing will be built with the `express.Router` object.
18
- *
19
- * ::: tip
20
- * See [Controllers](/docs/controllers.md) section for more details
21
- * :::
22
- *
23
- * ```typescript
24
- * @Controller("/calendars")
25
- * export provide CalendarCtrl {
26
- *
27
- * @Get("/:id")
28
- * public get(
29
- * @Req() request: Req,
30
- * @Res() response: Res,
31
- * @Next() next: Next
32
- * ): void {
33
- *
34
- * }
35
- * }
36
- * ```
37
- *
38
- * @param options
39
- * @controller
40
- * @decorator
41
- * @classDecorator
42
- */
43
- export declare function Controller(options: PathType | ControllerOptions): ClassDecorator;
@@ -1,8 +0,0 @@
1
- import { DecoratorParameters } from "@tsed/core";
2
- import { EndpointMetadata } from "../../domain";
3
- /**
4
- *
5
- * @param fn
6
- * @decorator
7
- */
8
- export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
@@ -1 +0,0 @@
1
- export { Location } from "@tsed/schema";
@@ -1 +0,0 @@
1
- export { Redirect } from "@tsed/schema";
@@ -1,128 +0,0 @@
1
- /**
2
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
3
- *
4
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
5
- * For example, if you placed the following route at the top of all other route definitions, it would require that
6
- * all routes from that point on would require authentication, and automatically load a user.
7
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
8
- * to continue matching subsequent routes.
9
- * @param path
10
- * @param args
11
- * @returns {Function}
12
- * @decorator
13
- * @operation
14
- * @httpMethod
15
- */
16
- export declare function All(path?: string | RegExp | any, ...args: any[]): Function;
17
- /**
18
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
19
- *
20
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
21
- * For example, if you placed the following route at the top of all other route definitions, it would require that
22
- * all routes from that point on would require authentication, and automatically load a user.
23
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
24
- * to continue matching subsequent routes.
25
- * @param path
26
- * @param args
27
- * @returns {Function}
28
- * @decorator
29
- * @operation
30
- * @httpMethod
31
- */
32
- export declare function Get(path?: string | RegExp | any, ...args: any[]): Function;
33
- /**
34
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
35
- *
36
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
37
- * For example, if you placed the following route at the top of all other route definitions, it would require that
38
- * all routes from that point on would require authentication, and automatically load a user.
39
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
40
- * to continue matching subsequent routes.
41
- * @param path
42
- * @param args
43
- * @returns {Function}
44
- * @decorator
45
- * @operation
46
- * @httpMethod
47
- */
48
- export declare function Post(path?: string | RegExp | any, ...args: any[]): Function;
49
- /**
50
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
51
- *
52
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
53
- * For example, if you placed the following route at the top of all other route definitions, it would require that
54
- * all routes from that point on would require authentication, and automatically load a user.
55
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
56
- * to continue matching subsequent routes.
57
- * @param path
58
- * @param args
59
- * @returns {Function}
60
- * @decorator
61
- * @operation
62
- * @httpMethod
63
- */
64
- export declare function Put(path?: string | RegExp | any, ...args: any[]): Function;
65
- /**
66
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
67
- *
68
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
69
- * For example, if you placed the following route at the top of all other route definitions, it would require that
70
- * all routes from that point on would require authentication, and automatically load a user.
71
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
72
- * to continue matching subsequent routes.
73
- * @param path
74
- * @param args
75
- * @returns {Function}
76
- * @decorator
77
- * @operation
78
- * @httpMethod
79
- */
80
- export declare function Delete(path?: string | RegExp | any, ...args: any[]): Function;
81
- /**
82
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
83
- *
84
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
85
- * For example, if you placed the following route at the top of all other route definitions, it would require that
86
- * all routes from that point on would require authentication, and automatically load a user.
87
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
88
- * to continue matching subsequent routes.
89
- * @param path
90
- * @param args
91
- * @returns {Function}
92
- * @decorator
93
- * @operation
94
- * @httpMethod
95
- */
96
- export declare function Head(path?: string | RegExp | any, ...args: any[]): Function;
97
- /**
98
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
99
- *
100
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
101
- * For example, if you placed the following route at the top of all other route definitions, it would require that
102
- * all routes from that point on would require authentication, and automatically load a user.
103
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
104
- * to continue matching subsequent routes.
105
- * @param path
106
- * @param args
107
- * @returns {Function}
108
- * @decorator
109
- * @operation
110
- * @httpMethod
111
- */
112
- export declare function Patch(path?: string | RegExp | any, ...args: any[]): Function;
113
- /**
114
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
115
- *
116
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
117
- * For example, if you placed the following route at the top of all other route definitions, it would require that
118
- * all routes from that point on would require authentication, and automatically load a user.
119
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
120
- * to continue matching subsequent routes.
121
- * @param path
122
- * @param args
123
- * @returns {Function}
124
- * @decorator
125
- * @operation
126
- * @httpMethod
127
- */
128
- export declare function Options(path?: string | RegExp | any, ...args: any[]): Function;
@@ -1,54 +0,0 @@
1
- import { Provider, TokenProvider } from "@tsed/di";
2
- import { JsonEntityStore } from "@tsed/schema";
3
- import { ControllerMiddlewares } from "../decorators/class/controller";
4
- import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
5
- import { EndpointMetadata } from "./EndpointMetadata";
6
- export declare class ControllerProvider<T = any> extends Provider<T> {
7
- readonly entity: JsonEntityStore;
8
- private router;
9
- constructor(provide: TokenProvider, options?: Partial<Provider>);
10
- get path(): string;
11
- set path(path: string);
12
- /**
13
- *
14
- * @returns {EndpointMetadata[]}
15
- */
16
- get endpoints(): EndpointMetadata[];
17
- get children(): TokenProvider[];
18
- /**
19
- *
20
- * @returns {ControllerProvider}
21
- */
22
- get parent(): TokenProvider | undefined;
23
- /**
24
- *
25
- */
26
- get routerOptions(): any;
27
- /**
28
- *
29
- * @param value
30
- */
31
- set routerOptions(value: any);
32
- /**
33
- *
34
- * @returns {any[]}
35
- */
36
- get middlewares(): ControllerMiddlewares;
37
- /**
38
- *
39
- * @param middlewares
40
- */
41
- set middlewares(middlewares: ControllerMiddlewares);
42
- /**
43
- *
44
- * @returns {boolean}
45
- */
46
- hasChildren(): boolean;
47
- /**
48
- *
49
- * @returns {boolean}
50
- */
51
- hasParent(): boolean;
52
- getRouter<T extends PlatformRouterMethods = any>(): T;
53
- setRouter(router: PlatformRouterMethods): this;
54
- }