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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) 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 +21 -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/method/endpointFn.js +15 -0
  32. package/lib/cjs/decorators/method/endpointFn.js.map +1 -0
  33. package/lib/cjs/decorators/method/location.js +6 -0
  34. package/lib/cjs/decorators/method/location.js.map +1 -0
  35. package/lib/cjs/decorators/method/redirect.js +6 -0
  36. package/lib/cjs/decorators/method/redirect.js.map +1 -0
  37. package/lib/cjs/decorators/method/route.js +13 -0
  38. package/lib/cjs/decorators/method/route.js.map +1 -0
  39. package/lib/cjs/decorators/method/view.js +34 -0
  40. package/lib/cjs/decorators/method/view.js.map +1 -0
  41. package/lib/cjs/decorators/multer/index.js +7 -0
  42. package/lib/cjs/decorators/multer/index.js.map +1 -0
  43. package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
  44. package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
  45. package/lib/cjs/decorators/multer/multerOptions.js +52 -0
  46. package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
  47. package/lib/cjs/decorators/multer/multipartFile.js +78 -0
  48. package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
  49. package/lib/cjs/decorators/params/error.js +20 -0
  50. package/lib/cjs/decorators/params/error.js.map +1 -0
  51. package/lib/cjs/decorators/params/next.js +21 -0
  52. package/lib/cjs/decorators/params/next.js.map +1 -0
  53. package/lib/cjs/decorators/params/request.js +39 -0
  54. package/lib/cjs/decorators/params/request.js.map +1 -0
  55. package/lib/cjs/decorators/params/response.js +33 -0
  56. package/lib/cjs/decorators/params/response.js.map +1 -0
  57. package/lib/cjs/domain/AnyToPromiseWithCtx.js +27 -0
  58. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
  59. package/lib/cjs/domain/ControllerProvider.js +51 -0
  60. package/lib/cjs/domain/ControllerProvider.js.map +1 -0
  61. package/lib/cjs/domain/EndpointMetadata.js +70 -0
  62. package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
  63. package/lib/cjs/domain/HandlerMetadata.js +57 -0
  64. package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
  65. package/lib/cjs/domain/PlatformContext.js +92 -0
  66. package/lib/cjs/domain/PlatformContext.js.map +1 -0
  67. package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
  68. package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
  69. package/lib/cjs/domain/index.js +10 -0
  70. package/lib/cjs/domain/index.js.map +1 -0
  71. package/lib/cjs/index.js +34 -0
  72. package/lib/cjs/index.js.map +1 -0
  73. package/lib/cjs/interfaces/AfterInit.js +3 -0
  74. package/lib/cjs/interfaces/AfterInit.js.map +1 -0
  75. package/lib/cjs/interfaces/AfterListen.js +3 -0
  76. package/lib/cjs/interfaces/AfterListen.js.map +1 -0
  77. package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
  78. package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
  79. package/lib/cjs/interfaces/BeforeInit.js +3 -0
  80. package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
  81. package/lib/cjs/interfaces/BeforeListen.js +3 -0
  82. package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
  83. package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
  84. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
  85. package/lib/cjs/interfaces/HandlerType.js +17 -0
  86. package/lib/cjs/interfaces/HandlerType.js.map +1 -0
  87. package/lib/cjs/interfaces/IncomingEvent.js +3 -0
  88. package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
  89. package/lib/cjs/interfaces/OnReady.js +3 -0
  90. package/lib/cjs/interfaces/OnReady.js.map +1 -0
  91. package/lib/cjs/interfaces/OnRequest.js +3 -0
  92. package/lib/cjs/interfaces/OnRequest.js.map +1 -0
  93. package/lib/cjs/interfaces/OnResponse.js +3 -0
  94. package/lib/cjs/interfaces/OnResponse.js.map +1 -0
  95. package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
  96. package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
  97. package/lib/cjs/interfaces/PathType.js +3 -0
  98. package/lib/cjs/interfaces/PathType.js.map +1 -0
  99. package/lib/cjs/interfaces/PlatformAdapter.js +3 -0
  100. package/lib/cjs/interfaces/PlatformAdapter.js.map +1 -0
  101. package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
  102. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
  103. package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
  104. package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
  105. package/lib/cjs/interfaces/Route.js +3 -0
  106. package/lib/cjs/interfaces/Route.js.map +1 -0
  107. package/lib/cjs/interfaces/index.js +21 -0
  108. package/lib/cjs/interfaces/index.js.map +1 -0
  109. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
  110. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  111. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +55 -0
  112. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
  113. package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
  114. package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
  115. package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
  116. package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
  117. package/lib/cjs/middlewares/index.js +7 -0
  118. package/lib/cjs/middlewares/index.js.map +1 -0
  119. package/lib/cjs/services/FakeRawDriver.js +26 -0
  120. package/lib/cjs/services/FakeRawDriver.js.map +1 -0
  121. package/lib/cjs/services/Platform.js +107 -0
  122. package/lib/cjs/services/Platform.js.map +1 -0
  123. package/lib/cjs/services/PlatformApplication.js +34 -0
  124. package/lib/cjs/services/PlatformApplication.js.map +1 -0
  125. package/lib/cjs/services/PlatformHandler.js +233 -0
  126. package/lib/cjs/services/PlatformHandler.js.map +1 -0
  127. package/lib/cjs/services/PlatformMiddlewaresChain.js +34 -0
  128. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
  129. package/lib/cjs/services/PlatformRequest.js +138 -0
  130. package/lib/cjs/services/PlatformRequest.js.map +1 -0
  131. package/lib/cjs/services/PlatformResponse.js +271 -0
  132. package/lib/cjs/services/PlatformResponse.js.map +1 -0
  133. package/lib/cjs/services/PlatformRouter.js +126 -0
  134. package/lib/cjs/services/PlatformRouter.js.map +1 -0
  135. package/lib/cjs/services/PlatformTest.js +166 -0
  136. package/lib/cjs/services/PlatformTest.js.map +1 -0
  137. package/lib/cjs/services/index.js +12 -0
  138. package/lib/cjs/services/index.js.map +1 -0
  139. package/lib/cjs/utils/createContext.js +38 -0
  140. package/lib/cjs/utils/createContext.js.map +1 -0
  141. package/lib/cjs/utils/createHandlerMetadata.js +49 -0
  142. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
  143. package/lib/cjs/utils/createHttpServer.js +34 -0
  144. package/lib/cjs/utils/createHttpServer.js.map +1 -0
  145. package/lib/cjs/utils/createHttpsServer.js +34 -0
  146. package/lib/cjs/utils/createHttpsServer.js.map +1 -0
  147. package/lib/cjs/utils/createInjector.js +38 -0
  148. package/lib/cjs/utils/createInjector.js.map +1 -0
  149. package/lib/cjs/utils/getConfiguration.js +42 -0
  150. package/lib/cjs/utils/getConfiguration.js.map +1 -0
  151. package/lib/cjs/utils/getStaticsOptions.js +21 -0
  152. package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
  153. package/lib/cjs/utils/index.js +11 -0
  154. package/lib/cjs/utils/index.js.map +1 -0
  155. package/lib/cjs/utils/listenServer.js +21 -0
  156. package/lib/cjs/utils/listenServer.js.map +1 -0
  157. package/lib/cjs/utils/mapReturnedResponse.js +15 -0
  158. package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
  159. package/lib/cjs/utils/printRoutes.js +36 -0
  160. package/lib/cjs/utils/printRoutes.js.map +1 -0
  161. package/lib/cjs/utils/setResponseHeaders.js +35 -0
  162. package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
  163. package/lib/cjs/utils/useCtxHandler.js +15 -0
  164. package/lib/cjs/utils/useCtxHandler.js.map +1 -0
  165. package/lib/esm/builder/PlatformBuilder.js +271 -0
  166. package/lib/esm/builder/PlatformBuilder.js.map +1 -0
  167. package/lib/esm/builder/PlatformControllerBuilder.js +79 -0
  168. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
  169. package/lib/esm/config/index.js +4 -0
  170. package/lib/esm/config/index.js.map +1 -0
  171. package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
  172. package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
  173. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +2 -0
  174. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  175. package/lib/esm/config/interfaces/PlatformLoggerSettings.js +2 -0
  176. package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  177. package/lib/esm/config/interfaces/PlatformMulterSettings.js +2 -0
  178. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -0
  179. package/lib/esm/config/interfaces/PlatformStaticsSettings.js +2 -0
  180. package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  181. package/lib/esm/config/interfaces/index.js +5 -0
  182. package/lib/esm/config/interfaces/index.js.map +1 -0
  183. package/lib/esm/config/services/PlatformConfiguration.js +178 -0
  184. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
  185. package/lib/esm/constants/routerOptions.js +2 -0
  186. package/lib/esm/constants/routerOptions.js.map +1 -0
  187. package/lib/esm/decorators/httpServer.js +28 -0
  188. package/lib/esm/decorators/httpServer.js.map +1 -0
  189. package/lib/esm/decorators/httpsServer.js +28 -0
  190. package/lib/esm/decorators/httpsServer.js.map +1 -0
  191. package/lib/esm/decorators/index.js +18 -0
  192. package/lib/esm/decorators/index.js.map +1 -0
  193. package/lib/esm/decorators/method/acceptMime.js +24 -0
  194. package/lib/esm/decorators/method/acceptMime.js.map +1 -0
  195. package/lib/esm/decorators/method/endpointFn.js +11 -0
  196. package/lib/esm/decorators/method/endpointFn.js.map +1 -0
  197. package/lib/esm/decorators/method/location.js +2 -0
  198. package/lib/esm/decorators/method/location.js.map +1 -0
  199. package/lib/esm/decorators/method/redirect.js +2 -0
  200. package/lib/esm/decorators/method/redirect.js.map +1 -0
  201. package/lib/esm/decorators/method/route.js +2 -0
  202. package/lib/esm/decorators/method/route.js.map +1 -0
  203. package/lib/esm/decorators/method/view.js +30 -0
  204. package/lib/esm/decorators/method/view.js.map +1 -0
  205. package/lib/esm/decorators/multer/index.js +4 -0
  206. package/lib/esm/decorators/multer/index.js.map +1 -0
  207. package/lib/esm/decorators/multer/multerFileSize.js +31 -0
  208. package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
  209. package/lib/esm/decorators/multer/multerOptions.js +48 -0
  210. package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
  211. package/lib/esm/decorators/multer/multipartFile.js +74 -0
  212. package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
  213. package/lib/esm/decorators/params/error.js +16 -0
  214. package/lib/esm/decorators/params/error.js.map +1 -0
  215. package/lib/esm/decorators/params/next.js +17 -0
  216. package/lib/esm/decorators/params/next.js.map +1 -0
  217. package/lib/esm/decorators/params/request.js +34 -0
  218. package/lib/esm/decorators/params/request.js.map +1 -0
  219. package/lib/esm/decorators/params/response.js +28 -0
  220. package/lib/esm/decorators/params/response.js.map +1 -0
  221. package/lib/esm/domain/AnyToPromiseWithCtx.js +23 -0
  222. package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
  223. package/lib/esm/domain/ControllerProvider.js +47 -0
  224. package/lib/esm/domain/ControllerProvider.js.map +1 -0
  225. package/lib/esm/domain/EndpointMetadata.js +67 -0
  226. package/lib/esm/domain/EndpointMetadata.js.map +1 -0
  227. package/lib/esm/domain/HandlerMetadata.js +53 -0
  228. package/lib/esm/domain/HandlerMetadata.js.map +1 -0
  229. package/lib/esm/domain/PlatformContext.js +88 -0
  230. package/lib/esm/domain/PlatformContext.js.map +1 -0
  231. package/lib/esm/domain/PlatformRouteDetails.js +20 -0
  232. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
  233. package/lib/esm/domain/index.js +7 -0
  234. package/lib/esm/domain/index.js.map +1 -0
  235. package/lib/esm/index.js +28 -0
  236. package/lib/esm/index.js.map +1 -0
  237. package/lib/esm/interfaces/AfterInit.js +2 -0
  238. package/lib/esm/interfaces/AfterInit.js.map +1 -0
  239. package/lib/esm/interfaces/AfterListen.js +2 -0
  240. package/lib/esm/interfaces/AfterListen.js.map +1 -0
  241. package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
  242. package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
  243. package/lib/esm/interfaces/BeforeInit.js +2 -0
  244. package/lib/esm/interfaces/BeforeInit.js.map +1 -0
  245. package/lib/esm/interfaces/BeforeListen.js +2 -0
  246. package/lib/esm/interfaces/BeforeListen.js.map +1 -0
  247. package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
  248. package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
  249. package/lib/esm/interfaces/HandlerType.js +14 -0
  250. package/lib/esm/interfaces/HandlerType.js.map +1 -0
  251. package/lib/esm/interfaces/IncomingEvent.js +2 -0
  252. package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
  253. package/lib/esm/interfaces/OnReady.js +2 -0
  254. package/lib/esm/interfaces/OnReady.js.map +1 -0
  255. package/lib/esm/interfaces/OnRequest.js +2 -0
  256. package/lib/esm/interfaces/OnRequest.js.map +1 -0
  257. package/lib/esm/interfaces/OnResponse.js +2 -0
  258. package/lib/esm/interfaces/OnResponse.js.map +1 -0
  259. package/lib/esm/interfaces/OnRoutesInit.js +2 -0
  260. package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
  261. package/lib/esm/interfaces/PathType.js +2 -0
  262. package/lib/esm/interfaces/PathType.js.map +1 -0
  263. package/lib/esm/interfaces/PlatformAdapter.js +2 -0
  264. package/lib/esm/interfaces/PlatformAdapter.js.map +1 -0
  265. package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
  266. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
  267. package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
  268. package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
  269. package/lib/esm/interfaces/Route.js +2 -0
  270. package/lib/esm/interfaces/Route.js.map +1 -0
  271. package/lib/esm/interfaces/index.js +18 -0
  272. package/lib/esm/interfaces/index.js.map +1 -0
  273. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
  274. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  275. package/lib/esm/middlewares/PlatformMulterMiddleware.js +52 -0
  276. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
  277. package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
  278. package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
  279. package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
  280. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
  281. package/lib/esm/middlewares/index.js +4 -0
  282. package/lib/esm/middlewares/index.js.map +1 -0
  283. package/lib/esm/services/FakeRawDriver.js +22 -0
  284. package/lib/esm/services/FakeRawDriver.js.map +1 -0
  285. package/lib/esm/services/Platform.js +104 -0
  286. package/lib/esm/services/Platform.js.map +1 -0
  287. package/lib/esm/services/PlatformApplication.js +31 -0
  288. package/lib/esm/services/PlatformApplication.js.map +1 -0
  289. package/lib/esm/services/PlatformHandler.js +230 -0
  290. package/lib/esm/services/PlatformHandler.js.map +1 -0
  291. package/lib/esm/services/PlatformMiddlewaresChain.js +31 -0
  292. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
  293. package/lib/esm/services/PlatformRequest.js +135 -0
  294. package/lib/esm/services/PlatformRequest.js.map +1 -0
  295. package/lib/esm/services/PlatformResponse.js +268 -0
  296. package/lib/esm/services/PlatformResponse.js.map +1 -0
  297. package/lib/esm/services/PlatformRouter.js +123 -0
  298. package/lib/esm/services/PlatformRouter.js.map +1 -0
  299. package/lib/esm/services/PlatformTest.js +162 -0
  300. package/lib/esm/services/PlatformTest.js.map +1 -0
  301. package/lib/esm/services/index.js +9 -0
  302. package/lib/esm/services/index.js.map +1 -0
  303. package/lib/esm/utils/createContext.js +34 -0
  304. package/lib/esm/utils/createContext.js.map +1 -0
  305. package/lib/esm/utils/createHandlerMetadata.js +45 -0
  306. package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
  307. package/lib/esm/utils/createHttpServer.js +29 -0
  308. package/lib/esm/utils/createHttpServer.js.map +1 -0
  309. package/lib/esm/utils/createHttpsServer.js +29 -0
  310. package/lib/esm/utils/createHttpsServer.js.map +1 -0
  311. package/lib/esm/utils/createInjector.js +34 -0
  312. package/lib/esm/utils/createInjector.js.map +1 -0
  313. package/lib/esm/utils/getConfiguration.js +38 -0
  314. package/lib/esm/utils/getConfiguration.js.map +1 -0
  315. package/lib/esm/utils/getStaticsOptions.js +17 -0
  316. package/lib/esm/utils/getStaticsOptions.js.map +1 -0
  317. package/lib/esm/utils/index.js +8 -0
  318. package/lib/esm/utils/index.js.map +1 -0
  319. package/lib/esm/utils/listenServer.js +17 -0
  320. package/lib/esm/utils/listenServer.js.map +1 -0
  321. package/lib/esm/utils/mapReturnedResponse.js +11 -0
  322. package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
  323. package/lib/esm/utils/printRoutes.js +32 -0
  324. package/lib/esm/utils/printRoutes.js.map +1 -0
  325. package/lib/esm/utils/setResponseHeaders.js +31 -0
  326. package/lib/esm/utils/setResponseHeaders.js.map +1 -0
  327. package/lib/esm/utils/useCtxHandler.js +11 -0
  328. package/lib/esm/utils/useCtxHandler.js.map +1 -0
  329. package/lib/{builder → types/builder}/PlatformBuilder.d.ts +25 -30
  330. package/lib/types/builder/PlatformControllerBuilder.d.ts +17 -0
  331. package/lib/{config → types/config}/index.d.ts +0 -0
  332. package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
  333. package/lib/{config → types/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
  334. package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -0
  335. package/lib/{config → types/config}/interfaces/PlatformMulterSettings.d.ts +0 -0
  336. package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
  337. package/lib/{config → types/config}/interfaces/index.d.ts +14 -1
  338. package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +12 -11
  339. package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
  340. package/lib/{decorators → types/decorators}/httpServer.d.ts +1 -0
  341. package/lib/{decorators → types/decorators}/httpsServer.d.ts +1 -0
  342. package/lib/{decorators → types/decorators}/index.d.ts +1 -0
  343. package/lib/{decorators → types/decorators}/method/acceptMime.d.ts +0 -0
  344. package/lib/{decorators → types/decorators}/method/endpointFn.d.ts +1 -0
  345. package/lib/{decorators → types/decorators}/method/location.d.ts +0 -0
  346. package/lib/{decorators → types/decorators}/method/redirect.d.ts +0 -0
  347. package/lib/{decorators → types/decorators}/method/route.d.ts +0 -0
  348. package/lib/types/decorators/method/view.d.ts +25 -0
  349. package/lib/{decorators → types/decorators}/multer/index.d.ts +0 -0
  350. package/lib/{decorators → types/decorators}/multer/multerFileSize.d.ts +0 -0
  351. package/lib/{decorators → types/decorators}/multer/multerOptions.d.ts +0 -0
  352. package/lib/{decorators → types/decorators}/multer/multipartFile.d.ts +0 -0
  353. package/lib/{decorators → types/decorators}/params/error.d.ts +0 -0
  354. package/lib/{decorators → types/decorators}/params/next.d.ts +0 -0
  355. package/lib/{decorators → types/decorators}/params/request.d.ts +0 -0
  356. package/lib/{decorators → types/decorators}/params/response.d.ts +0 -0
  357. package/lib/{domain → types/domain}/AnyToPromiseWithCtx.d.ts +0 -0
  358. package/lib/types/domain/ControllerProvider.d.ts +24 -0
  359. package/lib/{domain → types/domain}/EndpointMetadata.d.ts +3 -41
  360. package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
  361. package/lib/{domain → types/domain}/PlatformContext.d.ts +0 -0
  362. package/lib/{domain → types/domain}/PlatformRouteDetails.d.ts +4 -10
  363. package/lib/{domain → types/domain}/index.d.ts +0 -0
  364. package/lib/{index.d.ts → types/index.d.ts} +1 -3
  365. package/lib/{interfaces → types/interfaces}/AfterInit.d.ts +0 -0
  366. package/lib/{interfaces → types/interfaces}/AfterListen.d.ts +0 -0
  367. package/lib/{interfaces → types/interfaces}/AfterRoutesInit.d.ts +0 -0
  368. package/lib/{interfaces → types/interfaces}/BeforeInit.d.ts +0 -0
  369. package/lib/{interfaces → types/interfaces}/BeforeListen.d.ts +0 -0
  370. package/lib/{interfaces → types/interfaces}/BeforeRoutesInit.d.ts +0 -0
  371. package/lib/{interfaces → types/interfaces}/HandlerType.d.ts +0 -0
  372. package/lib/{interfaces → types/interfaces}/IncomingEvent.d.ts +0 -0
  373. package/lib/{interfaces → types/interfaces}/OnReady.d.ts +0 -0
  374. package/lib/{interfaces → types/interfaces}/OnRequest.d.ts +0 -0
  375. package/lib/{interfaces → types/interfaces}/OnResponse.d.ts +0 -0
  376. package/lib/{interfaces → types/interfaces}/OnRoutesInit.d.ts +0 -0
  377. package/lib/{interfaces → types/interfaces}/PathType.d.ts +0 -0
  378. package/lib/types/interfaces/PlatformAdapter.d.ts +19 -0
  379. package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +6 -4
  380. package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
  381. package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
  382. package/lib/{interfaces → types/interfaces}/index.d.ts +1 -1
  383. package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
  384. package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +0 -0
  385. package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
  386. package/lib/{middlewares → types/middlewares}/bindEndpointMiddleware.d.ts +0 -0
  387. package/lib/{middlewares → types/middlewares}/index.d.ts +0 -0
  388. package/lib/{services → types/services}/FakeRawDriver.d.ts +0 -0
  389. package/lib/{services → types/services}/Platform.d.ts +12 -6
  390. package/lib/{services → types/services}/PlatformApplication.d.ts +0 -0
  391. package/lib/{services → types/services}/PlatformHandler.d.ts +0 -0
  392. package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -0
  393. package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
  394. package/lib/{services → types/services}/PlatformResponse.d.ts +4 -4
  395. package/lib/{services → types/services}/PlatformRouter.d.ts +3 -2
  396. package/lib/{services → types/services}/PlatformTest.d.ts +7 -6
  397. package/lib/{services → types/services}/index.d.ts +1 -0
  398. package/lib/{utils → types/utils}/createContext.d.ts +0 -0
  399. package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +0 -0
  400. package/lib/types/utils/createHttpServer.d.ts +4 -0
  401. package/lib/types/utils/createHttpsServer.d.ts +4 -0
  402. package/lib/types/utils/createInjector.d.ts +7 -0
  403. package/lib/types/utils/getConfiguration.d.ts +2 -0
  404. package/lib/types/utils/getStaticsOptions.d.ts +5 -0
  405. package/lib/{utils → types/utils}/index.d.ts +0 -1
  406. package/lib/types/utils/listenServer.d.ts +7 -0
  407. package/lib/{utils → types/utils}/mapReturnedResponse.d.ts +0 -0
  408. package/lib/{utils → types/utils}/printRoutes.d.ts +0 -0
  409. package/lib/{utils → types/utils}/setResponseHeaders.d.ts +0 -0
  410. package/lib/{utils → types/utils}/useCtxHandler.d.ts +0 -0
  411. package/package.json +29 -28
  412. package/tsconfig.compile.esm.json +23 -0
  413. package/lib/PlatformModule.d.ts +0 -15
  414. package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
  415. package/lib/domain/ControllerProvider.d.ts +0 -53
  416. package/lib/index.js +0 -3651
  417. package/lib/index.js.map +0 -1
  418. package/lib/index.modern.js +0 -3464
  419. package/lib/index.modern.js.map +0 -1
  420. package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
  421. package/lib/registries/ControllerRegistry.d.ts +0 -1
  422. package/lib/utils/createHttpServer.d.ts +0 -3
  423. package/lib/utils/createHttpsServer.d.ts +0 -3
  424. package/lib/utils/createInjector.d.ts +0 -2
  425. package/lib/utils/createPlatformApplication.d.ts +0 -2
  426. package/lib/utils/getControllerPath.d.ts +0 -2
  427. package/lib/utils/listenServer.d.ts +0 -10
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sourceRoot":"","sources":["../../../../src/decorators/params/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,OAAO;QAC7B,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamTypes, UseParam} from \"@tsed/platform-params\";\n\n/**\n * Get the Next function (for express application and middleware).\n *\n * @decorator\n * @operation\n * @input\n */\nexport function Next(): ParameterDecorator {\n return UseParam({\n paramType: ParamTypes.NEXT_FN,\n dataPath: \"next\",\n useConverter: false,\n useValidation: false\n });\n}\n\ndeclare global {\n namespace TsED {\n export interface NextFunction extends Function {}\n }\n}\n/**\n * Get the Next function (for express application and middleware).\n *\n * @decorator\n * @operation\n * @input\n */\nexport type Next = TsED.NextFunction;\n"]}
@@ -0,0 +1,34 @@
1
+ import { isClass, Metadata, nameOf } from "@tsed/core";
2
+ import { IncomingMessage } from "http";
3
+ import { mapParamsOptions, ParamTypes, UseParam } from "@tsed/platform-params";
4
+ function getParamType(target, propertyKey, parameterIndex) {
5
+ const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
6
+ if (isClass(type)) {
7
+ if (nameOf(type) === "PlatformRequest") {
8
+ return { paramType: ParamTypes.PLATFORM_REQUEST, dataPath: "$ctx.request" };
9
+ }
10
+ if (type === IncomingMessage) {
11
+ return { paramType: ParamTypes.NODE_REQUEST, dataPath: "$ctx.request.req" };
12
+ }
13
+ }
14
+ return { paramType: ParamTypes.REQUEST, dataPath: "$ctx.request.request" };
15
+ }
16
+ export function Request(...args) {
17
+ // @ts-ignore
18
+ return Req(...args);
19
+ }
20
+ export function Req(...args) {
21
+ const { expression, useType, useConverter = false, useValidation = false } = mapParamsOptions(args);
22
+ return (target, propertyKey, parameterIndex) => {
23
+ const { paramType, dataPath } = getParamType(target, propertyKey, parameterIndex);
24
+ UseParam({
25
+ paramType,
26
+ dataPath,
27
+ expression,
28
+ useType,
29
+ useConverter,
30
+ useValidation
31
+ })(target, propertyKey, parameterIndex);
32
+ };
33
+ }
34
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/decorators/params/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAO,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,MAAM,CAAC;AACrC,OAAO,EAAC,gBAAgB,EAAgB,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE3F,SAAS,YAAY,CAAC,MAAc,EAAE,WAA4B,EAAE,cAAsB;IACxF,MAAM,IAAI,GAAG,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;IAE5E,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,iBAAiB,EAAE;YACtC,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAC,CAAC;SAC3E;QAED,IAAI,IAAI,KAAK,eAAe,EAAE;YAC5B,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAC,CAAC;SAC3E;KACF;IAED,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAC,CAAC;AAC3E,CAAC;AAcD,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACtB,CAAC;AAeD,MAAM,UAAU,GAAG,CAAC,GAAG,IAAW;IAChC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAElG,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE;QAC7C,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAEhF,QAAQ,CAAC;YACP,SAAS;YACT,QAAQ;YACR,UAAU;YACV,OAAO;YACP,YAAY;YACZ,aAAa;SACd,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {isClass, Metadata, nameOf, Type} from \"@tsed/core\";\nimport {IncomingMessage} from \"http\";\nimport {mapParamsOptions, ParamOptions, ParamTypes, UseParam} from \"@tsed/platform-params\";\n\nfunction getParamType(target: Object, propertyKey: string | symbol, parameterIndex: number) {\n const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];\n\n if (isClass(type)) {\n if (nameOf(type) === \"PlatformRequest\") {\n return {paramType: ParamTypes.PLATFORM_REQUEST, dataPath: \"$ctx.request\"};\n }\n\n if (type === IncomingMessage) {\n return {paramType: ParamTypes.NODE_REQUEST, dataPath: \"$ctx.request.req\"};\n }\n }\n\n return {paramType: ParamTypes.REQUEST, dataPath: \"$ctx.request.request\"};\n}\n\n/**\n * Request service.\n *\n * @decorator\n * @operation\n * @input\n */\nexport function Request(expression: string, useType: Type<any>): ParameterDecorator;\nexport function Request(expression: string): ParameterDecorator;\nexport function Request(useType: Type<any>): ParameterDecorator;\nexport function Request(options: ParamOptions<any>): ParameterDecorator;\nexport function Request(): ParameterDecorator;\nexport function Request(...args: any[]): ParameterDecorator {\n // @ts-ignore\n return Req(...args);\n}\n\n/**\n * Request service.\n *\n * @alias Request\n * @decorator\n * @operation\n * @input\n */\nexport function Req(expression: string, useType: Type<any>): ParameterDecorator;\nexport function Req(expression: string): ParameterDecorator;\nexport function Req(useType: Type<any>): ParameterDecorator;\nexport function Req(options: Partial<ParamOptions>): ParameterDecorator;\nexport function Req(): ParameterDecorator;\nexport function Req(...args: any[]): ParameterDecorator {\n const {expression, useType, useConverter = false, useValidation = false} = mapParamsOptions(args);\n\n return (target, propertyKey, parameterIndex) => {\n const {paramType, dataPath} = getParamType(target, propertyKey, parameterIndex);\n\n UseParam({\n paramType,\n dataPath,\n expression,\n useType,\n useConverter,\n useValidation\n })(target, propertyKey, parameterIndex);\n };\n}\n\n/**\n * Request service.\n *\n * @decorator\n * @operation\n * @input\n */\nexport interface Request extends TsED.Request {}\n\n/**\n * Request service.\n *\n * @alias Request\n * @decorator\n * @operation\n * @input\n */\nexport interface Req extends Request {}\n"]}
@@ -0,0 +1,28 @@
1
+ import { isClass, Metadata, nameOf } from "@tsed/core";
2
+ import { ParamTypes, UseParam } from "@tsed/platform-params";
3
+ import { ServerResponse } from "http";
4
+ function getParamType(target, propertyKey, parameterIndex) {
5
+ const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
6
+ if (isClass(type)) {
7
+ if (nameOf(type) === "PlatformResponse") {
8
+ return { paramType: ParamTypes.PLATFORM_RESPONSE, dataPath: "$ctx.response" };
9
+ }
10
+ if (type === ServerResponse) {
11
+ return { paramType: ParamTypes.NODE_RESPONSE, dataPath: "$ctx.response.res" };
12
+ }
13
+ }
14
+ return { paramType: ParamTypes.RESPONSE, dataPath: "$ctx.response.response" };
15
+ }
16
+ export function Response() {
17
+ return Res();
18
+ }
19
+ export function Res() {
20
+ return (target, propertyKey, parameterIndex) => {
21
+ const { paramType, dataPath } = getParamType(target, propertyKey, parameterIndex);
22
+ UseParam({
23
+ paramType,
24
+ dataPath
25
+ })(target, propertyKey, parameterIndex);
26
+ };
27
+ }
28
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/decorators/params/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,MAAM,CAAC;AAEpC,SAAS,YAAY,CAAC,MAAc,EAAE,WAA4B,EAAE,cAAsB;IACxF,MAAM,IAAI,GAAG,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;IAE5E,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,kBAAkB,EAAE;YACvC,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAC,CAAC;SAC7E;QAED,IAAI,IAAI,KAAK,cAAc,EAAE;YAC3B,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAC,CAAC;SAC7E;KACF;IAED,OAAO,EAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,wBAAwB,EAAC,CAAC;AAC9E,CAAC;AAWD,MAAM,UAAU,QAAQ;IACtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAYD,MAAM,UAAU,GAAG;IACjB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE;QAC7C,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAChF,QAAQ,CAAC;YACP,SAAS;YACT,QAAQ;SACT,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {isClass, Metadata, nameOf} from \"@tsed/core\";\nimport {ParamTypes, UseParam} from \"@tsed/platform-params\";\nimport {ServerResponse} from \"http\";\n\nfunction getParamType(target: Object, propertyKey: string | symbol, parameterIndex: number) {\n const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];\n\n if (isClass(type)) {\n if (nameOf(type) === \"PlatformResponse\") {\n return {paramType: ParamTypes.PLATFORM_RESPONSE, dataPath: \"$ctx.response\"};\n }\n\n if (type === ServerResponse) {\n return {paramType: ParamTypes.NODE_RESPONSE, dataPath: \"$ctx.response.res\"};\n }\n }\n\n return {paramType: ParamTypes.RESPONSE, dataPath: \"$ctx.response.response\"};\n}\n\n/**\n * Response service.\n *\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport function Response(): ParameterDecorator;\nexport function Response(): ParameterDecorator {\n return Res();\n}\n\n/**\n * Request service.\n *\n * @alias Response\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport function Res(): ParameterDecorator;\nexport function Res(): ParameterDecorator {\n return (target, propertyKey, parameterIndex) => {\n const {paramType, dataPath} = getParamType(target, propertyKey, parameterIndex);\n UseParam({\n paramType,\n dataPath\n })(target, propertyKey, parameterIndex);\n };\n}\n\n/**\n * Response service.\n *\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport interface Response extends TsED.Response {}\n\n/**\n * Response service.\n *\n * @alias Response\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport interface Res extends Response {}\n"]}
@@ -0,0 +1,23 @@
1
+ import { AnyToPromise } from "@tsed/core";
2
+ export class AnyToPromiseWithCtx extends AnyToPromise {
3
+ constructor({ $ctx, err }) {
4
+ super();
5
+ this.$ctx = $ctx;
6
+ this.err = err;
7
+ }
8
+ isDone() {
9
+ const { $ctx } = this;
10
+ return ($ctx === null || $ctx === void 0 ? void 0 : $ctx.isDone()) || super.isDone();
11
+ }
12
+ async call(cb) {
13
+ return super.call(() => cb(this));
14
+ }
15
+ destroy() {
16
+ // @ts-ignore
17
+ delete this.$ctx;
18
+ }
19
+ isCanceledResponse(process) {
20
+ return process === this.$ctx.getResponse();
21
+ }
22
+ }
23
+ //# sourceMappingURL=AnyToPromiseWithCtx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyToPromiseWithCtx.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromiseWithCtx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAC,MAAM,YAAY,CAAC;AAW1D,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAInD,YAAY,EAAC,IAAI,EAAE,GAAG,EAAwB;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,MAAM;QACJ,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QAEpB,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAY;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,aAAa;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,kBAAkB,CAAC,OAAY;QAC7B,OAAO,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import {AnyPromiseResult, AnyToPromise} from \"@tsed/core\";\nimport {PlatformContext} from \"./PlatformContext\";\n\n/**\n * @ignore\n */\nexport interface HandlerContextOptions {\n $ctx: PlatformContext;\n err?: any;\n}\n\nexport class AnyToPromiseWithCtx extends AnyToPromise {\n public $ctx: PlatformContext;\n public err: unknown;\n\n constructor({$ctx, err}: HandlerContextOptions) {\n super();\n this.$ctx = $ctx;\n this.err = err;\n }\n\n isDone(): boolean {\n const {$ctx} = this;\n\n return $ctx?.isDone() || super.isDone();\n }\n\n async call(cb: Function): Promise<AnyPromiseResult<any>> {\n return super.call(() => cb(this));\n }\n\n destroy() {\n // @ts-ignore\n delete this.$ctx;\n }\n\n isCanceledResponse(process: any) {\n return process === this.$ctx.getResponse();\n }\n}\n"]}
@@ -0,0 +1,47 @@
1
+ import { Provider, ProviderType } from "@tsed/di";
2
+ import { ROUTER_OPTIONS } from "../constants/routerOptions";
3
+ let AUTO_INC = 0;
4
+ export class ControllerProvider extends Provider {
5
+ constructor(provide, options = {}) {
6
+ super(provide, options);
7
+ this.type = ProviderType.CONTROLLER;
8
+ this.tokenRouter = `${this.name}_ROUTER_${AUTO_INC++}`;
9
+ }
10
+ /**
11
+ *
12
+ */
13
+ get routerOptions() {
14
+ return this.store.get(ROUTER_OPTIONS) || {};
15
+ }
16
+ /**
17
+ *
18
+ * @param value
19
+ */
20
+ set routerOptions(value) {
21
+ this.store.set(ROUTER_OPTIONS, value);
22
+ }
23
+ /**
24
+ *
25
+ * @returns {any[]}
26
+ */
27
+ get middlewares() {
28
+ return Object.assign({
29
+ use: [],
30
+ useAfter: [],
31
+ useBefore: []
32
+ }, this.store.get("middlewares", {}));
33
+ }
34
+ /**
35
+ *
36
+ * @param middlewares
37
+ */
38
+ set middlewares(middlewares) {
39
+ const mdlwrs = this.middlewares;
40
+ const concat = (key, a, b) => (a[key] = a[key].concat(b[key]));
41
+ Object.keys(middlewares).forEach((key) => {
42
+ concat(key, mdlwrs, middlewares);
43
+ });
44
+ this.store.set("middlewares", mdlwrs);
45
+ }
46
+ }
47
+ //# sourceMappingURL=ControllerProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControllerProvider.js","sourceRoot":"","sources":["../../../src/domain/ControllerProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,QAAQ,EAAE,YAAY,EAAgB,MAAM,UAAU,CAAC;AACtF,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE1D,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB,MAAM,OAAO,kBAA4B,SAAQ,QAAW;IAG1D,YAAY,OAAsB,EAAE,UAA6B,EAAE;QACjE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,GAAG,IAAI,CAAC,IAAI,WAAW,QAAQ,EAAE,EAAE,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,IAAK,EAAU,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,IAAI,aAAa,CAAC,KAAU;QAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,IAAI,WAAW;QACb,OAAO,MAAM,CAAC,MAAM,CAClB;YACE,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;SACd,EACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC,CAClC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,IAAI,WAAW,CAAC,WAAkC;QAChD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjF,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;YAC/C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {ControllerMiddlewares, Provider, ProviderType, TokenProvider} from \"@tsed/di\";\nimport {ROUTER_OPTIONS} from \"../constants/routerOptions\";\n\nlet AUTO_INC = 0;\n\nexport class ControllerProvider<T = any> extends Provider<T> {\n readonly tokenRouter: string;\n\n constructor(provide: TokenProvider, options: Partial<Provider> = {}) {\n super(provide, options);\n this.type = ProviderType.CONTROLLER;\n this.tokenRouter = `${this.name}_ROUTER_${AUTO_INC++}`;\n }\n\n /**\n *\n */\n get routerOptions(): any {\n return this.store.get(ROUTER_OPTIONS) || ({} as any);\n }\n\n /**\n *\n * @param value\n */\n set routerOptions(value: any) {\n this.store.set(ROUTER_OPTIONS, value);\n }\n\n /**\n *\n * @returns {any[]}\n */\n get middlewares(): ControllerMiddlewares {\n return Object.assign(\n {\n use: [],\n useAfter: [],\n useBefore: []\n },\n this.store.get(\"middlewares\", {})\n );\n }\n\n /**\n *\n * @param middlewares\n */\n set middlewares(middlewares: ControllerMiddlewares) {\n const mdlwrs = this.middlewares;\n const concat = (key: string, a: any, b: any) => (a[key] = a[key].concat(b[key]));\n\n Object.keys(middlewares).forEach((key: string) => {\n concat(key, mdlwrs, middlewares);\n });\n this.store.set(\"middlewares\", mdlwrs);\n }\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { __decorate } from "tslib";
2
+ import { DecoratorTypes, deepMerge, descriptorOf, nameOf, prototypeOf, Store } from "@tsed/core";
3
+ import { JsonEntityComponent, JsonEntityStore, JsonMethodStore } from "@tsed/schema";
4
+ /**
5
+ * EndpointMetadata contains metadata about a controller and his method.
6
+ * Each annotation (@Get, @Body...) attached to a method are stored in a endpoint.
7
+ * EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.
8
+ *
9
+ * Example :
10
+ *
11
+ * @Controller("/my-path")
12
+ * provide MyClass {
13
+ *
14
+ * @Get("/")
15
+ * @Authenticated()
16
+ * public myMethod(){}
17
+ * }
18
+ *
19
+ */
20
+ let EndpointMetadata = class EndpointMetadata extends JsonMethodStore {
21
+ get targetName() {
22
+ return nameOf(this.token);
23
+ }
24
+ get params() {
25
+ return this.parameters;
26
+ }
27
+ get view() {
28
+ return this.store.get("view");
29
+ }
30
+ set view(view) {
31
+ this.store.set("view", view);
32
+ }
33
+ get acceptMimes() {
34
+ return this.store.get("acceptMimes", []);
35
+ }
36
+ set acceptMimes(mimes) {
37
+ this.store.set("acceptMimes", mimes);
38
+ }
39
+ /**
40
+ * Get an endpoint.
41
+ * @param target
42
+ * @param propertyKey
43
+ * @param descriptor
44
+ */
45
+ static get(target, propertyKey, descriptor) {
46
+ descriptor = descriptor || descriptorOf(prototypeOf(target), propertyKey);
47
+ return JsonEntityStore.from(prototypeOf(target), propertyKey, descriptor);
48
+ }
49
+ addOperationPath(method, path, options = {}) {
50
+ return this.operation.addOperationPath(method, path, options);
51
+ }
52
+ /**
53
+ * Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
54
+ *
55
+ * @param key
56
+ * @returns {any}
57
+ */
58
+ get(key) {
59
+ const ctrlValue = Store.from(this.target).get(key);
60
+ return deepMerge(ctrlValue, this.store.get(key));
61
+ }
62
+ };
63
+ EndpointMetadata = __decorate([
64
+ JsonEntityComponent(DecoratorTypes.METHOD)
65
+ ], EndpointMetadata);
66
+ export { EndpointMetadata };
67
+ //# sourceMappingURL=EndpointMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndpointMetadata.js","sourceRoot":"","sources":["../../../src/domain/EndpointMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAO,MAAM,YAAY,CAAC;AAErG,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAYnF;;;;;;;;;;;;;;;GAeG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,eAAe;IACnD,IAAI,UAAU;QACZ,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAA6B,CAAC;IAC5C,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAwB,CAAC;IACvD,CAAC;IAED,IAAI,IAAI,CAAC,IAAyB;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAW,aAAa,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,WAAW,CAAC,KAAe;QAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB,EAAE,WAA4B,EAAE,UAA+B;QACzF,UAAU,GAAG,UAAU,IAAI,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;QAE1E,OAAO,eAAe,CAAC,IAAI,CAAmB,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAC9F,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,IAAqB,EAAE,UAAe,EAAE;QACvE,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAU,GAAQ;QACnB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnD,OAAO,SAAS,CAAI,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC;CACF,CAAA;AApDY,gBAAgB;IAD5B,mBAAmB,CAAC,cAAc,CAAC,MAAM,CAAC;GAC9B,gBAAgB,CAoD5B;SApDY,gBAAgB","sourcesContent":["import {DecoratorTypes, deepMerge, descriptorOf, nameOf, prototypeOf, Store, Type} from \"@tsed/core\";\nimport {ParamMetadata} from \"@tsed/platform-params\";\nimport {JsonEntityComponent, JsonEntityStore, JsonMethodStore} from \"@tsed/schema\";\n\nexport interface EndpointViewOptions {\n path: string;\n options: any;\n}\n\nexport interface EndpointRedirectOptions {\n status: number | undefined;\n url: string;\n}\n\n/**\n * EndpointMetadata contains metadata about a controller and his method.\n * Each annotation (@Get, @Body...) attached to a method are stored in a endpoint.\n * EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.\n *\n * Example :\n *\n * @Controller(\"/my-path\")\n * provide MyClass {\n *\n * @Get(\"/\")\n * @Authenticated()\n * public myMethod(){}\n * }\n *\n */\n@JsonEntityComponent(DecoratorTypes.METHOD)\nexport class EndpointMetadata extends JsonMethodStore {\n get targetName(): string {\n return nameOf(this.token);\n }\n\n get params(): ParamMetadata[] {\n return this.parameters as ParamMetadata[];\n }\n\n get view(): EndpointViewOptions {\n return this.store.get(\"view\") as EndpointViewOptions;\n }\n\n set view(view: EndpointViewOptions) {\n this.store.set(\"view\", view);\n }\n\n get acceptMimes(): string[] {\n return this.store.get<string[]>(\"acceptMimes\", []);\n }\n\n set acceptMimes(mimes: string[]) {\n this.store.set(\"acceptMimes\", mimes);\n }\n\n /**\n * Get an endpoint.\n * @param target\n * @param propertyKey\n * @param descriptor\n */\n static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata {\n descriptor = descriptor || descriptorOf(prototypeOf(target), propertyKey);\n\n return JsonEntityStore.from<EndpointMetadata>(prototypeOf(target), propertyKey, descriptor);\n }\n\n addOperationPath(method: string, path: string | RegExp, options: any = {}) {\n return this.operation.addOperationPath(method, path, options);\n }\n\n /**\n * Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.\n *\n * @param key\n * @returns {any}\n */\n get<T = any>(key: any): T {\n const ctrlValue = Store.from(this.target).get(key);\n\n return deepMerge<T>(ctrlValue, this.store.get(key));\n }\n}\n"]}
@@ -0,0 +1,53 @@
1
+ import { nameOf } from "@tsed/core";
2
+ import { ProviderScope } from "@tsed/di";
3
+ import { ParamTypes } from "@tsed/platform-params";
4
+ import { JsonParameterStore } from "@tsed/schema";
5
+ import { HandlerType } from "../interfaces/HandlerType";
6
+ export class HandlerMetadata {
7
+ constructor(options) {
8
+ this.injectable = false;
9
+ this.type = HandlerType.RAW_FN;
10
+ this.hasNextFunction = false;
11
+ const { target, token, propertyKey, type, scope, routeOptions } = options;
12
+ this.type = type || target.type || HandlerType.RAW_FN;
13
+ this.scope = scope || ProviderScope.SINGLETON;
14
+ this.routeOptions = routeOptions || {};
15
+ const handler = propertyKey ? target.prototype[propertyKey] : target;
16
+ if (propertyKey) {
17
+ this.target = target;
18
+ this.token = token;
19
+ this.propertyKey = propertyKey;
20
+ this.hasNextFunction = this.hasParamType(ParamTypes.NEXT_FN);
21
+ if (this.hasParamType(ParamTypes.ERR)) {
22
+ this.type = HandlerType.ERR_MIDDLEWARE;
23
+ }
24
+ this.injectable = JsonParameterStore.getParams(target, propertyKey).length > 0;
25
+ }
26
+ else {
27
+ this.handler = handler;
28
+ }
29
+ if (!this.injectable) {
30
+ if (handler.length === 4) {
31
+ this.type = HandlerType.RAW_ERR_FN;
32
+ }
33
+ this.hasNextFunction = handler.length >= 3;
34
+ }
35
+ }
36
+ get hasErrorParam() {
37
+ return this.type === HandlerType.ERR_MIDDLEWARE || this.type === HandlerType.RAW_ERR_FN;
38
+ }
39
+ getParams() {
40
+ return JsonParameterStore.getParams(this.target, this.propertyKey) || [];
41
+ }
42
+ hasParamType(paramType) {
43
+ return this.getParams().findIndex((p) => p.paramType === paramType) > -1;
44
+ }
45
+ isFinal() {
46
+ var _a;
47
+ return ((_a = this.routeOptions) === null || _a === void 0 ? void 0 : _a.isFinal) || false;
48
+ }
49
+ toString() {
50
+ return [this.target && nameOf(this.target), this.propertyKey].filter(Boolean).join(".");
51
+ }
52
+ }
53
+ //# sourceMappingURL=HandlerMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HandlerMetadata.js","sourceRoot":"","sources":["../../../src/domain/HandlerMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAO,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAYtD,MAAM,OAAO,eAAe;IAY1B,YAAY,OAA+B;QARlC,eAAU,GAAY,KAAK,CAAC;QAC5B,SAAI,GAAgB,WAAW,CAAC,MAAM,CAAC;QACvC,oBAAe,GAAY,KAAK,CAAC;QAOxC,MAAM,EAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAC,GAAG,OAAO,CAAC;QAExE,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,aAAa,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAErE,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,KAAM,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;YAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAE7D,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACrC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC;aACxC;YAED,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC,MAAa,EAAE,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SACvF;aAAM;YACL,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;SACxB;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC;aACpC;YACD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;SAC5C;IACH,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,cAAc,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,UAAU,CAAC;IAC1F,CAAC;IAEM,SAAS;QACd,OAAO,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC3E,CAAC;IAEM,YAAY,CAAC,SAAc;QAChC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,OAAO;;QACZ,OAAO,CAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,OAAO,KAAI,KAAK,CAAC;IAC7C,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["import {nameOf, Type} from \"@tsed/core\";\nimport {ProviderScope} from \"@tsed/di\";\nimport {ParamTypes} from \"@tsed/platform-params\";\nimport {JsonParameterStore} from \"@tsed/schema\";\nimport {HandlerType} from \"../interfaces/HandlerType\";\nimport {PlatformRouteOptions, PlatformRouteWithoutHandlers} from \"../interfaces/PlatformRouteOptions\";\n\nexport interface HandlerMetadataOptions {\n target: (Type<any> | Function) & {type?: HandlerType};\n routeOptions?: PlatformRouteWithoutHandlers;\n token?: Type<any>;\n propertyKey?: string | symbol;\n scope?: ProviderScope;\n type?: HandlerType;\n}\n\nexport class HandlerMetadata {\n readonly target: any;\n readonly token: Type<any>;\n readonly propertyKey: string | symbol;\n readonly injectable: boolean = false;\n readonly type: HandlerType = HandlerType.RAW_FN;\n readonly hasNextFunction: boolean = false;\n readonly routeOptions: Partial<PlatformRouteOptions>;\n readonly scope: ProviderScope;\n\n handler: any;\n\n constructor(options: HandlerMetadataOptions) {\n const {target, token, propertyKey, type, scope, routeOptions} = options;\n\n this.type = type || target.type || HandlerType.RAW_FN;\n this.scope = scope || ProviderScope.SINGLETON;\n this.routeOptions = routeOptions || {};\n const handler = propertyKey ? target.prototype[propertyKey] : target;\n\n if (propertyKey) {\n this.target = target;\n this.token = token!;\n this.propertyKey = propertyKey;\n this.hasNextFunction = this.hasParamType(ParamTypes.NEXT_FN);\n\n if (this.hasParamType(ParamTypes.ERR)) {\n this.type = HandlerType.ERR_MIDDLEWARE;\n }\n\n this.injectable = JsonParameterStore.getParams(target as any, propertyKey).length > 0;\n } else {\n this.handler = handler;\n }\n\n if (!this.injectable) {\n if (handler.length === 4) {\n this.type = HandlerType.RAW_ERR_FN;\n }\n this.hasNextFunction = handler.length >= 3;\n }\n }\n\n get hasErrorParam() {\n return this.type === HandlerType.ERR_MIDDLEWARE || this.type === HandlerType.RAW_ERR_FN;\n }\n\n public getParams() {\n return JsonParameterStore.getParams(this.target, this.propertyKey) || [];\n }\n\n public hasParamType(paramType: any): boolean {\n return this.getParams().findIndex((p) => p.paramType === paramType) > -1;\n }\n\n public isFinal() {\n return this.routeOptions?.isFinal || false;\n }\n\n toString() {\n return [this.target && nameOf(this.target), this.propertyKey].filter(Boolean).join(\".\");\n }\n}\n"]}
@@ -0,0 +1,88 @@
1
+ import { DIContext } from "@tsed/di";
2
+ import { PlatformApplication } from "../services/PlatformApplication";
3
+ import { PlatformRequest } from "../services/PlatformRequest";
4
+ import { PlatformResponse } from "../services/PlatformResponse";
5
+ export class PlatformContext extends DIContext {
6
+ constructor({ event, endpoint, ignoreUrlPatterns = [], ResponseKlass = PlatformResponse, RequestKlass = PlatformRequest, ...options }) {
7
+ super({
8
+ ...options,
9
+ ignoreLog: () => {
10
+ return this.ignoreUrlPatterns.find((reg) => !!this.url.match(reg));
11
+ }
12
+ });
13
+ this.ignoreUrlPatterns = [];
14
+ endpoint && (this.endpoint = endpoint);
15
+ this.ignoreUrlPatterns = ignoreUrlPatterns.map((pattern) => typeof pattern === "string" ? new RegExp(pattern, "gi") : pattern);
16
+ this.response = new ResponseKlass(event, this);
17
+ this.request = new RequestKlass(event, this);
18
+ this.response.request = this.request;
19
+ this.request.response = this.response;
20
+ this.request.request.$ctx = this;
21
+ this.request.request.id = this.id;
22
+ this.logger.url = this.url;
23
+ this.container.set(PlatformResponse, this.response);
24
+ this.container.set(PlatformRequest, this.request);
25
+ this.container.set(PlatformContext, this);
26
+ this.response.setHeader("x-request-id", this.id);
27
+ }
28
+ get url() {
29
+ return this.request.url;
30
+ }
31
+ get app() {
32
+ return this.injector.get(PlatformApplication);
33
+ }
34
+ async destroy() {
35
+ var _a, _b;
36
+ await super.destroy();
37
+ (_b = (_a = this.request) === null || _a === void 0 ? void 0 : _a.request) === null || _b === void 0 ? true : delete _b.$ctx;
38
+ this.response.destroy();
39
+ this.request.destroy();
40
+ // @ts-ignore
41
+ delete this.endpoint;
42
+ // @ts-ignore
43
+ delete this.response;
44
+ // @ts-ignore
45
+ delete this.request;
46
+ }
47
+ isDone() {
48
+ var _a, _b;
49
+ if (!this.request || !this.response) {
50
+ return true;
51
+ }
52
+ if ((_a = this.request) === null || _a === void 0 ? void 0 : _a.isAborted()) {
53
+ return true;
54
+ }
55
+ return (_b = this.response) === null || _b === void 0 ? void 0 : _b.isDone();
56
+ }
57
+ /**
58
+ * Return the framework request instance (Express, Koa, etc...)
59
+ */
60
+ getRequest() {
61
+ return this.request.getRequest();
62
+ }
63
+ /**
64
+ * Return the framework response instance (Express, Koa, etc...)
65
+ */
66
+ getResponse() {
67
+ return this.response.getResponse();
68
+ }
69
+ /**
70
+ * Get Node.js request
71
+ */
72
+ getReq() {
73
+ return this.request.getReq();
74
+ }
75
+ /**
76
+ * Get Node.js response
77
+ */
78
+ getRes() {
79
+ return this.response.getRes();
80
+ }
81
+ /**
82
+ * Return the original application instance.
83
+ */
84
+ getApp() {
85
+ return this.app.getApp();
86
+ }
87
+ }
88
+ //# sourceMappingURL=PlatformContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformContext.js","sourceRoot":"","sources":["../../../src/domain/PlatformContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAmB,MAAM,UAAU,CAAC;AAGrE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAiB9D,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAoB5C,YAAY,EACV,KAAK,EACL,QAAQ,EACR,iBAAiB,GAAG,EAAE,EACtB,aAAa,GAAG,gBAAgB,EAChC,YAAY,GAAG,eAAe,EAC9B,GAAG,OAAO,EACa;QACvB,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,SAAS,EAAE,GAAG,EAAE;gBACd,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACrE,CAAC;SACF,CAAC,CAAC;QAfG,sBAAiB,GAAa,EAAE,CAAC;QAiBvC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;QAEvC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAwB,EAAE,EAAE,CAC1E,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAClE,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAE3B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAE1C,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAsB,mBAAmB,CAAE,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,OAAO;;QACX,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QAEf,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,+CAAE,IAAI,CAAC;QAEnC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAEvB,aAAa;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC;QACrB,aAAa;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC;QACrB,aAAa;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACnC,OAAO,IAAI,CAAC;SACb;QAED,IAAI,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,EAAE,EAAE;YAC7B,OAAO,IAAI,CAAC;SACb;QAED,OAAO,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAO,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAO,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAS,CAAC;IAClC,CAAC;CACF","sourcesContent":["import {ContextMethods, DIContext, DIContextOptions} from \"@tsed/di\";\nimport {IncomingMessage, ServerResponse} from \"http\";\nimport {EndpointMetadata} from \"./EndpointMetadata\";\nimport {PlatformApplication} from \"../services/PlatformApplication\";\nimport {PlatformRequest} from \"../services/PlatformRequest\";\nimport {PlatformResponse} from \"../services/PlatformResponse\";\n\ndeclare global {\n namespace TsED {\n export interface Context extends PlatformContext {}\n }\n}\n\nexport interface PlatformContextOptions extends DIContextOptions {\n event: {\n response?: ServerResponse;\n request?: IncomingMessage;\n };\n ignoreUrlPatterns?: any[];\n endpoint?: EndpointMetadata;\n}\n\nexport class PlatformContext extends DIContext implements ContextMethods {\n /**\n * The current @@EndpointMetadata@@ resolved by Ts.ED during the request.\n */\n public endpoint: EndpointMetadata;\n /**\n * The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.\n */\n public data: any;\n /**\n * The current @@PlatformResponse@@.\n */\n public response: PlatformResponse;\n /**\n * The current @@PlatformRequest@@.\n */\n public request: PlatformRequest;\n\n private ignoreUrlPatterns: RegExp[] = [];\n\n constructor({\n event,\n endpoint,\n ignoreUrlPatterns = [],\n ResponseKlass = PlatformResponse,\n RequestKlass = PlatformRequest,\n ...options\n }: PlatformContextOptions) {\n super({\n ...options,\n ignoreLog: () => {\n return this.ignoreUrlPatterns.find((reg) => !!this.url.match(reg));\n }\n });\n\n endpoint && (this.endpoint = endpoint);\n\n this.ignoreUrlPatterns = ignoreUrlPatterns.map((pattern: string | RegExp) =>\n typeof pattern === \"string\" ? new RegExp(pattern, \"gi\") : pattern\n );\n\n this.response = new ResponseKlass(event, this);\n this.request = new RequestKlass(event, this);\n\n this.response.request = this.request;\n this.request.response = this.response;\n\n this.request.request.$ctx = this;\n this.request.request.id = this.id;\n this.logger.url = this.url;\n\n this.container.set(PlatformResponse, this.response);\n this.container.set(PlatformRequest, this.request);\n this.container.set(PlatformContext, this);\n\n this.response.setHeader(\"x-request-id\", this.id);\n }\n\n get url() {\n return this.request.url;\n }\n\n get app() {\n return this.injector.get<PlatformApplication>(PlatformApplication)!;\n }\n\n async destroy() {\n await super.destroy();\n\n delete this.request?.request?.$ctx;\n\n this.response.destroy();\n this.request.destroy();\n\n // @ts-ignore\n delete this.endpoint;\n // @ts-ignore\n delete this.response;\n // @ts-ignore\n delete this.request;\n }\n\n isDone() {\n if (!this.request || !this.response) {\n return true;\n }\n\n if (this.request?.isAborted()) {\n return true;\n }\n\n return this.response?.isDone();\n }\n\n /**\n * Return the framework request instance (Express, Koa, etc...)\n */\n getRequest<Req = any>(): Req {\n return this.request.getRequest<Req>();\n }\n\n /**\n * Return the framework response instance (Express, Koa, etc...)\n */\n getResponse<Res = any>(): Res {\n return this.response.getResponse<Res>();\n }\n\n /**\n * Get Node.js request\n */\n getReq(): IncomingMessage {\n return this.request.getReq();\n }\n\n /**\n * Get Node.js response\n */\n getRes(): ServerResponse {\n return this.response.getRes();\n }\n\n /**\n * Return the original application instance.\n */\n getApp<T = any>(): T {\n return this.app.getApp() as any;\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { ParamTypes } from "@tsed/platform-params";
2
+ import { JsonOperationRoute } from "@tsed/schema";
3
+ export class PlatformRouteDetails extends JsonOperationRoute {
4
+ constructor(options = {}) {
5
+ super(options);
6
+ this.rawBody = !!this.endpoint.parameters.find((param) => param.paramType === ParamTypes.RAW_BODY);
7
+ }
8
+ toJSON() {
9
+ return {
10
+ method: this.method,
11
+ name: this.name,
12
+ url: this.url,
13
+ className: this.className,
14
+ methodClassName: this.methodClassName,
15
+ parameters: this.parameters,
16
+ rawBody: this.rawBody
17
+ };
18
+ }
19
+ }
20
+ //# sourceMappingURL=PlatformRouteDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformRouteDetails.js","sourceRoot":"","sources":["../../../src/domain/PlatformRouteDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAWhD,MAAM,OAAO,oBAAqB,SAAQ,kBAAoC;IAI5E,YAAY,UAAyC,EAAE;QACrD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import {ParamMetadata, ParamTypes} from \"@tsed/platform-params\";\nimport {JsonOperationRoute} from \"@tsed/schema\";\nimport {EndpointMetadata} from \"./EndpointMetadata\";\nimport {ControllerProvider} from \"./ControllerProvider\";\n\nexport interface PlatformRouterDetailsOptions {\n provider: ControllerProvider;\n endpoint: EndpointMetadata;\n method: string;\n url: string;\n}\n\nexport class PlatformRouteDetails extends JsonOperationRoute<EndpointMetadata> {\n readonly rawBody: boolean;\n readonly provider: ControllerProvider;\n\n constructor(options: Partial<PlatformRouteDetails> = {}) {\n super(options);\n this.rawBody = !!this.endpoint.parameters.find((param: ParamMetadata) => param.paramType === ParamTypes.RAW_BODY);\n }\n\n toJSON() {\n return {\n method: this.method,\n name: this.name,\n url: this.url,\n className: this.className,\n methodClassName: this.methodClassName,\n parameters: this.parameters,\n rawBody: this.rawBody\n };\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export * from "./AnyToPromiseWithCtx";
2
+ export * from "./PlatformContext";
3
+ export * from "./PlatformRouteDetails";
4
+ export * from "./ControllerProvider";
5
+ export * from "./EndpointMetadata";
6
+ export * from "./HandlerMetadata";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./AnyToPromiseWithCtx\";\nexport * from \"./PlatformContext\";\nexport * from \"./PlatformRouteDetails\";\nexport * from \"./ControllerProvider\";\nexport * from \"./EndpointMetadata\";\nexport * from \"./HandlerMetadata\";\n"]}
@@ -0,0 +1,28 @@
1
+ import "@tsed/logger";
2
+ export * from "@tsed/di";
3
+ export * from "@tsed/platform-params";
4
+ export * from "@tsed/platform-exceptions";
5
+ export * from "@tsed/platform-response-filter";
6
+ export * from "@tsed/platform-cache";
7
+ export * from "@tsed/platform-middlewares";
8
+ export * from "@tsed/components-scan";
9
+ export * from "@tsed/platform-log-middleware";
10
+ export { $log, Logger } from "@tsed/logger";
11
+ export * from "./config";
12
+ // builder
13
+ export * from "./builder/PlatformBuilder";
14
+ export * from "./builder/PlatformControllerBuilder";
15
+ // decorators
16
+ export * from "./decorators";
17
+ // interfaces
18
+ export * from "./constants/routerOptions";
19
+ export * from "./interfaces";
20
+ // middlewares
21
+ export * from "./middlewares";
22
+ // domain
23
+ export * from "./domain";
24
+ // providers
25
+ export * from "./services";
26
+ // utils
27
+ export * from "./utils";
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,cAAc,CAAC;AAE1C,cAAc,UAAU,CAAC;AAEzB,UAAU;AACV,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AAEpD,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAE7B,cAAc;AACd,cAAc,eAAe,CAAC;AAE9B,SAAS;AACT,cAAc,UAAU,CAAC;AAEzB,YAAY;AACZ,cAAc,YAAY,CAAC;AAE3B,QAAQ;AACR,cAAc,SAAS,CAAC","sourcesContent":["import \"@tsed/logger\";\n\nexport * from \"@tsed/di\";\nexport * from \"@tsed/platform-params\";\nexport * from \"@tsed/platform-exceptions\";\nexport * from \"@tsed/platform-response-filter\";\nexport * from \"@tsed/platform-cache\";\nexport * from \"@tsed/platform-middlewares\";\nexport * from \"@tsed/components-scan\";\nexport * from \"@tsed/platform-log-middleware\";\n\nexport {$log, Logger} from \"@tsed/logger\";\n\nexport * from \"./config\";\n\n// builder\nexport * from \"./builder/PlatformBuilder\";\nexport * from \"./builder/PlatformControllerBuilder\";\n\n// decorators\nexport * from \"./decorators\";\n\n// interfaces\nexport * from \"./constants/routerOptions\";\nexport * from \"./interfaces\";\n\n// middlewares\nexport * from \"./middlewares\";\n\n// domain\nexport * from \"./domain\";\n\n// providers\nexport * from \"./services\";\n\n// utils\nexport * from \"./utils\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AfterInit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AfterInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterInit {\n $afterInit(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AfterListen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AfterListen.js","sourceRoot":"","sources":["../../../src/interfaces/AfterListen.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterListen {\n $afterListen(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AfterRoutesInit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AfterRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterRoutesInit {\n $afterRoutesInit(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BeforeInit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeforeInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeInit {\n $beforeInit(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BeforeListen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeforeListen.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeListen.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeListen {\n $beforeListen(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BeforeRoutesInit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeforeRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeRoutesInit {\n $beforeRoutesInit(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export var HandlerType;
5
+ (function (HandlerType) {
6
+ HandlerType["CUSTOM"] = "custom";
7
+ HandlerType["ENDPOINT"] = "endpoint";
8
+ HandlerType["MIDDLEWARE"] = "middleware";
9
+ HandlerType["ERR_MIDDLEWARE"] = "err:middleware";
10
+ HandlerType["CTX_FN"] = "context";
11
+ HandlerType["RAW_FN"] = "raw:middleware";
12
+ HandlerType["RAW_ERR_FN"] = "raw:err:middleware";
13
+ })(HandlerType || (HandlerType = {}));
14
+ //# sourceMappingURL=HandlerType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HandlerType.js","sourceRoot":"","sources":["../../../src/interfaces/HandlerType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;IACjC,iCAAkB,CAAA;IAClB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;AACnC,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB","sourcesContent":["/**\n * @ignore\n */\nexport enum HandlerType {\n CUSTOM = \"custom\",\n ENDPOINT = \"endpoint\",\n MIDDLEWARE = \"middleware\",\n ERR_MIDDLEWARE = \"err:middleware\",\n CTX_FN = \"context\",\n RAW_FN = \"raw:middleware\",\n RAW_ERR_FN = \"raw:err:middleware\"\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IncomingEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IncomingEvent.js","sourceRoot":"","sources":["../../../src/interfaces/IncomingEvent.ts"],"names":[],"mappings":"","sourcesContent":["import {IncomingMessage, ServerResponse} from \"http\";\n\nexport interface IncomingEvent<Req = IncomingMessage, Res = ServerResponse> extends Record<string, unknown> {\n response: Res;\n request: Req;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OnReady.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnReady.js","sourceRoot":"","sources":["../../../src/interfaces/OnReady.ts"],"names":[],"mappings":"","sourcesContent":["export interface OnReady {\n $onReady(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OnRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnRequest.js","sourceRoot":"","sources":["../../../src/interfaces/OnRequest.ts"],"names":[],"mappings":"","sourcesContent":["import {PlatformContext} from \"../domain/PlatformContext\";\n\nexport interface OnRequest {\n $onRequest(ctx: PlatformContext): void;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OnResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnResponse.js","sourceRoot":"","sources":["../../../src/interfaces/OnResponse.ts"],"names":[],"mappings":"","sourcesContent":["import {PlatformResponse} from \"../services/PlatformResponse\";\n\nexport interface OnResponse {\n $onResponse(ctx: PlatformResponse): void;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OnRoutesInit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/OnRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface OnRoutesInit {\n $onRoutesInit(): void | Promise<any>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PathType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathType.js","sourceRoot":"","sources":["../../../src/interfaces/PathType.ts"],"names":[],"mappings":"","sourcesContent":["export type PathType = string | RegExp | (string | RegExp)[];\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PlatformAdapter.js.map